From 55473f736f925ea2c16f1e55760cee3e8b4e8544 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Oct 30 2013 18:52:39 +0000 Subject: dracut-034-24.git20131030 - fixed booting with rd.iscsi.firmware and without root= - fips: include crct10dif_generic - fixed missing modules in hostonly, which have no modalias - moved dracut to /usr/sbin --- diff --git a/0019-usrmount-module-setup.sh-fixed-typo.patch b/0019-usrmount-module-setup.sh-fixed-typo.patch new file mode 100644 index 0000000..4cbedd5 --- /dev/null +++ b/0019-usrmount-module-setup.sh-fixed-typo.patch @@ -0,0 +1,22 @@ +From 0106da599a227cf1c28c3648b7e77985f617b878 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Fri, 25 Oct 2013 17:06:44 +0200 +Subject: [PATCH] usrmount/module-setup.sh: fixed typo + +--- + modules.d/98usrmount/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/98usrmount/module-setup.sh b/modules.d/98usrmount/module-setup.sh +index 1af789f..d8a0ec2 100755 +--- a/modules.d/98usrmount/module-setup.sh ++++ b/modules.d/98usrmount/module-setup.sh +@@ -7,7 +7,7 @@ check() { + local _init + [[ $mount_needs ]] && return 1 + _init=$(readlink -f /sbin/init) +- [[ "$init" == "${init##/usr}" ]] && return 255 ++ [[ "$_init" == "${_init##/usr}" ]] && return 255 + return 0 + } + diff --git a/0020-Handle-crypto-modules-with-and-without-modaliases.patch b/0020-Handle-crypto-modules-with-and-without-modaliases.patch new file mode 100644 index 0000000..132d772 --- /dev/null +++ b/0020-Handle-crypto-modules-with-and-without-modaliases.patch @@ -0,0 +1,85 @@ +From 4d7c18c7c0abf9c2347581d07a8e8be3d3969bd2 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 30 Oct 2013 12:22:52 +0100 +Subject: [PATCH] Handle crypto modules with and without modaliases + +If new kernels have modules split out, handle the case, where modules +have to modalias and just install them. + +Also add the crypto drivers and names to host_modalias. +--- + dracut-functions.sh | 14 ++++++++++---- + dracut.sh | 5 +++++ + modules.d/01fips/fips.sh | 1 - + 3 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 2e6e845..38095ba 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1480,7 +1480,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 +1497,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 +diff --git a/dracut.sh b/dracut.sh +index 4613d5b..ae792c4 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -968,6 +968,11 @@ if [[ $hostonly ]]; then + + rm -f -- "$initdir/.modalias" + ++ while read _k _s _v; do ++ [ "$_k" != "name" -a "$_k" != "driver" ] && continue ++ host_modalias["$_v"]=1 ++ done +Date: Wed, 30 Oct 2013 12:35:27 +0100 +Subject: [PATCH] fips: include crct10dif_generic + +Resolves: rhbz#1024455 +--- + modules.d/01fips/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index 6493290..fb5a5cd 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -16,7 +16,7 @@ depends() { + installkernel() { + local _fipsmodules _mod + _fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm " +- _fipsmodules+="chainiv crc32c cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod " ++ _fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod " + _fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 " + _fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic " + _fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib" diff --git a/0022-iscsi-nbd-do-not-try-to-mount-the-whole-disk-if-root.patch b/0022-iscsi-nbd-do-not-try-to-mount-the-whole-disk-if-root.patch new file mode 100644 index 0000000..8236232 --- /dev/null +++ b/0022-iscsi-nbd-do-not-try-to-mount-the-whole-disk-if-root.patch @@ -0,0 +1,61 @@ +From fa9384b1c0414efd33d82a2e083346b35c378f50 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 30 Oct 2013 17:36:54 +0100 +Subject: [PATCH] iscsi/nbd: do not try to mount the whole disk, if root= is + missing + +only mount the whole disk for root=dhcp +--- + modules.d/95iscsi/iscsiroot.sh | 11 ++--------- + modules.d/95nbd/nbdroot.sh | 2 +- + 2 files changed, 3 insertions(+), 10 deletions(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index 5181f52..738fff4 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -40,14 +40,6 @@ modprobe crc32c 2>/dev/null + [ -e /sys/module/bnx2i ] && iscsiuio + + if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then +- if [ -z "$root" -o -n "${root%%block:*}" ]; then +- # if root is not specified try to mount the whole iSCSI LUN +- printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules +- udevadm control --reload +- write_fs_tab /dev/root +- wait_for_dev /dev/root +- fi +- + for p in $(getargs rd.iscsi.param -d iscsi_param); do + iscsi_param="$iscsi_param --param $p" + done +@@ -55,6 +47,7 @@ if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then + iscsistart -b $iscsi_param + echo 'started' > "/tmp/iscsistarted-iscsi" + echo 'started' > "/tmp/iscsistarted-firmware" ++ need_shutdown + exit 0 + fi + +@@ -137,7 +130,7 @@ handle_netroot() + + # FIXME $iscsi_protocol?? + +- if [ -z "$root" -o -n "${root%%block:*}" ]; then ++ if [ "$root" = "dhcp" ]; then + # if root is not specified try to mount the whole iSCSI LUN + printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules + udevadm control --reload +diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh +index 823da0e..2e9d917 100755 +--- a/modules.d/95nbd/nbdroot.sh ++++ b/modules.d/95nbd/nbdroot.sh +@@ -97,7 +97,7 @@ done + + # If we didn't get a root= on the command line, then we need to + # add the udev rules for mounting the nbd0 device +-if [ -z "$root" -o -n "${root%%block:*}" -o "$root" = "block:/dev/root" ]; then ++if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then + printf 'KERNEL=="nbd0", ENV{DEVTYPE}!="partition", ENV{ID_FS_TYPE}=="?*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-nbd-root.rules + udevadm control --reload + type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh diff --git a/0023-dracut.spec-move-sbin-dracut-to-usr-sbin-dracut.patch b/0023-dracut.spec-move-sbin-dracut-to-usr-sbin-dracut.patch new file mode 100644 index 0000000..e6ff8c7 --- /dev/null +++ b/0023-dracut.spec-move-sbin-dracut-to-usr-sbin-dracut.patch @@ -0,0 +1,33 @@ +From 06d418abd1a78c79ca11ce597d7dcfdb0091c96e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 21 Oct 2013 09:43:04 +0200 +Subject: [PATCH] dracut.spec: move /sbin/dracut to /usr/sbin/dracut + +--- + dracut.spec | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index 3ec0ec0..44171d8 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -274,8 +274,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %endif + + # create compat symlink +-mkdir -p $RPM_BUILD_ROOT/sbin +-ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut ++mkdir -p $RPM_BUILD_ROOT%{_sbindir} ++ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut + + %clean + rm -rf -- $RPM_BUILD_ROOT +@@ -285,7 +285,7 @@ rm -rf -- $RPM_BUILD_ROOT + %doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg + %{_bindir}/dracut + # compat symlink +-/sbin/dracut ++%{_sbindir}/dracut + %{_datadir}/bash-completion/completions/dracut + %{_datadir}/bash-completion/completions/lsinitrd + %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 diff --git a/dracut.spec b/dracut.spec index da5ae8c..15c792b 100644 --- a/dracut.spec +++ b/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 034 -Release: 19.git20131021%{?dist} +Release: 24.git20131030%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -47,6 +47,11 @@ Patch15: 0015-mkdir-basic-dirs-in-run.patch Patch16: 0016-dracut-functions.sh-check_block_and_slaves-skip-LVM-.patch Patch17: 0017-kernel-modules-ARM-add-mmc_block-usb_storage-to-stat.patch Patch18: 0018-lvm-always-install-thin-utils-for-lvm.patch +Patch19: 0019-usrmount-module-setup.sh-fixed-typo.patch +Patch20: 0020-Handle-crypto-modules-with-and-without-modaliases.patch +Patch21: 0021-fips-include-crct10dif_generic.patch +Patch22: 0022-iscsi-nbd-do-not-try-to-mount-the-whole-disk-if-root.patch +Patch23: 0023-dracut.spec-move-sbin-dracut-to-usr-sbin-dracut.patch BuildRequires: bash git @@ -293,8 +298,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %endif # create compat symlink -mkdir -p $RPM_BUILD_ROOT/sbin -ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut +mkdir -p $RPM_BUILD_ROOT%{_sbindir} +ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut %clean rm -rf -- $RPM_BUILD_ROOT @@ -304,7 +309,7 @@ rm -rf -- $RPM_BUILD_ROOT %doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg %{_bindir}/dracut # compat symlink -/sbin/dracut +%{_sbindir}/dracut %{_datadir}/bash-completion/completions/dracut %{_datadir}/bash-completion/completions/lsinitrd %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 @@ -467,6 +472,12 @@ rm -rf -- $RPM_BUILD_ROOT %endif %changelog +* Wed Oct 30 2013 Harald Hoyer 034-24.git20131030 +- fixed booting with rd.iscsi.firmware and without root= +- fips: include crct10dif_generic +- fixed missing modules in hostonly, which have no modalias +- moved dracut to /usr/sbin + * Mon Oct 21 2013 Harald Hoyer 034-19.git20131021 - Fixed LVM with thin provisioning Resolves: rhbz#1013767