From c0e1df1a13bd659c77df559ef0eb575541fca0983270b190340fb6f84e401338 Mon Sep 17 00:00:00 2001 From: Raymond Wooninck Date: Fri, 29 Nov 2013 12:27:47 +0000 Subject: [PATCH] Accepting request 208892 from home:hreinecke:branches:Base:System - Update with patches from git repository: * kernel-modules: add ohci-pci to the list of forced module installs * Run 'xz' and 'lzma' with multiple threads * systemd: do not exit the initqueue, if systemd asks a password * iscsi,nbd: do not fail in hostonly mode * dracut-functions.sh: Avoid loading unnecessary 32-bit libraries for 64-bit initrds * fips: also install /etc/system-fips in the initramfs * dracut.modules.7.asc: removed empty section * dracut.sh: fixed PATH shortener * dracut.spec: move /sbin/dracut to /usr/sbin/dracut * iscsi/nbd: do not try to mount the whole disk, if root= is missing * fips: include crct10dif_generic * Handle crypto modules with and without modaliases * usrmount/module-setup.sh: fixed typo * lvm: always install thin utils for lvm * kernel-modules(ARM): add mmc_block usb_storage to static list of kernel mods * dracut-functions.sh:check_block_and_slaves*() skip LVM internal devs * mkdir basic dirs in /run * network/fcoe: only redirect output to loginit.pipe, if exists * dracut.sh: no need to make subdirs in run * dracut.sh: also mkdir /run/lock, which is copied to * lvm: fix thin recognition * Add lzo, lz4 compression and read INITRD_COMPRESS * remove resume-genrules.sh * resume: fix swap detection in hostonly * base/init.sh: also mkdir /run/lock * dmsquash-live: add /dev/mapper/live-base * Doc: cleanup, extend and split and reuse OBS-URL: https://build.opensuse.org/request/show/208892 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=82 --- ...asd-Install-kernel-modules-only-once.patch | 37 + ...all-module-if-normalize_dasd_arg-is-.patch | 28 + ...dasd_mod-make-dasd_cio_free-optional.patch | 41 + 0004-95zfcp-Make-installation-optional.patch | 38 + 0005-95znet-Make-installation-optional.patch | 28 + 0006-Install-bin-mount.patch | 25 + 0007-Fixup-keymap-setting-for-openSUSE.patch | 29 + 0008-Add-DASD-configuration-for-SuSE.patch | 155 + 0009-Add-zfcp-scripts-for-SUSE.patch | 121 + 0010-Make-logfile-configurable.patch | 70 + ...d-SUSE-compability-wrapper-for-dracu.patch | 378 ++ ...asc-Add-manpage-for-SUSE-compat-mkin.patch | 139 + 0013-Correct-paths-for-openSUSE.patch | 58 + 0014-Check-for-plymouth-lib-directories.patch | 45 + 0015-Fixup-script-permissions.patch | 49 + ...-shebang-from-shell-completion-files.patch | 37 + correct-paths-for-opensuse.patch | 81 - dracut-git-update.patch | 5557 +++++++++++++++++ dracut.changes | 56 + dracut.spec | 68 +- mkinitrd-fix-boot-dir-detection.patch | 18 - mkinitrd_update_bootloader.diff | 13 - suse_only_logger.patch | 16 - use_initrd_insteadof_initramfs.patch | 175 - use_sysconfig_values_correctly.patch | 12 - 25 files changed, 6935 insertions(+), 339 deletions(-) create mode 100644 0001-95dasd-Install-kernel-modules-only-once.patch create mode 100644 0002-95dasd-Only-install-module-if-normalize_dasd_arg-is-.patch create mode 100644 0003-95dasd_mod-make-dasd_cio_free-optional.patch create mode 100644 0004-95zfcp-Make-installation-optional.patch create mode 100644 0005-95znet-Make-installation-optional.patch create mode 100644 0006-Install-bin-mount.patch create mode 100644 0007-Fixup-keymap-setting-for-openSUSE.patch create mode 100644 0008-Add-DASD-configuration-for-SuSE.patch create mode 100644 0009-Add-zfcp-scripts-for-SUSE.patch create mode 100644 0010-Make-logfile-configurable.patch create mode 100644 0011-mkinitrd-suse-Add-SUSE-compability-wrapper-for-dracu.patch create mode 100644 0012-mkinitrd-suse.8.asc-Add-manpage-for-SUSE-compat-mkin.patch create mode 100644 0013-Correct-paths-for-openSUSE.patch create mode 100644 0014-Check-for-plymouth-lib-directories.patch create mode 100644 0015-Fixup-script-permissions.patch create mode 100644 0016-Remove-shebang-from-shell-completion-files.patch delete mode 100644 correct-paths-for-opensuse.patch create mode 100644 dracut-git-update.patch delete mode 100644 mkinitrd-fix-boot-dir-detection.patch delete mode 100644 mkinitrd_update_bootloader.diff delete mode 100644 suse_only_logger.patch delete mode 100644 use_initrd_insteadof_initramfs.patch delete mode 100644 use_sysconfig_values_correctly.patch diff --git a/0001-95dasd-Install-kernel-modules-only-once.patch b/0001-95dasd-Install-kernel-modules-only-once.patch new file mode 100644 index 0000000..883fe27 --- /dev/null +++ b/0001-95dasd-Install-kernel-modules-only-once.patch @@ -0,0 +1,37 @@ +From 0c3400336c7916819fd24b8081e24098880ef244 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 21 Nov 2013 11:51:30 +0100 +Subject: [PATCH] 95dasd: Install kernel modules only once + +Move kernel module selection to 95dasd_mod and make 95dasd depend +on that module. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95dasd/module-setup.sh | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/modules.d/95dasd/module-setup.sh b/modules.d/95dasd/module-setup.sh +index 861df29..16207bc 100755 +--- a/modules.d/95dasd/module-setup.sh ++++ b/modules.d/95dasd/module-setup.sh +@@ -11,15 +11,11 @@ check() { + + # called by dracut + depends() { ++ echo "dasd_mod" + return 0 + } + + # called by dracut +-installkernel() { +- instmods dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod +-} +- +-# called by dracut + install() { + inst_hook cmdline 30 "$moddir/parse-dasd.sh" + inst_multiple dasdinfo dasdconf.sh normalize_dasd_arg +-- +1.8.1.4 + diff --git a/0002-95dasd-Only-install-module-if-normalize_dasd_arg-is-.patch b/0002-95dasd-Only-install-module-if-normalize_dasd_arg-is-.patch new file mode 100644 index 0000000..2dc2ae1 --- /dev/null +++ b/0002-95dasd-Only-install-module-if-normalize_dasd_arg-is-.patch @@ -0,0 +1,28 @@ +From 3d10724ecd78a62ec8c987c97f9b5f4236c681a4 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 21 Nov 2013 11:53:09 +0100 +Subject: [PATCH] 95dasd: Only install module if normalize_dasd_arg is present + +normalize_dasd_arg is a RedHat specific script, so no point +installing this module if the script isn't present. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95dasd/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/95dasd/module-setup.sh b/modules.d/95dasd/module-setup.sh +index 16207bc..9c93d40 100755 +--- a/modules.d/95dasd/module-setup.sh ++++ b/modules.d/95dasd/module-setup.sh +@@ -5,6 +5,7 @@ + # called by dracut + check() { + local _arch=$(uname -m) ++ [ -x /sbin/normalize_dasd_arg ] || return 1 + [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 + return 0 + } +-- +1.8.1.4 + diff --git a/0003-95dasd_mod-make-dasd_cio_free-optional.patch b/0003-95dasd_mod-make-dasd_cio_free-optional.patch new file mode 100644 index 0000000..9b1f039 --- /dev/null +++ b/0003-95dasd_mod-make-dasd_cio_free-optional.patch @@ -0,0 +1,41 @@ +From 7d00da419fcbdb8736cbbe7caf13209589b43d9c Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 21 Nov 2013 12:33:57 +0100 +Subject: [PATCH] 95dasd_mod: make dasd_cio_free optional + +dasd_cio_free is a RedHat-specific tool, so make it optional. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95dasd_mod/module-setup.sh | 3 ++- + modules.d/95dasd_mod/parse-dasd-mod.sh | 4 +++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95dasd_mod/module-setup.sh b/modules.d/95dasd_mod/module-setup.sh +index 011010d..8fde525 100755 +--- a/modules.d/95dasd_mod/module-setup.sh ++++ b/modules.d/95dasd_mod/module-setup.sh +@@ -23,6 +23,7 @@ installkernel() { + # called by dracut + install() { + inst_hook cmdline 31 "$moddir/parse-dasd-mod.sh" +- inst_multiple dasd_cio_free grep sed seq ++ inst_multiple grep sed seq ++ inst_multiple -o dasd_cio_free + } + +diff --git a/modules.d/95dasd_mod/parse-dasd-mod.sh b/modules.d/95dasd_mod/parse-dasd-mod.sh +index 87c88ed..0236d12 100755 +--- a/modules.d/95dasd_mod/parse-dasd-mod.sh ++++ b/modules.d/95dasd_mod/parse-dasd-mod.sh +@@ -15,4 +15,6 @@ if [ -n "$mod_args" ]; then + fi + + unset dasd_arg +-dasd_cio_free ++if [ -x /sbin/dasd_cio_free ] ; then ++ dasd_cio_free ++fi +-- +1.8.1.4 + diff --git a/0004-95zfcp-Make-installation-optional.patch b/0004-95zfcp-Make-installation-optional.patch new file mode 100644 index 0000000..bf342a0 --- /dev/null +++ b/0004-95zfcp-Make-installation-optional.patch @@ -0,0 +1,38 @@ +From f0c233bc4396d3e47a8e660d2d27d78bd32762d7 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 21 Nov 2013 11:58:31 +0100 +Subject: [PATCH] 95zfcp: Make installation optional + +zfcp_cio_free is a RedHat-specific tool, so do not install this +module if the program isn't present. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95zfcp/module-setup.sh | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/modules.d/95zfcp/module-setup.sh b/modules.d/95zfcp/module-setup.sh +index 5d9b506..dfbeed5 100755 +--- a/modules.d/95zfcp/module-setup.sh ++++ b/modules.d/95zfcp/module-setup.sh +@@ -5,6 +5,7 @@ + # called by dracut + check() { + arch=$(uname -m) ++ [ -x /sbin/zfcp_cio_free ] || return 1 + [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 + + return 0 +@@ -12,9 +13,6 @@ check() { + + # called by dracut + depends() { +- arch=$(uname -m) +- [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 +- + return 0 + } + +-- +1.8.1.4 + diff --git a/0005-95znet-Make-installation-optional.patch b/0005-95znet-Make-installation-optional.patch new file mode 100644 index 0000000..f31a949 --- /dev/null +++ b/0005-95znet-Make-installation-optional.patch @@ -0,0 +1,28 @@ +From 8a7276ae8aae5694c40d977580c7db6c5c47a81a Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 21 Nov 2013 12:00:14 +0100 +Subject: [PATCH] 95znet: Make installation optional + +znet_cio_free is a RedHat-specific tool, so do not install this +module on systems where the program is missing. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95znet/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/95znet/module-setup.sh b/modules.d/95znet/module-setup.sh +index 4c211a9..5012b77 100755 +--- a/modules.d/95znet/module-setup.sh ++++ b/modules.d/95znet/module-setup.sh +@@ -5,6 +5,7 @@ + # called by dracut + check() { + arch=$(uname -m) ++ [ -z /sbin/znet_cio_free ] || return 1 + [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 + + return 0 +-- +1.8.1.4 + diff --git a/0006-Install-bin-mount.patch b/0006-Install-bin-mount.patch new file mode 100644 index 0000000..ccd2dc4 --- /dev/null +++ b/0006-Install-bin-mount.patch @@ -0,0 +1,25 @@ +From 9e87dcb25f82122be3ee16ca8f3c198dd3d02d77 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 27 Nov 2013 14:35:19 +0100 +Subject: [PATCH] Install /bin/mount + +systemd relies on /bin/mount to be present, so install it. + +Signed-off-by: Hannes Reinecke +--- + modules.d/99fs-lib/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh +index 7979bab..b24207d 100755 +--- a/modules.d/99fs-lib/module-setup.sh ++++ b/modules.d/99fs-lib/module-setup.sh +@@ -85,4 +85,5 @@ install() { + fi + + inst_multiple -o $_helpers fsck ++ inst /usr/bin/mount /bin/mount + } +-- +1.8.1.4 + diff --git a/0007-Fixup-keymap-setting-for-openSUSE.patch b/0007-Fixup-keymap-setting-for-openSUSE.patch new file mode 100644 index 0000000..3a8079a --- /dev/null +++ b/0007-Fixup-keymap-setting-for-openSUSE.patch @@ -0,0 +1,29 @@ +From 4b40f3a3361d5267d9987c57945ef006e90e964d Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 27 Nov 2013 14:42:24 +0100 +Subject: [PATCH] Fixup keymap setting for openSUSE + +openSUSE is using compressed keymaps. + +Signed-off-by: Hannes Reinecke +--- + modules.d/10i18n/module-setup.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh +index 0741c64..f07b148 100755 +--- a/modules.d/10i18n/module-setup.sh ++++ b/modules.d/10i18n/module-setup.sh +@@ -161,6 +161,9 @@ install() { + # Gentoo user may have KEYMAP set to something like "-u pl2", + KEYMAP=${KEYMAP#-* } + ++ # openSUSE user may have KEYMAP set to something like ".gz" ++ KEYMAP=${KEYMAP/.gz/} ++ + # KEYTABLE is a bit special - it defines base keymap name and UNICODE + # determines whether non-UNICODE or UNICODE version is used + +-- +1.8.1.4 + diff --git a/0008-Add-DASD-configuration-for-SuSE.patch b/0008-Add-DASD-configuration-for-SuSE.patch new file mode 100644 index 0000000..1df04ad --- /dev/null +++ b/0008-Add-DASD-configuration-for-SuSE.patch @@ -0,0 +1,155 @@ +From 60265e04911e2cfb980d048e378fb2e510b8370d Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 21 Nov 2013 12:23:44 +0100 +Subject: [PATCH] Add DASD configuration for SuSE + +On SuSE the DASD configuration is kept in udev rules, one rule +file per device. So add a new module for copying and creating +these rules during boot. + +Signed-off-by: Hannes Reinecke +--- + dracut-functions.sh | 28 +++++++++++++++++ + modules.d/95dasd_rules/module-setup.sh | 27 ++++++++++++++++ + modules.d/95dasd_rules/parse-dasd.sh | 56 ++++++++++++++++++++++++++++++++++ + 3 files changed, 111 insertions(+) + create mode 100755 modules.d/95dasd_rules/module-setup.sh + create mode 100755 modules.d/95dasd_rules/parse-dasd.sh + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 2872516..0337c13 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -899,6 +899,34 @@ inst_rules() { + done + } + ++inst_rules_wildcard() { ++ local _target=/etc/udev/rules.d _rule _found ++ ++ inst_dir "${udevdir}/rules.d" ++ inst_dir "$_target" ++ for _rule in ${udevdir}/rules.d/$1 ${dracutbasedir}/rules.d/$1 ; do ++ if [[ -e $_rule ]]; then ++ inst_rule_programs "$_rule" ++ inst_rule_group_owner "$_rule" ++ inst_rule_initqueue "$_rule" ++ inst_simple "$_rule" ++ _found=$_rule ++ fi ++ done ++ if [ -n ${hostonly} ] ; then ++ for _rule in ${_target}/$1 ; do ++ if [[ -f $_rule ]]; then ++ inst_rule_programs "$_rule" ++ inst_rule_group_owner "$_rule" ++ inst_rule_initqueue "$_rule" ++ inst_simple "$_rule" ++ _found=$_rule ++ fi ++ done ++ fi ++ [[ $_found ]] || dinfo "Skipping udev rule: $_rule" ++} ++ + prepare_udev_rules() { + [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version) + +diff --git a/modules.d/95dasd_rules/module-setup.sh b/modules.d/95dasd_rules/module-setup.sh +new file mode 100755 +index 0000000..d313171 +--- /dev/null ++++ b/modules.d/95dasd_rules/module-setup.sh +@@ -0,0 +1,27 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++# called by dracut ++check() { ++ local _arch=$(uname -m) ++ [ -x /sbin/dasd_configure ] || return 1 ++ [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 ++ return 0 ++} ++ ++# called by dracut ++depends() { ++ echo 'dasd_mod' ++ return 0 ++} ++ ++# called by dracut ++install() { ++ inst_multiple /usr/lib/udev/collect ++ inst_hook cmdline 30 "$moddir/parse-dasd.sh" ++ if [[ $hostonly ]] ; then ++ inst_rules_wildcard 51-dasd-*.rules ++ fi ++ inst_rules 59-dasd.rules ++} +diff --git a/modules.d/95dasd_rules/parse-dasd.sh b/modules.d/95dasd_rules/parse-dasd.sh +new file mode 100755 +index 0000000..9389c44 +--- /dev/null ++++ b/modules.d/95dasd_rules/parse-dasd.sh +@@ -0,0 +1,56 @@ ++#!/bin/sh ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++create_udev_rule() { ++ local ccw=$1 ++ local _drv _cu_type _dev_type ++ local _rule=/etc/udev/rules.d/51-dasd-${ccw}.rules ++ ++ if [ -e /sys/bus/ccw/devices/${ccw} ] ; then ++ read _cu_type < /sys/bus/ccw/devices/${ccw}/cutype ++ read _dev_type < /sys/bus/ccw/devices/${ccw}/devtype ++ fi ++ case "$_cu_type" in ++ 3990/*|2105/*|2107/*|1750/*|9343/*) ++ _drv=dasd-eckd ++ ;; ++ 6310/*) ++ _drv=dasd-fba ++ ;; ++ 3880/*) ++ case "$_dev_type" in ++ 3380/*) ++ _drv=dasd_eckd ++ ;; ++ 3370/*) ++ _drv=dasd-fba ++ ;; ++ esac ++ ;; ++ esac ++ [ -z "${_drv}" ] && return 0 ++ ++ [ -e ${_rule} ] && return 0 ++ ++ cat > $_rule < +Date: Thu, 21 Nov 2013 13:47:17 +0100 +Subject: [PATCH] Add zfcp scripts for SUSE + +SuSE is storing the zfcp configuration in udev files, so we should +be including these. + +Signed-off-by: Hannes Reinecke +--- + modules.d/95zfcp_rules/module-setup.sh | 25 +++++++++++++ + modules.d/95zfcp_rules/parse-zfcp.sh | 65 ++++++++++++++++++++++++++++++++++ + 2 files changed, 90 insertions(+) + create mode 100755 modules.d/95zfcp_rules/module-setup.sh + create mode 100755 modules.d/95zfcp_rules/parse-zfcp.sh + +diff --git a/modules.d/95zfcp_rules/module-setup.sh b/modules.d/95zfcp_rules/module-setup.sh +new file mode 100755 +index 0000000..9a1ab20 +--- /dev/null ++++ b/modules.d/95zfcp_rules/module-setup.sh +@@ -0,0 +1,25 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++# called by dracut ++check() { ++ local _arch=$(uname -m) ++ [ -x /sbin/zfcp_disk_configure ] || return 1 ++ [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 ++ return 0 ++} ++ ++# called by dracut ++depends() { ++ return 0 ++} ++ ++# called by dracut ++install() { ++ inst_multiple /usr/lib/udev/collect ++ inst_hook cmdline 30 "$moddir/parse-zfcp.sh" ++ if [[ $hostonly ]] ; then ++ inst_rules_wildcard 51-zfcp-*.rules ++ fi ++} +diff --git a/modules.d/95zfcp_rules/parse-zfcp.sh b/modules.d/95zfcp_rules/parse-zfcp.sh +new file mode 100755 +index 0000000..24dbdd3 +--- /dev/null ++++ b/modules.d/95zfcp_rules/parse-zfcp.sh +@@ -0,0 +1,65 @@ ++#!/bin/sh ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++ ++create_udev_rule() { ++ local ccw=$1 ++ local wwpn=$2 ++ local lun=$3 ++ local _rule=/etc/udev/rules.d/51-zfcp-${ccw}.rules ++ ++ local _cu_type _dev_type ++ local _rule=/etc/udev/rules.d/51-zfcp-${ccw}.rules ++ ++ if [ -e /sys/bus/ccw/devices/${ccw} ] ; then ++ read _cu_type < /sys/bus/ccw/devices/${ccw}/cutype ++ read _dev_type < /sys/bus/ccw/devices/${ccw}/devtype ++ fi ++ if [ "$_cu_type" != "1731/03" ] ; then ++ return 0; ++ fi ++ if [ "$_dev_type" != "1732/03" ] && [ "$_dev_type" != "1732/04" ] ; then ++ return 0; ++ fi ++ ++ [ -e ${_rule} ] && return 0 ++ ++ if [ ! -f "$_rule" ] ; then ++ cat > $_rule <> $_rule < +Date: Thu, 28 Nov 2013 13:21:30 +0100 +Subject: [PATCH] Make logfile configurable + +Add '--logfile' option to make the log file configurable during +runtime. + +Signed-off-by: Hannes Reinecke +--- + dracut.8.asc | 6 ++++++ + dracut.sh | 4 ++++ + 2 files changed, 10 insertions(+) + +diff --git a/dracut.8.asc b/dracut.8.asc +index 2ea6744..d381dcf 100644 +--- a/dracut.8.asc ++++ b/dracut.8.asc +@@ -275,6 +275,12 @@ Default: + + **--sshkey** __:: ssh key file used with ssh-client module. + ++**--logfile** __:: logfile to use; overrides any setting from ++ the configuration files. +++ ++Default: ++ _/var/log/dracut.log_ ++ + **-l, --local**:: + activates the local mode. dracut will use modules from the current working + directory instead of the system-wide installed modules in +diff --git a/dracut.sh b/dracut.sh +index bce2662..5f63d94 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -183,6 +183,7 @@ Creates initial ramdisk images for preloading modules + --keep Keep the temporary initramfs for debugging purposes + --printsize Print out the module install size + --sshkey [SSHKEY] Add ssh key to initramfs (use with ssh-client module) ++ --logfile [FILE] Logfile to use (overrides configuration setting) + + If [LIST] has multiple arguments, then you have to put these in quotes. + +@@ -335,6 +336,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \ + --long debug \ + --long profile \ + --long sshkey: \ ++ --long logfile: \ + --long verbose \ + --long quiet \ + --long local \ +@@ -418,6 +420,7 @@ while :; do + --debug) debug="yes";; + --profile) profile="yes";; + --sshkey) sshkey="$2"; shift;; ++ --logfile) logfile_l="$2"; shift;; + -v|--verbose) ((verbosity_mod_l++));; + -q|--quiet) ((verbosity_mod_l--));; + -l|--local) +@@ -690,6 +693,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) + [[ $ro_mnt_l ]] && ro_mnt="yes" + [[ $early_microcode_l ]] && early_microcode=$early_microcode_l + [[ $early_microcode ]] || early_microcode=no ++[[ $logfile_l ]] && logfile="$logfile_l" + # eliminate IFS hackery when messing with fw_dir + fw_dir=${fw_dir//:/ } + +-- +1.8.1.4 + diff --git a/0011-mkinitrd-suse-Add-SUSE-compability-wrapper-for-dracu.patch b/0011-mkinitrd-suse-Add-SUSE-compability-wrapper-for-dracu.patch new file mode 100644 index 0000000..608c9b7 --- /dev/null +++ b/0011-mkinitrd-suse-Add-SUSE-compability-wrapper-for-dracu.patch @@ -0,0 +1,378 @@ +From 48b0614371e7fabee84a45132771b9427091efa9 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 28 Nov 2013 10:53:57 +0100 +Subject: [PATCH] mkinitrd-suse: Add SUSE compability wrapper for dracut + +SUSE has its own mkinitrd system. As the arguments clash +with the dracut-provided mkinitrd script I've added a new +mkinitrd-suse.sh wrapper. + +Signed-off-by: Hannes Reinecke +--- + mkinitrd-suse.sh | 354 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 354 insertions(+) + create mode 100755 mkinitrd-suse.sh + +diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh +new file mode 100755 +index 0000000..d20270a +--- /dev/null ++++ b/mkinitrd-suse.sh +@@ -0,0 +1,354 @@ ++#!/bin/bash --norc ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++# ++# mkinitrd compability wrapper for SUSE. ++# ++# Copyright (c) 2013 SUSE Linux Products GmbH. All rights reserved. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++ ++boot_dir="/boot" ++quiet=0 ++host_only=1 ++force=0 ++logfile=/var/log/YaST2/mkinitrd.log ++dracut_cmd=dracut ++ ++error() { echo "$@" >&2; } ++ ++usage () { ++ [[ $1 = '-n' ]] && cmd=echo || cmd=error ++ ++ $cmd "usage: ${0##*/} [options]" ++ $cmd "" ++ $cmd " Create initial ramdisk images that contain all kernel modules needed" ++ $cmd " in the early boot process, before the root file system becomes" ++ $cmd " available." ++ $cmd " This usually includes SCSI and/or RAID modules, a file system module" ++ $cmd " for the root file system, or a network interface driver module for dhcp." ++ $cmd "" ++ $cmd " options:" ++ $cmd " -f \"feature list\" Features to be enabled when generating initrd." ++ $cmd " Available features are:" ++ $cmd " iscsi, md, multipath, lvm, lvm2," ++ $cmd " ifup, fcoe, dcbd" ++ $cmd " -k \"kernel list\" List of kernel images for which initrd files are" ++ $cmd " created. Defaults to all kernels found in /boot." ++ $cmd " -i \"initrd list\" List of file names for the initrd; position have" ++ $cmd " match to \"kernel list\". Defaults to all kernels" ++ $cmd " found in /boot." ++ $cmd " -b boot_dir Boot directory. Defaults to /boot." ++ $cmd " -t tmp_dir Temporary directory. Defaults to /var/tmp." ++ $cmd " -M map System.map file to use." ++ $cmd " -A Create a so called \"monster initrd\" which" ++ $cmd " includes all features and modules possible." ++ $cmd " -B Do not update bootloader configuration." ++ $cmd " -v Verbose mode." ++ $cmd " -L Disable logging." ++ $cmd " -h This help screen." ++ $cmd " -m \"module list\" Modules to include in initrd. Defaults to the" ++ $cmd " INITRD_MODULES variable in /etc/sysconfig/kernel" ++ $cmd " -u \"DomU module list\" Modules to include in initrd. Defaults to the" ++ $cmd " DOMU_INITRD_MODULES variable in" ++ $cmd " /etc/sysconfig/kernel." ++ $cmd " -d root_device Root device. Defaults to the device from" ++ $cmd " which / is mounted. Overrides the rootdev" ++ $cmd " enviroment variable if set." ++ $cmd " -j device Journal device" ++ $cmd " -D interface Run dhcp on the specified interface." ++ $cmd " -I interface Configure the specified interface statically." ++ $cmd " -a acpi_dsdt Attach compiled ACPI DSDT (Differentiated" ++ $cmd " System Description Table) to initrd. This" ++ $cmd " replaces the DSDT of the BIOS. Defaults to" ++ $cmd " the ACPI_DSDT variable in /etc/sysconfig/kernel." ++ $cmd " -s size Add splash animation and bootscreen to initrd." ++ ++ [[ $1 = '-n' ]] && exit 0 ++ exit 1 ++} ++ ++# Little helper function for reading args from the commandline. ++# it automatically handles -a b and -a=b variants, and returns 1 if ++# we need to shift $3. ++read_arg() { ++ # $1 = arg name ++ # $2 = arg value ++ # $3 = arg parameter ++ param="$1" ++ local rematch='^[^=]*=(.*)$' result ++ if [[ $2 =~ $rematch ]]; then ++ read "$param" <<< "${BASH_REMATCH[1]}" ++ else ++ for ((i=3; $i <= $#; i++)); do ++ # Only read next arg if it not an arg itself. ++ if [[ ${@:$i:1} = -* ]];then ++ break ++ fi ++ result="$result ${@:$i:1}" ++ # There is no way to shift our callers args, so ++ # return "no of args" to indicate they should do it instead. ++ done ++ read "$1" <<< "$result" ++ return $(($i - 3)) ++ fi ++} ++ ++# Helper functions to calculate ipconfig command line ++calc_netmask() { ++ local prefix=$1 ++ ++ [ -z "$prefix" ] && return ++ mask=$(echo "(2 ^ 32) - (2 ^ $prefix)" | bc -l) ++ byte1=$(( mask >> 24 )) ++ byte2=$(( mask >> 16 )) ++ byte3=$(( mask >> 8 )) ++ byte4=$(( mask & 0xff )) ++ netmask=$(printf "%d.%d.%d.%d" $(( byte1 & 0xff )) $(( byte2 & 0xff )) $(( byte3 & 0xff )) $byte4); ++ ++ echo $netmask ++} ++ ++ipconfig() { ++ local interface=$1 ++ local iplink macaddr broadcast gateway ipaddr prefix netmask ++ ++ iplink=$(ip addr show dev $interface | sed -n 's/ *inet \(.*\) brd.*/\1/p') ++ macaddr=$(ip addr show dev $interface | sed -n 's/.*ether \(.*\) brd.*/\1/p') ++ broadcast=$(ip addr show dev $interface | sed -n 's/.*brd \(.*\) scope.*/\1/p') ++ gateway=$(ip route show dev $interface | sed -n 's/default via \([0-9\.]*\).*/\1/p') ++ ++ ipaddr=${iplink%%/*} ++ prefix=${iplink##*/} ++ netmask=$(calc_netmask $prefix) ++ ++ echo "${ipaddr}:${serveraddr}:${gateway}:${netmask}:${hostname}:${interface}:none::${macaddr}" ++} ++ ++is_xen_kernel() { ++ local kversion=$1 ++ local root_dir=$2 ++ local cfg ++ ++ for cfg in ${root_dir}/boot/config-$kversion $root_dir/lib/modules/$kversion/build/.config ++ do ++ test -r $cfg || continue ++ grep -q "^CONFIG_XEN=y\$" $cfg ++ return ++ done ++ test $kversion != "${kversion%-xen*}" ++ return ++} ++ ++ ++# Taken over from SUSE mkinitrd ++default_kernel_images() { ++ local regex kernel_image kernel_version version_version initrd_image ++ local qf='%{NAME}-%{VERSION}-%{RELEASE}\n' ++ ++ case "$(uname -m)" in ++ s390|s390x) ++ regex='image' ++ ;; ++ ppc|ppc64) ++ regex='vmlinux' ++ ;; ++ i386|x86_64) ++ regex='vmlinuz' ++ ;; ++ arm*) ++ regex='[uz]Image' ++ ;; ++ aarch64) ++ regex='Image' ++ ;; ++ *) regex='vmlinu.' ++ ;; ++ esac ++ ++ kernel_images="" ++ initrd_images="" ++ for kernel_image in $(ls $boot_dir \ ++ | sed -ne "\|^$regex\(-[0-9.]\+-[0-9]\+-[a-z0-9]\+$\)\?|p" \ ++ | grep -v kdump$ ) ; do ++ ++ # Note that we cannot check the RPM database here -- this ++ # script is itself called from within the binary kernel ++ # packages, and rpm does not allow recursive calls. ++ ++ [ -L "$boot_dir/$kernel_image" ] && continue ++ [ "${kernel_image%%.gz}" != "$kernel_image" ] && continue ++ kernel_version=$(/usr/bin/get_kernel_version \ ++ $boot_dir/$kernel_image 2> /dev/null) ++ initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|") ++ if [ "$kernel_image" != "$initrd_image" -a \ ++ -n "$kernel_version" -a \ ++ -d "/lib/modules/$kernel_version" ]; then ++ kernel_images="$kernel_images $boot_dir/$kernel_image" ++ initrd_images="$initrd_images $boot_dir/$initrd_image" ++ fi ++ done ++ for kernel_image in $kernel_images;do ++ kernels="$kernels ${kernel_image#*-}" ++ done ++ for initrd_image in $initrd_images;do ++ targets="$targets $initrd_image" ++ done ++ host_only=1 ++ force=1 ++} ++ ++while (($# > 0)); do ++ case ${1%%=*} in ++ -f) read_arg feature_list "$@" || shift $? ++ # Could be several features ++ ;; ++ -k) # Would be nice to get a list of images here ++ read_arg kernel_images "$@" || shift $? ++ for kernel_image in $kernel_images;do ++ kernels="$kernels ${kernel_image#*-}" ++ done ++ host_only=1 ++ force=1 ++ ;; ++ -i) read_arg initrd_images "$@" || shift $? ++ for initrd_image in $initrd_images;do ++ # Check if the initrd_image contains a path. ++ # if not, then add the default boot_dir ++ dname=`dirname $initrd_image` ++ if [ "$dname" == "." ]; then ++ targets="$targets $boot_dir/$initrd_image"; ++ else ++ targets="$targets $initrd_image"; ++ fi ++ done ++ ;; ++ -b) read_arg boot_dir "$@" || shift $? ++ if [ ! -d $boot_dir ];then ++ error "Boot directory $boot_dir does not exist" ++ exit 1 ++ fi ++ ;; ++ -t) read_arg tmp_dir "$@" || shift $? ++ dracut_args="${dracut_args} --tmpdir $tmp_dir" ++ ;; ++ -M) read_arg map_file "$@" || shift $? ++ ;; ++ -A) host_only=0;; ++ -B) skip_update_bootloader=1;; ++ -v|--verbose) dracut_args="${dracut_args} -v";; ++ -L) logfile=;; ++ -h|--help) usage -n;; ++ -m) read_arg module_list "$@" || shift $? ;; ++ -u) read_arg domu_module_list "$@" || shift $? ++ echo "mkinitrd: DomU modules not yet supported" ;; ++ -d) read_arg rootfs "$@" || shift $? ++ dracut_args="${dracut_args} --filesystems $rootfs" ;; ++ -D) read_arg dhcp_if "$@" || shift $? ++ dracut_cmdline="${dracut_cmdline} ip=${dhcp_if}:dhcp" ++ ;; ++ -I) read_arg static_if "$@" || shift $? ++ dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)": ++ ;; ++ -a) read_arg acpi_dsdt "$@" || shift $? ++ echo "mkinitrd: custom DSDT not yet supported" ++ exit 1 ++ ;; ++ -s) read_arg boot_splash "$@" || shift $? ++ echo "mkinitrd: boot splash not yet supported" ++ exit 1 ++ ;; ++ -V) echo "mkinitrd: vendor scipts are no longer supported" ++ exit 1;; ++ --dracut) ++ read_arg dracut_cmd "$@" || shift $? ;; ++ --version|-R) ++ echo "mkinitrd: dracut compatibility wrapper" ++ exit 0;; ++ --force) force=1;; ++ --quiet|-q) quiet=1;; ++ *) if [[ ! $targets ]]; then ++ targets=$1 ++ elif [[ ! $kernels ]]; then ++ kernels=$1 ++ else ++ usage ++ fi;; ++ esac ++ shift ++done ++ ++[[ $targets && $kernels ]] || default_kernel_images ++[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage) ++ ++# We can have several targets/kernels, transform the list to an array ++targets=( $targets ) ++[[ $kernels ]] && kernels=( $kernels ) ++ ++[[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile" ++[[ $host_only == 1 ]] && dracut_args="${dracut_args} --hostonly" ++[[ $force == 1 ]] && dracut_args="${dracut_args} --force" ++[[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}" ++[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1 ++ ++# Update defaults from /etc/sysconfig/kernel ++if [ -f /etc/sysconfig/kernel ] ; then ++ . /etc/sysconfig/kernel ++fi ++[[ $module_list ]] || module_list="${INITRD_MODULES}" ++basicmodules="$basicmodules ${module_list}" ++[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}" ++[[ $acpi_dsdt ]] || acpi_dsdt="${ACPI_DSDT}" ++ ++echo "Creating: target|kernel|dracut args|basicmodules " ++for ((i=0 ; $i<${#targets[@]} ; i++)); do ++ ++ if [[ $img_vers ]];then ++ target="${targets[$i]}-${kernels[$i]}" ++ else ++ target="${targets[$i]}" ++ fi ++ kernel="${kernels[$i]}" ++ ++ # Duplicate code: No way found how to redirect output based on $quiet ++ if [[ $quiet == 1 ]];then ++ echo "$target|$kernel|$dracut_args|$basicmodules" ++ if is_xen_kernel $kernel $rootfs ; then ++ basicmodules="$basicmodules ${domu_module_list}" ++ fi ++ if [[ $basicmodules ]]; then ++ $dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \ ++ "$kernel" &>/dev/null ++ else ++ $dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null ++ fi ++ else ++ if is_xen_kernel $kernel $rootfs ; then ++ basicmodules="$basicmodules ${domu_module_list}" ++ fi ++ if [[ $basicmodules ]]; then ++ $dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \ ++ "$kernel" ++ else ++ $dracut_cmd $dracut_args "$target" "$kernel" ++ fi ++ fi ++done ++ ++if [ "$skip_update_bootloader" ] ; then ++ echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually." ++else ++ update-bootloader --refresh ++fi +-- +1.8.1.4 + diff --git a/0012-mkinitrd-suse.8.asc-Add-manpage-for-SUSE-compat-mkin.patch b/0012-mkinitrd-suse.8.asc-Add-manpage-for-SUSE-compat-mkin.patch new file mode 100644 index 0000000..6cd0254 --- /dev/null +++ b/0012-mkinitrd-suse.8.asc-Add-manpage-for-SUSE-compat-mkin.patch @@ -0,0 +1,139 @@ +From ed220c000020db2d883e798cbfa51e80e289b218 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Fri, 29 Nov 2013 08:01:34 +0100 +Subject: [PATCH] mkinitrd-suse.8.asc: Add manpage for SUSE compat mkinitrd + +Signed-off-by: Hannes Reinecke +--- + Makefile | 1 + + mkinitrd-suse.8.asc | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 107 insertions(+) + create mode 100644 mkinitrd-suse.8.asc + +diff --git a/Makefile b/Makefile +index e7da948..ba551cf 100644 +--- a/Makefile ++++ b/Makefile +@@ -27,6 +27,7 @@ man7pages = dracut.cmdline.7 \ + man8pages = dracut.8 \ + dracut-catimages.8 \ + mkinitrd.8 \ ++ mkinitrd-suse.8 \ + modules.d/98systemd/dracut-cmdline.service.8 \ + modules.d/98systemd/dracut-initqueue.service.8 \ + modules.d/98systemd/dracut-mount.service.8 \ +diff --git a/mkinitrd-suse.8.asc b/mkinitrd-suse.8.asc +new file mode 100644 +index 0000000..9eb8fc9 +--- /dev/null ++++ b/mkinitrd-suse.8.asc +@@ -0,0 +1,106 @@ ++MKINITRD(8) ++=========== ++:doctype: manpage ++:man source: dracut ++:man manual: dracut ++ ++NAME ++---- ++mkinitrd-suse - is a compat wrapper, which calls dracut to generate an initramfs ++ ++SYNOPSIS ++-------- ++*mkinitrd* ['OPTION...'] ++ ++DESCRIPTION ++----------- ++*mkinitrd* creates an initramfs image for the kernel with ++version by calling *dracut*. ++ ++[IMPORTANT] ++This version of mkinitrd is provided for compability with older ++versions of mkinitrd. If a more fine grained control over the ++resulting image is needed, *dracut* should be called directly. ++ ++OPTIONS ++------- ++**-R, --version**:: ++ print info about the version ++ ++**-k** __:: ++ List of kernel images for which initrd files are created (relative ++ to _boot_dir_), defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x ++ and _vmlinuz_ for everything else. ++ ++**-i** __:: ++ List of file names (relative to _boot_dir_) for the initrd; positions ++ have to match the _kernel_list_. Defaults to _initrd_. ++ ++**-m** __:: ++ Modules to include in initrd, defaults to _INITRD_MODULES_ variable ++ in */etc/sysconfig/kernel*. ++ ++**-f** __:: ++ Features to be enabled for the initrd. In general mkinitrd ++ configures the initrd for the root device it is started from. With ++ this option additional feature can be enabled. ++ ++**-b** __:: ++ Boot directory, defaults to */boot*, where the initrd is created. ++ ++**-d** __:: ++ Root device, defaults to the device from which the root_dir is ++ mounted; overwrites the rootdev enviroment variable if set ++ ++**-s** __:: ++ Add splash animation and bootscreen to initrd. ++ ++**-D** _:: ++ Run dhcp on the specified interface (for example "eth0"). ++ ++**-I** _:: ++ Configure the specified interface statically. ++ ++**-a** _:: ++ Attach compiled ACPI DSDT (Differentiated System Description Table) ++ to initrd. This replaces the DSDT of the BIOS. Defaults to the ++ _ACPI_DSDT_ variable in */etc/sysconfig/kernel*. ++ ++**-M** _:: ++ System.map file to use. ++ ++**-B**:: ++ Don’t run the *update-bootloader(8)* script after the initrd(s) have ++ been created. This is useful if you call mkinitrd(8) for anything ++ else than the running system. ++ ++**-A**:: ++ Create a so called "monster initrd" which includes all available ++ features and modules. ++ ++**-v, --verbose**:: ++ increase verbosity level ++ ++**-L**:: ++ Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for ++ testing if you don’t want to clutter the system log. ++ ++**--force**:: ++ overwrite existing initramfs file. ++ ++**--help**:: ++ print a help message and exit. ++ ++AVAILABILITY ++------------ ++The mkinitrd command is part of the dracut package and is available from ++link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org] ++ ++AUTHORS ++------- ++Harald Hoyer, Hannes Reinecke ++ ++SEE ALSO ++-------- ++*dracut*(8) ++*update-bootloader*(8) +-- +1.8.1.4 + diff --git a/0013-Correct-paths-for-openSUSE.patch b/0013-Correct-paths-for-openSUSE.patch new file mode 100644 index 0000000..8d5521b --- /dev/null +++ b/0013-Correct-paths-for-openSUSE.patch @@ -0,0 +1,58 @@ +From 16b73ffc6f9c67800811f39641c484123d2a159a Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Thu, 28 Nov 2013 10:07:59 +0100 +Subject: [PATCH] Correct paths for openSUSE + +openSUSE has things stored in different places, so fixup the +paths here. + +Signed-off-by: Christian Rodrigues +Signed-off-by: Hannes Reinecke +--- + dracut.sh | 2 +- + modules.d/10i18n/module-setup.sh | 2 ++ + modules.d/98systemd/rescue.service | 2 +- + 3 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 5f63d94..8680874 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -683,7 +683,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) + [[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l + [[ $lvmconf_l ]] && lvmconf=$lvmconf_l + [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut +-[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware" ++[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware /lib/firmware/$kernel" + [[ $tmpdir_l ]] && tmpdir="$tmpdir_l" + [[ $tmpdir ]] || tmpdir=/var/tmp + [[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS +diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh +index f07b148..3854a38 100755 +--- a/modules.d/10i18n/module-setup.sh ++++ b/modules.d/10i18n/module-setup.sh +@@ -102,6 +102,8 @@ install() { + + install_base() { + inst_multiple setfont loadkeys kbd_mode stty ++ inst /usr/bin/setfont /bin/setfont ++ inst /usr/bin/loadkeys /bin/loadkeys + + if ! dracut_module_included "systemd"; then + inst ${moddir}/console_init.sh /lib/udev/console_init +diff --git a/modules.d/98systemd/rescue.service b/modules.d/98systemd/rescue.service +index edc2461..d80900f 100644 +--- a/modules.d/98systemd/rescue.service ++++ b/modules.d/98systemd/rescue.service +@@ -16,7 +16,7 @@ Environment=HOME=/ + Environment=DRACUT_SYSTEMD=1 + Environment=NEWROOT=/sysroot + WorkingDirectory=/ +-ExecStartPre=-/bin/plymouth quit ++ExecStartPre=-/usr/bin/plymouth quit + ExecStart=-/bin/sh -i -l + ExecStopPost=-/bin/rm -f -- /.console_lock + ExecStopPost=-/usr/bin/systemctl --fail --no-block default +-- +1.8.1.4 + diff --git a/0014-Check-for-plymouth-lib-directories.patch b/0014-Check-for-plymouth-lib-directories.patch new file mode 100644 index 0000000..2de393e --- /dev/null +++ b/0014-Check-for-plymouth-lib-directories.patch @@ -0,0 +1,45 @@ +From cc0ec0cdcef806efe2315931ba4705fb35b82c6a Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 27 Nov 2013 15:54:00 +0100 +Subject: [PATCH] Check for plymouth lib directories + +SUSE installs plymount files in /usr/lib, not /usr/libexec. +So check for both when including plymouth support. + +Signed-off-by: Hannes Reinecke +--- + modules.d/50plymouth/module-setup.sh | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh +index 1360924..7ccf9e4 100755 +--- a/modules.d/50plymouth/module-setup.sh ++++ b/modules.d/50plymouth/module-setup.sh +@@ -15,12 +15,19 @@ depends() { + + # called by dracut + install() { +- if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \ +- || [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then ++ if [ -d /usr/libexec/plymouth ] ; then ++ _plymouth=/usr/libexec/plymouth; ++ elif [ -d /usr/lib/plymouth ] ; then ++ _plymouth=/usr/lib/plymouth ++ fi ++ if [ -n "$_plymouth" ] ; then ++ if grep -q nash ${_plymouth}/plymouth-populate-initrd \ ++ || [ ! -x ${_plymouth}/plymouth-populate-initrd ]; then + . "$moddir"/plymouth-populate-initrd.sh +- else +- PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \ +- /usr/libexec/plymouth/plymouth-populate-initrd -t "$initdir" ++ else ++ PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \ ++ ${_plymouth}/plymouth-populate-initrd -t "$initdir" ++ fi + fi + + inst_hook emergency 50 "$moddir"/plymouth-emergency.sh +-- +1.8.1.4 + diff --git a/0015-Fixup-script-permissions.patch b/0015-Fixup-script-permissions.patch new file mode 100644 index 0000000..86dc4c1 --- /dev/null +++ b/0015-Fixup-script-permissions.patch @@ -0,0 +1,49 @@ +From 96a44d8e982838a01e3d8f2a62941a9af0952b95 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Fri, 29 Nov 2013 11:36:02 +0100 +Subject: [PATCH] Fixup script permissions + +Scripts with a shebang should be marked as executable. + +Signed-off-by: Hannes Reinecke +--- + modules.d/03modsign/load-modsign-keys.sh | 0 + modules.d/03modsign/module-setup.sh | 0 + modules.d/40network/net-lib.sh | 0 + modules.d/40network/parse-vlan.sh | 0 + modules.d/50drm/module-setup.sh | 0 + modules.d/91crypt-loop/crypt-loop-lib.sh | 0 + modules.d/98pollcdrom/pollcdrom.sh | 0 + 7 files changed, 0 insertions(+), 0 deletions(-) + mode change 100644 => 100755 modules.d/03modsign/load-modsign-keys.sh + mode change 100644 => 100755 modules.d/03modsign/module-setup.sh + mode change 100644 => 100755 modules.d/40network/net-lib.sh + mode change 100644 => 100755 modules.d/40network/parse-vlan.sh + mode change 100644 => 100755 modules.d/50drm/module-setup.sh + mode change 100644 => 100755 modules.d/91crypt-loop/crypt-loop-lib.sh + mode change 100644 => 100755 modules.d/98pollcdrom/pollcdrom.sh + +diff --git a/modules.d/03modsign/load-modsign-keys.sh b/modules.d/03modsign/load-modsign-keys.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/03modsign/module-setup.sh b/modules.d/03modsign/module-setup.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/40network/parse-vlan.sh b/modules.d/40network/parse-vlan.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/91crypt-loop/crypt-loop-lib.sh b/modules.d/91crypt-loop/crypt-loop-lib.sh +old mode 100644 +new mode 100755 +diff --git a/modules.d/98pollcdrom/pollcdrom.sh b/modules.d/98pollcdrom/pollcdrom.sh +old mode 100644 +new mode 100755 +-- +1.8.1.4 + diff --git a/0016-Remove-shebang-from-shell-completion-files.patch b/0016-Remove-shebang-from-shell-completion-files.patch new file mode 100644 index 0000000..31b8383 --- /dev/null +++ b/0016-Remove-shebang-from-shell-completion-files.patch @@ -0,0 +1,37 @@ +From d29f993d5a4205f918c5fefb7e03dabc1062e11b Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Fri, 29 Nov 2013 12:46:24 +0100 +Subject: [PATCH] Remove shebang from shell-completion files + +Shell-completion files are meant to be sourced, not executed. +So they shouldn't have a shebang at the start. + +Signed-off-by: Hannes Reinecke +--- + dracut-bash-completion.sh | 2 +- + lsinitrd-bash-completion.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut-bash-completion.sh b/dracut-bash-completion.sh +index d796c35..9f359c6 100644 +--- a/dracut-bash-completion.sh ++++ b/dracut-bash-completion.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++# + # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + # ex: ts=8 sw=4 sts=4 et filetype=sh + # +diff --git a/lsinitrd-bash-completion.sh b/lsinitrd-bash-completion.sh +index 78ab165..3df2965 100644 +--- a/lsinitrd-bash-completion.sh ++++ b/lsinitrd-bash-completion.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++# + # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + # ex: ts=8 sw=4 sts=4 et filetype=sh + # +-- +1.8.1.4 + diff --git a/correct-paths-for-opensuse.patch b/correct-paths-for-opensuse.patch deleted file mode 100644 index 75ed11d..0000000 --- a/correct-paths-for-opensuse.patch +++ /dev/null @@ -1,81 +0,0 @@ ---- dracut-034.orig/dracut.sh -+++ dracut-034/dracut.sh -@@ -669,7 +669,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l - [[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l - [[ $lvmconf_l ]] && lvmconf=$lvmconf_l - [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut --[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware" -+[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware /lib/firmware/$kernel" - [[ $tmpdir_l ]] && tmpdir="$tmpdir_l" - [[ $tmpdir ]] || tmpdir=/var/tmp - [[ $compress_l ]] && compress=$compress_l ---- dracut-034.orig/modules.d/10i18n/module-setup.sh -+++ dracut-034/modules.d/10i18n/module-setup.sh -@@ -99,6 +99,8 @@ install() { - - install_base() { - inst_multiple setfont loadkeys kbd_mode stty -+ inst /usr/bin/setfont /bin/setfont -+ inst /usr/bin/loadkeys /bin/loadkeys - - if ! dracut_module_included "systemd"; then - inst ${moddir}/console_init.sh /lib/udev/console_init ---- dracut-034.orig/modules.d/50plymouth/module-setup.sh -+++ dracut-034/modules.d/50plymouth/module-setup.sh -@@ -12,12 +12,12 @@ depends() { - } - - install() { -- if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \ -- || [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then -+ if grep -q nash /usr/lib/plymouth/plymouth-populate-initrd \ -+ || [ ! -x /usr/lib/plymouth/plymouth-populate-initrd ]; then - . "$moddir"/plymouth-populate-initrd.sh - else - PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \ -- /usr/libexec/plymouth/plymouth-populate-initrd -t "$initdir" -+ /usr/lib/plymouth/plymouth-populate-initrd -t "$initdir" - fi - - inst_hook emergency 50 "$moddir"/plymouth-emergency.sh ---- dracut-034.orig/modules.d/90kernel-modules/module-setup.sh -+++ dracut-034/modules.d/90kernel-modules/module-setup.sh -@@ -74,7 +74,7 @@ installkernel() { - } - - install() { -- inst_multiple -o /lib/modprobe.d/*.conf -+ inst_multiple -o /etc/modprobe.d/*.conf - [[ $hostonly ]] && inst_multiple -o /etc/modprobe.d/*.conf /etc/modprobe.conf - if ! dracut_module_included "systemd"; then - inst_hook cmdline 01 "$moddir/parse-kernel.sh" ---- dracut-034.orig/modules.d/95udev-rules/module-setup.sh -+++ dracut-034/modules.d/95udev-rules/module-setup.sh -@@ -11,6 +11,8 @@ install() { - inst_multiple udevadm cat uname blkid \ - /etc/udev/udev.conf - -+ inst /usr/sbin/blkid /sbin/blkid -+ - [ -d ${initdir}/$systemdutildir ] || mkdir -p ${initdir}/$systemdutildir - for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /sbin/udevd; do - [ -x "$_i" ] || continue ---- dracut-034.orig/modules.d/98systemd/rescue.service -+++ dracut-034/modules.d/98systemd/rescue.service -@@ -16,7 +16,7 @@ Environment=HOME=/ - Environment=DRACUT_SYSTEMD=1 - Environment=NEWROOT=/sysroot - WorkingDirectory=/ --ExecStartPre=-/bin/plymouth quit -+ExecStartPre=-/usr/bin/plymouth quit - ExecStart=-/bin/sh -i -l - ExecStopPost=-/bin/rm -f -- /.console_lock - ExecStopPost=-/usr/bin/systemctl --fail --no-block default ---- dracut-034.orig/modules.d/99fs-lib/module-setup.sh -+++ dracut-034/modules.d/99fs-lib/module-setup.sh -@@ -81,4 +81,5 @@ install() { - fi - - inst_multiple -o $_helpers fsck -+ inst /usr/bin/mount /bin/mount - } diff --git a/dracut-git-update.patch b/dracut-git-update.patch new file mode 100644 index 0000000..e0e987c --- /dev/null +++ b/dracut-git-update.patch @@ -0,0 +1,5557 @@ +From: Hannes Reinecke +Subject: Dracut git update + +This patch updates dracut 034 to +git commit 28609baf6e9581ea97c4550340e2a6031c1b6fbd + +Signed-off-by: Hannes Reinecke + +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-functions.sh b/dracut-functions.sh +index 45e0911..2872516 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -65,6 +65,7 @@ ldconfig_paths() + printf "%s\n" ${d%/*}; + done + ); do ++ [[ "$i" = "/lib" || "$i" = "/usr/lib" || "$i" = "/lib64" || "$i" = "/usr/lib64" ]] && continue + a["$i"]=1; + done; + printf "%s\n" ${!a[@]} +@@ -81,7 +82,7 @@ if ! [[ $libdirs ]] ; then + [[ -d /usr/lib ]] && libdirs+=" /usr/lib" + fi + +- libdirs+="$(ldconfig_paths)" ++ libdirs+=" $(ldconfig_paths)" + + export libdirs + fi +@@ -579,7 +580,7 @@ host_fs_all() + check_block_and_slaves() { + local _x + [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. +- "$1" $2 && return ++ if ! lvm_internal_dev $2; then "$1" $2 && return; fi + check_vol_slaves "$@" && return 0 + if [[ -f /sys/dev/block/$2/../dev ]]; then + check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0 +@@ -595,7 +596,7 @@ check_block_and_slaves() { + check_block_and_slaves_all() { + local _x _ret=1 + [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. +- if "$1" $2; then ++ if ! lvm_internal_dev $2 && "$1" $2; then + _ret=0 + fi + check_vol_slaves "$@" && return 0 +@@ -1480,7 +1481,7 @@ dracut_kernel_post() { + + module_is_host_only() { + local _mod=$1 +- local _modenc a i ++ local _modenc a i _k _s _v _aliases + _mod=${_mod##*/} + _mod=${_mod%.ko} + _modenc=${_mod//-/_} +@@ -1497,19 +1498,25 @@ module_is_host_only() { + # this covers the case, where a new module is introduced + # or a module was renamed + # or a module changed from builtin to a module ++ + if [[ -d /lib/modules/$kernel_current ]]; then + # if the modinfo can be parsed, but the module + # is not loaded, then we can safely return 1 + modinfo -F filename "$_mod" &>/dev/null && return 1 + fi + +- # Finally check all modalias, if we install for a kernel +- # different from the current one +- for a in $(modinfo -k $kernel -F alias $_mod 2>/dev/null); do ++ _aliases=$(modinfo -k $kernel -F alias $_mod 2>/dev/null) ++ ++ # if the module has no aliases, install it ++ [[ $_aliases ]] || return 0 ++ ++ # finally check all modalias ++ for a in $_aliases; do + for i in "${!host_modalias[@]}"; do + [[ $i == $a ]] && return 0 + done + done ++ + fi + + return 1 +@@ -1672,3 +1679,15 @@ get_ucode_file () + printf "%02x-%02x-%02x" ${family} ${model} ${stepping} + fi + } ++ ++# Not every device in /dev/mapper should be examined. ++# If it is an LVM device, touch only devices which have /dev/VG/LV symlink. ++lvm_internal_dev() { ++ local dev_dm_dir=/sys/dev/block/$1/dm ++ [[ ! -f $dev_dm_dir/uuid || $(<$dev_dm_dir/uuid) != LVM-* ]] && return 1 # Not an LVM device ++ local DM_VG_NAME DM_LV_NAME DM_LV_LAYER ++ eval $(dmsetup splitname --nameprefixes --noheadings --rows "$(<$dev_dm_dir/name)" 2>/dev/null) ++ [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 0 # Better skip this! ++ [[ ${DM_LV_LAYER} ]] || [[ ! -L /dev/${DM_VG_NAME}/${DM_LV_NAME} ]] ++} ++ +diff --git a/dracut.8.asc b/dracut.8.asc +index 76fc75c..2ea6744 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] +@@ -408,6 +365,22 @@ Make sure your kernel has xz decompression support compiled in, otherwise you + will not be able to boot. Equivalent to "lzma --compress=xz --check=crc32 --lzma2=dict=1MiB" + ==== + ++**--lzo**:: ++ Compress the generated initramfs using lzop. ++[WARNING] ++==== ++Make sure your kernel has lzo decompression support compiled in, otherwise you ++will not be able to boot. ++==== ++ ++**--lz4**:: ++ Compress the generated initramfs using lz4. ++[WARNING] ++==== ++Make sure your kernel has lz4 decompression support compiled in, otherwise you ++will not be able to boot. ++==== ++ + **--compress** __:: + Compress the generated initramfs using the passed compression program. If + you pass it just the name of a compression program, it will call that +@@ -481,7 +454,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=