From 7128669a7fb9bd7d62386dd18fbc2ede7cb0ec40 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 04 2018 22:23:42 +0000 Subject: import dracut-033-502.el7_4.1 --- diff --git a/.dracut.metadata b/.dracut.metadata new file mode 100644 index 0000000..491ba7f --- /dev/null +++ b/.dracut.metadata @@ -0,0 +1 @@ +b55aaf37ee1ab768877491530ba168b4bdf267ae SOURCES/dracut-033.tar.bz2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..41b060f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/dracut-033.tar.bz2 diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-dracut.sh-harden-host_modalias-reading.patch b/SOURCES/0001-dracut.sh-harden-host_modalias-reading.patch new file mode 100644 index 0000000..228a062 --- /dev/null +++ b/SOURCES/0001-dracut.sh-harden-host_modalias-reading.patch @@ -0,0 +1,26 @@ +From ffecc452321bbef2c0e1efca09c2077775448141 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 13 Sep 2013 16:33:01 +0200 +Subject: [PATCH] dracut.sh: harden host_modalias reading + +Some weird PPC driver make their modulias unreadable + +$ cat /sys/devices/vio/4000/modalias +cat: /sys/devices/vio/4000/modalias: No such device +--- + dracut.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index bd905e3..fd27846 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -921,7 +921,7 @@ if [[ $hostonly ]]; then + declare -A host_modalias + find /sys/devices/ -name modalias -print > "$initdir/.modalias" + while read m; do +- host_modalias["$(<"$m")"]=1 ++ modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1 + done < "$initdir/.modalias" + rm -f -- "$initdir/.modalias" + diff --git a/SOURCES/0002-ifup-do-not-dhcp-on-network-interface-of-secondary-s.patch b/SOURCES/0002-ifup-do-not-dhcp-on-network-interface-of-secondary-s.patch new file mode 100644 index 0000000..961e833 --- /dev/null +++ b/SOURCES/0002-ifup-do-not-dhcp-on-network-interface-of-secondary-s.patch @@ -0,0 +1,35 @@ +From da63c0de561ce9ed158cc2438a1cc5fbb38c3758 Mon Sep 17 00:00:00 2001 +From: WANG Chao +Date: Fri, 13 Sep 2013 22:28:44 +0800 +Subject: [PATCH] ifup: do not dhcp on network interface of secondary stack + +Configure cmdline to: + ip=br0:dhcp bridge=br0:bond0 bond=bond0:eth0 + +By default ifup bond0 will run dhcp on bond0, which is wrong. bond0 +isn't the top interface. we should really run dhcp on br0. + +So if we ifup an network interface on secondary stack, we should not +dhcp. Fix this issue with this patch. +--- + modules.d/40network/ifup.sh | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 3261647..9f6f449 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -336,6 +336,13 @@ for p in $(getargs ip=); do + exit 0 + done + ++# netif isn't the top stack? Then we should exit here. ++# eg. netif is bond0. br0 is on top of it. dhcp br0 is correct but dhcp ++# bond0 doesn't make sense. ++if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then ++ exit 0 ++fi ++ + # no ip option directed at our interface? + if [ ! -e /tmp/setup_net_${netif}.ok ]; then + do_dhcp -4 diff --git a/SOURCES/0003-dracut.sh-also-search-uevent-s-for-MODALIAS.patch b/SOURCES/0003-dracut.sh-also-search-uevent-s-for-MODALIAS.patch new file mode 100644 index 0000000..92b1a9d --- /dev/null +++ b/SOURCES/0003-dracut.sh-also-search-uevent-s-for-MODALIAS.patch @@ -0,0 +1,28 @@ +From af34b260474c551a45a6fa4ae8719622f1e35910 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 13 Sep 2013 17:34:18 +0200 +Subject: [PATCH] dracut.sh: also search uevent's for MODALIAS + +--- + dracut.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/dracut.sh b/dracut.sh +index fd27846..ce39151 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -923,6 +923,14 @@ if [[ $hostonly ]]; then + while read m; do + modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1 + done < "$initdir/.modalias" ++ find /sys/devices/ -name uevent -print > "$initdir/.modalias" ++ while read m; do ++ while read line; do ++ [[ "$line" != MODALIAS\=* ]] && continue ++ modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1 ++ done < "$m" ++ done < "$initdir/.modalias" ++ + rm -f -- "$initdir/.modalias" + + # check /proc/modules diff --git a/SOURCES/0004-dracut.sh-we-don-t-need-to-read-the-modalias-files.patch b/SOURCES/0004-dracut.sh-we-don-t-need-to-read-the-modalias-files.patch new file mode 100644 index 0000000..d0dd111 --- /dev/null +++ b/SOURCES/0004-dracut.sh-we-don-t-need-to-read-the-modalias-files.patch @@ -0,0 +1,32 @@ +From 72ce014bc79933379cb864cef665114ac5d4ccfa Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 13 Sep 2013 17:51:29 +0200 +Subject: [PATCH] dracut.sh: we don't need to read the modalias files + +udev does only parse the uevent MODALIAS line, so whatever is in the +modalias files would not trigger any module load. +--- + dracut.sh | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index ce39151..196b3ad 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -919,15 +919,12 @@ if [[ $hostonly ]]; then + fi + # record all host modaliases + declare -A host_modalias +- find /sys/devices/ -name modalias -print > "$initdir/.modalias" +- while read m; do +- modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1 +- done < "$initdir/.modalias" + find /sys/devices/ -name uevent -print > "$initdir/.modalias" + while read m; do + while read line; do + [[ "$line" != MODALIAS\=* ]] && continue + modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1 ++ break + done < "$m" + done < "$initdir/.modalias" + diff --git a/SOURCES/0005-Add-option-to-turn-on-off-prelinking.patch b/SOURCES/0005-Add-option-to-turn-on-off-prelinking.patch new file mode 100644 index 0000000..3b86f32 --- /dev/null +++ b/SOURCES/0005-Add-option-to-turn-on-off-prelinking.patch @@ -0,0 +1,118 @@ +From 96f48da50cdc049c635cca8466b38084a3de0f48 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 17 Sep 2013 12:23:20 -0500 +Subject: [PATCH] Add option to turn on/off prelinking + +--prelink, --noprelink + +do_prelink=[yes|no] +--- + dracut.8.asc | 6 ++++++ + dracut.conf.5.asc | 3 +++ + dracut.sh | 34 ++++++++++++++++++++++------------ + 3 files changed, 31 insertions(+), 12 deletions(-) + +diff --git a/dracut.8.asc b/dracut.8.asc +index ee9d8de..76fc75c 100644 +--- a/dracut.8.asc ++++ b/dracut.8.asc +@@ -269,6 +269,12 @@ example: + **--nostrip**:: + do not strip binaries in the initramfs + ++**--prelink**:: ++ prelink binaries in the initramfs (default) ++ ++**--noprelink**:: ++ do not prelink binaries in the initramfs ++ + **--hardlink**:: + hardlink files in the initramfs (default) + +diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc +index a32516c..63991d4 100644 +--- a/dracut.conf.5.asc ++++ b/dracut.conf.5.asc +@@ -67,6 +67,9 @@ Configuration files must have the extension .conf; other extensions are ignored. + *do_strip=*"__{yes|no}__":: + Strip binaries in the initramfs (default=yes) + ++*do_prelink=*"__{yes|no}__":: ++ Prelink binaries in the initramfs (default=yes) ++ + *hostonly=*"__{yes|no}__":: + Host-Only mode: Install only what is needed for booting the local host + instead of a generic host and generate host-specific configuration. +diff --git a/dracut.sh b/dracut.sh +index 196b3ad..177e66d 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -97,6 +97,8 @@ Creates initial ramdisk images for preloading modules + --kernel-cmdline [PARAMETERS] Specify default kernel command line parameters + --strip Strip binaries in the initramfs + --nostrip Do not strip binaries in the initramfs ++ --prelink Prelink binaries in the initramfs ++ --noprelink Do not prelink binaries in the initramfs + --hardlink Hardlink files in the initramfs + --nohardlink Do not hardlink files in the initramfs + --prefix [DIR] Prefix initramfs files with [DIR] +@@ -315,6 +317,8 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \ + --long kernel-cmdline: \ + --long strip \ + --long nostrip \ ++ --long prelink \ ++ --long noprelink \ + --long hardlink \ + --long nohardlink \ + --long noprefix \ +@@ -394,6 +398,8 @@ while :; do + --no-early-microcode) early_microcode_l="no";; + --strip) do_strip_l="yes";; + --nostrip) do_strip_l="no";; ++ --prelink) do_prelink_l="yes";; ++ --noprelink) do_prelink_l="no";; + --hardlink) do_hardlink_l="yes";; + --nohardlink) do_hardlink_l="no";; + --noprefix) prefix_l="/";; +@@ -651,6 +657,8 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) + [[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l + [[ $do_strip_l ]] && do_strip=$do_strip_l + [[ $do_strip ]] || do_strip=yes ++[[ $do_prelink_l ]] && do_prelink=$do_prelink_l ++[[ $do_prelink ]] || do_prelink=yes + [[ $do_hardlink_l ]] && do_hardlink=$do_hardlink_l + [[ $do_hardlink ]] || do_hardlink=yes + [[ $prefix_l ]] && prefix=$prefix_l +@@ -1251,18 +1259,20 @@ if [[ $kernel_only != yes ]]; then + fi + fi + +-PRELINK_BIN="$(command -v prelink)" +-if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then +- if [[ $DRACUT_FIPS_MODE ]]; then +- dinfo "*** Installing prelink files ***" +- inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache +- else +- dinfo "*** Pre-linking files ***" +- inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf +- chroot "$initdir" "$PRELINK_BIN" -a +- rm -f -- "$initdir/$PRELINK_BIN" +- rm -fr -- "$initdir"/etc/prelink.* +- dinfo "*** Pre-linking files done ***" ++if [[ $do_prelink == yes ]]; then ++ PRELINK_BIN="$(command -v prelink)" ++ if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then ++ if [[ $DRACUT_FIPS_MODE ]]; then ++ dinfo "*** Installing prelink files ***" ++ inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache ++ else ++ dinfo "*** Pre-linking files ***" ++ inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf ++ chroot "$initdir" "$PRELINK_BIN" -a ++ rm -f -- "$initdir/$PRELINK_BIN" ++ rm -fr -- "$initdir"/etc/prelink.* ++ dinfo "*** Pre-linking files done ***" ++ fi + fi + fi + diff --git a/SOURCES/0006-add-etc-system-fips-for-dracut-fips-subpackage.patch b/SOURCES/0006-add-etc-system-fips-for-dracut-fips-subpackage.patch new file mode 100644 index 0000000..3ca5723 --- /dev/null +++ b/SOURCES/0006-add-etc-system-fips-for-dracut-fips-subpackage.patch @@ -0,0 +1,32 @@ +From 764b5209942dc435c7c611b0008975aa13738374 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 2 Oct 2013 12:36:25 +0200 +Subject: [PATCH] add /etc/system-fips for dracut-fips subpackage + +--- + dracut.spec | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dracut.spec b/dracut.spec +index 87340d7..b1cf9fe 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -271,6 +271,10 @@ echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-i + echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf + %endif + ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} ++> $RPM_BUILD_ROOT/etc/system-fips ++%endif ++ + # create compat symlink + mkdir -p $RPM_BUILD_ROOT/sbin + ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut +@@ -413,6 +417,7 @@ rm -rf -- $RPM_BUILD_ROOT + %defattr(-,root,root,0755) + %{dracutlibdir}/modules.d/01fips + %{dracutlibdir}/dracut.conf.d/40-fips.conf ++%config(missingok) /etc/system-fips + %endif + + %files fips-aesni diff --git a/SOURCES/0007-dracut-Generlize-microcode-early-cpio-usage.patch b/SOURCES/0007-dracut-Generlize-microcode-early-cpio-usage.patch new file mode 100644 index 0000000..622301a --- /dev/null +++ b/SOURCES/0007-dracut-Generlize-microcode-early-cpio-usage.patch @@ -0,0 +1,69 @@ +From 4b1aa19fa0fad0e607961995dbbe971be2ef9f81 Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Fri, 27 Sep 2013 20:10:37 +0200 +Subject: [PATCH] dracut: Generlize microcode early cpio usage + +ACPI early table override also may need to place files into an early cpio. +Reflect this in variable and file names. +This change is renaming only and does not introduce any real change. + +Reviewed-by: Konrad Rzeszutek Wilk +Signed-off-by: Thomas Renninger +--- + dracut.sh | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 177e66d..b3b8088 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -704,9 +704,9 @@ readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)" + } + + if [[ $early_microcode = yes ]]; then +- readonly microcode_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_microcode.XXXXXX)" +- [ -d "$microcode_dir" ] || { +- printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_microcode.XXXXXX failed." >&2 ++ readonly early_cpio_dir="$(mktemp --tmpdir="$TMPDIR/" -d -t early_cpio.XXXXXX)" ++ [ -d "$early_cpio_dir" ] || { ++ printf "%s\n" "dracut: mktemp --tmpdir=\"$TMPDIR/\" -d -t early_cpio.XXXXXX failed." >&2 + exit 1 + } + fi +@@ -715,7 +715,7 @@ trap ' + ret=$?; + [[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$"; + [[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; }; +- [[ $keep ]] && echo "Not removing $microcode_dir." >&2 || { [[ $microcode_dir ]] && rm -Rf -- "$microcode_dir"; }; ++ [[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; }; + [[ $_dlogdir ]] && rm -Rf -- "$_dlogdir"; + exit $ret; + ' EXIT +@@ -1311,7 +1311,7 @@ if [[ $early_microcode = yes ]]; then + dinfo "*** Generating early-microcode cpio image ***" + ucode_dir=(amd-ucode intel-ucode) + ucode_dest=(AuthenticAMD.bin GenuineIntel.bin) +- _dest_dir="$microcode_dir/d/kernel/x86/microcode" ++ _dest_dir="$early_cpio_dir/d/kernel/x86/microcode" + _dest_idx="0 1" + mkdir -p $_dest_dir + if [[ $hostonly ]]; then +@@ -1331,14 +1331,15 @@ if [[ $early_microcode = yes ]]; then + fi + done + done +- (cd "$microcode_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../ucode.cpio) ++ create_early_cpio="yes" + fi + + rm -f -- "$outfile" + dinfo "*** Creating image file ***" +-if [[ $early_microcode = yes ]]; then ++if [[ $create_early_cpio = yes ]]; then + # The microcode blob is _before_ the initramfs blob, not after +- mv $microcode_dir/ucode.cpio $outfile.$$ ++ (cd "$early_cpio_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../early.cpio) ++ mv $early_cpio_dir/early.cpio $outfile.$$ + fi + if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet| \ + $compress >> "$outfile.$$"; ); then diff --git a/SOURCES/0008-dracut-Do-not-create-early_cpio-if-no-suitable-micro.patch b/SOURCES/0008-dracut-Do-not-create-early_cpio-if-no-suitable-micro.patch new file mode 100644 index 0000000..5033f73 --- /dev/null +++ b/SOURCES/0008-dracut-Do-not-create-early_cpio-if-no-suitable-micro.patch @@ -0,0 +1,44 @@ +From ff33b576767d5e020c9f2685a0f5b0acb35a781c Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Fri, 27 Sep 2013 20:10:38 +0200 +Subject: [PATCH] dracut: Do not create early_cpio if no suitable microcode + exist in hostonly case + +Intel microcodes only exist for very specific family/model/stepping CPUs. +If no microcode gets added, there is no need to create an empty +(only directories) cpio later that gets glued to the initrd. + +This also fixes: + +*** Constructing GenuineIntel.bin **** +cat: /lib/firmware/intel-ucode/06-3c-03: No such file or directory + +in hostonly mode if there is no suitable microcode for the CPU. + +Reviewed-by: Konrad Rzeszutek Wilk +Signed-off-by: Thomas Renninger +--- + dracut.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index b3b8088..e43227e 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1326,12 +1326,15 @@ if [[ $early_microcode = yes ]]; then + dinfo "*** Constructing ${ucode_dest[$idx]} ****" + if [[ $hostonly ]]; then + _src=$(get_ucode_file) ++ if ! [[ -r $_fwdir/$_fw/$_src ]];then ++ break; ++ fi + fi + cat $_fwdir/$_fw/$_src > $_dest_dir/${ucode_dest[$idx]} ++ create_early_cpio="yes" + fi + done + done +- create_early_cpio="yes" + fi + + rm -f -- "$outfile" diff --git a/SOURCES/0009-dracut-Implement-ACPI-table-overriding.patch b/SOURCES/0009-dracut-Implement-ACPI-table-overriding.patch new file mode 100644 index 0000000..786df6d --- /dev/null +++ b/SOURCES/0009-dracut-Implement-ACPI-table-overriding.patch @@ -0,0 +1,45 @@ +From ebc7f823c0013dfe7fcefe82db48bf4832f5dcec Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Fri, 27 Sep 2013 20:10:39 +0200 +Subject: [PATCH] dracut: Implement ACPI table overriding + +An example config file for this feature could be: + +/etc/dracut.conf.d/03-acpi-override.conf + +with this content: +acpi_override="yes" +acpi_table_dir="/etc/dracut.conf.d/acpi_tables" + +Then all files ending with *.aml will be put into the early cpio +(kernel/firmware/acpi) and will be used to replace the BIOS provided tables +if the kernel supports this feature. + +Reviewed-by: Konrad Rzeszutek Wilk +Signed-off-by: Thomas Renninger +--- + dracut.sh | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/dracut.sh b/dracut.sh +index e43227e..b4b3e13 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1337,6 +1337,17 @@ if [[ $early_microcode = yes ]]; then + done + fi + ++if [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]]; then ++ dinfo "*** Packaging ACPI tables to override BIOS provided ones ***" ++ _dest_dir="$early_cpio_dir/d/kernel/firmware/acpi" ++ mkdir -p $_dest_dir ++ for table in $acpi_table_dir/*.aml; do ++ dinfo " Adding ACPI table: $table" ++ cp $table $_dest_dir ++ create_early_cpio="yes" ++ done ++fi ++ + rm -f -- "$outfile" + dinfo "*** Creating image file ***" + if [[ $create_early_cpio = yes ]]; then diff --git a/SOURCES/0010-dracut.conf.5.asc-Add-ACPI-table-override-and-uncomp.patch b/SOURCES/0010-dracut.conf.5.asc-Add-ACPI-table-override-and-uncomp.patch new file mode 100644 index 0000000..1020676 --- /dev/null +++ b/SOURCES/0010-dracut.conf.5.asc-Add-ACPI-table-override-and-uncomp.patch @@ -0,0 +1,37 @@ +From 54011e3591216503dd93d1028ff209a6a4851a57 Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Fri, 27 Sep 2013 20:10:40 +0200 +Subject: [PATCH] dracut.conf.5.asc: Add ACPI table override and uncompressed + cpio doc + +Signed-off-by: Thomas Renninger +--- + dracut.conf.5.asc | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc +index 63991d4..c9c854a 100644 +--- a/dracut.conf.5.asc ++++ b/dracut.conf.5.asc +@@ -125,6 +125,21 @@ If chrooted to another root other than the real root device, use --fstab and pro + *no_kernel=*"{yes|no}":: + Do not install kernel drivers and firmware files (default=no) + ++*acpi_override=*"{yes|no}":: ++ [WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! + ++ Override BIOS provided ACPI tables. For further documentation read ++ Documentation/acpi/initrd_table_override.txt in the kernel sources. ++ Search for ACPI table files (must have .aml suffix) in acpi_table_dir= ++ directory (see below) and add them to a separate uncompressed cpio ++ archive. This cpio archive gets glued (concatenated, uncompressed one ++ must be the first one) to the compressed cpio archive. The first, ++ uncompressed cpio archive is for data which the kernel must be able ++ to access very early (and cannot make use of uncompress alogrithms yet) ++ like microcode or ACPI tables (default=no). ++ ++*acpi_table_dir=*"____":: ++ Directory to search for ACPI tables if acpi_override= is set to yes. ++ + *early_microcode=*"{yes|no}":: + Combine early microcode with ramdisk (default=no) + diff --git a/SOURCES/0011-dracut-bash-completion.sh-add-prelink-noprelink.patch b/SOURCES/0011-dracut-bash-completion.sh-add-prelink-noprelink.patch new file mode 100644 index 0000000..3cfa91f --- /dev/null +++ b/SOURCES/0011-dracut-bash-completion.sh-add-prelink-noprelink.patch @@ -0,0 +1,22 @@ +From eaa4d30d5abd753bd08322e4b7e5ebd8a52dd75a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 2 Oct 2013 12:47:34 +0200 +Subject: [PATCH] dracut-bash-completion.sh: add --prelink --noprelink + +--- + dracut-bash-completion.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-bash-completion.sh b/dracut-bash-completion.sh +index f822058..d796c35 100644 +--- a/dracut-bash-completion.sh ++++ b/dracut-bash-completion.sh +@@ -34,7 +34,7 @@ _dracut() { + --local --hostonly --no-hostonly --fstab --help --bzip2 --lzma + --xz --no-compress --gzip --list-modules --show-modules --keep + --printsize --regenerate-all --noimageifnotneeded --early-microcode +- --no-early-microcode --print-cmdline' ++ --no-early-microcode --print-cmdline --prelink --noprelink' + + [ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers + --omit-drivers --modules --omit --drivers --filesystems --install diff --git a/SOURCES/0012-dracut.sh-bail-out-early-if-destination-dir-is-not-w.patch b/SOURCES/0012-dracut.sh-bail-out-early-if-destination-dir-is-not-w.patch new file mode 100644 index 0000000..45e80ad --- /dev/null +++ b/SOURCES/0012-dracut.sh-bail-out-early-if-destination-dir-is-not-w.patch @@ -0,0 +1,64 @@ +From cf9f56be9c0ab44e5ae5d5abde01151b33206fc2 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 2 Oct 2013 12:48:11 +0200 +Subject: [PATCH] dracut.sh: bail out early, if destination dir is not + writeable + +--- + dracut.sh | 36 +++++++++++++++++++----------------- + 1 file changed, 19 insertions(+), 17 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index b4b3e13..e135dfc 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -824,9 +824,25 @@ if [[ -d $srcmods ]]; then + } + fi + +-if [[ -f $outfile && ! $force && ! $print_cmdline ]]; then +- dfatal "Will not override existing initramfs ($outfile) without --force" +- exit 1 ++if [[ ! $print_cmdline ]]; then ++ if [[ -f $outfile && ! $force ]]; then ++ dfatal "Will not override existing initramfs ($outfile) without --force" ++ exit 1 ++ fi ++ ++ outdir=${outfile%/*} ++ [[ $outdir ]] || outdir="/" ++ ++ if [[ ! -d "$outdir" ]]; then ++ dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible." ++ exit 1 ++ elif [[ ! -w "$outdir" ]]; then ++ dfatal "No permission to write to $outdir." ++ exit 1 ++ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then ++ dfatal "No permission to write $outfile." ++ exit 1 ++ fi + fi + + # Need to be able to have non-root users read stuff (rpcbind etc) +@@ -1041,20 +1057,6 @@ if [[ $print_cmdline ]]; then + exit 0 + fi + +-outdir=${outfile%/*} +-[[ $outdir ]] || outdir="/" +- +-if [[ ! -d "$outdir" ]]; then +- dfatal "Can't write to $outdir: Directory $outdir does not exist or is not accessible." +- exit 1 +-elif [[ ! -w "$outdir" ]]; then +- dfatal "No permission to write to $outdir." +- exit 1 +-elif [[ -f "$outfile" && ! -w "$outfile" ]]; then +- dfatal "No permission to write $outfile." +- exit 1 +-fi +- + # Create some directory structure first + [[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}" + diff --git a/SOURCES/0013-dracut-logger.sh-do-not-log-to-syslog-kmsg-journal-f.patch b/SOURCES/0013-dracut-logger.sh-do-not-log-to-syslog-kmsg-journal-f.patch new file mode 100644 index 0000000..29d670c --- /dev/null +++ b/SOURCES/0013-dracut-logger.sh-do-not-log-to-syslog-kmsg-journal-f.patch @@ -0,0 +1,44 @@ +From d87da4c7776d0e16b8ce6c3a583d21209c3db144 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 2 Oct 2013 12:48:57 +0200 +Subject: [PATCH] dracut-logger.sh: do not log to syslog/kmsg/journal for UID + != 0 + +Don't clutter the system log with user actions. + +Also check, if systemd-cat works, before using it. +--- + dracut-logger.sh | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/dracut-logger.sh b/dracut-logger.sh +index b052581..f679dc9 100755 +--- a/dracut-logger.sh ++++ b/dracut-logger.sh +@@ -140,11 +140,16 @@ dlog_init() { + fi + fi + ++ if (( $UID != 0 )); then ++ kmsgloglvl=0 ++ sysloglvl=0 ++ fi ++ + if (( $sysloglvl > 0 )); then + if [[ -d /run/systemd/journal ]] \ + && type -P systemd-cat &>/dev/null \ +- && (( $UID == 0 )) \ +- && systemctl is-active systemd-journald.socket &>/dev/null; then ++ && systemctl --quiet is-active systemd-journald.socket &>/dev/null \ ++ && { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then + readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)" + readonly _systemdcatfile="$_dlogdir/systemd-cat" + mkfifo "$_systemdcatfile" +@@ -153,6 +158,7 @@ dlog_init() { + exec 15>"$_systemdcatfile" + elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then + # We cannot log to syslog, so turn this facility off. ++ kmsgloglvl=$sysloglvl + sysloglvl=0 + ret=1 + errmsg="No '/dev/log' or 'logger' included for syslog logging" diff --git a/SOURCES/0014-lvm-mdraid-Fix-LVM-on-MD-activation.patch b/SOURCES/0014-lvm-mdraid-Fix-LVM-on-MD-activation.patch new file mode 100644 index 0000000..06497b1 --- /dev/null +++ b/SOURCES/0014-lvm-mdraid-Fix-LVM-on-MD-activation.patch @@ -0,0 +1,43 @@ +From 32b970339f5439300fe6155352ec1f17c5e48d78 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Fri, 4 Oct 2013 10:41:24 +0200 +Subject: [PATCH] lvm/mdraid: Fix LVM on MD activation + +The 69-dm-lvm-metad.rules set some udev env. variables that makes it +possible to detect the right time to activate LVM on MD. The MD is very +similar to DM during activation - it's usable only after proper device +activation - the CHANGE event. We need to make a difference between a +CHANGE event that comes from this activation and CHANGE event that is +the outcome of the WATCH udev rule (otherwise we'd end up with LVM +activation done on each CHANGE event - which is wrong). + +So we need the udev databse to be persistent during pivot to root fs +even for MD devices. +--- + modules.d/90lvm/module-setup.sh | 2 +- + modules.d/90mdraid/59-persistent-storage-md.rules | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh +index 2ef9a51..f98ffff 100755 +--- a/modules.d/90lvm/module-setup.sh ++++ b/modules.d/90lvm/module-setup.sh +@@ -82,7 +82,7 @@ install() { + } > "${initdir}/etc/lvm/lvm.conf" + fi + +- inst_rules 11-dm-lvm.rules ++ inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules + # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules + # files, but provides the one below: + inst_rules 64-device-mapper.rules +diff --git a/modules.d/90mdraid/59-persistent-storage-md.rules b/modules.d/90mdraid/59-persistent-storage-md.rules +index bea9325..6ef858a 100644 +--- a/modules.d/90mdraid/59-persistent-storage-md.rules ++++ b/modules.d/90mdraid/59-persistent-storage-md.rules +@@ -20,4 +20,5 @@ IMPORT{program}="/sbin/mdadm --detail --export $tempnode" + IMPORT BLKID + OPTIONS+="link_priority=100" + OPTIONS+="watch" ++OPTIONS+="db_persist" + LABEL="md_end" diff --git a/SOURCES/0015-bcache-optionally-install-the-tools-and-rules.patch b/SOURCES/0015-bcache-optionally-install-the-tools-and-rules.patch new file mode 100644 index 0000000..948bb0b --- /dev/null +++ b/SOURCES/0015-bcache-optionally-install-the-tools-and-rules.patch @@ -0,0 +1,24 @@ +From a5659901e87ef70b3cf8ea8b254e3d0f9fa88d96 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 9 Oct 2013 09:50:15 +0200 +Subject: [PATCH] bcache: optionally install the tools and rules + +--- + modules.d/90bcache/module-setup.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/90bcache/module-setup.sh b/modules.d/90bcache/module-setup.sh +index b02b8b4..a5a57ed 100755 +--- a/modules.d/90bcache/module-setup.sh ++++ b/modules.d/90bcache/module-setup.sh +@@ -27,7 +27,7 @@ installkernel() { + } + + install() { +- blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } || inst_multiple probe-bcache +- inst_multiple ${udevdir}/bcache-register +- inst_rules 61-bcache.rules ++ blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } || inst_multiple -o probe-bcache ++ inst_multiple -o ${udevdir}/bcache-register ++ inst_rules 61-bcache.rules 69-bcache.rules + } diff --git a/SOURCES/0016-dracut-functions.sh-inst_rules-do-not-install-rules-.patch b/SOURCES/0016-dracut-functions.sh-inst_rules-do-not-install-rules-.patch new file mode 100644 index 0000000..813334c --- /dev/null +++ b/SOURCES/0016-dracut-functions.sh-inst_rules-do-not-install-rules-.patch @@ -0,0 +1,25 @@ +From 31b89c8c2bfb5a0336268cc66bd663429122feb3 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 4 Oct 2013 13:32:15 +0200 +Subject: [PATCH] dracut-functions.sh:inst_rules() do not install rules in CWD + +--- + dracut-functions.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index cf33af5..45e0911 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -882,7 +882,10 @@ inst_rules() { + fi + done + fi +- for r in '' ./ $dracutbasedir/rules.d/; do ++ for r in '' $dracutbasedir/rules.d/; do ++ # skip rules without an absolute path ++ [[ "${r}$_rule" != /* ]] && continue ++ + if [[ -f ${r}$_rule ]]; then + _found="${r}$_rule" + inst_rule_programs "$_found" diff --git a/SOURCES/0017-mdraid-module-setup.sh-install-configs-from-etc-mdad.patch b/SOURCES/0017-mdraid-module-setup.sh-install-configs-from-etc-mdad.patch new file mode 100644 index 0000000..f9ce093 --- /dev/null +++ b/SOURCES/0017-mdraid-module-setup.sh-install-configs-from-etc-mdad.patch @@ -0,0 +1,30 @@ +From fdaa69db2061cc83845f631e6e3216e55b2eb235 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Thu, 3 Oct 2013 14:54:42 +0400 +Subject: [PATCH] mdraid/module-setup.sh: install configs from + /etc/mdadm.conf.d + +/etc/mdadm.conf.d directory is supported since mdadm-3.3 +--- + modules.d/90mdraid/module-setup.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh +index 5df2274..45767c6 100755 +--- a/modules.d/90mdraid/module-setup.sh ++++ b/modules.d/90mdraid/module-setup.sh +@@ -93,6 +93,14 @@ install() { + else + [ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf + fi ++ if [ -d /etc/mdadm.conf.d ]; then ++ local f ++ inst_dir /etc/mdadm.conf.d ++ for f in /etc/mdadm.conf.d/*.conf; do ++ [ -f "$f" ] || continue ++ inst "$f" ++ done ++ fi + fi + + inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh" diff --git a/SOURCES/0018-mdraid-module-setup.sh-fixes-for-mdadm-3.2.6.patch b/SOURCES/0018-mdraid-module-setup.sh-fixes-for-mdadm-3.2.6.patch new file mode 100644 index 0000000..160aae5 --- /dev/null +++ b/SOURCES/0018-mdraid-module-setup.sh-fixes-for-mdadm-3.2.6.patch @@ -0,0 +1,51 @@ +From 4fde4d06474cdf321958592edf3f856446927d29 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Sun, 29 Sep 2013 01:31:01 +0400 +Subject: [PATCH] mdraid/module-setup.sh: fixes for mdadm-3.2.6+ + +mdadm-3.2.6+: +Incremental assembly rule contains "--offroot" arg. Update +regexp to catch this variant. + +mdadm-3.3+: +Rules was splitted into two files: 63-md-raid-arrays.rules +and 64-md-raid-assembly.rules. Install them both and edit +the latter. +--- + modules.d/90mdraid/module-setup.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh +index 45767c6..34aae1e 100755 +--- a/modules.d/90mdraid/module-setup.sh ++++ b/modules.d/90mdraid/module-setup.sh +@@ -59,6 +59,7 @@ cmdline() { + } + + install() { ++ local rule rule_path + inst_multiple cat + inst_multiple -o mdmon + inst $(command -v partx) /sbin/partx +@@ -67,12 +68,20 @@ install() { + cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf" + echo >> "${initdir}/etc/cmdline.d/90mdraid.conf" + ++ # =mdadm-3.3 udev rules ++ inst_rules 63-md-raid-arrays.rules 64-md-raid-assembly.rules + # remove incremental assembly from stock rules, so they don't shadow + # 65-md-inc*.rules and its fine-grained controls, or cause other problems + # when we explicitly don't want certain components to be incrementally + # assembled +- sed -i -r -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode)"/d' "${initdir}${udevdir}/rules.d/64-md-raid.rules" ++ for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do ++ rule_path="${initdir}${udevdir}/rules.d/${rule}" ++ [ -f "${rule_path}" ] && sed -i -r \ ++ -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \ ++ "${rule_path}" ++ done + + inst_rules "$moddir/65-md-incremental-imsm.rules" + diff --git a/SOURCES/0019-fcoe-add-FCoE-UEFI-boot-device-support.patch b/SOURCES/0019-fcoe-add-FCoE-UEFI-boot-device-support.patch new file mode 100644 index 0000000..9e5f118 --- /dev/null +++ b/SOURCES/0019-fcoe-add-FCoE-UEFI-boot-device-support.patch @@ -0,0 +1,240 @@ +From 1b827040f8b3e1e4fec19de76526fe0620654502 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 Oct 2013 14:24:36 +0200 +Subject: [PATCH] fcoe: add FCoE UEFI boot device support + +--- + modules.d/95fcoe/module-setup.sh | 1 + + modules.d/95fcoe/parse-uefifcoe.sh | 35 +++++++++ + modules.d/99base/module-setup.sh | 1 + + modules.d/99base/uefi-lib.sh | 155 +++++++++++++++++++++++++++++++++++++ + 4 files changed, 192 insertions(+) + create mode 100755 modules.d/95fcoe/parse-uefifcoe.sh + create mode 100755 modules.d/99base/uefi-lib.sh + +diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh +index d3c58cc..08ba4ea 100755 +--- a/modules.d/95fcoe/module-setup.sh ++++ b/modules.d/95fcoe/module-setup.sh +@@ -32,6 +32,7 @@ install() { + inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up" + inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd" + inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh" ++ inst_hook cmdline 20 "$moddir/parse-uefifcoe.sh" + inst_hook cmdline 99 "$moddir/parse-fcoe.sh" + dracut_need_initqueue + } +diff --git a/modules.d/95fcoe/parse-uefifcoe.sh b/modules.d/95fcoe/parse-uefifcoe.sh +new file mode 100755 +index 0000000..e03bcb3 +--- /dev/null ++++ b/modules.d/95fcoe/parse-uefifcoe.sh +@@ -0,0 +1,35 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++command -v getarg >/dev/null || . /lib/dracut-lib.sh ++command -v get_fcoe_boot_mac >/dev/null || . /lib/uefi-lib.sh ++command -v set_ifname >/dev/null || . /lib/net-lib.sh ++ ++print_fcoe_uefi_conf() ++{ ++ local mac dev vlan ++ mac=$(get_fcoe_boot_mac) ++ [ -z "$mac" ] && continue ++ dev=$(set_ifname fcoe $mac) ++ vlan=$(get_fcoe_boot_vlan) ++ if [ "$vlan" -ne "0" ]; then ++ case "$vlan" in ++ [0-9]*) ++ printf "%s\n" "vlan=$dev.$vlan:$dev" ++ dev="$dev.$vlan" ++ ;; ++ *) ++ printf "%s\n" "vlan=$vlan:$dev" ++ dev="$vlan" ++ ;; ++ esac ++ fi ++ # fcoe=eth0:nodcb ++ printf "%s\n" "$dev:nodcb" ++} ++ ++ ++if [ -e /sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data ]; then ++ print_fcoe_uefi_conf > /etc/cmdline.d/40-fcoe-uefi.conf ++fi +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index 52ce400..d33a0fb 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -42,6 +42,7 @@ install() { + mkdir -p ${initdir}/tmp + + inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh" ++ inst_simple "$moddir/uefi-lib.sh" "/lib/uefi-lib.sh" + + if ! dracut_module_included "systemd"; then + inst_multiple switch_root || dfatal "Failed to install switch_root" +diff --git a/modules.d/99base/uefi-lib.sh b/modules.d/99base/uefi-lib.sh +new file mode 100755 +index 0000000..faedbac +--- /dev/null ++++ b/modules.d/99base/uefi-lib.sh +@@ -0,0 +1,155 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++# ++# Copyright 2013 Red Hat, Inc. All rights reserved. ++# Copyright 2013 Harald Hoyer ++# ++# 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 . ++# ++ ++getbyte () { ++ local IFS= LC_CTYPE=C res c ++ read -r -n 1 -d '' c ++ res=$? ++ # the single quote in the argument of the printf ++ # yields the numeric value of $c (ASCII since LC_CTYPE=C) ++ [[ -n $c ]] && c=$(printf '%u' "'$c") || c=0 ++ printf "$c" ++ return $res ++} ++ ++getword () { ++ local b1 b2 val ++ b1=$(getbyte) || return 1 ++ b2=$(getbyte) || return 1 ++ (( val = b2 * 256 + b1 )) ++ echo $val ++ return 0 ++} ++ ++# Acpi(PNP0A08,0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)/MAC(90E2BA265ED4,0x0)/Vlan(172)/Fibre(0x4EA06104A0CC0050,0x0) ++uefi_device_path() ++{ ++ local IFS= LC_CTYPE=C res tt len type hextype first ++ first=1 ++ ++ while :; do ++ type=$(getbyte) || return 1 ++ subtype=$(getbyte) || return 1 ++ len=$(getword) || return 1 ++ hextype=$(printf "%02x%02x" "$type" "$subtype") ++ if [[ $first == 1 ]]; then ++ first=0 ++ elif [[ $hextype != "7fff" ]]; then ++ printf "/" ++ fi ++ case $hextype in ++ 0101) ++ # PCI ++ tt=$(getword) ++ printf "PCI(0x%x,0x%x)" $(($tt / 256)) $(($tt & 255)) ++ ;; ++ 0201) ++ # ACPI ++ printf "Acpi(0x%x,0x%x)" $(($(getword) + $(getword) * 65536)) $(($(getword) + $(getword) * 65536)) ++ ;; ++ 0303) ++ # FIBRE ++ getword &>/dev/null ++ getword &>/dev/null ++ printf "Fibre(0x%x%x%x%x%x%x%x%x,0x%x)" \ ++ $(getbyte) $(getbyte) $(getbyte) $(getbyte) \ ++ $(getbyte) $(getbyte) $(getbyte) $(getbyte) \ ++ $(( $(getword) + $(getword) * 65536 + 4294967296 * ( $(getword) + $(getword) * 65536 ) )) ++ ;; ++ 030b) ++ # MAC ++ printf "MAC(%02x%02x%02x%02x%02x%02x," $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) ++ read -r -N 26 tt || return 1 ++ printf "0x%x)" $(getbyte) ++ ;; ++ 0314) ++ # VLAN ++ printf "VLAN(%d)" $(getword) ++ ;; ++ 7fff) ++ # END ++ printf "\n" ++ return 0 ++ ;; ++ *) ++ printf "Unknown(Type:%d SubType:%d len=%d)" "$type" "$subtype" "$len" ++ read -r -N $(($len-4)) tt || return 1 ++ ;; ++ esac ++ done ++} ++ ++get_fcoe_boot_mac() ++{ ++ data=${1:-/sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data} ++ [ -f $data ] || return 1 ++ local IFS= LC_CTYPE=C tt len type hextype ++ first=1 ++ ++ while :; do ++ type=$(getbyte) || return 1 ++ subtype=$(getbyte) || return 1 ++ len=$(getword) || return 1 ++ hextype=$(printf "%02x%02x" "$type" "$subtype") ++ case $hextype in ++ 030b) ++ # MAC ++ printf "%02x:%02x:%02x:%02x:%02x:%02x" $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) ++ read -r -N 27 tt || return 1 ++ ;; ++ 7fff) ++ # END ++ return 0 ++ ;; ++ *) ++ read -r -N $(($len-4)) tt || return 1 ++ ;; ++ esac ++ done < $data ++} ++ ++get_fcoe_boot_vlan() ++{ ++ data=${1:-/sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data} ++ [ -f $data ] || return 1 ++ local IFS= LC_CTYPE=C tt len type hextype ++ first=1 ++ ++ while :; do ++ type=$(getbyte) || return 1 ++ subtype=$(getbyte) || return 1 ++ len=$(getword) || return 1 ++ hextype=$(printf "%02x%02x" "$type" "$subtype") ++ case $hextype in ++ 0314) ++ # VLAN ++ printf "%d" $(getword) ++ ;; ++ 7fff) ++ # END ++ return 0 ++ ;; ++ *) ++ read -r -N $(($len-4)) tt || return 1 ++ ;; ++ esac ++ done < $data ++} diff --git a/SOURCES/0020-rootfs-block-add-support-for-the-rootfallback-kernel.patch b/SOURCES/0020-rootfs-block-add-support-for-the-rootfallback-kernel.patch new file mode 100644 index 0000000..9cb2a9c --- /dev/null +++ b/SOURCES/0020-rootfs-block-add-support-for-the-rootfallback-kernel.patch @@ -0,0 +1,94 @@ +From 4584826e9a25fdddb876f07875423196d9fc8840 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 Oct 2013 15:06:22 +0200 +Subject: [PATCH] rootfs-block: add support for the rootfallback= kernel + cmdline option + +--- + dracut.cmdline.7.asc | 6 +++++ + modules.d/95rootfs-block/module-setup.sh | 3 ++- + modules.d/95rootfs-block/rootfallback.sh | 46 ++++++++++++++++++++++++++++++++ + 3 files changed, 54 insertions(+), 1 deletion(-) + create mode 100755 modules.d/95rootfs-block/rootfallback.sh + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index 09c47e8..4b2ab03 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -69,6 +69,12 @@ rootfstype=ext3 + force mounting _/_ and _/usr_ (if it is a separate device) read-write. + See also ro option. + ++**rootfallback=**__:: ++ specify the block device to use as the root filesystem, if the normal root cannot be found. ++ This can only be a simple block device with a simple file system, for which the filesystem ++ driver is either compiled in, or added manually to the initramfs. ++ This parameter can be specified multiple times. ++ + **rd.auto** **rd.auto=1**:: + enable autoassembly of special devices like cryptoLUKS, dmraid, mdraid or lvm. + Default is off as of dracut version >= 024. +diff --git a/modules.d/95rootfs-block/module-setup.sh b/modules.d/95rootfs-block/module-setup.sh +index f066a79..7e714eb 100755 +--- a/modules.d/95rootfs-block/module-setup.sh ++++ b/modules.d/95rootfs-block/module-setup.sh +@@ -44,5 +44,6 @@ install() { + inst_hook pre-udev 30 "$moddir/block-genrules.sh" + inst_hook mount 99 "$moddir/mount-root.sh" + fi +-} + ++ inst_hook initqueue/timeout 99 "$moddir/rootfallback.sh" ++} +diff --git a/modules.d/95rootfs-block/rootfallback.sh b/modules.d/95rootfs-block/rootfallback.sh +new file mode 100755 +index 0000000..246ce9a +--- /dev/null ++++ b/modules.d/95rootfs-block/rootfallback.sh +@@ -0,0 +1,46 @@ ++#!/bin/sh ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh ++ ++for root in $(getargs rootfallback=); do ++ case "$root" in ++ block:LABEL=*|LABEL=*) ++ root="${root#block:}" ++ root="$(echo $root | sed 's,/,\\x2f,g')" ++ root="/dev/disk/by-label/${root#LABEL=}" ++ ;; ++ block:UUID=*|UUID=*) ++ root="${root#block:}" ++ root="${root#UUID=}" ++ root="$(echo $root | tr "[:upper:]" "[:lower:]")" ++ root="/dev/disk/by-uuid/${root#UUID=}" ++ ;; ++ block:PARTUUID=*|PARTUUID=*) ++ root="${root#block:}" ++ root="${root#PARTUUID=}" ++ root="$(echo $root | tr "[:upper:]" "[:lower:]")" ++ root="/dev/disk/by-partuuid/${root}" ++ ;; ++ block:PARTLABEL=*|PARTLABEL=*) ++ root="${root#block:}" ++ root="/dev/disk/by-partlabel/${root#PARTLABEL=}" ++ ;; ++ esac ++ ++ if ! [ -b "$root" ]; then ++ warn "Could not find rootfallback $root" ++ continue ++ fi ++ ++ if mount "$root" /sysroot; then ++ info "Mounted rootfallback $root" ++ exit 0 ++ else ++ warn "Failed to mount rootfallback $root" ++ exit 1 ++ fi ++done ++ ++[ -e "$job" ] && rm -f "$job" diff --git a/SOURCES/0021-btrfs-use-inst_hook-to-install-the-timeout-hook.patch b/SOURCES/0021-btrfs-use-inst_hook-to-install-the-timeout-hook.patch new file mode 100644 index 0000000..62473d8 --- /dev/null +++ b/SOURCES/0021-btrfs-use-inst_hook-to-install-the-timeout-hook.patch @@ -0,0 +1,23 @@ +From 6ea78f9f4eb405e6743e8be67836f9134d11e77b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 Oct 2013 15:06:50 +0200 +Subject: [PATCH] btrfs: use inst_hook to install the timeout hook + +--- + modules.d/90btrfs/module-setup.sh | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh +index 638a050..a280594 100755 +--- a/modules.d/90btrfs/module-setup.sh ++++ b/modules.d/90btrfs/module-setup.sh +@@ -39,8 +39,7 @@ install() { + fi + + if ! dracut_module_included "systemd"; then +- inst_script "$moddir/btrfs_timeout.sh" \ +- /usr/lib/dracut/hooks/initqueue/timeout/btrfs_timeout.sh ++ inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh" + fi + + inst_multiple -o btrfsck btrfs-zero-log diff --git a/SOURCES/0022-lvm-install-thin-utils-for-non-hostonly.patch b/SOURCES/0022-lvm-install-thin-utils-for-non-hostonly.patch new file mode 100644 index 0000000..df0f97d --- /dev/null +++ b/SOURCES/0022-lvm-install-thin-utils-for-non-hostonly.patch @@ -0,0 +1,38 @@ +From 52d3c1b7267b6930fe6a835b4000546c5f106d0e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 8 Oct 2013 10:30:00 +0200 +Subject: [PATCH] lvm: install thin utils for non-hostonly + +--- + modules.d/90lvm/module-setup.sh | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh +index f98ffff..514addc 100755 +--- a/modules.d/90lvm/module-setup.sh ++++ b/modules.d/90lvm/module-setup.sh +@@ -52,13 +52,17 @@ install() { + + inst lvm + +- get_host_lvs | while read line; do +- printf "%s" " rd.lvm.lv=$line" +- if ! [[ $_needthin ]]; then +- [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1 +- fi +- done >> "${initdir}/etc/cmdline.d/90lvm.conf" +- echo >> "${initdir}/etc/cmdline.d/90lvm.conf" ++ if [[ $hostonly ]]; then ++ get_host_lvs | while read line; do ++ printf "%s" " rd.lvm.lv=$line" ++ if ! [[ $_needthin ]]; then ++ [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1 ++ fi ++ done >> "${initdir}/etc/cmdline.d/90lvm.conf" ++ echo >> "${initdir}/etc/cmdline.d/90lvm.conf" ++ else ++ _needthin=1 ++ fi + + inst_rules "$moddir/64-lvm.rules" + diff --git a/SOURCES/0023-dracut.sh-do-not-bail-out-if-kernel-modules-dir-is-m.patch b/SOURCES/0023-dracut.sh-do-not-bail-out-if-kernel-modules-dir-is-m.patch new file mode 100644 index 0000000..d1baa17 --- /dev/null +++ b/SOURCES/0023-dracut.sh-do-not-bail-out-if-kernel-modules-dir-is-m.patch @@ -0,0 +1,38 @@ +From f0df0f3fcd0e79a697ec8bd45b9ce2e420f2820a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 8 Oct 2013 15:03:40 +0200 +Subject: [PATCH] dracut.sh: do not bail out, if kernel modules dir is missing + +and only print a warning message +--- + dracut.sh | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index e135dfc..d9533dd 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -496,17 +496,18 @@ if [[ $regenerate_all == "yes" ]]; then + ((ret+=$?)) + done + exit $ret +-elif [[ $kernel ]]; then +- if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then +- printf -- "Kernel version $kernel has no modules in /lib/modules/$kernel\n" >&2 +- exit 1 +- fi + fi + + if ! [[ $kernel ]]; then + kernel=$(uname -r) + fi + ++if [[ $kernel ]]; then ++ if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then ++ printf -- "Kernel version $kernel has no module directory /lib/modules/$kernel\n" >&2 ++ fi ++fi ++ + if ! [[ $outfile ]]; then + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id + diff --git a/SOURCES/0024-dmsquash-live-add-dev-mapper-live-base.patch b/SOURCES/0024-dmsquash-live-add-dev-mapper-live-base.patch new file mode 100644 index 0000000..5a21944 --- /dev/null +++ b/SOURCES/0024-dmsquash-live-add-dev-mapper-live-base.patch @@ -0,0 +1,47 @@ +From 86fff83927ad194def97c60c2eef80099ebb1238 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Tue, 8 Oct 2013 15:13:44 +0200 +Subject: [PATCH] dmsquash-live: add /dev/mapper/live-base + +This is similar to the reason for adding the +/run/initramfs/live-baseloop symlink -- access to the original live +image without overlays. + +livemedia-creator does not create a osmin.img, so there is no mountable +device for it to use when rsyncing the live image to the target. It +needs a device that points to the original live image without overlays. + +Note that lmc won't be creating osmin.img, since really isn't needed any +longer. Its purpose was to provide a minimal image that could be dd'd to +the target. Now that we use rsync this is no longer necessary. + +The included patch adds a /dev/mapper/live-base device that Anaconda can +use whether or not there is an osmin present. +--- + modules.d/90dmsquash-live/dmsquash-live-root.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh +index 8951f80..5705e8d 100755 +--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh ++++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh +@@ -144,6 +144,9 @@ do_live_overlay() { + over=$OVERLAY_LOOPDEV + fi + echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw ++ ++ # Create a device that always points to a ro base image ++ echo 0 $sz linear $base 0 | dmsetup create --readonly live-base + } + + # live cd helper function +@@ -225,9 +228,6 @@ if [ -n "$ROOTFLAGS" ]; then + ROOTFLAGS="-o $ROOTFLAGS" + fi + +-if [ -b "$BASE_LOOPDEV" ]; then +- ln -s $BASE_LOOPDEV /run/initramfs/live-baseloop +-fi + ln -s /dev/mapper/live-rw /dev/root + printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh + diff --git a/SOURCES/0025-Doc-cleanup-extend-and-split-and-reuse.patch b/SOURCES/0025-Doc-cleanup-extend-and-split-and-reuse.patch new file mode 100644 index 0000000..c627001 --- /dev/null +++ b/SOURCES/0025-Doc-cleanup-extend-and-split-and-reuse.patch @@ -0,0 +1,3212 @@ +From 84fe197facb96947638c518639c0913ecad1599b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 8 Oct 2013 14:59:47 +0200 +Subject: [PATCH] Doc: cleanup, extend and split and reuse + +--- + Makefile | 8 +- + dracut.8.asc | 61 +--- + dracut.asc | 888 +-------------------------------------------------- + dracut.cmdline.7.asc | 414 ++++++++++++++---------- + dracut.css | 434 +------------------------ + dracut.modules.7.asc | 293 +++++++++++++++++ + dracut.spec | 1 + + dracut.usage.asc | 526 ++++++++++++++++++++++++++++++ + 8 files changed, 1084 insertions(+), 1541 deletions(-) + create mode 100644 dracut.modules.7.asc + create mode 100644 dracut.usage.asc + +diff --git a/Makefile b/Makefile +index 124a41b..e7da948 100644 +--- a/Makefile ++++ b/Makefile +@@ -21,7 +21,8 @@ man1pages = lsinitrd.1 + man5pages = dracut.conf.5 + + man7pages = dracut.cmdline.7 \ +- dracut.bootup.7 ++ dracut.bootup.7 \ ++ dracut.modules.7 + + man8pages = dracut.8 \ + dracut-catimages.8 \ +@@ -37,7 +38,6 @@ man8pages = dracut.8 \ + + manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages) + +- + .PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh + + all: dracut-version.sh dracut-install +@@ -76,7 +76,9 @@ endif + %.xml: %.asc + asciidoc -d manpage -b docbook -o $@ $< + +-dracut.html: dracut.asc $(manpages) dracut.css ++dracut.8: dracut.usage.asc dracut.8.asc ++ ++dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc + asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc + xsltproc -o dracut.html --xinclude -nonet \ + --stringparam custom.css.source dracut.css \ +diff --git a/dracut.8.asc b/dracut.8.asc +index 76fc75c..584514c 100644 +--- a/dracut.8.asc ++++ b/dracut.8.asc +@@ -10,7 +10,7 @@ dracut - low-level tool for generating an initramfs image + + SYNOPSIS + -------- +-*dracut* ['OPTION...'] [ [__]] ++*dracut* [__OPTION...__] [____ [____]] + + DESCRIPTION + ----------- +@@ -37,53 +37,10 @@ Additional debugging info can be produced by adding **rd.debug** to the kernel c + _/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools. + It should be attached to any report about dracut problems. + +-EXAMPLE +-------- +- +-To create a initramfs image, the most simple command is: +----- +-# dracut +----- +- +-This will generate a general purpose initramfs image, with all possible +-functionality resulting of the combination of the installed dracut modules and +-system tools. The image is /boot/initramfs-_++++_.img and +-contains the kernel modules of the currently active kernel with version +-_++++_. +- +-If the initramfs image already exists, dracut will display an error message, and +-to overwrite the existing image, you have to use the --force option. +----- +-# dracut --force +----- +- +-If you want to specify another filename for the resulting image you would issue +-a command like: +----- +-# dracut foobar.img +----- +- +-To generate an image for a specific kernel version, the command would be: +----- +-# dracut foobar.img 2.6.40-1.rc5.f20 +----- +- +-A shortcut to generate the image at the default location for a specific kernel +-version is: +----- +-# dracut --kver 2.6.40-1.rc5.f20 +----- +- +-If you want to create lighter, smaller initramfs images, you may want to specify +-the --hostonly or -H option. Using this option, the resulting image will +-contain only those dracut modules, kernel modules and filesystems, which are +-needed to boot this specific machine. This has the drawback, that you can't put +-the disk on another controller or machine, and that you can't switch to another +-root filesystem, without recreating the initramfs image. The usage of the +---hostonly option is only for experts and you will have to keep the broken +-pieces. At least keep a copy of a general purpose image (and corresponding +-kernel) as a fallback to rescue your system. ++USAGE ++----- + ++include::dracut.usage.asc[] + + OPTIONS + ------- +@@ -337,7 +294,7 @@ provide a valid _/etc/fstab_. + **-N, --no-hostonly**:: + Disable Host-Only mode + +-**--persistent-policy** __:: ++**--persistent-policy** __:: + Use __ to address disks and partitions. + __ can be any directory name found in /dev/disk. + E.g. "by-uuid", "by-label" +@@ -345,7 +302,7 @@ provide a valid _/etc/fstab_. + **--fstab**:: + Use _/etc/fstab_ instead of _/proc/self/mountinfo_. + +-**--add-fstab** __ :: ++**--add-fstab** __:: + Add entries of __ to the initramfs /etc/fstab. + + **--mount** "__ __ __ __":: +@@ -358,13 +315,13 @@ provide a valid _/etc/fstab_. + LVM or an encrypted partition. + [NB --device can be used for compatibility with earlier releases] + +-**-i, --include** __ __:: ++**-i, --include** __ __:: + include the files in the SOURCE directory into the + TARGET directory in the final initramfs. If SOURCE is a file, it will be + installed to TARGET in the final initramfs. This parameter can be specified + multiple times. + +-**-I, --install** __:: ++**-I, --install** __:: + install the space separated list of files into the initramfs. + + + [NOTE] +@@ -481,7 +438,7 @@ _/etc/conf.d/_:: + _/etc/cmdline_:: + Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf. + +-_/etc/cmdline.d/*.conf:: ++_/etc/cmdline.d/*.conf_:: + Can contain additional command line options. + + AVAILABILITY +diff --git a/dracut.asc b/dracut.asc +index c011658..031b201 100644 +--- a/dracut.asc ++++ b/dracut.asc +@@ -1,7 +1,7 @@ + dracut + ====== + Harald Hoyer +-v2.0, March 2011 ++v3.0, October 2013 + + :language: bash + +@@ -145,885 +145,10 @@ This ensures, that all devices are disassembled and unmounted cleanly. + + = User Manual + +-== Creating an initramfs Image +-To create a initramfs image, the most simple command is: +----- +-# dracut +----- +- +-This will generate a general purpose initramfs image, with all possible +-functionality resulting of the combination of the installed dracut modules and +-system tools. The image is /boot/initramfs-_++++_.img and +-contains the kernel modules of the currently active kernel with version +-_++++_. +- +-If the initramfs image already exists, dracut will display an error message, and +-to overwrite the existing image, you have to use the --force option. +----- +-# dracut --force +----- +- +-If you want to specify another filename for the resulting image you would issue +-a command like: +----- +-# dracut foobar.img +----- +- +-To generate an image for a specific kernel version, the command would be: +----- +-# dracut foobar.img 2.6.40-1.rc5.f20 +----- +- +-A shortcut to generate the image at the default location for a specific kernel +-version is: +----- +-# dracut --kver 2.6.40-1.rc5.f20 +----- +- +-If you want to create lighter, smaller initramfs images, you may want to specify +-the --host-only or -H option. Using this option, the resulting image will +-contain only those dracut modules, kernel modules and filesystems, which are +-needed to boot this specific machine. This has the drawback, that you can't put +-the disk on another controller or machine, and that you can't switch to another +-root filesystem, without recreating the initramfs image. The usage of the +---host-only option is only for experts and you will have to keep the broken +-pieces. At least keep a copy of a general purpose image (and corresponding +-kernel) as a fallback to rescue your system. +- +-=== Inspecting the Contents +-To see the contents of the image created by dracut, you can use the lsinitrd tool. +----- +-# lsinitrd /boot/initramfs-$(uname -r).img | less +----- +- +-To display the contents of a file in the initramfs also use the lsinitrd tool: +----- +-# lsinitrd /boot/initramfs-$(uname -r).img /etc/ld.so.conf +-include ld.so.conf.d/*.conf +----- +- +-=== Adding dracut Modules +-Some dracut modules are turned off by default and have to be activated manually. +-You can do this by adding the dracut modules to the configuration file +-_/etc/dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_. See <>. +-You can also add dracut modules on the command line +-by using the -a or --add option: +----- +-# dracut --add bootchart initramfs-bootchart.img +----- +- +-To see a list of available dracut modules, use the --list-modules option: +----- +-# dracut --list-modules +----- +- +-or, if you have a dracut version earlier than +008+, issue the command: +----- +-# for mod in /usr/lib/dracut/modules.d/*; do echo ${mod##*/??}; done +----- +- +-=== Omitting dracut Modules +-Sometimes you don't want a dracut module to be included for reasons of speed, +-size or functionality. To do this, either specify the omit_dracutmodules +-variable in the _dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_ configuration +-file (see <>), or use the -o or --omit option +-on the command line: +----- +-# dracut -o "multipath lvm" no-multipath-lvm.img +----- +- +-=== Adding Kernel Modules +-If you need a special kernel module in the initramfs, which is not +-automatically picked up by dracut, you have the use the --add-drivers option +-on the command line or the drivers vaiable in the _/etc/dracut.conf_ +-or _/etc/dracut.conf.d/myconf.conf_ configuration file (see <>): +----- +-# dracut --add-drivers mymod initramfs-with-mymod.img +----- +- +-== Boot parameters +-The generated initramfs.img file normally does not contain any system +-configuration files (except for some special exceptions), so the configuration +-has to be done on the kernel command line. With this flexibility, you can easily +-boot from a changed root partition, without the need to recompile the initramfs +-image. So, you could completly change your root partition (move it inside a md +-raid with encryption and LVM on top), as long as you specify the correct +-filesystem LABEL or UUID on the kernel command line for your root device, dracut +-will find it and boot from it. +- +-The kernel command line usually can be configured in _/boot/grub/grub.conf_, if +-grub is your bootloader and it also can be edited in the real boot process in +-the grub menu. +- +-The kernel command line can also be provided by the dhcp server with the +-root-path option. See <>. +- +-For a full reference of all kernel command line parameters, see <>. +- +-=== Specifying the root Device +-This is the only option dracut really needs to boot from your root partition. +-Because your root partition can live in various environments, there are a lot of +-formats for the root= option. The most basic one is root=_++++_: +----- +-root=/dev/sda2 +----- +- +-Because device node names can change, dependent on the drive ordering, you are +-encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) +-to specify your root partition: +----- +-root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331 +----- +- +-or +- +----- +-root=LABEL=myrootpartitionlabel +----- +- +-To see all UUIDs or LABELs on your system, do: +----- +-# ls -l /dev/disk/by-uuid +----- +- +-or +- +----- +-# ls -l /dev/disk/by-label +----- +- +-If your root partition is on the network see <>. +- +-=== Keyboard Settings +-If you have to input passwords for encrypted disk volumes, you might want to set +-the keyboard layout and specify a display font. +- +-A typical german kernel command would contain: +----- +-vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys locale.LANG=de_DE.UTF-8 +----- +- +-Setting these options can override the setting stored on your system, if you use +-a modern init system, like systemd. +- +-For dracut versions prior to version +008+ the line would look like: +----- +-LANG=de_DE.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys +----- +- +-=== Blacklisting Kernel Modules +-Sometimes it is required to prevent the automatic kernel module loading of a +-specific kernel module. To do this, just add rd.blacklist=_++++_, with _++++_ not containing the _.ko_ +-suffix, to the kernel command line. For example: +----- +-rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau +----- +- +-The option can be specified multiple times on the kernel command line. +- +-=== Speeding up the Boot Process +-If you want to speed up the boot process, you can specify as much information +-for dracut on the kernel command as possible. For example, you can tell dracut, +-that you root partition is not on a LVM volume or not on a raid partition, or +-that it lives inside a specific crypto LUKS encrypted volume. By default, dracut +-searches everywhere. A typical dracut kernel command line for a plain primary or +-logical partition would contain: +----- +-rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 +----- +- +-On systems with dracut version prior to +008+ the line would look like: +----- +-rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM +----- +- +-This turns off every automatic assembly of LVM, MD raids, DM raids and crypto LUKS. +- +-Of course, you could also omit the dracut modules in the initramfs creation +-process, but then you would lose the posibility to turn it on on demand. +- +- +-[[Injecting]] +-=== Injecting custom Files +-To add your own files to the initramfs image, you have several possibilities. +- +-The --include option let you specify a source path and a target path. For example +----- +-# dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img +----- +-will create an initramfs image, where the file cmdline-preset will be copied +-inside the initramfs to _/etc/cmdline.d/mycmdline.conf_. --include can only be specified once. +- +- +----- +-# mkdir rd.live.overlay +-# mkdir rd.live.overlay/etc +-# mkdir rd.live.overlay/etc/conf.d +-# mkdir rd.live.overlay/etc/cmdline.d +-# echo "ip=auto" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf +-# echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf +-# echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf +-# tree rd.live.overlay/ +-rd.live.overlay/ +-└── etc +- ├── cmdline.d +- │   └── mycmdline.conf +- └── conf.d +- └── testvar.conf +- +-# dracut --include rd.live.overlay / initramfs-rd.live.overlay.img +----- +- +-This will put the contents of the rd.live.overlay directory into the root of the +-initramfs image. +- +-The --install option let you specify several files, which will get installed in +-the initramfs image at the same location, as they are present on initramfs +-creation time. +- +- +----- +-# dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img +----- +- +-This will create an initramfs with the strace, fsck.ext3 and ssh executables, +-together with the libraries needed to start those. The --install option can be +-specified multiple times. +- +- +-[[NetworkBoot]] +-== Network Boot +- +-If your root partition is on a network drive, you have to have the network +-dracut modules installed to create a network aware initramfs image. +- +-On a Red Hat Enterprise Linux or Fedora system, this means, you have to install +-the _dracut-network_ rpm package: +- +- +----- +-# yum install dracut-network +----- +- +-The resulting initramfs image can be served by a boot manager residing on your +-local hard drive or it can be served by a PXE/TFTP server. +- +-How to setup your PXE/TFTP server can be found in the +-http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red +-Hat Enterprise Linux Storage Administration Guide]. +- +-If you specify ip=auto on the kernel command line, then dracut asks a dhcp +-server about the ip adress for the machine. The dhcp server can also serve an +-additional root-path, which will set the root device for dracut. With this +-mechanism, you have static configuration on your client machine and a +-centralized boot configuration on your TFTP/DHCP server. If you can't pass a +-kernel command line, then you can inject _/etc/cmdline.d/mycmdline.conf_, with a method described +-in <>. +- +- +- +- +-=== Reducing the Image Size +- +-To reduce the size of the initramfs, you should create it with by ommitting all +-dracut modules, which you know, you don't need to boot the machine. +- +-You can also specify the exact dracut and kernel modules to produce a very tiny +-initramfs image. +- +-For example for a NFS image, you would do: +- +- +----- +-# dracut -m "nfs network base" initramfs-nfs-only.img +----- +- +-Then you would boot from this image with your target machine and reduce the size +-once more by creating it on the target machine with the --host-only option: +- +- +----- +-# dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img +----- +- +-This will reduce the size of the initramfs image significantly. +- +- +- +-=== NFS Root Device +- +-FIXME +- +-=== iSCSI Root Device +- +-FIXME +- +-=== FCoE Root Device +- +-FIXME +- +-== Troubleshooting +- +-If the boot process does not succeed, you have several options to debug the +-situation. Some of the basic operations are covered here. For more information +-you should also visit: +-http://fedoraproject.org/wiki/How_to_debug_Dracut_problems +- +- +-[[identifying-your-problem-area]] +-=== Identifying your problem area +-. Remove ''rhgb'' and ''quiet'' from the kernel command line +-. Add ''rd.shell'' to the kernel command line. This will present a shell should +-dracut be unable to locate your root device +-. Add ''rd.shell rd.debug log_buf_len=1M'' to the kernel command line so that +-dracut shell commands are printed as they are executed +-. With dracut >= 002-11, you can inspect the rd.debug output with: +-+ +----- +-# less /run/initramfs/init.log +-# dmesg | less +----- +-. With dracut >= 022 and systemd, you can inspect the rd.debug output with: +----- +-# journalctl -ab +----- +-. With dracut >= 025 the file /run/initramfs/rdsosreport.txt is generated, which contains all the logs and the output of all significant tools, which are mentioned later. +- +-If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that. +-Then you can store the output for later inspection. +- +-[[information-to-include-in-your-report]] +-=== Information to include in your report +- +-[[all-bug-reports]] +-==== All bug reports +-In all cases, the following should be mentioned and attached to your bug report: +- +-* The exact kernel command-line used. Typically from the bootloader +-configuration file (e.g. _/etc/grub.conf_) or from _/proc/cmdline_. +-* A copy of your disk partition information from _/etc/fstab_, which might be +-obtained booting an old working initramfs or a rescue medium. +-* A device listing from device-mapper. This can be obtained by running the +-command +-+ +----- +-# dmsetup ls --tree +----- +-+ +-* A list of block device attributes. This can be obtained by running the commands: +-+ +----- +-# blkid -p +-# blkid -p -o udev +----- +-* Turn on dracut debugging (see _the 'debugging dracut' section_), and attach +-all relevant information from the boot log. This can be obtained by running the +-command +-+ +----- +-# dmesg|grep dracut +----- +-+ +-* If you use a dracut configuration file, please include _/etc/dracut.conf_ and +-all files in _/etc/dracut.conf.d/*.conf_ +- +-[[logical-volume-management-related-problems]] +-==== Logical Volume Management related problems +-As well as the information from <> include the following +-information: +- +-* Include physical volume information by running the command: +-+ +----- +-# lvm pvdisplay +----- +-+ +-* Include volume group information by running the command: +-+ +----- +-# lvm vgdisplay +----- +-+ +-* Include logical volume information by running the command: +-+ +----- +-# lvm lvdisplay +----- +- +-[[software-raid-related-problems]] +-==== Software RAID related problems +-As well as the information from <>, include the following +-information: +- +-* If using software RAID disk partitions, please include the output of +-+ +----- +-# cat /proc/mdstat +----- +- +-[[network-root-device-related-problems]] +-==== Network root device related problems +-This section details information to include when experiencing problems on a +-system whose root device is located on a network attached volume (e.g. iSCSI, +-NFS or NBD). As well as the information from <>, include the +-following information: +- +- +-* Please include the output of +-+ +----- +-# /sbin/ifup +-# ip addr show +----- +- +-[[debugging-dracut]] +-=== Debugging dracut +- +- +-[[configure-a-serial-console]] +-==== Configure a serial console +- +-Successfully debugging dracut will require some form of console +-logging during the system boot. This section documents configuring a +-serial console connection to record boot messages. +- +-. First, enable serial console output for both the kernel and the bootloader. +-. Open the file _/etc/grub.conf_ for editing. Below the line ''timeout=5'', add +-the following: +-+ +----- +-serial --unit=0 --speed=9600 +-terminal --timeout=5 serial console +----- +-+ +-. Also in _/etc/grub.conf_, add the following boot arguemnts to the ''kernel'' +-line: +-+ +----- +-console=tty0 console=ttyS0,9600 +----- +-+ +-. When finished, the _/etc/grub.conf_ file should look similar to the example +-below. +-+ +----- +-default=0 +-timeout=5 +-serial --unit=0 --speed=9600 +-terminal --timeout=5 serial console +-title Fedora (2.6.29.5-191.fc11.x86_64) +- root (hd0,0) +- kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600 +- initrd /dracut-2.6.29.5-191.fc11.x86_64.img +----- +-+ +-. More detailed information on how to configure the kernel for console output +-can be found at +-http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL. +-. Redirecting non-interactive output +-+ +--- +-NOTE: You can redirect all non-interactive output to _/dev/kmsg_ and the kernel +-will put it out on the console when it reaches the kernel buffer by doing +- +----- +-# exec >/dev/kmsg 2>&1 >). +- +-[[accessing-the-root-volume-from-the-dracut-shell]] +-==== Accessing the root volume from the dracut shell +-From the dracut debug shell, you can manually perform the task of locating and +-preparing your root volume for boot. The required steps will depend on how your +-root volume is configured. Common scenarios include: +- +-* A block device (e.g. _/dev/sda7_) +-* A LVM logical volume (e.g. _/dev/VolGroup00/LogVol00_) +-* An encrypted device (e.g. _/dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83_) +-* A network attached device (e.g. netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.fedoraproject:for.all) +- +-The exact method for locating and preparing will vary. However, to continue with +-a successful boot, the objective is to locate your root volume and create a +-symlink _/dev/root_ which points to the file system. For example, the following +-example demonstrates accessing and booting a root volume that is an encrypted +-LVM Logical volume. +- +-. Inspect your partitions using parted +-+ +----- +-# parted /dev/sda -s p +-Model: ATA HTS541060G9AT00 (scsi) +-Disk /dev/sda: 60.0GB +-Sector size (logical/physical): 512B/512B +-Partition Table: msdos +-Number Start End Size Type File system Flags +-1 32.3kB 10.8GB 107MB primary ext4 boot +-2 10.8GB 55.6GB 44.7GB logical lvm +----- +-+ +-. You recall that your root volume was a LVM logical volume. Scan and activate +-any logical volumes. +-+ +----- +-# lvm vgscan +-# lvm vgchange -ay +----- +-+ +-. You should see any logical volumes now using the command blkid: +-+ +----- +-# blkid +-/dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4" +-/dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member" +-/dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS" +-/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3" +-/dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap" +----- +-+ +-. From the output above, you recall that your root volume exists on an encrypted +-block device. Following the guidance disk encryption guidance from the +-Installation Guide, you unlock your encrypted root volume. +-+ +----- +-# UUID=$(cryptsetup luksUUID /dev/mapper/linux-root) +-# cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID +-Enter passphrase for /dev/mapper/linux-root: +-Key slot 0 unlocked. +----- +-+ +-. Next, make a symbolic link to the unlocked root volume +-+ +----- +-# ln -s /dev/mapper/luks-$UUID /dev/root +----- +-+ +-. With the root volume available, you may continue booting the system by exiting +-the dracut shell +-+ +----- +-# exit +----- +- +-[[additional-dracut-boot-parameters]] +-==== Additional dracut boot parameters +-For more debugging options, see <> in <>. +- +- +-[[debugging-dracut-on-shutdown]] +-==== Debugging dracut on shutdown +- +-To debug the shutdown sequence on systemd systems, you can _rd.break_ +-on _pre-shutdown_ or _shutdown_. +- +-To do this from an already booted system: +----- +-# mkdir -p /run/initramfs/etc/cmdline.d +-# echo "rd.break=pre-shutdown" > /run/initramfs/etc/cmdline.d/debug.conf +-# touch /run/initramfs/.need_shutdown +----- +- +-This will give you a dracut shell after the system pivot'ed back in the initramfs. +- +- +-= Developer Manual +- +-== dracut Components +- +-dracut uses a modular system to build and extend the initramfs image. All +-modules are located in _/usr/lib/dracut/modules.d_ or in _/modules.d_. +-The most basic dracut module is _99base_. In _99base_ the initial shell script +-init is defined, which gets run by the kernel after initramfs loading. Although +-you can replace init with your own version of _99base_, this is not encouraged. +-Instead you should use, if possible, the hooks of dracut. All hooks, and the +-point of time in which they are executed, are described in <>. +- +-The main script, which creates the initramfs is dracut itsself. It parses all +-arguments and sets up the directory, in which everything is installed. It then +-executes all check, install, installkernel scripts found in the modules, which +-are to be processed. After everything is installed, the install directory is +-archived and compressed to the final initramfs image. All helper functions used +-by check, install and installkernel are found in in the file _dracut-functions_. +-These shell functions are available to all module installer (install, +-installkernel) scripts, without the need to source _dracut-functions_. +- +-A module can check the preconditions for install and installkernel with the +-check script. Also dependencies can be expressed with check. If a module passed +-check, install and installkernel will be called to install all of the necessary +-files for the module. To split between kernel and non-kernel parts of the +-installation, all kernel module related parts have to be in installkernel. All +-other files found in a module directory are module specific and mostly are hook +-scripts and udev rules. +- +- +-[[stages]] +-== Boot Process Stages +- +-dracut modules can insert custom script at various points, to control the boot +-process. +-These hooks are plain directories containing shell scripts ending with ".sh", +-which are sourced by init. +-Common used functions are in _dracut-lib.sh_, which can be sourced by any script. +- +-=== Hook: cmdline +- +-The _cmdline_ hook is a place to insert scripts to parse the kernel command line +-and prepare the later actions, like setting up udev rules and configuration +-files. +- +-In this hook the most important environment variable is defined: root. The +-second one is rootok, which indicates, that a module claimed to be able to parse +-the root defined. So for example, **root=**__iscsi:....__ will be claimed by the +-iscsi dracut module, which then sets rootok. +- +-=== Hook: pre-udev +- +-This hook is executed right after the cmdline hook and a check if root and +-rootok were set. Here modules can take action with the final root, and before +-udev has been run. +- +-=== Start Udev +- +-Now udev is started and the logging for udev is setup. +- +-=== Hook: pre-trigger +- +-In this hook, you can set udev environment variables with **udevadm control +---property=KEY=_value_** or control the further execution of udev with +-udevadm. +- +-=== Trigger Udev +- +-udev is triggered by calling udevadm trigger, which sends add events for all +-devices and subsystems. +- +-=== Main Loop +- +-In the main loop of dracut loops until udev has settled and +-all scripts in _initqueue/finished_ returned true. +-In this loop there are three hooks, where scripts can be inserted +-by calling /sbin/initqueue. +- +-==== Initqueue +- +-This hook gets executed every time a script is inserted here, regardless of the +-udev state. +- +-==== Initqueue settled +- +-This hooks (initqueue/settled) gets executed every time udev has settled. +- +- +-==== Initqueue timeout +- +-This hooks (initqueue/timeout) gets executed, when the main loop counter becomes half of the +-rd.retry counter. +- +-==== Initqueue finished +- +-This hook (initqueue/finished) is called after udev has settled and +-if all scripts herein return 0 the main loop will be ended. +-Abritary scripts can be added here, to loop in the +-initqueue until something happens, which a dracut module wants to wait for. +- +-=== Hook: pre-mount +- +-Before the root device is mounted all scripts in the hook pre-mount are +-executed. In some cases (e.g. NFS) the real root device is already mounted, +-though. +- +-=== Hook: mount +- +-This hook is mainly to mount the real root device. +- +-=== Hook: pre-pivot +- +-This hook is called before cleanup hook, This is a good place for +-actions other than cleanups which need to be called before pivot. +- +-=== Hook: cleanup +- +-This hook is the last hook and is called before init finally switches root to +-the real root device. This is a good place to clean up and kill processes not +-needed anymore. +- +- +-=== Cleanup and switch_root +- +-Init (or systemd) kills all udev processes, cleans up the environment, +-sets up the arguments for the real init process and finally calls switch_root. +-switch_root removes the whole filesystem hierarchy of the initramfs, +-chroot()s to the real root device and calls /sbin/init with the specified arguments. +- +-To ensure all files in the initramfs hierarchy can be removed, all processes +-still running from the initramfs should not have any open file descriptors left. +- +-== Network Infrastructure +- +-FIXME +- +-== Writing a Module +- +-A simple example module is _96insmodpost_, which modprobes a kernel module after +-udev has settled and the basic device drivers have been loaded. +- +-All module installation information is in the file module-setup.sh. +- +-First we create a check() function, which just exits with 0 indicating that this +-module should be included by default. +- +-check(): +----- +-return 0 +----- +- +-The we create the install() function, which installs a cmdline hook with +-priority number 20 called _parse-insmodpost.sh_. It also installs the +-_insmodpost.sh_ script in _/sbin_. +- +-install(): +----- +-inst_hook cmdline 20 "$moddir/parse-insmodpost.sh" +-inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh +----- +- +-The _pase-instmodpost.sh_ parses the kernel command line for a argument +-rd.driver.post, blacklists the module from being autoloaded and installs the +-hook _insmodpost.sh_ in the _initqueue/settled_. +- +-_parse-insmodpost.sh_: +----- +-for p in $(getargs rd.driver.post=); do +- echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf +- _do_insmodpost=1 +-done +- +-[ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh +-unset _do_insmodpost +- +----- +- +-_insmodpost.sh_, which is called in the _initqueue/settled_ hook will just +-modprobe the kernel modules specified in all rd.driver.post kernel command line +-parameters. It runs after udev has settled and is only called once (--onetime). +- +-_insmodpost.sh_: +----- +-. /lib/dracut-lib.sh +- +-for p in $(getargs rd.driver.post=); do +- modprobe $p +-done +- +----- +- +- +- +-=== check() +- +-_check()_ is called by dracut to evaluate the inclusion of a dracut module in +-the initramfs. +- +-$hostonly:: If the $hostonly variable is set, then the module check() function +-should be in "hostonly" mode, which means, that the check() should only return +-0, if the module is really needed to boot this specific host. +- +-check() should return with: +- +-0:: Include the dracut module in the initramfs. +- +-1:: Do not include the dracut module. The requirements are not fullfilled +-(missing tools, etc.) +- +-255:: Only include the dracut module, if another module requires it or if +-explicitly specified in the config file or on the argument list. +- +- +- +-=== depends() +- +-The function depends() should echo all other dracut module names the module +-depends on. +- +- +- +-=== install() +- +-inst_multiple +- +-inst +- +-inst_hook +- +-inst_rules +- +- +- +- +- +-=== installkernel() +- +-instmods +- +- +- +-=== Creation Functions +- +-FIXME +- +- +-=== Initramfs Functions +- +-FIXME +- +- +-=== Network Modules +- +-FIXME +- + :leveloffset: 1 +-[[dracutbootup7]] +-include::dracut.bootup.7.asc[] +- +-:leveloffset: 1 +-[[dracut8]] + include::dracut.8.asc[] + ++:leveloffset: 1 + [[dracutconf5]] + include::dracut.conf.5.asc[] + +@@ -1036,6 +161,15 @@ include::lsinitrd.1.asc[] + [[mkinitrd8]] + include::mkinitrd.8.asc[] + ++= Developer Manual ++ ++:leveloffset: 1 ++[[dracutmodules7]] ++include::dracut.modules.7.asc[] ++ ++[[dracutbootup7]] ++include::dracut.bootup.7.asc[] ++ + :leveloffset: 0 + [appendix] + License +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index 4b2ab03..19bfb93 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -31,16 +31,16 @@ line is the value, which is honored. + + Standard + ~~~~~~~~ +-**init=**__:: ++**init=**____:: + specify the path to the init programm to be started after the initramfs has + finished + +-**root=**__:: ++**root=**____:: + specify the block device to use as the root filesystem. + + +-E.g.: +-+ +----- ++[listing] ++.Example ++-- + root=/dev/sda1 + root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 + root=/dev/disk/by-label/Root +@@ -48,15 +48,17 @@ root=LABEL=Root + root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7 + root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 + root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 +----- ++-- + +-**rootfstype=**__:: "auto" if not specified, e.g.: ++**rootfstype=**____:: "auto" if not specified. + + +----- ++[listing] ++.Example ++-- + rootfstype=ext3 +----- ++-- + +-**rootflags=**__:: ++**rootflags=**____:: + specify additional mount options for the root filesystem. If not set, + _/etc/fstab_ of the real root will be parsed for special mount options and + mounted accordingly. +@@ -69,7 +71,7 @@ rootfstype=ext3 + force mounting _/_ and _/usr_ (if it is a separate device) read-write. + See also ro option. + +-**rootfallback=**__:: ++**rootfallback=**____:: + specify the block device to use as the root filesystem, if the normal root cannot be found. + This can only be a simple block device with a simple file system, for which the filesystem + driver is either compiled in, or added manually to the initramfs. +@@ -83,16 +85,16 @@ rootfstype=ext3 + do not honor special mount options for the root filesystem found in + _/etc/fstab_ of the real root. + +-**resume=**__:: ++**resume=**____:: + resume from a swap partition + + +-E.g.: +-+ +----- ++[listing] ++.Example ++-- + resume=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 + resume=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7 + resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 +----- ++-- + + **rd.skipfsck**:: + skip fsck for rootfs and _/usr_. If you're mounting _/usr_ read-only and +@@ -102,19 +104,19 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 + + Misc + ~~~~ +-**rd.driver.blacklist=**_[,,...]_:: ++**rd.driver.blacklist=**____[,____,...]:: + do not load kernel module . This parameter can be specified + multiple times. + +-**rd.driver.pre=**_[,,...]_:: ++**rd.driver.pre=**____[,____,...]:: + force loading kernel module . This parameter can be specified + multiple times. + +-**rd.driver.post=**_[,,...]_:: ++**rd.driver.post=**____[,____,...]:: + force loading kernel module after all automatic loading modules + have been loaded. This parameter can be specified multiple times. + +-**rd.retry=**__:: ++**rd.retry=**____:: + specify how long dracut should wait for devices to appear. + The default is 30 seconds. After 2/3 of the time, degraded raids are force + started. If you have hardware, which takes a very long time to announce its +@@ -123,7 +125,7 @@ Misc + **rd.noverifyssl**:: + accept self-signed certificates for ssl downloads. + +-**rd.ctty=**__**:: ++**rd.ctty=**____:: + specify the controlling terminal for the console. + This is useful, if you have multiple "console=" arguments. + +@@ -150,17 +152,20 @@ It should be attached to any report about dracut problems. + If "quiet" is set, it also logs to the console. + + **rd.memdebug=[0-3]**:: +- Print memory usage info at various points, set the verbose level from 0 to 3 ++ Print memory usage info at various points, set the verbose level from 0 to 3. + + Higher level means more debugging output: +++ ++---- + 0 - no output + 1 - partial /proc/meminfo + 2 - /proc/meminfo + 3 - /proc/meminfo + /proc/slabinfo ++---- + + **rd.break**:: + drop to a shell at the end + +-**rd.break=**_{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}_:: ++**rd.break=**__{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}__:: + drop to a shell on defined breakpoint + + **rd.udev.info**:: +@@ -171,50 +176,56 @@ It should be attached to any report about dracut problems. + + I18N + ~~~~ +-**vconsole.keymap=**__:: ++**rd.vconsole.keymap=**____:: + keyboard translation table loaded by loadkeys; taken from keymaps directory; +- will be written as KEYMAP to _/etc/vconsole.conf_ in the initramfs, e.g.: ++ will be written as KEYMAP to _/etc/vconsole.conf_ in the initramfs. + + +----- +-vconsole.keymap=de-latin1-nodeadkeys +----- ++[listing] ++.Example ++-- ++rd.vconsole.keymap=de-latin1-nodeadkeys ++-- + +-**vconsole.keymap.ext=**__:: ++**rd.vconsole.keymap.ext=**____:: + list of extra keymaps to bo loaded (sep. by space); will be written as + EXT_KEYMAP to _/etc/vconsole.conf_ in the initramfs + +-**vconsole.unicode**[=_{0|1}_]:: ++**rd.vconsole.unicode**:: + boolean, indicating UTF-8 mode; will be written as UNICODE to + _/etc/vconsole.conf_ in the initramfs + +-**vconsole.font=**__:: ++**rd.vconsole.font=**____:: + console font; taken from consolefonts directory; will be written as FONT to +- _/etc/vconsole.conf_ in the initramfs; e.g.: ++ _/etc/vconsole.conf_ in the initramfs. + + +----- +-vconsole.font=LatArCyrHeb-16 +----- ++[listing] ++.Example ++-- ++rd.vconsole.font=LatArCyrHeb-16 ++-- + +-**vconsole.font.map=**__:: ++**rd.vconsole.font.map=**____:: + see description of '-m' parameter in setfont manual; taken from consoletrans + directory; will be written as FONT_MAP to _/etc/vconsole.conf_ in the + initramfs + +-**vconsole.font.unimap=**__:: ++**rd.vconsole.font.unimap=**____:: + see description of '-u' parameter in setfont manual; taken from unimaps + directory; will be written as FONT_UNIMAP to _/etc/vconsole.conf_ in the + initramfs + +-**locale.LANG=**__:: ++**rd.locale.LANG=**____:: + taken from the environment; if no UNICODE is defined we set its value in + basis of LANG value (whether it ends with ".utf8" (or similar) or not); will +- be written as LANG to _/etc/locale.conf_ in the initramfs; e.g.: ++ be written as LANG to _/etc/locale.conf_ in the initramfs. + + +----- +-locale.LANG=pl_PL.utf8 +----- ++[listing] ++.Example ++-- ++rd.locale.LANG=pl_PL.utf8 ++-- + +-**locale.LC_ALL=**__:: ++**rd.locale.LC_ALL=**____:: + taken from the environment; will be written as LC_ALL to _/etc/locale.conf_ + in the initramfs + +@@ -223,11 +234,11 @@ LVM + **rd.lvm=0**:: + disable LVM detection + +-**rd.lvm.vg=**__:: ++**rd.lvm.vg=**____:: + only activate the volume groups with the given name. rd.lvm.vg can be + specified multiple times on the kernel command line. + +-**rd.lvm.lv=**__:: ++**rd.lvm.lv=**____:: + only activate the logical volumes with the given name. rd.lvm.lv can be + specified multiple times on the kernel command line. + +@@ -239,14 +250,14 @@ crypto LUKS + **rd.luks=0**:: + disable crypto LUKS detection + +-**rd.luks.uuid=**__:: ++**rd.luks.uuid=**____:: + only activate the LUKS partitions with the given UUID. Any "luks-" of the + LUKS UUID is removed before comparing to __. + The comparisons also matches, if __ is only the beginning of the + LUKS UUID, so you don't have to specify the full UUID. + This parameter can be specified multiple times. + +-**rd.luks.allow-discards=**__:: ++**rd.luks.allow-discards=**____:: + Allow using of discards (TRIM) requests for LUKS partitions with the given UUID. + Any "luks-" of the LUKS UUID is removed before comparing to __. + The comparisons also matches, if __ is only the beginning of the +@@ -261,16 +272,18 @@ crypto LUKS + + crypto LUKS - key on removable device support + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-**rd.luks.key=**_::_:: ++**rd.luks.key=**____:____:____:: + _keypath_ is a path to key file to look for. It's REQUIRED. When _keypath_ ends with '.gpg' it's considered to be key encrypted symmetrically with GPG. You will be prompted for password on boot. GPG support comes with 'crypt-gpg' module which needs to be added explicitly. + + + _keydev_ is a device on which key file resides. It might be kernel name of devices (should start with "/dev/"), UUID (prefixed with "UUID=") or label (prefix with "LABEL="). You don't have to specify full UUID. Just its beginning will suffice, even if its ambiguous. All matching devices will be probed. This parameter is recommended, but not required. If not present, all block devices will be probed, which may significantly increase boot time. + + + If _luksdev_ is given, the specified key will only be applied for that LUKS device. Possible values are the same as for _keydev_. Unless you have several LUKS devices, you don't have to specify this parameter. The simplest usage is: + + +----- ++[listing] ++.Example ++-- + rd.luks.key=/foo/bar.key +----- ++-- + + + As you see, you can skip colons in such a case. + + +@@ -281,20 +294,20 @@ to crypsetup luksFormat with _-d -_, too! + + Here follows example for key encrypted with GPG: + +----- +-gpg --quiet --decrypt rootkey.gpg \ +-| cryptsetup -d - -v \ +---cipher serpent-cbc-essiv:sha256 \ ++[listing] ++-- ++gpg --quiet --decrypt rootkey.gpg | \ ++cryptsetup -d - -v --cipher serpent-cbc-essiv:sha256 \ + --key-size 256 luksFormat /dev/sda3 +----- ++-- + + If you use plain keys, just add path to _-d_ option: + +----- +-cryptsetup -d rootkey.key -v \ +---cipher serpent-cbc-essiv:sha256 \ +---key-size 256 luksFormat /dev/sda3 +----- ++[listing] ++-- ++cryptsetup -d rootkey.key -v --cipher serpent-cbc-essiv:sha256 \ ++ --key-size 256 luksFormat /dev/sda3 ++-- + =============================== + + MD RAID +@@ -314,7 +327,7 @@ MD RAID + **rd.md.waitclean=1**:: + wait for any resync, recovery, or reshape activity to finish before continuing + +-**rd.md.uuid=**__:: ++**rd.md.uuid=**____:: + only activate the raid sets with the given UUID. This parameter can be + specified multiple times. + +@@ -323,7 +336,7 @@ DM RAID + **rd.dm=0**:: + disable DM RAID detection + +-**rd.dm.uuid=**__:: ++**rd.dm.uuid=**____:: + only activate the raid sets with the given UUID. This parameter can be + specified multiple times. + +@@ -332,15 +345,17 @@ FIPS + **rd.fips**:: + enable FIPS + +-**boot=**__:: +- specify the device, where /boot is located. e.g. ++**boot=**____:: ++ specify the device, where /boot is located. + + +----- ++[listing] ++.Example ++-- + boot=/dev/sda1 + boot=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 + boot=UUID= + boot=LABEL=