dracut-017-59.git20120321

new upstream version, which fixes various anaconda loader issues
This commit is contained in:
Harald Hoyer 2012-03-21 17:03:57 +01:00
parent 9e9f8f2f11
commit 1ee1e39180
17 changed files with 7017 additions and 8 deletions

View File

@ -0,0 +1,31 @@
From 803be5aa50b4ad7c76b83a2df23a47ae4744aabf Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 11:48:48 +0100
Subject: [PATCH] README: added github and sourceforge git links
---
README | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/README b/README
index 6edc2c0..f9198bf 100644
--- a/README
+++ b/README
@@ -62,9 +62,17 @@ Git:
http://git.kernel.org/pub/scm/boot/dracut/dracut.git
https://git.kernel.org/pub/scm/boot/dracut/dracut.git
+ git://github.com/haraldh/dracut.git
+
+ git://dracut.git.sourceforge.net/gitroot/dracut/dracut
+
Git Web:
http://git.kernel.org/?p=boot/dracut/dracut.git
+ https://haraldh@github.com/haraldh/dracut.git
+
+ http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut
+
Git Web RSS Feed:
http://git.kernel.org/?p=boot/dracut/dracut.git;a=rss

51
0044-AUTHORS-update.patch Normal file
View File

@ -0,0 +1,51 @@
From 3a00cf9eccaadb44fd22d8f49c99b4d6dfe16009 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 11:50:07 +0100
Subject: [PATCH] AUTHORS: update
---
AUTHORS | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 12dbe15..f7a1007 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,24 +5,24 @@ Warren Togami <wtogami@redhat.com>
Amadeusz Żołnowski <aidecoe@aidecoe.name>
Jeremy Katz <katzj@redhat.com>
David Dillow <dave@thedillows.org>
-Michal Soltys <soltys@ziu.info>
Will Woods <wwoods@redhat.com>
+Michal Soltys <soltys@ziu.info>
+Dave Young <dyoung@redhat.com>
+Amerigo Wang <amwang@redhat.com>
Andrey Borzenkov <arvidjaar@gmail.com>
+Colin Guthrie <colin@mageia.org>
Andreas Thienemann <andreas@bawue.net>
Hans de Goede <hdegoede@redhat.com>
Peter Jones <pjones@redhat.com>
-Amerigo Wang <amwang@redhat.com>
-Colin Guthrie <colin@mageia.org>
John Reiser <jreiser@bitwagon.com>
Luca Berra <bluca@vodka.it>
-Dave Young <dyoung@redhat.com>
Daniel Drake <dsd@laptop.org>
Marc Grimme <grimme@atix.de>
+Dan Horák <dhorak@redhat.com>
Roberto Sassu <roberto.sassu@polito.it>
Anton Blanchard <anton@samba.org>
Bill Nottingham <notting@redhat.com>
Brian C. Lane <bcl@redhat.com>
-Dan Horák <dhorak@redhat.com>
David Cantrell <dcantrell@redhat.com>
Lance Albertson <lance@osuosl.org>
Marian Ganisin <mganisin@redhat.com>
@@ -47,6 +47,7 @@ Frederic Crozat <fcrozat@mandriva.com>
Glen Gray <slaine@slaine.org>
Hermann Gausterer <git-dracut-2012@mrq1.org>
James Laska <jlaska@redhat.com>
+Jan Stodola <jstodola@redhat.com>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Leho Kraav <leho@kraav.com>
Lubomir Rintel <lkundrak@v3.sk>

View File

