From 0903d0a843ac7854010a894da7327eeb11dbc098 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 04:59:44 +0000 Subject: import dracut-033-554.el7 --- diff --git a/SOURCES/0001-dracut.sh-workaround-broken-read-from-proc-modules.patch b/SOURCES/0001-dracut.sh-workaround-broken-read-from-proc-modules.patch deleted file mode 100644 index 99f25ba..0000000 --- a/SOURCES/0001-dracut.sh-workaround-broken-read-from-proc-modules.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 14af2ab39994576bda1d2a6b9c7980f08473e784 Mon Sep 17 00:00:00 2001 -From: Lukas Nykryn -Date: Mon, 11 Jun 2018 11:07:59 +0200 -Subject: [PATCH] dracut.sh: workaround broken read from /proc/modules - -RHEL-only (upstream is using libkmod) -Resolves: #1578222 ---- - dracut.sh | 21 +++++++++++++++++---- - 1 file changed, 17 insertions(+), 4 deletions(-) - -diff --git a/dracut.sh b/dracut.sh -index 873274c..9dadece 100755 ---- a/dracut.sh -+++ b/dracut.sh -@@ -1145,10 +1145,23 @@ if [[ $hostonly ]]; then - - # check /proc/modules - declare -A host_modules -- while read m rest; do -- [ -z "$m" ] && continue -- host_modules["$m"]=1 -- done +Date: Mon, 11 Jun 2018 11:07:59 +0200 +Subject: [PATCH] dracut.sh: workaround broken read from /proc/modules + +RHEL-only (upstream is using libkmod) +Resolves: #1578222 +--- + dracut.sh | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 873274c0..9dadece0 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1145,10 +1145,23 @@ if [[ $hostonly ]]; then + + # check /proc/modules + declare -A host_modules +- while read m rest; do +- [ -z "$m" ] && continue +- host_modules["$m"]=1 +- done +Date: Mon, 11 Jun 2018 12:30:07 +0200 +Subject: [PATCH] net-lib: bump carrier timeout to 15 + +df95b10 caused that dracut now waits only 5 seconds for carrier. +Let's bump this in downstream to avoid regressions in minor versions. + +RHEL-only +Resolves: #1401811 +--- + modules.d/40network/net-lib.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 9083aea7..23f2f9ff 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -706,7 +706,7 @@ iface_has_carrier() { + interface="/sys/class/net/$interface" + [ -d "$interface" ] || return 2 + local timeout="$(getargs rd.net.timeout.carrier=)" +- timeout=${timeout:-5} ++ timeout=${timeout:-15} + timeout=$(($timeout*10)) + + linkup "$1" diff --git a/SOURCES/0537-dracut-function.sh-check_block_and_slaves-check-for-.patch b/SOURCES/0537-dracut-function.sh-check_block_and_slaves-check-for-.patch new file mode 100644 index 0000000..6926160 --- /dev/null +++ b/SOURCES/0537-dracut-function.sh-check_block_and_slaves-check-for-.patch @@ -0,0 +1,58 @@ +From dd235965dd7b5de9dd87e5e5a4244005c5fb21e2 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 19 Feb 2018 09:03:02 +0100 +Subject: [PATCH] dracut-function.sh:check_block_and_slaves() check for block + devices + +Some nvme have char parents, so check if the "slave" is a block dev. + +Fixes https://github.com/dracutdevs/dracut/issues/373 + +Cherry-picked from: e64dafd1f2489f1d926cce3e3bfd33f62b29b192 +Resolves: #1549498 +--- + dracut-functions.sh | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 98a4b88b..ca54bd7f 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -616,13 +616,14 @@ check_block_and_slaves() { + [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. + if ! lvm_internal_dev $2; then "$1" $2 && return; fi + check_vol_slaves "$@" && return 0 +- if [[ -f /sys/dev/block/$2/../dev ]]; then ++ if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then + check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0 + fi + [[ -d /sys/dev/block/$2/slaves ]] || return 1 +- for _x in /sys/dev/block/$2/slaves/*/dev; do +- [[ -f $_x ]] || continue +- check_block_and_slaves $1 $(<"$_x") && return 0 ++ for _x in /sys/dev/block/$2/slaves/*; do ++ [[ -f $_x/dev ]] || continue ++ [[ $_x/subsystem -ef /sys/class/block ]] || continue ++ check_block_and_slaves $1 $(<"$_x/dev") && return 0 + done + return 1 + } +@@ -634,13 +635,14 @@ check_block_and_slaves_all() { + _ret=0 + fi + check_vol_slaves_all "$@" && return 0 +- if [[ -f /sys/dev/block/$2/../dev ]]; then ++ if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then + check_block_and_slaves_all $1 $(<"/sys/dev/block/$2/../dev") && _ret=0 + fi + [[ -d /sys/dev/block/$2/slaves ]] || return 1 +- for _x in /sys/dev/block/$2/slaves/*/dev; do +- [[ -f $_x ]] || continue +- check_block_and_slaves_all $1 $(<"$_x") && _ret=0 ++ for _x in /sys/dev/block/$2/slaves/*; do ++ [[ -f $_x/dev ]] || continue ++ [[ $_x/subsystem -ef /sys/class/block ]] || continue ++ check_block_and_slaves_all $1 $(<"$_x/dev") && _ret=0 + done + return $_ret + } diff --git a/SOURCES/0538-dracut-functions.sh-check_vol_slaves-speedup-LV-VG-n.patch b/SOURCES/0538-dracut-functions.sh-check_vol_slaves-speedup-LV-VG-n.patch new file mode 100644 index 0000000..f41ebd8 --- /dev/null +++ b/SOURCES/0538-dracut-functions.sh-check_vol_slaves-speedup-LV-VG-n.patch @@ -0,0 +1,94 @@ +From 15384bcedb8002440e1327e97cd9c139af8a32dd Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 15 Jan 2018 15:44:46 +0100 +Subject: [PATCH] dracut-functions.sh:check_vol_slaves() speedup LV -> VG name + +Instead of trying all /dev/mapper/* devices to match the maj:min, and +get the VG name with "lvm lvs", use the dm/name from /sys and dmsetup +splitname. + +This should speedup execution with lots of LVs. + +Cherry-picked from: 9ed6eb741 +Resolves: #1531503 +--- + dracut-functions.sh | 62 +++++++++++++++++++++++++---------------------------- + 1 file changed, 29 insertions(+), 33 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index ca54bd7f..53289ca0 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -687,43 +687,39 @@ for_each_host_dev_and_slaves() + # but you cannot create the logical volume without the volume group. + # And the volume group might be bigger than the devices the LV needs. + check_vol_slaves() { +- local _lv _vg _pv +- for i in /dev/mapper/*; do +- [[ $i == /dev/mapper/control ]] && continue +- _lv=$(get_maj_min $i) +- if [[ $_lv = $2 ]]; then +- _vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) +- # strip space +- _vg="${_vg//[[:space:]]/}" +- if [[ $_vg ]]; then +- for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null) +- do +- check_block_and_slaves $1 $(get_maj_min $_pv) && return 0 +- done +- fi +- fi +- done ++ local _lv _vg _pv _dm _majmin ++ _majmin="$2" ++ _lv="/dev/block/$_majmin" ++ _dm=/sys/dev/block/$_majmin/dm ++ [[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1 ++ _vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") ) ++ # strip space ++ _vg="${_vg//[[:space:]]/}" ++ if [[ $_vg ]]; then ++ for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null) ++ do ++ check_block_and_slaves $1 $(get_maj_min $_pv) && return 0 ++ done ++ fi + return 1 + } + + check_vol_slaves_all() { +- local _lv _vg _pv +- for i in /dev/mapper/*; do +- [[ $i == /dev/mapper/control ]] && continue +- _lv=$(get_maj_min $i) +- if [[ $_lv = $2 ]]; then +- _vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) +- # strip space +- _vg="${_vg//[[:space:]]/}" +- if [[ $_vg ]]; then +- for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null) +- do +- check_block_and_slaves_all $1 $(get_maj_min $_pv) +- done +- return 0 +- fi +- fi +- done ++ local _lv _vg _pv _majmin ++ _majmin="$2" ++ _lv="/dev/block/$_majmin" ++ _dm="/sys/dev/block/$_majmin/dm" ++ [[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1 ++ _vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") ) ++ # strip space ++ _vg="${_vg//[[:space:]]/}" ++ if [[ $_vg ]]; then ++ for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null) ++ do ++ check_block_and_slaves_all $1 $(get_maj_min $_pv) ++ done ++ return 0 ++ fi + return 1 + } + diff --git a/SOURCES/0539-40network-introduce-ip-either6-option.patch b/SOURCES/0539-40network-introduce-ip-either6-option.patch new file mode 100644 index 0000000..5bd8002 --- /dev/null +++ b/SOURCES/0539-40network-introduce-ip-either6-option.patch @@ -0,0 +1,115 @@ +From 26273649dcfbc095c8e9dbc0f65bb02fd90ee510 Mon Sep 17 00:00:00 2001 +From: Pingfan Liu +Date: Tue, 24 Apr 2018 16:41:21 +0800 +Subject: [PATCH] 40network: introduce ip=either6 option + +In kdump, if dump-target is ssh on ipv6, we need to sync until ipv6 addr +is ready. Currently ip=auto6/dhcp6 provides such function. But in 1st kernel, +it is hard to know whether the ipv6 addr is got by dhcpv6 or SLAAC. +E.g ifcfg-eth* contains DHCPV6C=yes direction, but there is no dhcpv6 +server in the network, and then after the system is up, the user +echo 1 > /proc/sys/net/ipv6/conf/eth0/autoconf && accept_ra by manual +to obtain a ipv6 addr. Or vice. +So this patch suggests to make dhcpv6 as auto6 fallback + +Signed-off-by: Pingfan Liu + +Cherry-picked from: 67354ee +Resolves: #1582398 +--- + dracut.cmdline.7.asc | 4 +++- + modules.d/40network/ifup.sh | 6 +++++- + modules.d/40network/net-lib.sh | 4 ++-- + modules.d/40network/parse-ip-opts.sh | 1 + + 4 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index 45902fa9..1204aeb2 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -449,7 +449,7 @@ USB Android phone:: + * enp0s29u1u2 + ===================== + +-**ip=**__{dhcp|on|any|dhcp6|auto6}__:: ++**ip=**__{dhcp|on|any|dhcp6|auto6|either6}__:: + dhcp|on|any::: get ip from dhcp server from all interfaces. If root=dhcp, + loop sequentially through all interfaces (eth0, eth1, ...) and use the first + with a valid DHCP root-path. +@@ -458,6 +458,8 @@ USB Android phone:: + + dhcp6::: IPv6 DHCP + ++ either6::: if auto6 fails, then dhcp6 ++ + **ip=**____:__{dhcp|on|any|dhcp6|auto6}__[:[____][:____]]:: + This parameter can be specified multiple times. + + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 9ed48155..b3631648 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -76,6 +76,7 @@ load_ipv6() { + } + + do_ipv6auto() { ++ local ret + load_ipv6 + echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding + echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra +@@ -84,10 +85,11 @@ do_ipv6auto() { + [ -n "$macaddr" ] && ip link set address $macaddr dev $netif + [ -n "$mtu" ] && ip link set mtu $mtu dev $netif + wait_for_ipv6_auto $netif ++ ret=$? + + [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname + +- return 0 ++ return $ret + } + + # Handle static ip configuration +@@ -393,6 +395,8 @@ for p in $(getargs ip=); do + do_dhcp -6 ;; + auto6) + do_ipv6auto ;; ++ either6) ++ do_ipv6auto || do_dhcp -6 ;; + *) + do_static ;; + esac +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 23f2f9ff..9e87aeab 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -445,7 +445,7 @@ ip_to_var() { + fi + + if [ $# -eq 1 ]; then +- # format: ip={dhcp|on|any|dhcp6|auto6} ++ # format: ip={dhcp|on|any|dhcp6|auto6|either6} + # or + # ip= means anaconda-style static config argument cluster + autoconf="$1" +@@ -472,7 +472,7 @@ ip_to_var() { + return 0 + fi + +- if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" ]; then ++ if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then + # format: ip=:{dhcp|on|any|dhcp6|auto6}[:[][:]] + [ -n "$1" ] && dev="$1" + [ -n "$2" ] && autoconf="$2" +diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh +index 68afe91b..3d1e95a6 100755 +--- a/modules.d/40network/parse-ip-opts.sh ++++ b/modules.d/40network/parse-ip-opts.sh +@@ -78,6 +78,7 @@ for p in $(getargs ip=); do + die "Sorry, automatic calculation of netmask is not yet supported" + ;; + auto6);; ++ either6);; + dhcp|dhcp6|on|any) \ + #[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ + # die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" diff --git a/SOURCES/0540-Fix-loading-of-modules-in-modules-load.d.patch b/SOURCES/0540-Fix-loading-of-modules-in-modules-load.d.patch new file mode 100644 index 0000000..e13fef9 --- /dev/null +++ b/SOURCES/0540-Fix-loading-of-modules-in-modules-load.d.patch @@ -0,0 +1,38 @@ +From 249dcc61ea2cfb5963c7f9565dcee3405e064c7b Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Fri, 3 Feb 2017 16:02:34 +0100 +Subject: [PATCH] Fix loading of modules in modules-load.d + +With hostonly enabled, only modules that are currently +loaded are included in the initrd. Modules which are +explicitly listed in modules-load.d do not need to +be filtered that way. Fix for boo#962224. + +Cherry-picked from: 9fd3e045d +Resolves: #1547730 +--- + modules.d/98systemd/module-setup.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh +index 10beadda..c59cb945 100755 +--- a/modules.d/98systemd/module-setup.sh ++++ b/modules.d/98systemd/module-setup.sh +@@ -166,7 +166,7 @@ install() { + } + + _mods=$(modules_load_get /usr/lib/modules-load.d) +- [[ $_mods ]] && instmods $_mods ++ [[ $_mods ]] && hostonly='' instmods $_mods + + if [[ $hostonly ]]; then + inst_multiple -o \ +@@ -181,7 +181,7 @@ install() { + /etc/sysctl.conf + + _mods=$(modules_load_get /etc/modules-load.d) +- [[ $_mods ]] && instmods $_mods ++ [[ $_mods ]] && hostonly='' instmods $_mods + fi + + if ! [[ -e "$initdir/etc/machine-id" ]]; then diff --git a/SOURCES/0541-Skip-iscsi-attachment-if-no-info.patch b/SOURCES/0541-Skip-iscsi-attachment-if-no-info.patch new file mode 100644 index 0000000..63600a9 --- /dev/null +++ b/SOURCES/0541-Skip-iscsi-attachment-if-no-info.patch @@ -0,0 +1,34 @@ +From 903d6fc2fc8a050caceb6f95363f6cc4572b9fc3 Mon Sep 17 00:00:00 2001 +From: Derek Higgins +Date: Thu, 26 Oct 2017 15:29:42 +0100 +Subject: [PATCH] Skip iscsi attachment if no info + +If no iscsi session information can be retrieved from the firmware +then skip the iscsi attachment and allow the boot process to continue. +Ensure the timeout scripts don't hit their timeout waiting for +/tmp/iscsistarted-firmware to be created. +This will allow a common image to be used for servers with both a +local and iscsi root with rd.iscsi.firmware set. + +Cherry-picked from: 9408a2ac330970e98dc4d289ec3ffb163f0517d1 +Resolves: #1513397 +--- + modules.d/95iscsi/iscsiroot.sh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index 4cf3d355..c93ff068 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -46,8 +46,9 @@ fi + handle_firmware() + { + if ! iscsistart -f; then +- warn "iscistart: Could not get list of targets from firmware." +- return 1 ++ warn "iscistart: Could not get list of targets from firmware. Skipping." ++ echo 'skipped' > "/tmp/iscsistarted-firmware" ++ return 0 + fi + + for p in $(getargs rd.iscsi.param -d iscsi_param); do diff --git a/SOURCES/0542-dracut-Introduce-force-drivers-parameter-and-force_d.patch b/SOURCES/0542-dracut-Introduce-force-drivers-parameter-and-force_d.patch new file mode 100644 index 0000000..f495b67 --- /dev/null +++ b/SOURCES/0542-dracut-Introduce-force-drivers-parameter-and-force_d.patch @@ -0,0 +1,126 @@ +From 125bb747c3fd357b95e9833ae4255a370ba3211c Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Mon, 8 Sep 2014 12:34:48 +0200 +Subject: [PATCH] dracut: Introduce --force-drivers parameter and + force_drivers=+ config option + +Which will not only add listed drivers, but also enforce that they are +tried to be loaded at early boot time. + +This is needed if drivers which are not autoloaded (e.g. loop and a lot +others) shall get loaded via initramfs. + +Cherry-picked from: cea907f6bf2fc97933b59e04f4520ca227251574 +Resolves: #1577626 +--- + dracut.8.asc | 13 +++++++++++++ + dracut.conf.5.asc | 4 ++++ + dracut.sh | 21 +++++++++++++++++++++ + 3 files changed, 38 insertions(+) + +diff --git a/dracut.8.asc b/dracut.8.asc +index e097e769..5af99fa3 100644 +--- a/dracut.8.asc ++++ b/dracut.8.asc +@@ -136,6 +136,19 @@ example: + ---- + =============================== + ++**--force-drivers** __:: ++ See add-drivers above. But in this case it is ensured that the drivers ++ are tried to be loaded early via modprobe. +++ ++[NOTE] ++=============================== ++If [LIST] has multiple arguments, then you have to put these in quotes. For ++example: ++---- ++# dracut --force-drivers "kmodule1 kmodule2" ... ++---- ++=============================== ++ + **--omit-drivers** __:: + specify a space-separated list of kernel modules not to add to the + initramfs. +diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc +index f4ad49d2..90120115 100644 +--- a/dracut.conf.5.asc ++++ b/dracut.conf.5.asc +@@ -54,6 +54,10 @@ Space-separated lists have to have a leading and trailing space! + Specify a space-separated list of kernel modules to add to the initramfs. + The kernel modules have to be specified without the ".ko" suffix. + ++*force_drivers+=*" ____ ":: ++ See add_drivers above. But in this case it is ensured that the drivers ++ are tried to be loaded early via modprobe. ++ + *omit_drivers+=*" ____ ":: + Specify a space-separated list of kernel modules not to add to the + initramfs. The kernel modules have to be specified without the ".ko" suffix. +diff --git a/dracut.sh b/dracut.sh +index 9dadece0..a34ca2a6 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -81,6 +81,10 @@ Creates initial ramdisk images for preloading modules + exclusively include in the initramfs. + --add-drivers [LIST] Specify a space-separated list of kernel + modules to add to the initramfs. ++ --force-drivers [LIST] Specify a space-separated list of kernel ++ modules to add to the initramfs and make sure they ++ are tried to be loaded via modprobe same as passing ++ rd.driver.pre=DRIVER kernel parameter. + --omit-drivers [LIST] Specify a space-separated list of kernel + modules not to add to the initramfs. + --filesystems [LIST] Specify a space-separated list of kernel filesystem +@@ -308,6 +312,7 @@ rearrange_params() + --long add: \ + --long force-add: \ + --long add-drivers: \ ++ --long force-drivers: \ + --long omit-drivers: \ + --long modules: \ + --long omit: \ +@@ -476,6 +481,7 @@ while :; do + -a|--add) push add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; + --force-add) push force_add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; + --add-drivers) push add_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; ++ --force-drivers) push force_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; + --omit-drivers) push omit_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; + -m|--modules) push dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; + -o|--omit) push omit_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;; +@@ -928,6 +934,13 @@ if (( ${#add_drivers_l[@]} )); then + fi + add_drivers=${add_drivers/-/_} + ++if (( ${#force_drivers_l[@]} )); then ++ while pop force_drivers_l val; do ++ force_drivers+=" $val " ++ done ++fi ++force_drivers=${force_drivers/-/_} ++ + if (( ${#omit_drivers_l[@]} )); then + while pop omit_drivers_l val; do + omit_drivers+=" $val " +@@ -944,6 +957,7 @@ fi + omit_drivers_corrected="" + for d in $omit_drivers; do + [[ " $drivers $add_drivers " == *\ $d\ * ]] && continue ++ [[ " $drivers $force_drivers " == *\ $d\ * ]] && continue + omit_drivers_corrected+="$d|" + done + omit_drivers="${omit_drivers_corrected%|}" +@@ -1389,6 +1403,13 @@ if [[ $no_kernel != yes ]]; then + if [[ $add_drivers ]]; then + hostonly='' instmods -c $add_drivers + fi ++ if [[ $force_drivers ]]; then ++ hostonly='' instmods -c $force_drivers ++ rm -f $initdir/etc/cmdline.d/20-force_driver.conf ++ for mod in $force_drivers; do ++ echo "rd.driver.pre=$mod" >>$initdir/etc/cmdline.d/20-force_drivers.conf ++ done ++ fi + if [[ $filesystems ]]; then + hostonly='' instmods -c $filesystems + fi diff --git a/SOURCES/0543-mdraid-mdraid_start.sh-tell-mainloop-if-we-make-prog.patch b/SOURCES/0543-mdraid-mdraid_start.sh-tell-mainloop-if-we-make-prog.patch new file mode 100644 index 0000000..2e27fd8 --- /dev/null +++ b/SOURCES/0543-mdraid-mdraid_start.sh-tell-mainloop-if-we-make-prog.patch @@ -0,0 +1,32 @@ +From f421aa0f16a6afa56b7b27796ee0708385dd933a Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 26 Mar 2015 15:41:46 +1100 +Subject: [PATCH] mdraid/mdraid_start.sh: tell mainloop if we make progress. + +mdraid_start is a number of scripts which run after a timeout. +If it makes progress, it should tell the main loop so that it +knows that it is worth waiting a bit longer. + +So in that case, create the initqueue/work file which the main loop +checks for. + +Signed-off-by: NeilBrown + +Cherry-picked from: 3b82ac16 +Resolves: #1451660 +--- + modules.d/90mdraid/mdraid_start.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh +index fe0e9f40..39998b03 100755 +--- a/modules.d/90mdraid/mdraid_start.sh ++++ b/modules.d/90mdraid/mdraid_start.sh +@@ -29,6 +29,7 @@ _md_force_run() { + + _path_d="${_path_s%/*}/degraded" + [ ! -r "$_path_d" ] && continue ++ > $hookdir/initqueue/work + done + } + diff --git a/SOURCES/0544-mdraid-wait-for-rd.md.uuid-specified-devices-to-be-a.patch b/SOURCES/0544-mdraid-wait-for-rd.md.uuid-specified-devices-to-be-a.patch new file mode 100644 index 0000000..61e84e0 --- /dev/null +++ b/SOURCES/0544-mdraid-wait-for-rd.md.uuid-specified-devices-to-be-a.patch @@ -0,0 +1,128 @@ +From c9e0ee2c91de55a51d2afc6b0032f39f1f7f2ea8 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 16 May 2017 11:31:26 +0200 +Subject: [PATCH] mdraid: wait for rd.md.uuid specified devices to be assembled + +This patch uses wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}" for the +specified uuids. + +On timeout only md devices are force started which are specified by +uuid, or all, if rd.auto was specified. + +Fixes https://github.com/dracutdevs/dracut/issues/227 + +Cherry-picked from: 3cea0658 +Resolves: #1451660 +--- + modules.d/90mdraid/mdraid_start.sh | 74 +++++++++++++++++++++++++++----------- + modules.d/90mdraid/parse-md.sh | 3 ++ + 2 files changed, 57 insertions(+), 20 deletions(-) + +diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh +index 39998b03..5ebf09f4 100755 +--- a/modules.d/90mdraid/mdraid_start.sh ++++ b/modules.d/90mdraid/mdraid_start.sh +@@ -2,35 +2,69 @@ + # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + # ex: ts=8 sw=4 sts=4 et filetype=sh + +-type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh +-_md_force_run() { ++type getargs >/dev/null 2>&1 || . /lib/dracut-lib.sh ++ ++_md_start() { + local _udevinfo + local _path_s + local _path_d ++ local _md="$1" ++ local _offroot="$2" ++ ++ _udevinfo="$(udevadm info --query=env --name="${_md}")" ++ strstr "$_udevinfo" "MD_LEVEL=container" && continue ++ strstr "$_udevinfo" "DEVTYPE=partition" && continue ++ ++ _path_s="/sys/$(udevadm info -q path -n "${_md}")/md/array_state" ++ [ ! -r "$_path_s" ] && continue ++ ++ # inactive ? ++ [ "$(cat "$_path_s")" != "inactive" ] && continue ++ ++ mdadm $_offroot -R "${_md}" 2>&1 | vinfo ++ ++ # still inactive ? ++ [ "$(cat "$_path_s")" = "inactive" ] && continue ++ ++ _path_d="${_path_s%/*}/degraded" ++ [ ! -r "$_path_d" ] && continue ++ > $hookdir/initqueue/work ++} ++ ++_md_force_run() { + local _offroot +- _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot) +- # try to force-run anything not running yet +- for md in /dev/md[0-9_]*; do +- [ -b "$md" ] || continue +- _udevinfo="$(udevadm info --query=env --name="$md")" +- strstr "$_udevinfo" "MD_LEVEL=container" && continue +- strstr "$_udevinfo" "DEVTYPE=partition" && continue ++ local _md ++ local _UUID ++ local _MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=) ++ [ -n "$_MD_UUID" ] || getargbool 0 rd.auto || return + +- _path_s="/sys/$(udevadm info -q path -n "$md")/md/array_state" +- [ ! -r "$_path_s" ] && continue ++ _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot) + +- # inactive ? +- [ "$(cat "$_path_s")" != "inactive" ] && continue ++ if [ -n "$_MD_UUID" ]; then ++ for _md in /dev/md[0-9_]*; do ++ [ -b "$_md" ] || continue ++ _UUID=$( ++ /sbin/mdadm -D --export "$_md" \ ++ | while read line || [ -n "$line" ]; do ++ str_starts "$line" "MD_UUID=" || continue ++ printf "%s" "${line#MD_UUID=}" ++ done ++ ) + +- mdadm $_offroot -R "$md" 2>&1 | vinfo ++ [ -z "$_UUID" ] && continue + +- # still inactive ? +- [ "$(cat "$_path_s")" = "inactive" ] && continue ++ # check if we should handle this device ++ strstr " $_MD_UUID " " $_UUID " || continue + +- _path_d="${_path_s%/*}/degraded" +- [ ! -r "$_path_d" ] && continue +- > $hookdir/initqueue/work +- done ++ _md_start "${_md}" "${_offroot}" ++ done ++ else ++ # try to force-run anything not running yet ++ for _md in /dev/md[0-9_]*; do ++ [ -b "$_md" ] || continue ++ _md_start "${_md}" "${_offroot}" ++ done ++ fi + } + + _md_force_run +diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh +index dd7bda25..ae76bac1 100755 +--- a/modules.d/90mdraid/parse-md.sh ++++ b/modules.d/90mdraid/parse-md.sh +@@ -26,6 +26,9 @@ else + done < "${f}" > "${f}.new" + mv "${f}.new" "$f" + done ++ for uuid in $MD_UUID; do ++ wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}" ++ done + fi + fi + diff --git a/SOURCES/0545-fcoe-handle-CNAs-with-DCB-firmware-support.patch b/SOURCES/0545-fcoe-handle-CNAs-with-DCB-firmware-support.patch new file mode 100644 index 0000000..a87dd23 --- /dev/null +++ b/SOURCES/0545-fcoe-handle-CNAs-with-DCB-firmware-support.patch @@ -0,0 +1,72 @@ +From f055e5126f7d28553c3886a865e5f13fdc4c18d2 Mon Sep 17 00:00:00 2001 +From: Xunlei Pang +Date: Mon, 25 Sep 2017 11:18:06 +0800 +Subject: [PATCH] fcoe: handle CNAs with DCB firmware support + +Some Combined Network Adapters(CNAs) implement DCB protocol +in firmware, it is recommended that do not run software-based +DCB or LLDP on CNAs that implement DCB, but we have to start +the lldpad service anyway(there might be other software DCB). + +If the network interface provides hardware DCB/DCBX capabilities, +the field DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to +be set to "no". + +We met an issue on "QLogic BCM57810" with DCB firmware support, +and found dracut still generated "fcoe=:dcb" which caused +kdump boot failure when using that fcoe dump target. + +This patch parses /etc/fcoe/cfg-xxx to detect DCB_REQUIRED="no", +and force "nodcb" if it is the case. + +Also improved some coding style in passing. + +Signed-off-by: Xunlei Pang + +Cherry-picked from: 795256bbb +Resolves: #1442663 +--- + modules.d/95fcoe/module-setup.sh | 26 ++++++++++++++++++++------ + 1 file changed, 20 insertions(+), 6 deletions(-) + +diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh +index 4bab0c7d..ac27c76a 100755 +--- a/modules.d/95fcoe/module-setup.sh ++++ b/modules.d/95fcoe/module-setup.sh +@@ -51,16 +51,30 @@ cmdline() { + read mac < ${i}/address + s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p') + if [ -z "$s" ] ; then +- p=$(get_vlan_parent ${i}) +- if [ "$p" ] ; then +- s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p') +- fi ++ p=$(get_vlan_parent ${i}) ++ if [ "$p" ] ; then ++ s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p') ++ fi + fi + if [ "$s" = "on" ] ; then +- dcb="dcb" ++ dcb="dcb" + else +- dcb="nodcb" ++ dcb="nodcb" + fi ++ ++ # Some Combined Network Adapters(CNAs) implement DCB in firmware. ++ # Do not run software-based DCB or LLDP on CNAs that implement DCB. ++ # If the network interface provides hardware DCB/DCBX capabilities, ++ # DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to set to "no". ++ # ++ # Force "nodcb" if there's any DCB_REQUIRED="no"(child or vlan parent). ++ grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${i##*/} &>/dev/null ++ [ $? -eq 0 ] && dcb="nodcb" ++ if [ "$p" ] ; then ++ grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${p} &>/dev/null ++ [ $? -eq 0 ] && dcb="nodcb" ++ fi ++ + echo "fcoe=${mac}:${dcb}" + done + } diff --git a/SOURCES/0546-40network-dhclient.conf-rename-classless-routes-to-c.patch b/SOURCES/0546-40network-dhclient.conf-rename-classless-routes-to-c.patch new file mode 100644 index 0000000..364f1eb --- /dev/null +++ b/SOURCES/0546-40network-dhclient.conf-rename-classless-routes-to-c.patch @@ -0,0 +1,32 @@ +From 013030d9471fca3f99d358e8bc3cb7a418f9735b Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 13 Jul 2017 16:46:19 +0200 +Subject: [PATCH] 40network/dhclient.conf: rename classless-routes to + classless-static-routes + +We tell dhclient to name 121 option "classless-routes", +but in dhclient-script we parse classless_static_routes. +So either have to change the configuration or the script. + +And since dhclient uses by default classless_static_routes, +let's change the configuration + +Cherry-picked from: 62b7920ed +Resolves: #1453907 +--- + modules.d/40network/dhclient.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/40network/dhclient.conf b/modules.d/40network/dhclient.conf +index a1739ce3..49266db0 100644 +--- a/modules.d/40network/dhclient.conf ++++ b/modules.d/40network/dhclient.conf +@@ -1,6 +1,6 @@ + +-option classless-routes code 121 = array of unsigned integer 8; ++option classless-static-routes code 121 = array of unsigned integer 8; + + request subnet-mask, broadcast-address, time-offset, routers, + domain-name, domain-name-servers, domain-search, host-name, +- root-path, interface-mtu, classless-routes; ++ root-path, interface-mtu, classless-static-routes; diff --git a/SOURCES/0547-Record-loaded-kernel-modules-when-hostonly-mode-is-e.patch b/SOURCES/0547-Record-loaded-kernel-modules-when-hostonly-mode-is-e.patch new file mode 100644 index 0000000..78d3cba --- /dev/null +++ b/SOURCES/0547-Record-loaded-kernel-modules-when-hostonly-mode-is-e.patch @@ -0,0 +1,66 @@ +From 8df75b15736b2feaea05fd45d3b4819775226ee5 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Tue, 17 Jul 2018 17:16:07 +0800 +Subject: [PATCH] Record loaded kernel modules when hostonly mode is enabled + +A hostonly image will not include every possibly required kernel module, +so if any hardware or configuration changed, the image may fail to boot. + +One way to know if there are any hardware change or configuration change +that will require an image rebuild or not is to check the loaded kernel +module list. If the loaded kernel module list differs from last build +time, then the image may require to be rebuilt. + +This commit will let dracut record the loaded kernel module list when +the image is being built, so other tools or services can compare this +list with currently loaded kernel modules to decide if dracut should be +called to rebuild the image. + +To retrieve the loaded kernel modules list when an image is built, use +lsinitrd command: + +lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt + +Cherry-picked from: 7047294617bbdd3ffb2466c73db56fda4e6156db +Resolves: #1607744 +--- + dracut-functions.sh | 11 +++++++++++ + dracut.sh | 3 +++ + 2 files changed, 14 insertions(+) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 53289ca0..b7568bd9 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1748,6 +1748,17 @@ get_ucode_file () + fi + } + ++# Get currently loaded modules ++# sorted, and delimited by newline ++get_loaded_kernel_modules () ++{ ++ local modules=( ) ++ while read _module _size _used _used_by; do ++ modules+=( "$_module" ) ++ done <<< $(lsmod | sed -n '1!p') ++ printf '%s\n' "${modules[@]}" | sort ++} ++ + # 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() { +diff --git a/dracut.sh b/dracut.sh +index a34ca2a6..245b4c49 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1395,6 +1395,9 @@ dinfo "*** Including modules done ***" + + ## final stuff that has to happen + if [[ $no_kernel != yes ]]; then ++ if [[ $hostonly ]]; then ++ echo "$(get_loaded_kernel_modules)" > $initdir/lib/dracut/loaded-kernel-modules.txt ++ fi + + if [[ $drivers ]]; then + hostonly='' instmods $drivers diff --git a/SOURCES/0548-Correct-paths-for-openSUSE.patch b/SOURCES/0548-Correct-paths-for-openSUSE.patch new file mode 100644 index 0000000..7887303 --- /dev/null +++ b/SOURCES/0548-Correct-paths-for-openSUSE.patch @@ -0,0 +1,31 @@ +From 5f381a151fa210d31d8b6f71f83f1405f876c0aa Mon Sep 17 00:00:00 2001 +From: Christian Rodrigues +Date: Mon, 23 Mar 2015 17:12:15 +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 +Signed-off-by: Thomas Renninger + +Cherry-picked from: b52cfbea +Resolves: #1608491 +--- + dracut.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index 245b4c49..4f324439 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -809,7 +809,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/SOURCES/0549-Introduce-tri-state-hostonly-mode.patch b/SOURCES/0549-Introduce-tri-state-hostonly-mode.patch new file mode 100644 index 0000000..fa07e49 --- /dev/null +++ b/SOURCES/0549-Introduce-tri-state-hostonly-mode.patch @@ -0,0 +1,125 @@ +From ecd196732f36064aad675e18bf77b2b678673d63 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Wed, 4 Jul 2018 17:21:37 +0800 +Subject: [PATCH] Introduce tri-state hostonly mode + +Add a new option --hostonly-mode which accept an parameter, so we have a tri-state hostonly mode: + + * generic: by passing "--no-hostonly" or not passing anything. + "--hostonly-mode" has no effect in such case. + * sloppy: by passing "--hostonly --hostonly-mode sloppy". This + is also the default mode when only "--hostonly" is given. + * strict: by passing "--hostonly --hostonly-mode strict". + +Sloppy mode is the original hostonly mode, the new introduced strict +mode will allow modules to ignore more drivers or do some extra job to +save memory and disk space, while making the image less portable. + +Also introduced a helper function "optional_hostonly" to make it +easier for modules to leverage new hostonly mode. + +To force install modules only in sloppy hostonly mode, use the form: + +hostonly="$(optional_hostonly)" instmods + +Signed-off-by: Kairui Song + +Cherry-picked from: a695250ec7db21359689e50733c6581a8d211215 +Resolves: #1599592 +--- + dracut-functions.sh | 11 +++++++++++ + dracut.sh | 34 ++++++++++++++++++++++++++++++++++ + 2 files changed, 45 insertions(+) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index b7568bd9..4387168a 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1770,3 +1770,14 @@ lvm_internal_dev() { + [[ ${DM_LV_LAYER} ]] || [[ ! -L /dev/${DM_VG_NAME}/${DM_LV_NAME} ]] + } + ++# Use with form hostonly="$(optional_hostonly)" inst_xxxx ++# If hosotnly mode is set to "strict", hostonly restrictions will still ++# be applied, else will ignore hostonly mode and try to install all ++# given modules. ++optional_hostonly() { ++ if [[ $hostonly_mode = "strict" ]]; then ++ printf -- "$hostonly" ++ else ++ printf "" ++ fi ++} +diff --git a/dracut.sh b/dracut.sh +index 4f324439..52835872 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -141,6 +141,21 @@ Creates initial ramdisk images for preloading modules + -H, --hostonly Host-Only mode: Install only what is needed for + booting the local host instead of a generic host. + -N, --no-hostonly Disables Host-Only mode ++ --hostonly-mode ++ Specify the hostonly mode to use. could be ++ one of "sloppy" or "strict". "sloppy" mode is used ++ by default. ++ In "sloppy" hostonly mode, extra drivers and modules ++ will be installed, so minor hardware change won't make ++ the image unbootable (eg. changed keyboard), and the ++ image is still portable among similar hosts. ++ With "strict" mode enabled, anything not necessary ++ for booting the local host in its current state will ++ not be included, and modules may do some extra job ++ to save more space. Minor change of hardware or ++ environment could make the image unbootable. ++ DO NOT use "strict" mode unless you know what you ++ are doing. + --hostonly-cmdline Store kernel command line arguments needed + in the initramfs + --no-hostonly-cmdline Do not store kernel command line arguments needed +@@ -364,6 +379,7 @@ rearrange_params() + --long host-only \ + --long no-hostonly \ + --long no-host-only \ ++ --long hostonly-mode: \ + --long hostonly-cmdline \ + --long no-hostonly-cmdline \ + --long no-hostonly-default-device \ +@@ -548,6 +564,8 @@ while :; do + hostonly_l="yes" ;; + -N|--no-hostonly|--no-host-only) + hostonly_l="no" ;; ++ --hostonly-mode) ++ hostonly_mode_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;; + --hostonly-cmdline) + hostonly_cmdline_l="yes" ;; + --hostonly-i18n) +@@ -803,6 +821,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l)) + [[ $prefix = "/" ]] && unset prefix + [[ $hostonly_l ]] && hostonly=$hostonly_l + [[ $hostonly_cmdline_l ]] && hostonly_cmdline=$hostonly_cmdline_l ++[[ $hostonly_mode_l ]] && hostonly_mode=$hostonly_mode_l + [[ $i18n_install_all_l ]] && i18n_install_all=$i18n_install_all_l + [[ $persistent_policy_l ]] && persistent_policy=$persistent_policy_l + [[ $use_fstab_l ]] && use_fstab=$use_fstab_l +@@ -840,6 +859,21 @@ fi + [[ $hostonly = yes ]] && hostonly="-h" + [[ $hostonly != "-h" ]] && unset hostonly + ++case $hostonly_mode in ++ '') ++ [[ $hostonly ]] && hostonly_mode="sloppy" ;; ++ sloppy|strict) ++ if [[ ! $hostonly ]]; then ++ unset hostonly_mode ++ fi ++ ;; ++ *) ++ printf "%s\n" "dracut: Invalid hostonly mode '$hostonly_mode'." >&2 ++ exit 1 ++esac ++ ++ ++ + readonly TMPDIR="$tmpdir" + readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)" + [ -d "$DRACUT_TMPDIR" ] || { diff --git a/SOURCES/0550-Revert-add-90multipath-hostonly-module.patch b/SOURCES/0550-Revert-add-90multipath-hostonly-module.patch new file mode 100644 index 0000000..0000b26 --- /dev/null +++ b/SOURCES/0550-Revert-add-90multipath-hostonly-module.patch @@ -0,0 +1,125 @@ +From af97814e42c3942005f7201f9afdeee363111796 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 26 Jul 2018 14:43:37 +0200 +Subject: [PATCH] Revert "add 90multipath-hostonly module" + +This reverts commit 6ef3173e86c2be99b504f7c7a789dea5c0072f64. + +Cherry-picked from: 35e86ac117acbfd699f371f163cdda9db0ebc047 +Resolves: #1599592 +--- + modules.d/90multipath-hostonly/module-setup.sh | 53 -------------------------- + modules.d/90multipath/module-setup.sh | 26 +++++++++++++ + 2 files changed, 26 insertions(+), 53 deletions(-) + delete mode 100755 modules.d/90multipath-hostonly/module-setup.sh + +diff --git a/modules.d/90multipath-hostonly/module-setup.sh b/modules.d/90multipath-hostonly/module-setup.sh +deleted file mode 100755 +index 88839033..00000000 +--- a/modules.d/90multipath-hostonly/module-setup.sh ++++ /dev/null +@@ -1,53 +0,0 @@ +-#!/bin/bash +- +-# called by dracut +-check() { +- return 255 +-} +- +-# called by dracut +-depends() { +- echo multipath +- return 0 +-} +- +-# called by dracut +-install() { +- local _f _allow +- +- is_mpath() { +- local _dev=$1 +- [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1 +- [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0 +- return 1 +- } +- +- majmin_to_mpath_dev() { +- local _dev +- for i in /dev/mapper/*; do +- [[ $i == /dev/mapper/control ]] && continue +- _dev=$(get_maj_min $i) +- if [ "$_dev" = "$1" ]; then +- echo $i +- return +- fi +- done +- } +- +- add_hostonly_mpath_conf() { +- is_mpath $1 && { +- local _dev +- +- _dev=$(majmin_to_mpath_dev $1) +- [ -z "$_dev" ] && return +- strstr "$_allow" "$_dev" && return +- _allow="$_allow --allow $_dev" +- } +- } +- +- [[ $hostonly ]] && { +- for_each_host_dev_and_slaves_all add_hostonly_mpath_conf +- [ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf +- } +-} +- +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index 232ddcd8..a9238884 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -9,6 +9,17 @@ is_mpath() { + return 1 + } + ++majmin_to_mpath_dev() { ++ local _dev ++ for i in /dev/mapper/*; do ++ [[ $i == /dev/mapper/control ]] && continue ++ _dev=$(get_maj_min $i) ++ if [ "$_dev" = "$1" ]; then ++ echo $i ++ return ++ fi ++ done ++} + + check() { + local _rootdev +@@ -70,6 +81,16 @@ installkernel() { + + install() { + local _f _allow ++ add_hostonly_mpath_conf() { ++ is_mpath $1 && { ++ local _dev ++ ++ _dev=$(majmin_to_mpath_dev $1) ++ [ -z "$_dev" ] && return ++ strstr "$_allow" "$_dev" && return ++ _allow="$_allow --allow $_dev" ++ } ++ } + + inst_multiple -o \ + dmsetup \ +@@ -84,6 +105,11 @@ install() { + /etc/multipath.conf \ + /etc/multipath/* + ++ [[ $hostonly ]] && [[ $hostonly_mode = "strict" ]] && { ++ for_each_host_dev_and_slaves_all add_hostonly_mpath_conf ++ [ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf ++ } ++ + inst $(command -v partx) /sbin/partx + + inst_libdir_file "libmultipath*" "multipath/*" diff --git a/SOURCES/0551-dracut.spec-remove-90multipath-hostonly.patch b/SOURCES/0551-dracut.spec-remove-90multipath-hostonly.patch new file mode 100644 index 0000000..73096aa --- /dev/null +++ b/SOURCES/0551-dracut.spec-remove-90multipath-hostonly.patch @@ -0,0 +1,23 @@ +From da6411f59cba83491e0a9d274c3e79230ef48265 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 5 Jul 2018 13:17:53 +0200 +Subject: [PATCH] dracut.spec: remove 90multipath-hostonly + +Cherry-picked from: ca77afdeb37f96d23ad0673396333af8e859d817 +Resolves: #1599592 +--- + dracut.spec | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/dracut.spec b/dracut.spec +index ee12013b..2ddd90bb 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -351,7 +351,6 @@ rm -rf -- $RPM_BUILD_ROOT + %{dracutlibdir}/modules.d/90lvm + %{dracutlibdir}/modules.d/90mdraid + %{dracutlibdir}/modules.d/90multipath +-%{dracutlibdir}/modules.d/90multipath-hostonly + %{dracutlibdir}/modules.d/90qemu + %{dracutlibdir}/modules.d/91crypt-gpg + %{dracutlibdir}/modules.d/91crypt-loop diff --git a/SOURCES/0552-dracut-functions-fix-the-word-splitting.patch b/SOURCES/0552-dracut-functions-fix-the-word-splitting.patch new file mode 100644 index 0000000..9a8222d --- /dev/null +++ b/SOURCES/0552-dracut-functions-fix-the-word-splitting.patch @@ -0,0 +1,24 @@ +From e4034dcae31a788bf7eeed943862289e0bcc1a04 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 9 Aug 2018 12:14:20 +0200 +Subject: [PATCH] dracut-functions: fix the word splitting + +Cherry-picked from: dc4f0a40f8fbea23ccd1e0fcde48d5c6f7996021 +Resolves: #1607744 +--- + dracut-functions.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 4387168a..e5985e33 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1755,7 +1755,7 @@ get_loaded_kernel_modules () + local modules=( ) + while read _module _size _used _used_by; do + modules+=( "$_module" ) +- done <<< $(lsmod | sed -n '1!p') ++ done <<< "$(lsmod | sed -n '1!p')" + printf '%s\n' "${modules[@]}" | sort + } + diff --git a/SOURCES/0553-kernel-modules-add-nfit.patch b/SOURCES/0553-kernel-modules-add-nfit.patch new file mode 100644 index 0000000..2d741f1 --- /dev/null +++ b/SOURCES/0553-kernel-modules-add-nfit.patch @@ -0,0 +1,26 @@ +From e5c337c3b3ac2539007834b5f623914159d6c38b Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 20 Aug 2018 18:40:05 +0800 +Subject: [PATCH] kernel-modules: add nfit + +To support pmem devices, nfit module is required + +Cherry-picked from: 09ba1b289f2cba613c1950b03f0f549ebb7eb83f +Resolves: #1288619 +--- + modules.d/90kernel-modules/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh +index dea32602..3e215f97 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -45,7 +45,7 @@ installkernel() { + instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \ + atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \ + atkbd i8042 usbhid firewire-ohci pcmcia usb_storage \ +- nvme hv-vmbus sdhci_acpi ++ nvme hv-vmbus sdhci_acpi nfit + + instmods \ + "=drivers/hid" \ diff --git a/SPECS/dracut.spec b/SPECS/dracut.spec index 121c4d1..3ca4823 100644 --- a/SPECS/dracut.spec +++ b/SPECS/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 033 -Release: 535%{?dist}.1 +Release: 554%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -563,8 +563,25 @@ Patch531: 0531-Align-dev_unit_name-with-systemd-s-function.patch Patch532: 0532-base-dracut-lib.sh-remove-bashism.patch Patch533: 0533-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch Patch534: 0534-90lvm-always-add-dm-snapshot.patch - -Patch900: 0001-dracut.sh-workaround-broken-read-from-proc-modules.patch +Patch535: 0535-dracut.sh-workaround-broken-read-from-proc-modules.patch +Patch536: 0536-net-lib-bump-carrier-timeout-to-15.patch +Patch537: 0537-dracut-function.sh-check_block_and_slaves-check-for-.patch +Patch538: 0538-dracut-functions.sh-check_vol_slaves-speedup-LV-VG-n.patch +Patch539: 0539-40network-introduce-ip-either6-option.patch +Patch540: 0540-Fix-loading-of-modules-in-modules-load.d.patch +Patch541: 0541-Skip-iscsi-attachment-if-no-info.patch +Patch542: 0542-dracut-Introduce-force-drivers-parameter-and-force_d.patch +Patch543: 0543-mdraid-mdraid_start.sh-tell-mainloop-if-we-make-prog.patch +Patch544: 0544-mdraid-wait-for-rd.md.uuid-specified-devices-to-be-a.patch +Patch545: 0545-fcoe-handle-CNAs-with-DCB-firmware-support.patch +Patch546: 0546-40network-dhclient.conf-rename-classless-routes-to-c.patch +Patch547: 0547-Record-loaded-kernel-modules-when-hostonly-mode-is-e.patch +Patch548: 0548-Correct-paths-for-openSUSE.patch +Patch549: 0549-Introduce-tri-state-hostonly-mode.patch +Patch550: 0550-Revert-add-90multipath-hostonly-module.patch +Patch551: 0551-dracut.spec-remove-90multipath-hostonly.patch +Patch552: 0552-dracut-functions-fix-the-word-splitting.patch +Patch553: 0553-kernel-modules-add-nfit.patch BuildRequires: bash git @@ -888,7 +905,6 @@ rm -rf -- $RPM_BUILD_ROOT %{dracutlibdir}/modules.d/90lvm %{dracutlibdir}/modules.d/90mdraid %{dracutlibdir}/modules.d/90multipath -%{dracutlibdir}/modules.d/90multipath-hostonly %{dracutlibdir}/modules.d/90qemu %{dracutlibdir}/modules.d/91crypt-gpg %{dracutlibdir}/modules.d/91crypt-loop @@ -997,7 +1013,50 @@ rm -rf -- $RPM_BUILD_ROOT %endif %changelog -* Wed Jun 13 2018 Lukas Nykryn - 033-535.1 +* Thu Sep 27 2018 Lukas Nykryn - 033-554 +- kernel-modules: add nfit +Resolves: #1288619 + +* Thu Aug 09 2018 Lukas Nykryn - 033-553 +- dracut-functions: fix the word splitting +Resolves: #1607744 + +* Mon Jul 30 2018 Lukas Nykryn - 033-552 +- dracut.spec: remove 90multipath-hostonly +Resolves: #1599592 + +* Mon Jul 30 2018 Lukas Nykryn - 033-551 +- Revert "add 90multipath-hostonly module" +- Introduce tri-state hostonly mode +Resolves: #1599592 +- Correct paths for firmware +Resolves: #1608491 +- Record loaded kernel modules when hostonly mode is enabled +Resolves: #1607744 + +* Thu Jun 21 2018 Lukas Nykryn - 033-547 +- 40network/dhclient.conf: rename classless-routes to classless-static-routes +Resolves: #1453907 + +* Wed Jun 20 2018 Lukas Nykryn - 033-546 +- fcoe: handle CNAs with DCB firmware support +Resolves: #1442663 +- mdraid: wait for rd.md.uuid specified devices to be assembled +Resolves: #1451660 +- dracut: Introduce --force-drivers parameter and force_drivers=+ config option +Resolves: #1577626 +- Skip iscsi attachment if no info +Resolves: #1513397 +- Fix loading of modules in modules-load.d +Resolves: #1547730 +- 40network: introduce ip=either6 option +Resolves: #1582398 +- dracut-functions.sh:check_vol_slaves() speedup LV -> VG name +Resolves: #1531503 +- dracut-function.sh:check_block_and_slaves() check for block devices +Resolves: #1549498 +- net-lib: bump carrier timeout to 15 +Resolves: #1401811 - dracut.sh: workaround broken read from /proc/modules Resolves: #1578222