dracut/0058-dracut-add-warning-when-including-unsupported-module.patch

126 lines
4.7 KiB
Diff
Raw Normal View History

Accepting request 237520 from home:hreinecke:branches:Base:System - 40network: always start netroot in ifup.sh (bnc#881235) * Add: 0066-40network-always-start-netroot-in-ifup.sh.patch - 95fcoe: check() always returns 255 * Add: 0067-95fcoe-check-always-returns-255.patch - 95fcoe-uefi: Test for EFI firmware (bnc#882412) * Add: 0068-95fcoe-uefi-Test-for-EFI-firmware.patch - Rename patches to match git repository: * Old: more-fips-adjustments.patch * New: 0057-01fips-Include-some-more-hmacs.patch * Old: dracut-check-supported.patch * New: 0058-dracut-add-warning-when-including-unsupported-module.patch - Add 99suse module to git repository: * Remove: parse-suse-initrd.sh * Remove: module-setup-initrd.sh * Add: 0059-99suse-Add-SUSE-specific-initrd-parsing.patch - Add write-ifcfg-suse.sh to git repository: * Remove: write-ifcfg-suse.sh * Add: 0060-45ifcfg-Add-SUSE-specific-write-ifcfg-file.patch - Fixup error messages in write-ifcfg-suse.sh (bnc#881286) * Add: 0061-45ifcfg-Fixup-error-message-in-write-ifcfg-suse.patch - Add missing 'libgcc_s.so' library (bnc#881692): * Add: 0062-95iscsi-Install-libgcc_s-library.patch * Add: 0063-90multipath-Install-libgcc_s-library.patch - Install missing scsi_dh_alua module (bnc#871617) * Add: 0064-90kernel-modules-install-scsi_dh_alua.patch - 95iscsi: fixup bnx2i offload booting (bnc#855747) * Add: 0065-95iscsi-Fixup-bnx2i-offload-booting.patch Add: more-fips-adjustments.patch OBS-URL: https://build.opensuse.org/request/show/237520 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=160
2014-06-17 09:43:08 +02:00
From 5473e4b5d8d9bbf9bd995dff815647de0ed1b30b Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <jeffm@suse.com>
Accepting request 237520 from home:hreinecke:branches:Base:System - 40network: always start netroot in ifup.sh (bnc#881235) * Add: 0066-40network-always-start-netroot-in-ifup.sh.patch - 95fcoe: check() always returns 255 * Add: 0067-95fcoe-check-always-returns-255.patch - 95fcoe-uefi: Test for EFI firmware (bnc#882412) * Add: 0068-95fcoe-uefi-Test-for-EFI-firmware.patch - Rename patches to match git repository: * Old: more-fips-adjustments.patch * New: 0057-01fips-Include-some-more-hmacs.patch * Old: dracut-check-supported.patch * New: 0058-dracut-add-warning-when-including-unsupported-module.patch - Add 99suse module to git repository: * Remove: parse-suse-initrd.sh * Remove: module-setup-initrd.sh * Add: 0059-99suse-Add-SUSE-specific-initrd-parsing.patch - Add write-ifcfg-suse.sh to git repository: * Remove: write-ifcfg-suse.sh * Add: 0060-45ifcfg-Add-SUSE-specific-write-ifcfg-file.patch - Fixup error messages in write-ifcfg-suse.sh (bnc#881286) * Add: 0061-45ifcfg-Fixup-error-message-in-write-ifcfg-suse.patch - Add missing 'libgcc_s.so' library (bnc#881692): * Add: 0062-95iscsi-Install-libgcc_s-library.patch * Add: 0063-90multipath-Install-libgcc_s-library.patch - Install missing scsi_dh_alua module (bnc#871617) * Add: 0064-90kernel-modules-install-scsi_dh_alua.patch - 95iscsi: fixup bnx2i offload booting (bnc#855747) * Add: 0065-95iscsi-Fixup-bnx2i-offload-booting.patch Add: more-fips-adjustments.patch OBS-URL: https://build.opensuse.org/request/show/237520 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=160
2014-06-17 09:43:08 +02:00
Date: Thu, 12 Jun 2014 09:30:01 +0200
Subject: dracut: add warning when including unsupported modules
With self-built kernels (often used for debugging by both internal and
external development), it's a common mistake to not set up
Module.supported properly. As a result, modules can end up without the
supported tag. "make install" will happily build an initramfs, via
dracut, that will not boot due to the kernel refusing to load the
unsupported modules.
This patch adds a --check-supported option to check whether all modules
added to the initramfs are marked supported and warn if they are not.
It will not cause the initramfs creation to fail.
The option is intended to be called via /sbin/installkernel, which will
check to see if the kernel has CONFIG_SUSE_KERNEL_SUPPORTED before using
the option.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
Accepting request 237520 from home:hreinecke:branches:Base:System - 40network: always start netroot in ifup.sh (bnc#881235) * Add: 0066-40network-always-start-netroot-in-ifup.sh.patch - 95fcoe: check() always returns 255 * Add: 0067-95fcoe-check-always-returns-255.patch - 95fcoe-uefi: Test for EFI firmware (bnc#882412) * Add: 0068-95fcoe-uefi-Test-for-EFI-firmware.patch - Rename patches to match git repository: * Old: more-fips-adjustments.patch * New: 0057-01fips-Include-some-more-hmacs.patch * Old: dracut-check-supported.patch * New: 0058-dracut-add-warning-when-including-unsupported-module.patch - Add 99suse module to git repository: * Remove: parse-suse-initrd.sh * Remove: module-setup-initrd.sh * Add: 0059-99suse-Add-SUSE-specific-initrd-parsing.patch - Add write-ifcfg-suse.sh to git repository: * Remove: write-ifcfg-suse.sh * Add: 0060-45ifcfg-Add-SUSE-specific-write-ifcfg-file.patch - Fixup error messages in write-ifcfg-suse.sh (bnc#881286) * Add: 0061-45ifcfg-Fixup-error-message-in-write-ifcfg-suse.patch - Add missing 'libgcc_s.so' library (bnc#881692): * Add: 0062-95iscsi-Install-libgcc_s-library.patch * Add: 0063-90multipath-Install-libgcc_s-library.patch - Install missing scsi_dh_alua module (bnc#871617) * Add: 0064-90kernel-modules-install-scsi_dh_alua.patch - 95iscsi: fixup bnx2i offload booting (bnc#855747) * Add: 0065-95iscsi-Fixup-bnx2i-offload-booting.patch Add: more-fips-adjustments.patch OBS-URL: https://build.opensuse.org/request/show/237520 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=160
2014-06-17 09:43:08 +02:00
dracut-functions.sh | 21 +++++++++++++++++++++
dracut.8.asc | 11 +++++++++++
dracut.sh | 5 +++++
3 files changed, 37 insertions(+)
Index: dracut-041/dracut-functions.sh
===================================================================
--- dracut-041.orig/dracut-functions.sh 2015-03-17 13:03:05.977340283 +0100
+++ dracut-041/dracut-functions.sh 2015-03-17 13:04:36.570421062 +0100
@@ -1436,6 +1436,17 @@
done
}
+check_supported_kmod() {
+ kmod=$1
+ supported=$(modinfo -k $kernel -F supported $kmod 2>/dev/null)
+ case "$supported" in
+ yes|external) ;;
+ *) dwarn "Module \"$(basename $kmod)\" is unsupported. This may cause" \
+ "problems while booting." ;;
+ esac
+}
+
+
# Install a single kernel module along with any firmware it may require.
# $1 = full path to kernel module to install
install_kmod_with_fw() {
@@ -1498,6 +1509,10 @@
fi
fi
done
+
+ if [[ "$check_supported" = "yes" ]]; then
+ check_supported_kmod $1
+ fi
return 0
}
@@ -1544,6 +1559,12 @@
inst_simple "$_modpath" "/lib/modules/$kernel/${_destpath}" || exit $?
done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
fi
+
+ if [[ $check_supported ]]; then
+ while read _modpath; do
+ check_supported_kmod $_modpath
+ done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
+ fi
) &
_pid=$(jobs -p | while read a ; do printf ":$a";done)
_pid=${_pid##*:}
Index: dracut-041/dracut.8.asc
===================================================================
--- dracut-041.orig/dracut.8.asc 2015-03-17 13:03:05.985340731 +0100
+++ dracut-041/dracut.8.asc 2015-03-17 13:04:36.574421286 +0100
@@ -465,6 +465,17 @@
**--loginstall _<DIR>_::
Log all files installed from the host to _<DIR>_.
Accepting request 237520 from home:hreinecke:branches:Base:System - 40network: always start netroot in ifup.sh (bnc#881235) * Add: 0066-40network-always-start-netroot-in-ifup.sh.patch - 95fcoe: check() always returns 255 * Add: 0067-95fcoe-check-always-returns-255.patch - 95fcoe-uefi: Test for EFI firmware (bnc#882412) * Add: 0068-95fcoe-uefi-Test-for-EFI-firmware.patch - Rename patches to match git repository: * Old: more-fips-adjustments.patch * New: 0057-01fips-Include-some-more-hmacs.patch * Old: dracut-check-supported.patch * New: 0058-dracut-add-warning-when-including-unsupported-module.patch - Add 99suse module to git repository: * Remove: parse-suse-initrd.sh * Remove: module-setup-initrd.sh * Add: 0059-99suse-Add-SUSE-specific-initrd-parsing.patch - Add write-ifcfg-suse.sh to git repository: * Remove: write-ifcfg-suse.sh * Add: 0060-45ifcfg-Add-SUSE-specific-write-ifcfg-file.patch - Fixup error messages in write-ifcfg-suse.sh (bnc#881286) * Add: 0061-45ifcfg-Fixup-error-message-in-write-ifcfg-suse.patch - Add missing 'libgcc_s.so' library (bnc#881692): * Add: 0062-95iscsi-Install-libgcc_s-library.patch * Add: 0063-90multipath-Install-libgcc_s-library.patch - Install missing scsi_dh_alua module (bnc#871617) * Add: 0064-90kernel-modules-install-scsi_dh_alua.patch - 95iscsi: fixup bnx2i offload booting (bnc#855747) * Add: 0065-95iscsi-Fixup-bnx2i-offload-booting.patch Add: more-fips-adjustments.patch OBS-URL: https://build.opensuse.org/request/show/237520 OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=160
2014-06-17 09:43:08 +02:00
+**--check-supported**::
+ The kernel may be configured to check whether a module is
+ supported by the vendor before allowing it to be loaded. On these
+ systems, it's possible to generate an initramfs image that will
+ fail to boot due to unsupported modules being refused. This
+ option enables a check that will issue a warning if a module built
+ without the support option enabled is encountered while building
+ the image. Use of this option assumes that the kernel requires
+ supported modules and will issue a warning on every module if used
+ otherwise.
+
FILES
-----
_/var/log/dracut.log_::
Index: dracut-041/dracut.sh
===================================================================
--- dracut-041.orig/dracut.sh 2015-03-17 13:04:36.578421510 +0100
+++ dracut-041/dracut.sh 2015-03-17 13:05:51.022596862 +0100
@@ -193,6 +193,9 @@
--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)
+ --check-supported Check to ensure that modules are marked supported when
+ using a kernel that is configured to check the
+ support status of a module before loading.
--reproducible Create reproducible images
--loginstall [DIR] Log all files installed from the host to [DIR]
@@ -387,6 +390,7 @@
--long noimageifnotneeded \
--long early-microcode \
--long no-early-microcode \
+ --long check-supported \
--long reproducible \
--long loginstall: \
-- "$@")
@@ -576,6 +580,7 @@
--printsize) printsize="yes";;
--regenerate-all) regenerate_all="yes";;
--noimageifnotneeded) noimageifnotneeded="yes";;
+ --check-supported) check_supported="yes" ;;
--reproducible) reproducible_l="yes";;
--) shift; break;;