@ -0,0 +1,831 @@
From dc824f19943d31bfba33f017be63e0c8ed74bb47 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 13:27:13 +0100
Subject: [PATCH] remove dracut-gencmdline
---
Makefile | 4 +-
dracut-gencmdline.8.xml | 46 ---
dracut-gencmdline.sh | 716 -----------------------------------------------
dracut.spec | 2 -
4 files changed, 1 insertion(+), 767 deletions(-)
delete mode 100644 dracut-gencmdline.8.xml
delete mode 100755 dracut-gencmdline.sh
diff --git a/Makefile b/Makefile
index 13c6c84..d79b2b0 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
-manpages = dracut.8 dracut.cmdline.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8
+manpages = dracut.8 dracut.cmdline.7 dracut.conf.5 dracut-catimages.8
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
@@ -32,7 +32,6 @@ install: doc
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
mkdir -p $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
- install -m 0755 dracut-gencmdline.sh $(DESTDIR)$(bindir)/dracut-gencmdline
install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
@@ -45,7 +44,6 @@ install: doc
cp -arx modules.d $(DESTDIR)$(pkglibdir)
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8/dracut.8
install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8/dracut-catimages.8
- install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8/dracut-gencmdline.8
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5/dracut.conf.5
install -m 0644 dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.cmdline.7
ln -s dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
diff --git a/dracut-gencmdline.8.xml b/dracut-gencmdline.8.xml
deleted file mode 100644
index a893d0b..0000000
--- a/dracut-gencmdline.8.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<!-- lifted from troff+man by doclifter -->
-<refentry id='dracutgencmdline8'>
-<refmeta>
-<refentrytitle>DRACUT-GENCMDLINE</refentrytitle>
-<manvolnum>8</manvolnum>
-<refmiscinfo class='source'>June 2009</refmiscinfo>
-<refmiscinfo class='manual'>Linux</refmiscinfo>
-</refmeta>
-<refnamediv id='name'>
-<refname>dracut-gencmdline</refname>
-<refpurpose>generates kernel command line parameters for the dracut generated initramfs</refpurpose>
-</refnamediv>
-<!-- body begins here -->
-<refsynopsisdiv id='synopsis'>
-<cmdsynopsis>
- <command>dracut-gencmdline</command>
- <sbr/>
-</cmdsynopsis>
-</refsynopsisdiv>
-
-
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para><command>dracut-gencmdline</command>
-generates kernel command line parameters for the dracut generated initramfs, which are very specific to the host system.</para>
-
-</refsect1>
-
-<refsect1 id='authors'><title>AUTHORS</title>
-<literallayout remap='.nf'>
-Harald Hoyer &lt;harald@redhat.com&gt;
-</literallayout> <!-- .fi -->
-</refsect1>
-
-<refsect1 id='availability'><title>AVAILABILITY</title>
-<para>The dracut-gencmdline command is part of the dracut package and is available from
-<ulink url='https://dracut.wiki.kernel.org'>https://dracut.wiki.kernel.org</ulink></para>
-
-</refsect1>
-
-<refsect1 id='see_also'><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
-</refsect1>
-</refentry>
-
diff --git a/dracut-gencmdline.sh b/dracut-gencmdline.sh
deleted file mode 100755
index c909e27..0000000
--- a/dracut-gencmdline.sh
+++ /dev/null
@@ -1,716 +0,0 @@
-#!/bin/bash --norc
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
-# ex: ts=8 sw=4 sts=4 et filetype=sh
-#
-# Copyright 2005-2009 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# code taken from mkinitrd
-#
-#. /usr/libexec/initrd-functions
-
-IF_verbose=""
-function set_verbose() {
- case $1 in
- 1|true|yes|on)
- IF_verbose="-v"
- ;;
- 0|false|no|off)
- IF_verbose=""
- ;;
- esac
-}
-
-function is_verbose() {
- [ -n "$IF_verbose" ] && return 0
- return 1
-}
-
-function get_verbose() {
- echo "$IF_verbose"
- is_verbose
-}
-
-
-function get_numeric_dev() {
- (
- fmt="%d:%d"
- if [ "$1" == "hex" ]; then
- fmt="%x:%x"
- fi
- ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
- ) 2>/dev/null
-}
-
-
-function error() {
- echo "$@" >&2
-}
-
-function vecho() {
- is_verbose && echo "$@"
-}
-
-# module dep finding and installation functions
-moduledep() {
- MPARGS=""
- if [ "$1" == "--ignore-install" ]; then
- MPARGS="$MPARGS --ignore-install"
- shift
- fi
- vecho -n "Looking for deps of module $1"
- deps=""
- deps=$(modprobe $MPARGS --set-version $kernel --quiet --show-depends $1 | awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done)
- [ -n "$deps" ] && vecho ": $deps" || vecho
-}
-
-export MALLOC_PERTURB_=204
-
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
-export PATH
-
-# Set the umask. For iscsi, the initrd can contain plaintext
-# password (chap secret), so only allow read by owner.
-umask 077
-
-VERSION=6.0.87
-
-PROBE="yes"
-MODULES=""
-GRAPHICSMODS=""
-PREMODS=""
-DMRAIDS=""
-ncryptodevs=0
-ncryptoparts=0
-ncryptolvs=0
-ncryptoraids=0
-root=""
-scsi_wait_scan="no"
-
-NET_LIST=""
-LD_SO_CONF=/etc/ld.so.conf
-LD_SO_CONF_D=/etc/ld.so.conf.d/
-
-[ -e /etc/sysconfig/mkinitrd ] && . /etc/sysconfig/mkinitrd
-
-CONFMODS="$MODULES"
-MODULES=""
-ARCH=$(uname -m | sed -e 's/s390x/s390/')
-
-compress=1
-allowmissing=""
-target=""
-kernel=""
-force=""
-img_vers=""
-builtins=""
-modulefile=/etc/modules.conf
-[ "$ARCH" != "s390" ] && withusb=1
-rc=0
-nolvm=""
-nodmraid=""
-
-IMAGESIZE=8000
-PRESCSIMODS=""
-fstab="/etc/fstab"
-
-vg_list=""
-net_list="$NET_LIST"
-
-usage () {
- if [ "$1" == "-n" ]; then
- cmd=echo
- else
- cmd=error
- fi
-
- $cmd "usage: `basename $0` [--version] [--help] [-v] [-f]"
-
- if [ "$1" == "-n" ]; then
- exit 0
- else
- exit 1
- fi
-}
-
-
-qpushd() {
- pushd "$1" >/dev/null 2>&1
-}
-
-qpopd() {
- popd >/dev/null 2>&1
-}
-
-
-freadlink() {
- readlink -f "$1"
-}
-
-resolve_device_name() {
- if [ -z "${1##UUID=*}" ]; then
- real=$(freadlink /dev/disk/by-uuid/${1##UUID=})
- [ -b $real ] && { echo $real; return; }
- fi
- if [ -z "${1##LABEL=*}" ]; then
- real=$(freadlink /dev/disk/by-label/${1##LABEL=})
- [ -b $real ] && { echo $real; return; }
- fi
- echo "$1"
-}
-
-finddevnoinsys() {
- majmin="$1"
- if [ -n "$majmin" ]; then
- dev=$(for x in /sys/block/* ; do find $x/ -name dev ; done | while read device ; do \
- echo "$majmin" | cmp -s $device && echo $device ; done)
- if [ -n "$dev" ]; then
- dev=${dev%%/dev}
- dev=${dev%%/}
- echo "$dev"
- return 0
- fi
- fi
- return 1
-}
-
-finddevicedriverinsys () {
- if is_iscsi $PWD; then
- handleiscsi "$PWD"
- return
- fi
- while [ "$PWD" != "/sys/devices" ]; do
- deps=
- if [ -f modalias ]; then
- MODALIAS=$(cat modalias)
- if [ "${MODALIAS::7}" == "scsi:t-" ]; then
- scsi_wait_scan=yes
- fi
- moduledep $MODALIAS
- unset MODALIAS
- fi
-
- cd ..
- done
-}
-
-findstoragedriverinsys () {
- local sysfs=$(freadlink "$1")
-
- # if its a partition look at the device holding the partition
- if [ -f "$sysfs/start" ]; then
- sysfs=$(freadlink ${sysfs%/*})
- fi
-
- if [[ ! "$sysfs" =~ ^/sys/.*block/.*$ ]]; then
- #error "WARNING: $sysfs is a not a block sysfs path, skipping"
- return
- fi
-
- case " $handleddevices " in
- *" $sysfs "*)
- return ;;
- *) handleddevices="$handleddevices $sysfs" ;;
- esac
-
- if [[ "$sysfs" =~ ^/sys/.*block/md[0-9]+$ ]]; then
- local raid=${sysfs##*/}
- vecho "Found MDRAID component $raid"
- handleraid $raid
- fi
- if [[ "$sysfs" =~ ^/sys/.*block/dm-[0-9]+$ ]]; then
- vecho "Found DeviceMapper component ${sysfs##*/}"
- handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2)
- fi
-
- for slave in $(ls -d "$sysfs"/slaves/* 2>/dev/null) ; do
- findstoragedriverinsys "$slave"
- done
-
- if [ -L "$sysfs/device" ]; then
- qpushd $(freadlink "$sysfs/device")
- finddevicedriverinsys
- qpopd
- fi
-}
-
-findstoragedriver () {
- local device="$1"
-
- if [ ! -b "$device" ]; then
- #error "WARNING: $device is a not a block device, skipping"
- return
- fi
-
- local majmin=$(get_numeric_dev dec "$device")
- local sysfs=$(finddevnoinsys "$majmin")
-
- if [ -z "$sysfs" ]; then
- #error "WARNING: $device major:minor $majmin not found, skipping"
- return
- fi
-
- vecho "Looking for driver for $device in $sysfs"
- findstoragedriverinsys "$sysfs"
-}
-
-iscsi_get_rec_val() {
-
- # The open-iscsi 742 release changed to using flat files in
- # /var/lib/iscsi.
-
- result=$(grep "^${2} = " "$1" | sed -e s'/.* = //')
-}
-
-iscsi_set_parameters() {
- path=$1
- vecho setting iscsi parameters
-
- tmpfile=$(mktemp)
-
- # Check once before getting explicit values, so we can output a decent
- # error message.
- /sbin/iscsiadm --show -m session -r $path > $tmpfile
- if [ ! -s $tmpfile ]; then
- echo Unable to find iscsi record for $path
- exit 1
- fi
-
- nit_name=$(grep "^InitiatorName=" /etc/iscsi/initiatorname.iscsi | \
- sed -e "s/^InitiatorName=//")
-
- iscsi_get_rec_val $tmpfile "node.name"
- tgt_name=${result}
- iscsi_get_rec_val $tmpfile "node.tpgt"
- tpgt=${result}
- # iscsistart wants node.conn[0].address / port
- iscsi_get_rec_val $tmpfile 'node.conn\[0\].address'
- tgt_ipaddr=${result}
- iscsi_get_rec_val $tmpfile 'node.conn\[0\].port'
- tgt_port=${result}
-
- # Note: we get chap secrets (passwords) in plaintext, and also store
- # them in the initrd.
-
- iscsi_get_rec_val $tmpfile "node.session.auth.username"
- chap=${result}
- if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
- chap="-u ${chap}"
- iscsi_get_rec_val $tmpfile "node.session.auth.password"
- chap_pw="-w ${result}"
- else
- chap=""
- fi
-
- iscsi_get_rec_val $tmpfile "node.session.auth.username_in"
- chap_in=${result}
- if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
- chap_in="-U ${chap_in}"
- iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
- chap_in_pw="-W ${result}"
- else
- chap_in=""
- fi
-
- rm $tmpfile
-}
-
-emit_iscsi () {
- if [ -n "${iscsi_devs}" ]; then
- for dev in ${iscsi_devs}; do
- iscsi_set_parameters $dev
- # recid is not really used, just use 0 for it
- echo "/bin/iscsistart -t ${tgt_name} -i ${nit_name} \
- -g ${tpgt} -a ${tgt_ipaddr} ${chap} ${chap_pw} \
- ${chap_in} ${chap_in_pw}"
- done
- fi
-}
-
-is_iscsi() {
- path=$1
- if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
- return 0
- else
- return 1
- fi
-}
-
-handledm() {
- major=$1
- minor=$2
- while read dmstart dmend dmtype r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 ; do
- case "$dmtype" in
- crypt)
- # this device is encrypted; find the slave device and see
- # whether the encryption is LUKS; if not, bail.
- slavedev=$(finddevnoinsys $r3)
- # get the basename, then s,!,/, in case it's a cciss device
- slavedev=$(echo ${slavedev##*/} | tr '!' '/')
- cryptsetup isLuks "/dev/$slavedev" 2>/dev/null || continue
- find_base_dm_mods
- dmname=$(dmsetup info -j $major -m $minor -c --noheadings -o name)
- # do the device resolution dance to get /dev/mapper/foo
- # since 'lvm lvs' doesn't like dm-X device nodes
- if [[ "$slavedev" =~ ^dm- ]]; then
- majmin=$(get_numeric_dev dec "/dev/$slavedev")
- for dmdev in /dev/mapper/* ; do
- dmnum=$(get_numeric_dev dev $dmdev)
- if [ $dmnum = $majmin ]; then
- slavedev=${dmdev#/dev/}
- break
- fi
- done
- fi
-
- # determine if $slavedev is an LV
- # if so, add the device to latecryptodevs
- # if not, add the device to cryptodevs
- local vg=$(lvshow /dev/$slavedev)
- if [ -n "$vg" ]; then
- eval cryptolv${ncryptolvs}='"'/dev/$slavedev $dmname'"'
- let ncryptolvs++
- elif grep -q "^$slavedev :" /proc/mdstat ; then
- eval cryptoraid${ncryptoraids}='"'/dev/$slavedev $dmname'"'
- let ncryptoraids++
- else
- eval cryptoparts${ncryptoparts}='"'/dev/$slavedev $dmname'"'
- let ncryptoparts++
- fi
-
- let ncryptodevs++
- findstoragedriver "/dev/$slavedev"
- ;;
- esac
- done << EOF
- $(dmsetup table -j $major -m $minor 2>/dev/null)
-EOF
- local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
- local vg=$(lvshow "/dev/mapper/$name")
- local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
- if [ -n "$vg" ]; then
- vg=`echo $vg` # strip whitespace
- case " $vg_list " in
- *" $vg "*) ;;
- *) vg_list="$vg_list $vg"
- [ -z "$nolvm" ] && find_base_dm_mods
- ;;
- esac
- fi
- for raid in $raids ; do
- if [ "$raid" == "$name" ]; then
- case " $DMRAIDS " in
- *" $raid "*) ;;
- *) DMRAIDS="$DMRAIDS $raid"
- [ -z "$nodmraid" ] && find_base_dm_mods
- ;;
- esac
- break
- fi
- done
-}
-
-handleiscsi() {
- vecho "Found iscsi component $1"
-
- # We call iscsi_set_parameters once here to figure out what network to
- # use (it sets tgt_ipaddr), and once again to emit iscsi values,
- # not very efficient.
- iscsi_set_parameters $1
- iscsi_devs="$iscsi_devs $1"
- netdev=$(/sbin/ip route get to $tgt_ipaddr | \
- sed 's|.*dev \(.*\).*|\1|g' | awk '{ print $1; exit }')
- addnetdev $netdev
-}
-
-handleraid() {
- local start=0
-
- if [ -n "$noraid" -o ! -f /proc/mdstat ]; then
- return 0
- fi
-
- levels=$(awk "/^$1[ ]*:/ { print\$4 }" /proc/mdstat)
-
- for level in $levels ; do
- case $level in
- linear)
- start=1
- ;;
- multipath)
- start=1
- ;;
- raid[01] | raid10)
- start=1
- ;;
- raid[456])
- start=1
- ;;
- *)
- error "raid level $level (in /proc/mdstat) not recognized"
- ;;
- esac
- done
- if [ "$start" = 1 ]; then
- raiddevices="$raiddevices $1"
- fi
- return $start
-}
-
-lvshow() {
- lvm lvs --ignorelockingfailure --noheadings -o vg_name \
- $1 2>/dev/null | egrep -v '^ *(WARNING:|Volume Groups with)'
-}
-
-vgdisplay() {
- lvm vgdisplay --ignorelockingfailure -v $1 2>/dev/null |
- sed -n 's/PV Name//p'
-}
-
-dmmods_found="n"
-find_base_dm_mods()
-{
- [ "$dmmods_found" == "n" ] || return
- dmmods_found="y"
-}
-
-savedargs=$*
-while [ $# -gt 0 ]; do
- case $1 in
- --fstab*)
- if [ "$1" != "${1##--fstab=}" ]; then
- fstab=${1##--fstab=}
- else
- fstab=$2
- shift
- fi
- ;;
-
-
- -v|--verbose)
- set_verbose true
- ;;
- --net-dev*)
- if [ "$1" != "${1##--net-dev=}" ]; then
- net_list="$net_list ${1##--net-dev=}"
- else
- net_list="$net_list $2"
- shift
- fi
- ;;
- --rootdev*)
- if [ "$1" != "${1##--rootdev=}" ]; then
- rootdev="${1##--rootdev=}"
- else
- rootdev="$2"
- shift
- fi
- ;;
- --thawdev*)
- if [ "$1" != "${1##--thawdev=}" ]; then
- thawdev="${1##--thawdev=}"
- else
- thawdev="$2"
- shift
- fi
- ;;
- --rootfs*)
- if [ "$1" != "${1##--rootfs=}" ]; then
- rootfs="${1##--rootfs=}"
- else
- rootfs="$2"
- shift
- fi
- ;;
- --rootopts*)
- if [ "$1" != "${1##--rootopts=}" ]; then
- rootopts="${1##--rootopts=}"
- else
- rootopts="$2"
- shift
- fi
- ;;
- --root*)
- if [ "$1" != "${1##--root=}" ]; then
- root="${1##--root=}"
- else
- root="$2"
- shift
- fi
- ;;
- --loopdev*)
- if [ "$1" != "${1##--loopdev=}" ]; then
- loopdev="${1##--loopdev=}"
- else
- loopdev="$2"
- shift
- fi
- ;;
- --loopfs*)
- if [ "$1" != "${1##--loopfs=}" ]; then
- loopfs="${1##--loopfs=}"
- else
- loopfs="$2"
- shift
- fi
- ;;
- --loopopts*)
- if [ "$1" != "${1##--loopopts=}" ]; then
- loopopts="${1##--loopopts=}"
- else
- loopopts="$2"
- shift
- fi
- ;;
- --looppath*)
- if [ "$1" != "${1##--looppath=}" ]; then
- looppath="${1##--looppath=}"
- else
- looppath="$2"
- shift
- fi
- ;;
- --help)
- usage -n
- ;;
- *)
- if [ -z "$target" ]; then
- target=$1
- elif [ -z "$kernel" ]; then
- kernel=$1
- else
- usage
- fi
- ;;
- esac
-
- shift
-done
-
-[ -z "$rootfs" ] && rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
-[ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
-[ -z "$rootopts" ] && rootopts="defaults"
-
-
-[ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
- # check if it's nfsroot
-physdev=""
-if [ "$rootfs" == "nfs" ]; then
- if [ "x$net_list" == "x" ]; then
- handlenfs $rootdev
- fi
-else
- # check if it's root by label
- rdev=$rootdev
- rdev=$(resolve_device_name "$rdev")
- rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,_rnetdev//' -e 's/_rnetdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
- findstoragedriver "$rdev"
-fi
-
- # find the first swap dev which would get used for swsusp
-[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
-swsuspdev="$thawdev"
-if [ -n "$swsuspdev" ]; then
- swsuspdev=$(resolve_device_name "$swsuspdev")
- findstoragedriver "$swsuspdev"
-fi
-
-
-cemit()
-{
- cat
-}
-
-emit()
-{
- NONL=""
- if [ "$1" == "-n" ]; then
- NONL="-n"
- shift
- fi
- echo $NONL "$@"
-}
-
-emitdmraids()
-{
- if [ -z "$nodmraid" -a -n "$DMRAIDS" ]; then
- for raid in $DMRAIDS; do
- echo -n "rd_DM_UUID=$raid "
- done
- fi
-}
-
-
-# HACK: module loading + device creation isn't necessarily synchronous...
-# this will make sure that we have all of our devices before trying
-# things like RAID or LVM
-emitdmraids
-
-emitcrypto()
-{
- local luksuuid=$(grep "^$2 " /etc/crypttab 2>/dev/null| awk '{ print $2 }')
- if [ -z "$luksuuid" ]; then
- luksuuid="$2"
- fi
- luksuuid=${luksuuid##UUID=}
- echo -n "rd_LUKS_UUID=$luksuuid "
-}
-
-if [ -n "$raiddevices" ]; then
- for dev in $raiddevices; do
- uid=$(udevadm info --query=env --name /dev/${dev}|grep MD_UUID)
- uid=${uid##MD_UUID=}
- [ -n "$uid" ] && echo -n "rd_MD_UUID=$uid "
- done
-else
- echo -n "rd_NO_MD "
-fi
-
-if [ -z "$nolvm" -a -n "$vg_list" ]; then
- for vg in $vg_list; do
- echo -n "rd_LVM_VG=$vg "
- done
-else
- echo -n "rd_NO_LVM "
-fi
-
-cryptdevs="$(echo ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@})"
-
-if [ -z "$cryptdevs" ]; then
- echo -n "rd_NO_LUKS "
-else
- for cryptdev in ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@} ; do
- emitcrypto `eval echo '$'$cryptdev`
- done
-fi
-
-# output local keyboard/18n settings
-[ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
-[ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
-
-for i in KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do
- val=$(eval echo \$$i)
- [[ $val ]] && echo -n "$i=$val "
-done
-
-if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then
- echo -n "KEYBOARDTYPE=$KEYBOARDTYPE "
-fi
-
-if [ -n "$rootdev" ]; then
- echo -n "root=$rootdev "
-fi
-
-echo
diff --git a/dracut.spec b/dracut.spec
index 0275af3..7a058ae 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -318,9 +318,7 @@ rm -rf $RPM_BUILD_ROOT
%files tools
%defattr(-,root,root,0755)
-%{_mandir}/man8/dracut-gencmdline.8*
%{_mandir}/man8/dracut-catimages.8*
-%{_bindir}/dracut-gencmdline
%{_bindir}/dracut-catimages
%dir /boot/dracut
%dir /var/lib/dracut

File diff suppressed because it is too large Load Diff

98
0047-precompile-doc.patch Normal file
View File

@ -0,0 +1,98 @@
From 4ce3a1b1bbd08c3d5031632b88036335d2d2dfee Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 15:19:39 +0100
Subject: [PATCH] precompile doc
---
Makefile | 27 +++++++++++++++++----------
dracut.spec | 6 ++++--
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
index bd27d06..f0af487 100644
--- a/Makefile
+++ b/Makefile
@@ -13,9 +13,10 @@ manpages = dracut.8 dracut.cmdline.7 dracut.conf.5 dracut-catimages.8
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
-doc: $(manpages) dracut.html
all: syncheck
+doc: $(manpages) dracut.html
+
%: %.xml
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
@@ -26,7 +27,8 @@ dracut.html: dracut.asc $(manpages)
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
xsltproc -o dracut.html --xinclude -nonet \
--stringparam draft.mode yes \
- --stringparam html.stylesheet http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
+ --stringparam html.stylesheet \
+ http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
rm dracut.xml
@@ -57,8 +59,10 @@ install: doc
install -m 0644 dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir); \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/reboot.target.wants; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants; \
- ln -s ../dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/reboot.target.wants/dracut-shutdown.service; \
- ln -s ../dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
+ ln -s ../dracut-shutdown.service \
+ $(DESTDIR)$(systemdsystemunitdir)/reboot.target.wants/dracut-shutdown.service; \
+ ln -s ../dracut-shutdown.service \
+ $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
fi
clean:
@@ -72,13 +76,16 @@ clean:
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
-dist: dracut-$(VERSION).tar.gz
-
-dracut-$(VERSION).tar.bz2:
- git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
+dist: dracut-$(VERSION).tar.bz2
-dracut-$(VERSION).tar.gz:
- git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |gzip > dracut-$(VERSION).tar.gz
+dracut-$(VERSION).tar.bz2: doc
+ git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ > dracut-$(VERSION).tar
+ mkdir -p dracut-$(VERSION)
+ cp $(manpages) dracut.html dracut-$(VERSION)
+ tar -rf dracut-$(VERSION).tar dracut-$(VERSION)/*.[0-9] dracut-$(VERSION)/dracut.html
+ rm -fr dracut-$(VERSION).tar.bz2 dracut-$(VERSION)
+ bzip2 -9 dracut-$(VERSION).tar
+ rm -f dracut-$(VERSION).tar
rpm: dracut-$(VERSION).tar.bz2
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
diff --git a/dracut.spec b/dracut.spec
index 7a058ae..be7ba8a 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -40,9 +40,11 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt
%endif
%if 0%{?suse_version}
-BuildRequires: docbook-xsl-stylesheets libxslt
+-BuildRequires: docbook-xsl-stylesheets libxslt
%endif
+BuildRequires: asciidoc
+
%if 0%{?fedora} > 12 || 0%{?rhel}
# no "provides", because dracut does not offer
# all functionality of the obsoleted packages
@@ -161,7 +163,7 @@ git am -p1 %{patches}
%endif
%build
-make
+make all
%install
%if 0%{?fedora} || 0%{?rhel}

View File

@ -0,0 +1,48 @@
From f94ceb13b8e6eb825b29f453a68657c508481942 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 15:52:35 +0100
Subject: [PATCH] TEST-10-RAID: wait for udev settle before deconstructing
---
test/TEST-10-RAID/create-root.sh | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh
index 099d619..3dd86cb 100755
--- a/test/TEST-10-RAID/create-root.sh
+++ b/test/TEST-10-RAID/create-root.sh
@@ -16,20 +16,23 @@ mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /d
# wait for the array to finish initailizing, otherwise this sometimes fails
# randomly.
mdadm -W /dev/md0
+set -e
echo -n test >keyfile
cryptsetup -q luksFormat /dev/md0 /keyfile
echo "The passphrase is test"
-cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile && \
-lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test && \
-lvm vgcreate dracut /dev/mapper/dracut_crypt_test && \
+cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile
+lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test
+lvm vgcreate dracut /dev/mapper/dracut_crypt_test
lvm lvcreate -l 100%FREE -n root dracut && \
-lvm vgchange -ay && \
-mke2fs /dev/dracut/root && \
-mkdir -p /sysroot && \
-mount /dev/dracut/root /sysroot && \
-cp -a -t /sysroot /source/* && \
-umount /sysroot && \
-lvm lvchange -a n /dev/dracut/root && \
-cryptsetup luksClose /dev/mapper/dracut_crypt_test && \
+lvm vgchange -ay
+mke2fs /dev/dracut/root
+mkdir -p /sysroot
+mount /dev/dracut/root /sysroot
+cp -a -t /sysroot /source/*
+umount /sysroot
+lvm lvchange -a n /dev/dracut/root
+udevadm settle
+cryptsetup luksClose /dev/mapper/dracut_crypt_test
+udevadm settle
echo "dracut-root-block-created" >/dev/sda1
poweroff -f

32
0049-NEWS-update.patch Normal file
View File

@ -0,0 +1,32 @@
From 08842612835a2ccf4051afc43213af9243dc6ecf Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 16:00:42 +0100
Subject: [PATCH] NEWS: update
---
NEWS | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/NEWS b/NEWS
index bed32ca..017fc9d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,18 @@
+dracut-018
+==========
+- converted manpage and documentation source to asciidoc
+- write-ifcfg fixes and cleanups
+- ifup is now done in the initqueue
+- netroot cleanup
+- initqueue/online is now for hooks, which require network
+- no more /tmp/root.info
+- 98pollcdrom: factored out the ugly cdrom polling in the main loop
+- simplified rd.luks.uuid testing
+- removed "egrep" and "ls" calls
+- speedup kernel module installation
+- make bzip2 optional
+- lots of bugfixes
+
dracut-017
==========
- a _lot_ faster than dracut-016 in image creation

84
0050-remove-ctty.patch Normal file
View File

@ -0,0 +1,84 @@
From 02aa795514b4f6febcedd1d0f3079c6eacdfd3f2 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 16:13:48 +0100
Subject: [PATCH] remove --ctty
---
dracut.8.asc | 3 ---
dracut.cmdline.7.asc | 6 ------
dracut.sh | 4 +---
modules.d/99base/module-setup.sh | 1 -
4 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/dracut.8.asc b/dracut.8.asc
index 6ca7347..891246d 100644
--- a/dracut.8.asc
+++ b/dracut.8.asc
@@ -193,9 +193,6 @@ example:
**--noprefix**::
do not prefix initramfs files (default)
-**--ctty**::
- if possible, try to spawn an emergency shell on a terminal with job control
-
**-h, --help**::
display help text and exit.
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 8924b89..738d464 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -78,12 +78,6 @@ Misc
force loading kernel module <drivername> after all automatic loading modules
have been loaded. This parameter can be specified multiple times.
-**rd.ctty=**_<terminal>_::
- if the dracut image was generated with --ctty option, try to spawn an
- emergency shell on the specified terminal; if rd.ctty is specified without a
- value or not provided at all, the default is /dev/tty1. The '/dev' prefix
- can be omitted.
-
[[dracutkerneldebug]]
Debug
~~~~~
diff --git a/dracut.sh b/dracut.sh
index 417008c..1bf8ad9 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -121,7 +121,6 @@ Creates initial ramdisk images for preloading modules
build.
--keep Keep the temporary initramfs for debugging purposes
--sshkey [SSHKEY] Add ssh key to initramfs (use with ssh-client module)
- --ctty Add control tty for emergency shells
If [LIST] has multiple arguments, then you have to put these in quotes.
For example:
@@ -241,7 +240,6 @@ while (($# > 0)); do
--nolvmconf) lvmconf_l="no";;
--debug) debug="yes";;
--profile) profile="yes";;
- --ctty) cttyhack="yes";;
--sshkey) read_arg sshkey "$@" || shift;;
-v|--verbose) ((verbosity_mod_l++));;
-q|--quiet) ((verbosity_mod_l--));;
@@ -625,7 +623,7 @@ done
export initdir dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug no_kernel kernel_only \
add_drivers omit_drivers mdadmconf lvmconf filesystems \
- use_fstab fstab_lines libdir usrlibdir fscks nofscks cttyhack \
+ use_fstab fstab_lines libdir usrlibdir fscks nofscks \
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
debug host_fs_types host_devs sshkey
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 5a97770..98742f5 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -16,7 +16,6 @@ install() {
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink
dracut_install -o less
- [[ $cttyhack = yes ]] && dracut_install -o setsid
if [ ! -e "${initdir}/bin/sh" ]; then
dracut_install bash
(ln -s bash "${initdir}/bin/sh" || :)

View File

@ -0,0 +1,101 @@
From c3d81de59b3828c35bbab6973f2ab0777777cf51 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 16:19:53 +0100
Subject: [PATCH] remove openvt and use "setsid -c", if possible
---
dracut.conf.d/fedora.conf.example | 2 +-
modules.d/99base/dracut-lib.sh | 21 ++++++++++++---------
modules.d/99base/module-setup.sh | 2 +-
modules.d/99shutdown/shutdown.sh | 21 ++++++++++++---------
4 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
index efec77e..02a530e 100644
--- a/dracut.conf.d/fedora.conf.example
+++ b/dracut.conf.d/fedora.conf.example
@@ -7,4 +7,4 @@ omit_dracutmodules+=" dash "
omit_drivers+=" .*/fs/ocfs/.* "
stdloglvl=3
realinitpath="/usr/lib/systemd/systemd"
-install_items+=" vi /etc/virc ps grep cat rm openvt "
+install_items+=" vi /etc/virc ps grep cat rm "
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 80e093b..a6c4e24 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -803,16 +803,19 @@ emergency_shell()
echo
export PS1="$_rdshell_name:\${PWD}# "
[ -e /.profile ] || >/.profile
- _ctty=/dev/console
- if [ -n "$(command -v setsid)" ]; then
- _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
- [ -c "$_ctty" ] || _ctty=/dev/tty1
- setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1
- elif [ -n "$(command -v openvt)" ] && ! getarg "console=" >/dev/null 2>&1 && getargbool 1 "rd.openvt" ; then
- openvt -f -c 1 -w -s -l -- sh
- else
- sh -i -l 0<$_ctty 1>$_ctty 2>&1
+
+ _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
+ if [ -z "$_ctty" ]; then
+ _ctty=console
+ while [ -f /sys/class/tty/$_ctty/active ]; do
+ _ctty=$(cat /sys/class/tty/$_ctty/active)
+ _ctty=${_ctty##* } # last one in the list
+ done
+ _ctty=/dev/$_ctty
fi
+ [ -c "$_ctty" ] || _ctty=/dev/tty1
+ strstr "$(setsid --help)" "control" && CTTY="-c"
+ setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
else
warn "Boot has failed. To debug this issue add \"rdshell\" to the kernel command line."
# cause a kernel panic
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 98742f5..581ba93 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -14,7 +14,7 @@ depends() {
install() {
local _d
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
- sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink
+ sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid
dracut_install -o less
if [ ! -e "${initdir}/bin/sh" ]; then
dracut_install bash
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
index 2576687..c8ca664 100755
--- a/modules.d/99shutdown/shutdown.sh
+++ b/modules.d/99shutdown/shutdown.sh
@@ -30,16 +30,19 @@ emergency_shell()
echo
export PS1="$_rdshell_name:\${PWD}# "
[ -e /.profile ] || >/.profile
- _ctty=/dev/console
- if [ -n "$(command -v setsid)" ]; then
- _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
- [ -c "$_ctty" ] || _ctty=/dev/tty1
- setsid sh -i -l 0<$_ctty 1>$_ctty 2>&1
- elif [ -n "$(command -v openvt)" ] && ! getarg "console=" >/dev/null 2>&1 && getargbool 1 "rd.openvt" ; then
- openvt -f -c 1 -w -s -l -- sh
- else
- sh -i -l 0<$_ctty 1>$_ctty 2>&1
+
+ _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
+ if [ -z "$_ctty" ]; then
+ _ctty=console
+ while [ -f /sys/class/tty/$_ctty/active ]; do
+ _ctty=$(cat /sys/class/tty/$_ctty/active)
+ _ctty=${_ctty##* } # last one in the list
+ done
+ _ctty=/dev/$_ctty
fi
+ [ -c "$_ctty" ] || _ctty=/dev/tty1
+ strstr "$(setsid --help)" "control" && CTTY="-c"
+ setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
else
exec /lib/systemd/systemd-shutdown "$@"
warn "Shutdown has failed. To debug this issue add \"rdshell\" to the kernel command line."

View File

@ -0,0 +1,39 @@
From d8eb522e8062751f53def079ac1bab8f1c05a401 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 16:32:19 +0100
Subject: [PATCH] TEST-01-BASIC: add setsid
---
test/TEST-01-BASIC/test-init.sh | 5 ++++-
test/TEST-01-BASIC/test.sh | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh
index fd03aa5..f8d6693 100755
--- a/test/TEST-01-BASIC/test-init.sh
+++ b/test/TEST-01-BASIC/test-init.sh
@@ -11,7 +11,10 @@ export PS1='initramfs-test:\w\$ '
[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab
stty sane
echo "made it to the rootfs!"
-strstr "$CMDLINE" "rd.shell" && sh -i
+if strstr "$CMDLINE" "rd.shell"; then
+ strstr "$(setsid --help)" "control" && CTTY="-c"
+ setsid $CTTY sh -i
+fi
echo "Powering down."
mount -n -o remount,ro /
poweroff -f
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index ca7a1fe..6187144 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -29,7 +29,7 @@ test_setup() {
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient \
- umount strace less
+ umount strace less setsid
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
[ -f ${_terminfodir}/l/linux ] && break
done

View File

@ -0,0 +1,24 @@
From 8cd592dfcb6a5c41ae0dae0b4ec7571fdfa36f92 Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Wed, 14 Mar 2012 17:09:40 -0400
Subject: [PATCH] fix "execvp: No such file or directory" in emergency_shell
Older versions of setsid emit this message on stderr if you try to run
"setsid --help". Redirect it to /dev/null.
---
modules.d/99base/dracut-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index a6c4e24..f0d426c 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -814,7 +814,7 @@ emergency_shell()
_ctty=/dev/$_ctty
fi
[ -c "$_ctty" ] || _ctty=/dev/tty1
- strstr "$(setsid --help)" "control" && CTTY="-c"
+ strstr "$(setsid --help 2>/dev/null)" "control" && CTTY="-c"
setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
else
warn "Boot has failed. To debug this issue add \"rdshell\" to the kernel command line."

View File

@ -0,0 +1,37 @@
From 478314a90e4c8db40c483d7ad5f9337fc561d3ad Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Wed, 14 Mar 2012 17:09:49 -0400
Subject: [PATCH] Make sure 'set -x' gets turned back on in wait_for_loginit
wait_for_loginit does set +x (to turn off debugging temporarily), but
sometimes it would return before turning it back on. Move the set +x
line to fix that, then use 'setdebug' to make sure we don't turn it back
on unless it was needed.
---
modules.d/99base/dracut-lib.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index f0d426c..6f506b6 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -756,9 +756,9 @@ need_shutdown() {
wait_for_loginit()
{
- set +x
[ "$RD_DEBUG" = "yes" ] || return
[ -e /run/initramfs/loginit.pipe ] || return
+ set +x
echo "DRACUT_LOG_END"
exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
# wait for loginit
@@ -778,7 +778,7 @@ wait_for_loginit()
kill $(while read line;do echo $line;done</run/initramfs/loginit.pid)
fi
- set -x
+ setdebug
rm -f /run/initramfs/loginit.pipe /run/initramfs/loginit.pid
}

View File

@ -0,0 +1,66 @@
From abbb76fe930763ca48878f3c8098633b10e6f579 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 20 Mar 2012 13:30:42 +0100
Subject: [PATCH] Do not mount --bind /run anymore
switch_root in util-linux 2.21 does mount --move /run also
---
dracut.spec | 6 +++---
modules.d/99base/init.sh | 16 +++-------------
2 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/dracut.spec b/dracut.spec
index be7ba8a..d197173 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -76,11 +76,11 @@ Requires: hardlink
Requires: gzip
Requires: module-init-tools >= 3.7-9
Requires: sed
-Requires: udev
+Requires: udev > 166
%if 0%{?fedora} || 0%{?rhel} > 6
-Requires: util-linux >= 2.20
+Requires: util-linux >= 2.21
%else
-Requires: util-linux-ng >= 2.17.2
+Requires: util-linux-ng >= 2.21
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 5d51c9d..fa712a7 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -68,7 +68,7 @@ fi
if ! ismounted /run; then
mkdir -m 0755 /newrun
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /newrun >/dev/null
- cp -a /run/* /newrun
+ mv /run/* /newrun >/dev/null 2>&1
mount --move /newrun /run
rm -fr /newrun
fi
@@ -312,20 +312,10 @@ else
fi
[ "$RD_DEBUG" = "yes" ] && set -x
-if [ -d "$NEWROOT"/run ]; then
- NEWRUN="${NEWROOT}/run"
- mount --bind /run "$NEWRUN"
- NEWINITRAMFSROOT="$NEWRUN/initramfs"
-
- if [ "$NEWINITRAMFSROOT/lib" -ef "/lib" ]; then
- for d in bin etc lib lib64 sbin tmp usr var; do
- [ -h /$d ] && ln -fsn $NEWINITRAMFSROOT/$d /$d
- done
- fi
-else
+if ! [ -d "$NEWROOT"/run ]; then
NEWRUN=/dev/.initramfs
mkdir -m 0755 "$NEWRUN"
- mount --bind /run/initramfs "$NEWRUN"
+ mount --rbind /run/initramfs "$NEWRUN"
fi
wait_for_loginit

View File

@ -0,0 +1,23 @@
From 5055abb615a0b4f7519d24a6a37d8af5b5bea6d5 Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Tue, 20 Mar 2012 13:31:36 +0100
Subject: [PATCH] 98selinux/selinux-loadpolicy.sh: use mount --rbind for /dev
This preserves /dev/shm and /dev/pts for the selinux relabel.
---
modules.d/98selinux/selinux-loadpolicy.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/98selinux/selinux-loadpolicy.sh b/modules.d/98selinux/selinux-loadpolicy.sh
index 6eb1dbb..d6e24d6 100755
--- a/modules.d/98selinux/selinux-loadpolicy.sh
+++ b/modules.d/98selinux/selinux-loadpolicy.sh
@@ -43,7 +43,7 @@ rd_load_policy()
if [ $ret -eq 0 -o $ret -eq 2 ]; then
# If machine requires a relabel, force to permissive mode
[ -e "$NEWROOT"/.autorelabel ] && LANG=C /usr/sbin/setenforce 0
- mount --bind /dev "$NEWROOT/dev"
+ mount --rbind /dev "$NEWROOT/dev"
LANG=C chroot "$NEWROOT" /sbin/restorecon -R /dev
return 0
fi

View File

@ -0,0 +1,36 @@
From 4e25cf6edf94755219a822ebc0e108e13377cc27 Mon Sep 17 00:00:00 2001
From: Daniel Drake <dsd@laptop.org>
Date: Fri, 16 Mar 2012 21:11:24 +0000
Subject: [PATCH] Avoid use of "export -n"
"export -n" is a bash extension, not part of POSIX, and is hence
incompatible with the busybox shell.
This was breaking boot when the busybox module was used.
Reimplement the scope change in a few lines of standard shell code.
---
modules.d/99base/init.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index fa712a7..84c13e0 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -263,8 +263,15 @@ else
udevadm info --cleanup-db
fi
+# Retain the values of these variables but ensure that they are unexported
+# This is a POSIX-compliant equivalent of bash's "export -n"
+for var in root rflags fstype netroot NEWROOT; do
+ eval tmp=\$$var
+ unset $var
+ [ -n "$tmp" ] && eval $var=\"$tmp\"
+done
+
export RD_TIMESTAMP
-export -n root rflags fstype netroot NEWROOT
set +x # Turn off debugging for this section
# Clean up the environment
for i in $(export -p); do

View File

@ -0,0 +1,27 @@
From b7b062ba795521433ecd82fa4f214084d17f1ffa Mon Sep 17 00:00:00 2001
From: Wim Muskee <wimmuskee@gmail.com>
Date: Sat, 17 Mar 2012 12:33:55 +0100
Subject: [PATCH] provide name based nbd connects
Because nbd-server also provides name-based exports instead of
port-based ones, make it possible to connect to those.
---
modules.d/95nbd/nbdroot.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh
index e20b4e4..0e7dd9b 100755
--- a/modules.d/95nbd/nbdroot.sh
+++ b/modules.d/95nbd/nbdroot.sh
@@ -30,6 +30,11 @@ nbdfstype=${root%%:*}; root=${root#*:}
nbdflags=${root%%:*}
nbdopts=${root#*:}
+# If nbdport not an integer, then assume name based import
+if [[ $nbdport != [0-9]* ]]; then
+ nbdport="-N $nbdport"
+fi
+
if [ "$nbdopts" = "$nbdflags" ]; then
unset nbdopts
fi

View File

@ -10,7 +10,7 @@
Name: dracut
Version: 017
Release: 43.git20120312%{?dist}
Release: 59.git20120321%{?dist}
Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel}
@ -66,6 +66,22 @@ Patch39: 0039-install-ctcm-network-module-on-s390.patch
Patch40: 0040-img-lib-fix-unpack_img.patch
Patch41: 0041-url-lib-clean-up-output.patch
Patch42: 0042-Add-live.updates-to-livenet-module.patch
Patch43: 0043-README-added-github-and-sourceforge-git-links.patch
Patch44: 0044-AUTHORS-update.patch
Patch45: 0045-remove-dracut-gencmdline.patch
Patch46: 0046-replace-xml-documentation-with-asciidoc.patch
Patch47: 0047-precompile-doc.patch
Patch48: 0048-TEST-10-RAID-wait-for-udev-settle-before-deconstruct.patch
Patch49: 0049-NEWS-update.patch
Patch50: 0050-remove-ctty.patch
Patch51: 0051-remove-openvt-and-use-setsid-c-if-possible.patch
Patch52: 0052-TEST-01-BASIC-add-setsid.patch
Patch53: 0053-fix-execvp-No-such-file-or-directory-in-emergency_sh.patch
Patch54: 0054-Make-sure-set-x-gets-turned-back-on-in-wait_for_logi.patch
Patch55: 0055-Do-not-mount-bind-run-anymore.patch
Patch56: 0056-98selinux-selinux-loadpolicy.sh-use-mount-rbind-for-.patch
Patch57: 0057-Avoid-use-of-export-n.patch
Patch58: 0058-provide-name-based-nbd-connects.patch
BuildArch: noarch
@ -83,9 +99,11 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt
%endif
%if 0%{?suse_version}
BuildRequires: docbook-xsl-stylesheets libxslt
-BuildRequires: docbook-xsl-stylesheets libxslt
%endif
BuildRequires: asciidoc
%if 0%{?fedora} > 12 || 0%{?rhel}
# no "provides", because dracut does not offer
# all functionality of the obsoleted packages
@ -117,11 +135,11 @@ Requires: hardlink
Requires: gzip
Requires: module-init-tools >= 3.7-9
Requires: sed
Requires: udev
Requires: udev > 166
%if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.20
Requires: util-linux >= 2.21
%else
Requires: util-linux-ng >= 2.17.2
Requires: util-linux-ng >= 2.21
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
@ -204,7 +222,7 @@ git am -p1 %{patches}
%endif
%build
make
make all
%install
%if 0%{?fedora} || 0%{?rhel}
@ -361,15 +379,16 @@ rm -rf $RPM_BUILD_ROOT
%files tools
%defattr(-,root,root,0755)
%{_mandir}/man8/dracut-gencmdline.8*
%{_mandir}/man8/dracut-catimages.8*
%{_bindir}/dracut-gencmdline
%{_bindir}/dracut-catimages
%dir /boot/dracut
%dir /var/lib/dracut
%dir /var/lib/dracut/overlay
%changelog
* Wed Mar 21 2012 Harald Hoyer <harald@redhat.com> 017-59.git20120321
- new upstream version, which fixes various anaconda loader issues
* Mon Mar 12 2012 Harald Hoyer <harald@redhat.com> 017-43.git20120312
- live image: fixed image uncompression
- live updates for livenet