721 lines
25 KiB
Diff
721 lines
25 KiB
Diff
|
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
||
|
index 391b549..c758029 100755
|
||
|
--- a/dracut-functions.sh
|
||
|
+++ b/dracut-functions.sh
|
||
|
@@ -33,7 +33,11 @@ if [[ $initdir ]] && ! [[ -d $initdir ]]; then
|
||
|
fi
|
||
|
|
||
|
# Generic substring function. If $2 is in $1, return 0.
|
||
|
-strstr() { [[ $1 = *$2* ]]; }
|
||
|
+strstr() { [[ $1 = *"$2"* ]]; }
|
||
|
+# Generic glob matching function. If glob pattern $2 matches anywhere in $1, OK
|
||
|
+strglobin() { [[ $1 = *$2* ]]; }
|
||
|
+# Generic glob matching function. If glob pattern $2 matches all of $1, OK
|
||
|
+strglob() { [[ $1 = $2 ]]; }
|
||
|
|
||
|
# helper function for check() in module-setup.sh
|
||
|
# to check for required installed binaries
|
||
|
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
|
||
|
index f29c814..0dd1938 100644
|
||
|
--- a/dracut-initramfs-restore.sh
|
||
|
+++ b/dracut-initramfs-restore.sh
|
||
|
@@ -6,6 +6,10 @@ set -e
|
||
|
|
||
|
KERNEL_VERSION="$(uname -r)"
|
||
|
|
||
|
+[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||
|
+SKIP="$dracutbasedir/skipcpio"
|
||
|
+[[ -x $SKIP ]] || SKIP=cat
|
||
|
+
|
||
|
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||
|
|
||
|
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||
|
@@ -16,11 +20,11 @@ fi
|
||
|
cd /run/initramfs
|
||
|
|
||
|
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
|
||
|
-if zcat "$IMG" | cpio -id --quiet >/dev/null; then
|
||
|
+if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||
|
rm -f -- .need_shutdown
|
||
|
-elif xzcat "$IMG" | cpio -id --quiet >/dev/null; then
|
||
|
+elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||
|
rm -f -- .need_shutdown
|
||
|
-elif lz4 -d -c "$IMG" | cpio -id --quiet >/dev/null; then
|
||
|
+elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||
|
rm -f -- .need_shutdown
|
||
|
else
|
||
|
# something failed, so we clean up
|
||
|
diff --git a/lsinitrd.sh b/lsinitrd.sh
|
||
|
index 8dc9032..a697bc2 100755
|
||
|
--- a/lsinitrd.sh
|
||
|
+++ b/lsinitrd.sh
|
||
|
@@ -160,27 +160,35 @@ case $bin in
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
-if [[ $SKIP ]]; then
|
||
|
- read -N 6 bin < <($SKIP "$image")
|
||
|
-fi
|
||
|
-
|
||
|
-case $bin in
|
||
|
- $'\x1f\x8b'*)
|
||
|
- CAT="zcat --";;
|
||
|
- BZh*)
|
||
|
- CAT="bzcat --";;
|
||
|
- $'\x71\xc7'*|070701)
|
||
|
- CAT="cat --"
|
||
|
- ;;
|
||
|
- $'\x02\x21'*)
|
||
|
- CAT="lz4 -d -c";;
|
||
|
- *)
|
||
|
- CAT="xzcat --";
|
||
|
- if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||
|
- CAT="xzcat --single-stream --"
|
||
|
- fi
|
||
|
- ;;
|
||
|
-esac
|
||
|
+CAT=$({
|
||
|
+ if [[ $SKIP ]]; then
|
||
|
+ $SKIP "$image"
|
||
|
+ else
|
||
|
+ cat "$image"
|
||
|
+ fi } | {
|
||
|
+ read -N 6 bin
|
||
|
+ case $bin in
|
||
|
+ $'\x1f\x8b'*)
|
||
|
+ echo "zcat --"
|
||
|
+ ;;
|
||
|
+ BZh*)
|
||
|
+ echo "bzcat --"
|
||
|
+ ;;
|
||
|
+ $'\x71\xc7'*|070701)
|
||
|
+ echo "cat --"
|
||
|
+ ;;
|
||
|
+ $'\x02\x21'*)
|
||
|
+ echo "lz4 -d -c"
|
||
|
+ ;;
|
||
|
+ *)
|
||
|
+ if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||
|
+ echo "xzcat --single-stream --"
|
||
|
+ else
|
||
|
+ echo "xzcat --"
|
||
|
+ fi
|
||
|
+ ;;
|
||
|
+ esac
|
||
|
+ })
|
||
|
|
||
|
skipcpio()
|
||
|
{
|
||
|
diff --git a/modules.d/10i18n/parse-i18n.sh b/modules.d/10i18n/parse-i18n.sh
|
||
|
index 135c57b..8f256fa 100755
|
||
|
--- a/modules.d/10i18n/parse-i18n.sh
|
||
|
+++ b/modules.d/10i18n/parse-i18n.sh
|
||
|
@@ -12,7 +12,7 @@ inst_key_val() {
|
||
|
_value="$(getarg $@)"
|
||
|
[ -z "${_value}" ] && _value=$_default
|
||
|
if [ -n "${_value}" ]; then
|
||
|
- printf '%s="%s"\n' $key ${_value} >> $_file
|
||
|
+ printf '%s="%s"\n' ${_key} ${_value} >> $_file
|
||
|
fi
|
||
|
unset _file
|
||
|
unset _value
|
||
|
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
|
||
|
index 50e8932..ba05250 100755
|
||
|
--- a/modules.d/40network/dhclient-script.sh
|
||
|
+++ b/modules.d/40network/dhclient-script.sh
|
||
|
@@ -64,13 +64,17 @@ setup_interface6() {
|
||
|
search=$(printf -- "$new_domain_search")
|
||
|
namesrv=$new_domain_name_servers
|
||
|
hostname=$new_host_name
|
||
|
- lease_time=$new_dhcp_lease_time
|
||
|
+ [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||
|
+ [ -n "$new_max_life" ] && lease_time=$new_max_life
|
||
|
+ preferred_lft=$lease_time
|
||
|
+ [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||
|
|
||
|
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||
|
|
||
|
ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
|
||
|
- dev ${netif} scope global valid_lft ${lease_time} \
|
||
|
- preferred_lft ${lease_time}
|
||
|
+ dev ${netif} scope global \
|
||
|
+ ${lease_time:+valid_lft $lease_time} \
|
||
|
+ ${preferred_lft:+preferred_lft ${preferred_lft}}
|
||
|
|
||
|
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||
|
if [ -n "$namesrv" ] ; then
|
||
|
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
|
||
|
index 51b0d52..7740be5 100755
|
||
|
--- a/modules.d/40network/ifup.sh
|
||
|
+++ b/modules.d/40network/ifup.sh
|
||
|
@@ -130,12 +130,12 @@ do_ipv6auto() {
|
||
|
|
||
|
# Handle static ip configuration
|
||
|
do_static() {
|
||
|
- strstr $ip '*:*:*' && load_ipv6
|
||
|
+ strglobin $ip '*:*:*' && load_ipv6
|
||
|
|
||
|
linkup $netif
|
||
|
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||
|
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||
|
- if strstr $ip '*:*:*'; then
|
||
|
+ if strglobin $ip '*:*:*'; then
|
||
|
# note no ip addr flush for ipv6
|
||
|
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
|
||
|
wait_for_ipv6_dad $netif
|
||
|
@@ -364,7 +364,12 @@ fi
|
||
|
|
||
|
# no ip option directed at our interface?
|
||
|
if [ ! -e /tmp/net.${netif}.up ]; then
|
||
|
- do_dhcp -4
|
||
|
+ if getargs 'ip=dhcp6'; then
|
||
|
+ load_ipv6
|
||
|
+ do_dhcp -6
|
||
|
+ else
|
||
|
+ do_dhcp -4
|
||
|
+ fi
|
||
|
fi
|
||
|
|
||
|
exit 0
|
||
|
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||
|
index 7430e4c..a82f1a8 100755
|
||
|
--- a/modules.d/40network/net-lib.sh
|
||
|
+++ b/modules.d/40network/net-lib.sh
|
||
|
@@ -377,7 +377,7 @@ ip_to_var() {
|
||
|
# ip=<ipv4-address> means anaconda-style static config argument cluster:
|
||
|
# ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
|
||
|
# ksdevice={link|bootif|ibft|<MAC>|<ifname>}
|
||
|
- if strstr "$autoconf" "*.*.*.*"; then
|
||
|
+ if strglob "$autoconf" "*.*.*.*"; then
|
||
|
ip="$autoconf"
|
||
|
gw=$(getarg gateway=)
|
||
|
mask=$(getarg netmask=)
|
||
|
@@ -516,3 +516,27 @@ find_iface_with_link() {
|
||
|
done
|
||
|
return 1
|
||
|
}
|
||
|
+
|
||
|
+is_persistent_ethernet_name() {
|
||
|
+ case "$1" in
|
||
|
+ # udev persistent interface names
|
||
|
+ eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*)
|
||
|
+ ;;
|
||
|
+ eno[0-9]|eno[0-9][0-9]|eno[0-9][0-9][0-9]*)
|
||
|
+ ;;
|
||
|
+ ens[0-9]|ens[0-9][0-9]|ens[0-9][0-9][0-9]*)
|
||
|
+ ;;
|
||
|
+ enp[0-9]s[0-9]*|enp[0-9][0-9]s[0-9]*|enp[0-9][0-9][0-9]*s[0-9]*)
|
||
|
+ ;;
|
||
|
+ enP*p[0-9]s[0-9]*|enP*p[0-9][0-9]s[0-9]*|enP*p[0-9][0-9][0-9]*s[0-9]*)
|
||
|
+ ;;
|
||
|
+ # biosdevname
|
||
|
+ em[0-9]|em[0-9][0-9]|em[0-9][0-9][0-9]*)
|
||
|
+ ;;
|
||
|
+ p[0-9]p[0-9]*|p[0-9][0-9]p[0-9]*|p[0-9][0-9][0-9]*p[0-9]*)
|
||
|
+ ;;
|
||
|
+ *)
|
||
|
+ return 1
|
||
|
+ esac
|
||
|
+ return 0
|
||
|
+}
|
||
|
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
|
||
|
index e2fa485..5de2e90 100755
|
||
|
--- a/modules.d/45ifcfg/write-ifcfg.sh
|
||
|
+++ b/modules.d/45ifcfg/write-ifcfg.sh
|
||
|
@@ -85,7 +85,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||
|
|
||
|
netif=${netup%%.did-setup}
|
||
|
netif=${netif##*/net.}
|
||
|
- strstr "$netif" ":*:*:*:*:" && continue
|
||
|
+ strglobin "$netif" ":*:*:*:*:" && continue
|
||
|
[ -e /tmp/ifcfg/ifcfg-$netif ] && continue
|
||
|
unset bridge
|
||
|
unset bond
|
||
|
@@ -122,7 +122,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||
|
echo "UUID=\"$uuid\""
|
||
|
if [ -f /tmp/dhclient.$netif.lease ]; then
|
||
|
[ -f /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||
|
- strstr "$ip" '*:*:*' && echo "IPV6INIT=yes"
|
||
|
+ strstr "$(ip -6 addr show dev $netif)" 'inet6' && echo "IPV6INIT=yes"
|
||
|
if [ -f /tmp/net.$netif.has_ibft_config ]; then
|
||
|
echo "BOOTPROTO=ibft"
|
||
|
else
|
||
|
@@ -132,7 +132,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||
|
else
|
||
|
# If we've booted with static ip= lines, the override file is there
|
||
|
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||
|
- if strstr "$ip" '*:*:*'; then
|
||
|
+ if strglobin "$ip" '*:*:*'; then
|
||
|
echo "IPV6INIT=yes"
|
||
|
echo "IPV6_AUTOCONF=no"
|
||
|
echo "IPV6ADDR=\"$ip/$mask\""
|
||
|
@@ -149,7 +149,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||
|
fi
|
||
|
fi
|
||
|
fi
|
||
|
- if strstr "$gw" '*:*:*'; then
|
||
|
+ if strglobin "$gw" '*:*:*'; then
|
||
|
echo "IPV6_DEFAULTGW=\"$gw\""
|
||
|
elif [ -n "$gw" ]; then
|
||
|
echo "GATEWAY=\"$gw\""
|
||
|
@@ -164,7 +164,13 @@ for netup in /tmp/net.*.did-setup ; do
|
||
|
{
|
||
|
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||
|
if ! print_s390 $netif; then
|
||
|
- [ -n "$macaddr" ] || echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
|
||
|
+ if [ -z "$macaddr" ] && \
|
||
|
+ ! is_persistent_ethernet_name "$netif" && \
|
||
|
+ [ -f /sys/class/net/$netif/addr_assign_type ] && \
|
||
|
+ [ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] && \
|
||
|
+ [ -f /sys/class/net/$netif/address ]; then
|
||
|
+ echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
|
||
|
+ fi
|
||
|
fi
|
||
|
echo "TYPE=Ethernet"
|
||
|
echo "NAME=\"$netif\""
|
||
|
diff --git a/modules.d/80cms/cms-write-ifcfg.sh b/modules.d/80cms/cms-write-ifcfg.sh
|
||
|
index c0623a4..924be1d 100755
|
||
|
--- a/modules.d/80cms/cms-write-ifcfg.sh
|
||
|
+++ b/modules.d/80cms/cms-write-ifcfg.sh
|
||
|
@@ -26,7 +26,7 @@ function cms_write_config()
|
||
|
|
||
|
IFCFGFILE=/run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-$DEVICE
|
||
|
|
||
|
- strstr "$IPADDR" '*:*:*' && ipv6=1
|
||
|
+ strglobin "$IPADDR" '*:*:*' && ipv6=1
|
||
|
|
||
|
# to please NetworkManager on startup in loader before loader reconfigures net
|
||
|
cat > /etc/sysconfig/network << EOF
|
||
|
diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh
|
||
|
index b361650..926340e 100755
|
||
|
--- a/modules.d/80cms/cmsifup.sh
|
||
|
+++ b/modules.d/80cms/cmsifup.sh
|
||
|
@@ -8,7 +8,7 @@ DEVICE=$1
|
||
|
|
||
|
. /tmp/cms.conf
|
||
|
|
||
|
-strstr "$IPADDR" '*:*:*' && ipv6=1
|
||
|
+strglobin "$IPADDR" '*:*:*' && ipv6=1
|
||
|
|
||
|
if [ "$ipv6" ] && ! str_starts "$IPADDR" "["; then
|
||
|
IPADDR="[$IPADDR]"
|
||
|
diff --git a/modules.d/90dm/module-setup.sh b/modules.d/90dm/module-setup.sh
|
||
|
index 829c24b..2367588 100755
|
||
|
--- a/modules.d/90dm/module-setup.sh
|
||
|
+++ b/modules.d/90dm/module-setup.sh
|
||
|
@@ -16,7 +16,7 @@ depends() {
|
||
|
# called by dracut
|
||
|
installkernel() {
|
||
|
instmods =drivers/md
|
||
|
- instmods dm_mod
|
||
|
+ instmods dm_mod dm-cache dm-cache-mq dm-cache-cleaner
|
||
|
}
|
||
|
|
||
|
# called by dracut
|
||
|
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
|
||
|
index 93a452e..5b810b9 100755
|
||
|
--- a/modules.d/90lvm/module-setup.sh
|
||
|
+++ b/modules.d/90lvm/module-setup.sh
|
||
|
@@ -80,7 +80,8 @@ install() {
|
||
|
inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules
|
||
|
|
||
|
# Do not run lvmetad update via pvscan in udev rule - lvmetad is not running yet in dracut!
|
||
|
- if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
|
||
|
+ if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]] && \
|
||
|
+ grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then
|
||
|
sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||
|
sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||
|
sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
|
||
|
diff --git a/modules.d/95fcoe/fcoe-genrules.sh b/modules.d/95fcoe/fcoe-genrules.sh
|
||
|
index 80894ed..fa3af6d 100755
|
||
|
--- a/modules.d/95fcoe/fcoe-genrules.sh
|
||
|
+++ b/modules.d/95fcoe/fcoe-genrules.sh
|
||
|
@@ -13,4 +13,4 @@
|
||
|
else
|
||
|
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
|
||
|
fi
|
||
|
-} > /etc/udev/rules.d/92-fcoe.rules
|
||
|
+} >> /etc/udev/rules.d/92-fcoe.rules
|
||
|
diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
|
||
|
index 511c554..d8c73c8 100755
|
||
|
--- a/modules.d/95fcoe/fcoe-up.sh
|
||
|
+++ b/modules.d/95fcoe/fcoe-up.sh
|
||
|
@@ -28,12 +28,35 @@ if [ "$dcb" = "dcb" ]; then
|
||
|
# are to kill it and start a new lldpad to take over. Data is transfered
|
||
|
# between the 2 using a shm segment
|
||
|
lldpad -d
|
||
|
- # stupid tools, need sleep
|
||
|
- sleep 1
|
||
|
- dcbtool sc "$netif" dcb on
|
||
|
- sleep 1
|
||
|
- dcbtool sc "$netif" app:fcoe e:1 a:1 w:1
|
||
|
+ # wait for lldpad to be ready
|
||
|
+ i=0
|
||
|
+ while [ $i -lt 60 ]; do
|
||
|
+ lldptool -p && break
|
||
|
+ info "Waiting for lldpad to be ready"
|
||
|
+ sleep 1
|
||
|
+ i=$(($i+1))
|
||
|
+ done
|
||
|
+
|
||
|
+ # on some systems lldpad needs some time
|
||
|
+ # sleep until we find a better solution
|
||
|
+ sleep 30
|
||
|
+
|
||
|
+ while [ $i -lt 60 ]; do
|
||
|
+ dcbtool sc "$netif" dcb on && break
|
||
|
+ info "Retrying to turn dcb on"
|
||
|
+ sleep 1
|
||
|
+ i=$(($i+1))
|
||
|
+ done
|
||
|
+
|
||
|
+ while [ $i -lt 60 ]; do
|
||
|
+ dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 && break
|
||
|
+ info "Retrying to turn fcoe on"
|
||
|
+ sleep 1
|
||
|
+ i=$(($i+1))
|
||
|
+ done
|
||
|
+
|
||
|
sleep 1
|
||
|
+
|
||
|
fipvlan "$netif" -c -s
|
||
|
elif [ "$netdriver" = "bnx2x" ]; then
|
||
|
# If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
|
||
|
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
|
||
|
index c502ba0..9a52c00 100755
|
||
|
--- a/modules.d/95fcoe/module-setup.sh
|
||
|
+++ b/modules.d/95fcoe/module-setup.sh
|
||
|
@@ -21,7 +21,7 @@ installkernel() {
|
||
|
|
||
|
# called by dracut
|
||
|
install() {
|
||
|
- inst_multiple ip dcbtool fipvlan lldpad readlink
|
||
|
+ inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
|
||
|
|
||
|
mkdir -m 0755 -p "$initdir/var/lib/lldpad"
|
||
|
|
||
|
diff --git a/modules.d/95fstab-sys/mount-sys.sh b/modules.d/95fstab-sys/mount-sys.sh
|
||
|
index 12711a0..a237810 100755
|
||
|
--- a/modules.d/95fstab-sys/mount-sys.sh
|
||
|
+++ b/modules.d/95fstab-sys/mount-sys.sh
|
||
|
@@ -27,7 +27,11 @@ fstab_mount() {
|
||
|
return 0
|
||
|
}
|
||
|
|
||
|
-[ -f /etc/fstab ] && fstab_mount /etc/fstab
|
||
|
+# systemd will mount and run fsck from /etc/fstab and we don't want to
|
||
|
+# run into a race condition.
|
||
|
+if [ -z "$DRACUT_SYSTEMD" ]; then
|
||
|
+ [ -f /etc/fstab ] && fstab_mount /etc/fstab
|
||
|
+fi
|
||
|
|
||
|
# prefer $NEWROOT/etc/fstab.sys over local /etc/fstab.sys
|
||
|
if [ -f $NEWROOT/etc/fstab.sys ]; then
|
||
|
diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh
|
||
|
index 9ced2e6..d5377fe 100755
|
||
|
--- a/modules.d/95nfs/nfs-lib.sh
|
||
|
+++ b/modules.d/95nfs/nfs-lib.sh
|
||
|
@@ -40,7 +40,7 @@ nfsroot_to_var() {
|
||
|
arg="${arg##$nfs:}"
|
||
|
|
||
|
# check if we have a server
|
||
|
- if strstr "$arg" ':/*' ; then
|
||
|
+ if strstr "$arg" ':/' ; then
|
||
|
server="${arg%%:/*}"
|
||
|
arg="/${arg##*:/}"
|
||
|
fi
|
||
|
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
|
||
|
index 03dcc4e..1b9e701 100644
|
||
|
--- a/modules.d/98systemd/dracut-initqueue.service
|
||
|
+++ b/modules.d/98systemd/dracut-initqueue.service
|
||
|
@@ -11,6 +11,8 @@
|
||
|
Description=dracut initqueue hook
|
||
|
Documentation=man:dracut-initqueue.service(8)
|
||
|
DefaultDependencies=no
|
||
|
+Before=remote-fs-pre.target
|
||
|
+Wants=remote-fs-pre.target
|
||
|
After=systemd-udev-trigger.service
|
||
|
Wants=systemd-udev-trigger.service
|
||
|
ConditionPathExists=/etc/initrd-release
|
||
|
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
|
||
|
index c72aad4..e7bf73b 100755
|
||
|
--- a/modules.d/98systemd/module-setup.sh
|
||
|
+++ b/modules.d/98systemd/module-setup.sh
|
||
|
@@ -44,6 +44,7 @@ install() {
|
||
|
$systemdutildir/systemd-modules-load \
|
||
|
$systemdutildir/systemd-vconsole-setup \
|
||
|
$systemdutildir/system-generators/systemd-fstab-generator \
|
||
|
+ $systemdutildir/system-generators/systemd-gpt-auto-generator \
|
||
|
\
|
||
|
$systemdsystemunitdir/cryptsetup.target \
|
||
|
$systemdsystemunitdir/emergency.target \
|
||
|
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
|
||
|
index e4d7da8..127287c 100755
|
||
|
--- a/modules.d/99base/dracut-lib.sh
|
||
|
+++ b/modules.d/99base/dracut-lib.sh
|
||
|
@@ -20,19 +20,33 @@ debug_on() {
|
||
|
[ "$RD_DEBUG" = "yes" ] && set -x
|
||
|
}
|
||
|
|
||
|
-# returns OK if $1 contains $2
|
||
|
+# returns OK if $1 contains literal string $2 (and isn't empty)
|
||
|
strstr() {
|
||
|
- [ "${1#*$2*}" != "$1" ]
|
||
|
+ [ "${1##*"$2"*}" != "$1" ]
|
||
|
}
|
||
|
|
||
|
-# returns OK if $1 contains $2 at the beginning
|
||
|
+# returns OK if $1 matches (completely) glob pattern $2
|
||
|
+# An empty $1 will not be considered matched, even if $2 is * which technically
|
||
|
+# matches; as it would match anything, it's not an interesting case.
|
||
|
+strglob() {
|
||
|
+ [ -n "$1" -a -z "${1##$2}" ]
|
||
|
+}
|
||
|
+
|
||
|
+# returns OK if $1 contains (anywhere) a match of glob pattern $2
|
||
|
+# An empty $1 will not be considered matched, even if $2 is * which technically
|
||
|
+# matches; as it would match anything, it's not an interesting case.
|
||
|
+strglobin() {
|
||
|
+ [ -n "$1" -a -z "${1##*$2*}" ]
|
||
|
+}
|
||
|
+
|
||
|
+# returns OK if $1 contains literal string $2 at the beginning, and isn't empty
|
||
|
str_starts() {
|
||
|
- [ "${1#$2*}" != "$1" ]
|
||
|
+ [ "${1#"$2"*}" != "$1" ]
|
||
|
}
|
||
|
|
||
|
-# returns OK if $1 contains $2 at the end
|
||
|
+# returns OK if $1 contains literal string $2 at the end, and isn't empty
|
||
|
str_ends() {
|
||
|
- [ "${1%*$2}" != "$1" ]
|
||
|
+ [ "${1%*"$2"}" != "$1" ]
|
||
|
}
|
||
|
|
||
|
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||
|
@@ -85,9 +99,9 @@ str_replace() {
|
||
|
local out=''
|
||
|
|
||
|
while strstr "${in}" "$s"; do
|
||
|
- chop="${in%%$s*}"
|
||
|
+ chop="${in%%"$s"*}"
|
||
|
out="${out}${chop}$r"
|
||
|
- in="${in#*$s}"
|
||
|
+ in="${in#*"$s"}"
|
||
|
done
|
||
|
echo "${out}${in}"
|
||
|
}
|
||
|
@@ -555,7 +569,7 @@ nfsroot_to_var() {
|
||
|
arg="${arg##$nfs:}"
|
||
|
|
||
|
# check if we have a server
|
||
|
- if strstr "$arg" ':/*' ; then
|
||
|
+ if strstr "$arg" ':/' ; then
|
||
|
server="${arg%%:/*}"
|
||
|
arg="/${arg##*:/}"
|
||
|
fi
|
||
|
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
|
||
|
index 2364f4f..a1232eb 100755
|
||
|
--- a/modules.d/99base/init.sh
|
||
|
+++ b/modules.d/99base/init.sh
|
||
|
@@ -353,7 +353,9 @@ wait_for_loginit
|
||
|
# remove helper symlink
|
||
|
[ -h /dev/root ] && rm -f -- /dev/root
|
||
|
|
||
|
-getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
|
||
|
+bv=$(getarg rd.break -d rdbreak) && [ -z "$bv" ] &&
|
||
|
+ emergency_shell -n switch_root "Break before switch_root"
|
||
|
+unset bv
|
||
|
info "Switching root"
|
||
|
|
||
|
|
||
|
diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh
|
||
|
index 7979bab..b6f85b1 100755
|
||
|
--- a/modules.d/99fs-lib/module-setup.sh
|
||
|
+++ b/modules.d/99fs-lib/module-setup.sh
|
||
|
@@ -17,10 +17,10 @@ echo_fs_helper() {
|
||
|
local dev=$1 fs=$2
|
||
|
case "$fs" in
|
||
|
xfs)
|
||
|
- echo -n " xfs_db xfs_repair xfs_check xfs_metadump "
|
||
|
+ echo -n " xfs_db xfs_repair xfs_check xfs_metadump"
|
||
|
;;
|
||
|
ext?)
|
||
|
- echo -n " fsck.$fs e2fsck "
|
||
|
+ echo -n " e2fsck "
|
||
|
;;
|
||
|
jfs)
|
||
|
echo -n " jfs_fsck "
|
||
|
@@ -31,10 +31,10 @@ echo_fs_helper() {
|
||
|
btrfs)
|
||
|
echo -n " btrfsck "
|
||
|
;;
|
||
|
- *)
|
||
|
- [[ -x fsck.$fs ]] && echo -n " fsck.$fs "
|
||
|
- ;;
|
||
|
esac
|
||
|
+
|
||
|
+ echo -n " fsck.$fs "
|
||
|
+ return 0
|
||
|
}
|
||
|
|
||
|
include_fs_helper_modules() {
|
||
|
diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh
|
||
|
index 5fc02d9..cf5a026 100755
|
||
|
--- a/test/TEST-01-BASIC/test-init.sh
|
||
|
+++ b/test/TEST-01-BASIC/test-init.sh
|
||
|
@@ -1,7 +1,7 @@
|
||
|
#!/bin/sh
|
||
|
>/dev/watchdog
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-02-SYSTEMD/test-init.sh b/test/TEST-02-SYSTEMD/test-init.sh
|
||
|
index ff17b6b..3fc24f5 100755
|
||
|
--- a/test/TEST-02-SYSTEMD/test-init.sh
|
||
|
+++ b/test/TEST-02-SYSTEMD/test-init.sh
|
||
|
@@ -1,6 +1,6 @@
|
||
|
#!/bin/sh
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec </dev/console >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-03-USR-MOUNT/test-init.sh b/test/TEST-03-USR-MOUNT/test-init.sh
|
||
|
index 63520ab..99e109a 100755
|
||
|
--- a/test/TEST-03-USR-MOUNT/test-init.sh
|
||
|
+++ b/test/TEST-03-USR-MOUNT/test-init.sh
|
||
|
@@ -1,7 +1,7 @@
|
||
|
#!/bin/sh
|
||
|
>/dev/watchdog
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec </dev/console >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-04-FULL-SYSTEMD/test-init.sh b/test/TEST-04-FULL-SYSTEMD/test-init.sh
|
||
|
index dcda926..3012213 100755
|
||
|
--- a/test/TEST-04-FULL-SYSTEMD/test-init.sh
|
||
|
+++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh
|
||
|
@@ -1,7 +1,7 @@
|
||
|
#!/bin/sh
|
||
|
>/dev/watchdog
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec </dev/console >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-10-RAID/test-init.sh b/test/TEST-10-RAID/test-init.sh
|
||
|
index 62afcee..4b4977a 100755
|
||
|
--- a/test/TEST-10-RAID/test-init.sh
|
||
|
+++ b/test/TEST-10-RAID/test-init.sh
|
||
|
@@ -1,6 +1,6 @@
|
||
|
#!/bin/sh
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
command -v plymouth >/dev/null && plymouth --quit
|
||
|
exec >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-11-LVM/test-init.sh b/test/TEST-11-LVM/test-init.sh
|
||
|
index fd03aa5..db3c52a 100755
|
||
|
--- a/test/TEST-11-LVM/test-init.sh
|
||
|
+++ b/test/TEST-11-LVM/test-init.sh
|
||
|
@@ -1,6 +1,6 @@
|
||
|
#!/bin/sh
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-12-RAID-DEG/test-init.sh b/test/TEST-12-RAID-DEG/test-init.sh
|
||
|
index 62afcee..4b4977a 100755
|
||
|
--- a/test/TEST-12-RAID-DEG/test-init.sh
|
||
|
+++ b/test/TEST-12-RAID-DEG/test-init.sh
|
||
|
@@ -1,6 +1,6 @@
|
||
|
#!/bin/sh
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
command -v plymouth >/dev/null && plymouth --quit
|
||
|
exec >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-14-IMSM/test-init.sh b/test/TEST-14-IMSM/test-init.sh
|
||
|
index f434f13..932bd26 100755
|
||
|
--- a/test/TEST-14-IMSM/test-init.sh
|
||
|
+++ b/test/TEST-14-IMSM/test-init.sh
|
||
|
@@ -1,6 +1,6 @@
|
||
|
#!/bin/sh
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-16-DMSQUASH/test-init.sh b/test/TEST-16-DMSQUASH/test-init.sh
|
||
|
index 616bf68..55a5321 100755
|
||
|
--- a/test/TEST-16-DMSQUASH/test-init.sh
|
||
|
+++ b/test/TEST-16-DMSQUASH/test-init.sh
|
||
|
@@ -1,6 +1,6 @@
|
||
|
#!/bin/sh
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-17-LVM-THIN/test-init.sh b/test/TEST-17-LVM-THIN/test-init.sh
|
||
|
index fd03aa5..db3c52a 100755
|
||
|
--- a/test/TEST-17-LVM-THIN/test-init.sh
|
||
|
+++ b/test/TEST-17-LVM-THIN/test-init.sh
|
||
|
@@ -1,6 +1,6 @@
|
||
|
#!/bin/sh
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
plymouth --quit
|
||
|
exec >/dev/console 2>&1
|
||
|
diff --git a/test/TEST-20-NFS/client-init.sh b/test/TEST-20-NFS/client-init.sh
|
||
|
index ad6a656..a16db3c 100755
|
||
|
--- a/test/TEST-20-NFS/client-init.sh
|
||
|
+++ b/test/TEST-20-NFS/client-init.sh
|
||
|
@@ -4,7 +4,7 @@ exec >/dev/console 2>&1
|
||
|
export TERM=linux
|
||
|
export PS1='initramfs-test:\w\$ '
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
|
||
|
stty sane
|
||
|
strstr "$CMDLINE" "rd.shell" && sh -i
|
||
|
diff --git a/test/TEST-50-MULTINIC/client-init.sh b/test/TEST-50-MULTINIC/client-init.sh
|
||
|
index 51f8b64..13affc4 100755
|
||
|
--- a/test/TEST-50-MULTINIC/client-init.sh
|
||
|
+++ b/test/TEST-50-MULTINIC/client-init.sh
|
||
|
@@ -2,14 +2,15 @@
|
||
|
exec >/dev/console 2>&1
|
||
|
set -x
|
||
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||
|
+strstr() { [ "${1##*"$2"*}" != "$1" ]; }
|
||
|
+strglobin() { [ -n "$1" -a -z "${1##*$2*}" ]; }
|
||
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||
|
export TERM=linux
|
||
|
export PS1='initramfs-test:\w\$ '
|
||
|
stty sane
|
||
|
echo "made it to the rootfs! Powering down."
|
||
|
for i in /run/initramfs/net.*.did-setup; do
|
||
|
- strstr "$i" ":*:*:*:*:" && continue
|
||
|
+ strglobin "$i" ":*:*:*:*:" && continue
|
||
|
i=${i%.did-setup}
|
||
|
IFACES+="${i##*/net.} "
|
||
|
done
|