dracut 045-18.git20170515
- git snapshot
This commit is contained in:
parent
0da17b8999
commit
3763a85444
1
.gitignore
vendored
1
.gitignore
vendored
@ -29,3 +29,4 @@
|
||||
/dracut-042.tar.xz
|
||||
/dracut-043.tar.xz
|
||||
/dracut-044.tar.xz
|
||||
/dracut-045.tar.xz
|
||||
|
@ -0,0 +1,98 @@
|
||||
From 2a1723ed83accdcb6871e12c722c03dac35dc35e Mon Sep 17 00:00:00 2001
|
||||
From: Moritz Maxeiner <moritz@ucworks.org>
|
||||
Date: Fri, 10 Jul 2015 15:38:59 +0200
|
||||
Subject: [PATCH] crypt-gpg: For GnuPG >= 2.1 support OpenPGP smartcards
|
||||
|
||||
---
|
||||
modules.d/91crypt-gpg/crypt-gpg-lib.sh | 34 ++++++++++++++++++++++++++++++++--
|
||||
modules.d/91crypt-gpg/module-setup.sh | 17 +++++++++++++++++
|
||||
2 files changed, 49 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.d/91crypt-gpg/crypt-gpg-lib.sh b/modules.d/91crypt-gpg/crypt-gpg-lib.sh
|
||||
index 5c7ea855..b85ed2b8 100755
|
||||
--- a/modules.d/91crypt-gpg/crypt-gpg-lib.sh
|
||||
+++ b/modules.d/91crypt-gpg/crypt-gpg-lib.sh
|
||||
@@ -4,7 +4,7 @@ command -v ask_for_password >/dev/null || . /lib/dracut-crypt-lib.sh
|
||||
|
||||
# gpg_decrypt mnt_point keypath keydev device
|
||||
#
|
||||
-# Decrypts encrypted symmetrically key to standard output.
|
||||
+# Decrypts symmetrically encrypted (password or OpenPGP smartcard) key to standard output.
|
||||
#
|
||||
# mnt_point - mount point where <keydev> is already mounted
|
||||
# keypath - GPG encrypted key path relative to <mnt_point>
|
||||
@@ -22,10 +22,40 @@ gpg_decrypt() {
|
||||
|
||||
mkdir -m 0700 -p "$gpghome"
|
||||
|
||||
+ # Setup GnuPG home and gpg-agent for usage of OpenPGP smartcard.
|
||||
+ # This requires GnuPG >= 2.1, as it uses the new ,,pinentry-mode´´
|
||||
+ # feature, which - when set to ,,loopback´´ - allows us to pipe
|
||||
+ # the smartcard's pin to GnuPG (instead of using a normal pinentry
|
||||
+ # program needed with GnuPG < 2.1), making for uncomplicated
|
||||
+ # integration with the existing codebase.
|
||||
+ local useSmartcard="0"
|
||||
+ local gpgMajorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')"
|
||||
+ local gpgMinorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')"
|
||||
+
|
||||
+ if [ "${gpgMajorVersion}" -ge 2 ] && [ "${gpgMinorVersion}" -ge 1 ] \
|
||||
+ && [ -f /root/crypt-public-key.gpg ] && getargbool 1 rd.luks.smartcard ; then
|
||||
+ useSmartcard="1"
|
||||
+ echo "allow-loopback-pinentry" >> "$gpghome/gpg-agent.conf"
|
||||
+ GNUPGHOME="$gpghome" gpg-agent --quiet --daemon
|
||||
+ GNUPGHOME="$gpghome" gpg --quiet --no-tty --import < /root/crypt-public-key.gpg
|
||||
+ local smartcardSerialNumber="$(GNUPGHOME=$gpghome gpg --no-tty --card-status \
|
||||
+ | sed -n -r -e 's|Serial number.*: ([0-9]*)|\1|p' | tr -d '\n')"
|
||||
+ if [ -n "${smartcardSerialNumber}" ]; then
|
||||
+ inputPrompt="PIN (OpenPGP card ${smartcardSerialNumber})"
|
||||
+ fi
|
||||
+ GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null learn /bye
|
||||
+ opts="$opts --pinentry-mode=loopback"
|
||||
+ fi
|
||||
+
|
||||
ask_for_password \
|
||||
--cmd "gpg $opts --decrypt $mntp/$keypath" \
|
||||
- --prompt "Password ($keypath on $keydev for $device)" \
|
||||
+ --prompt "${inputPrompt:-Password ($keypath on $keydev for $device)}" \
|
||||
--tries 3 --tty-echo-off
|
||||
|
||||
+ # Clean up the smartcard gpg-agent
|
||||
+ if [ "${useSmartcard}" == "1" ]; then
|
||||
+ GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null killagent /bye
|
||||
+ fi
|
||||
+
|
||||
rm -rf -- "$gpghome"
|
||||
}
|
||||
diff --git a/modules.d/91crypt-gpg/module-setup.sh b/modules.d/91crypt-gpg/module-setup.sh
|
||||
index d328c04c..1323a181 100755
|
||||
--- a/modules.d/91crypt-gpg/module-setup.sh
|
||||
+++ b/modules.d/91crypt-gpg/module-setup.sh
|
||||
@@ -5,6 +5,12 @@
|
||||
check() {
|
||||
require_binaries gpg || return 1
|
||||
|
||||
+ if [ -f "${initdir}/root/crypt-public-key.gpg" ]; then
|
||||
+ require_binaries gpg-agent || return 1
|
||||
+ require_binaries gpg-connect-agent || return 1
|
||||
+ require_binaries /usr/libexec/scdaemon || return 1
|
||||
+ fi
|
||||
+
|
||||
return 255
|
||||
}
|
||||
|
||||
@@ -17,4 +23,15 @@ depends() {
|
||||
install() {
|
||||
inst_multiple gpg
|
||||
inst "$moddir/crypt-gpg-lib.sh" "/lib/dracut-crypt-gpg-lib.sh"
|
||||
+
|
||||
+ local gpgMajorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')"
|
||||
+ local gpgMinorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')"
|
||||
+ if [ "${gpgMajorVersion}" -ge 2 ] && [ "${gpgMinorVersion}" -ge 1 ] && [ -f /etc/dracut.conf.d/crypt-public-key.gpg ]; then
|
||||
+ inst_multiple gpg-agent
|
||||
+ inst_multiple gpg-connect-agent
|
||||
+ inst_multiple /usr/libexec/scdaemon || derror "crypt-gpg: gnugpg with scdaemon required for smartcard support in the initramfs"
|
||||
+ cp "/etc/dracut.conf.d/crypt-public-key.gpg" "${initdir}/root/"
|
||||
+ elif [ -f /etc/dracut.conf.d/crypt-public-key.gpg ]; then
|
||||
+ dwarning "crypt-gpg: gnupg >= 2.1 required for smartcard support in the initramfs"
|
||||
+ fi
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
From 6ed1d9fd07d7b081296aab687e07653f0eb295e3 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 26 Nov 2015 15:50:39 +0100
|
||||
Subject: [PATCH] dmsquash-live/dmsquash-live-root.sh: fixed typo
|
||||
|
||||
---
|
||||
modules.d/90dmsquash-live/dmsquash-live-root.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
index ffa1e7a..fa44a03 100755
|
||||
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
@@ -249,7 +249,7 @@ if [ -n "$FSIMG" ] ; then
|
||||
else
|
||||
unpack_archive $FSIMG /run/initramfs/fsimg/
|
||||
fi
|
||||
- FSIMG = /run/initramfs/fsimg/rootfs.img
|
||||
+ FSIMG=/run/initramfs/fsimg/rootfs.img
|
||||
fi
|
||||
if [ -n "$writable_fsimg" ] || [ -z "$SQUASHED" -a -n "$live_ram" ] ||
|
||||
[ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then
|
@ -0,0 +1,67 @@
|
||||
From 98047e08d02b91f632ec8554fc02af05069216dd Mon Sep 17 00:00:00 2001
|
||||
From: Moritz Maxeiner <moritz@ucworks.org>
|
||||
Date: Mon, 13 Jul 2015 17:53:29 +0200
|
||||
Subject: [PATCH] crypt-gpg: Add README describing the procedure of moving from
|
||||
password-only gpg keyfile to password/smartcard gpg keyfile
|
||||
|
||||
---
|
||||
modules.d/91crypt-gpg/README | 50 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 50 insertions(+)
|
||||
create mode 100644 modules.d/91crypt-gpg/README
|
||||
|
||||
diff --git a/modules.d/91crypt-gpg/README b/modules.d/91crypt-gpg/README
|
||||
new file mode 100644
|
||||
index 00000000..be6df55a
|
||||
--- /dev/null
|
||||
+++ b/modules.d/91crypt-gpg/README
|
||||
@@ -0,0 +1,50 @@
|
||||
+# Directions for changing a system from password-based gpg keyfile
|
||||
+# to smartcard-based gpg keyfile
|
||||
+
|
||||
+# Be sure that you meet the following requirements:
|
||||
+# 1. GnuPG >= 2.1 installed with
|
||||
+# * Smartcard support enabled (scdaemon must be built)
|
||||
+# * Direct CCID access built into scdaemon
|
||||
+# 2. A password-based gpg keyfile ${KEYFILE} (e.g. "keyfile.gpg"):
|
||||
+# That is, a file containing the slot key for LUKS, which
|
||||
+# has been encrypted symmetrically with GnuPG using
|
||||
+# a password.
|
||||
+# 3. Your public OpenPGP identity ${RECIPIENT} (e.g. "3A696356")
|
||||
+# 4. An OpenPGP smartcard holding the decryption key associated
|
||||
+# with your public identity
|
||||
+# 5. A CCID smartcard reader
|
||||
+
|
||||
+# Notes: Requirement 4. and 5. can of course be one device, e.g.
|
||||
+# a USB token with an integrated OpenPGP smartcard
|
||||
+
|
||||
+# Make a backup of your keyfile (assuming it lies on the boot partition)
|
||||
+$ cp /boot/${KEYFILE} /safe/place/keyfile.bak.gpg
|
||||
+
|
||||
+# Change your keyfile from purely password-based to both
|
||||
+# password-based and key-based (you can then decrypt the keyfile
|
||||
+# with either method). As an example aes256 is chosen, the cipher
|
||||
+# is not important to this guide, but do note that your kernel
|
||||
+# must support it at boot time (be it built into the kernel image
|
||||
+# or loaded as a module from the initramfs).
|
||||
+$ cat /safe/place/keyfile.bak.gpg | gpg -d | gpg --encrypt --recipient ${RECIPIENT} --cipher-algo aes256 --armor -c > /safe/place/keyfile_sc.gpg
|
||||
+
|
||||
+# Verify that you can decrypt your new keyfile both with the password
|
||||
+# and your smartcard.
|
||||
+# (with smartcard inserted, you should be prompted for your PIN, unless
|
||||
+# you already did so and have not yet timed out)
|
||||
+$ gpg -d /safe/place/keyfile_sc.gpg
|
||||
+# (with smartcard disconnected, you should be prompted for your password)
|
||||
+$ gpg -d /safe/place/keyfile_sc.gpg
|
||||
+
|
||||
+# After verification, replace your old keyfile with your new one
|
||||
+$ su -c 'cp /safe/place/keyfile_sc.gpg /boot/${KEYFILE}'
|
||||
+
|
||||
+# Export your public key to where crypt-gpg can find it
|
||||
+$ gpg --armor --export-options export-minimal --export ${RECIPIENT} > /safe/place/crypt-public-key.gpg
|
||||
+$ su -c 'cp /safe/place/crypt-public-key.gpg /etc/dracut.conf.d/crypt-public-key.gpg'
|
||||
+
|
||||
+# Rebuild your initramfs as usual
|
||||
+# When booting with any of the requirements not met, crypt-gpg will default to password-based keyfile unlocking.
|
||||
+# If all requirements are met and smartcard support is not disabled by setting the kernel option "rd.luks.smartcard=0"
|
||||
+# crypt-gpg will try find and use a connected OpenPGP smartcard by prompting you for the PIN and then
|
||||
+# unlocking the gpg keyfile with the smartcard.
|
@ -1,23 +0,0 @@
|
||||
From 5d8d0ac814e015e4ad35a7e40a92b9f0bb554301 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 26 Nov 2015 17:46:03 +0100
|
||||
Subject: [PATCH] dmraid/61-dmraid-imsm.rules: add nowatch option for udev
|
||||
|
||||
udev rereads partitions, if watch is set for disks
|
||||
---
|
||||
modules.d/90dmraid/61-dmraid-imsm.rules | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules b/modules.d/90dmraid/61-dmraid-imsm.rules
|
||||
index 0193fbc..4d4d939 100644
|
||||
--- a/modules.d/90dmraid/61-dmraid-imsm.rules
|
||||
+++ b/modules.d/90dmraid/61-dmraid-imsm.rules
|
||||
@@ -16,6 +16,8 @@ ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}!="?*", GOTO="dm_end"
|
||||
|
||||
ENV{rd_NO_DM}=="?*", GOTO="dm_end"
|
||||
|
||||
+OPTIONS:="nowatch"
|
||||
+
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_end"
|
||||
|
||||
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
|
74
0003-crypt-gpg-Rework-setup-for-CCID-smartcard-support.patch
Normal file
74
0003-crypt-gpg-Rework-setup-for-CCID-smartcard-support.patch
Normal file
@ -0,0 +1,74 @@
|
||||
From 0982fcb2e5ae334790851fa8ff7cf65281842ad1 Mon Sep 17 00:00:00 2001
|
||||
From: Moritz Maxeiner <moritz@ucworks.org>
|
||||
Date: Thu, 30 Mar 2017 14:17:05 +0200
|
||||
Subject: [PATCH] crypt-gpg: Rework setup for CCID smartcard support
|
||||
|
||||
---
|
||||
modules.d/91crypt-gpg/module-setup.sh | 46 ++++++++++++++++++++++++++---------
|
||||
1 file changed, 35 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/modules.d/91crypt-gpg/module-setup.sh b/modules.d/91crypt-gpg/module-setup.sh
|
||||
index 1323a181..bb34676f 100755
|
||||
--- a/modules.d/91crypt-gpg/module-setup.sh
|
||||
+++ b/modules.d/91crypt-gpg/module-setup.sh
|
||||
@@ -5,10 +5,11 @@
|
||||
check() {
|
||||
require_binaries gpg || return 1
|
||||
|
||||
- if [ -f "${initdir}/root/crypt-public-key.gpg" ]; then
|
||||
- require_binaries gpg-agent || return 1
|
||||
- require_binaries gpg-connect-agent || return 1
|
||||
- require_binaries /usr/libexec/scdaemon || return 1
|
||||
+ if sc_requested; then
|
||||
+ if ! sc_supported; then
|
||||
+ dwarning "crypt-gpg: GnuPG >= 2.1 with scdaemon and libusb required for ccid smartcard support"
|
||||
+ return 1
|
||||
+ fi
|
||||
fi
|
||||
|
||||
return 255
|
||||
@@ -24,14 +25,37 @@ install() {
|
||||
inst_multiple gpg
|
||||
inst "$moddir/crypt-gpg-lib.sh" "/lib/dracut-crypt-gpg-lib.sh"
|
||||
|
||||
- local gpgMajorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')"
|
||||
- local gpgMinorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')"
|
||||
- if [ "${gpgMajorVersion}" -ge 2 ] && [ "${gpgMinorVersion}" -ge 1 ] && [ -f /etc/dracut.conf.d/crypt-public-key.gpg ]; then
|
||||
+ if sc_requested; then
|
||||
inst_multiple gpg-agent
|
||||
inst_multiple gpg-connect-agent
|
||||
- inst_multiple /usr/libexec/scdaemon || derror "crypt-gpg: gnugpg with scdaemon required for smartcard support in the initramfs"
|
||||
- cp "/etc/dracut.conf.d/crypt-public-key.gpg" "${initdir}/root/"
|
||||
- elif [ -f /etc/dracut.conf.d/crypt-public-key.gpg ]; then
|
||||
- dwarning "crypt-gpg: gnupg >= 2.1 required for smartcard support in the initramfs"
|
||||
+ inst_multiple /usr/libexec/scdaemon
|
||||
+ cp "$(sc_public_key)" "${initdir}/root/"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+sc_public_key() {
|
||||
+ echo -n "/etc/dracut.conf.d/crypt-public-key.gpg"
|
||||
+}
|
||||
+
|
||||
+# CCID Smartcard support requires GnuPG >= 2.1 with scdaemon and libusb
|
||||
+sc_supported() {
|
||||
+ local gpgMajor="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')"
|
||||
+ local gpgMinor="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')"
|
||||
+ if [[ "${gpgMajor}" -gt 2 || "${gpgMajor}" -eq 2 && "${gpgMinor}" -ge 1 ]] && \
|
||||
+ require_binaries gpg-agent &&
|
||||
+ require_binaries gpg-connect-agent &&
|
||||
+ require_binaries /usr/libexec/scdaemon &&
|
||||
+ (ldd /usr/libexec/scdaemon | grep libusb > /dev/null); then
|
||||
+ return 0
|
||||
+ else
|
||||
+ return 1
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+sc_requested() {
|
||||
+ if [ -f "$(sc_public_key)" ]; then
|
||||
+ return 0
|
||||
+ else
|
||||
+ return 1
|
||||
fi
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
From 88ba9372be6b8011bbf4b59bdc290c62e6d01972 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 27 Nov 2015 09:44:24 +0100
|
||||
Subject: [PATCH] livenet/livenet-generator.sh: mode 0755
|
||||
|
||||
---
|
||||
modules.d/90livenet/livenet-generator.sh | 0
|
||||
1 file changed, 0 insertions(+), 0 deletions(-)
|
||||
mode change 100644 => 100755 modules.d/90livenet/livenet-generator.sh
|
||||
|
||||
diff --git a/modules.d/90livenet/livenet-generator.sh b/modules.d/90livenet/livenet-generator.sh
|
||||
old mode 100644
|
||||
new mode 100755
|
@ -0,0 +1,21 @@
|
||||
From 0e1b686b8367925b21c76b9d9e36bf7d2f6b89ac Mon Sep 17 00:00:00 2001
|
||||
From: Moritz Maxeiner <moritz@ucworks.org>
|
||||
Date: Thu, 30 Mar 2017 14:54:26 +0200
|
||||
Subject: [PATCH] crypt-gpg: Include module if CCID smartcard support requested
|
||||
|
||||
---
|
||||
modules.d/91crypt-gpg/module-setup.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/modules.d/91crypt-gpg/module-setup.sh b/modules.d/91crypt-gpg/module-setup.sh
|
||||
index bb34676f..f1c6a34b 100755
|
||||
--- a/modules.d/91crypt-gpg/module-setup.sh
|
||||
+++ b/modules.d/91crypt-gpg/module-setup.sh
|
||||
@@ -10,6 +10,7 @@ check() {
|
||||
dwarning "crypt-gpg: GnuPG >= 2.1 with scdaemon and libusb required for ccid smartcard support"
|
||||
return 1
|
||||
fi
|
||||
+ return 0
|
||||
fi
|
||||
|
||||
return 255
|
@ -1,39 +0,0 @@
|
||||
From 54e09dfb72b557ac8ccd48f5d37089287d272ec7 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 30 Nov 2015 11:27:03 +0100
|
||||
Subject: [PATCH] shutdown: guard against read-only /run
|
||||
|
||||
remount the switch rooted /run writeable again.
|
||||
---
|
||||
modules.d/99shutdown/module-setup.sh | 2 +-
|
||||
modules.d/99shutdown/shutdown.sh | 4 ++++
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh
|
||||
index b80a82c..5cb3594 100755
|
||||
--- a/modules.d/99shutdown/module-setup.sh
|
||||
+++ b/modules.d/99shutdown/module-setup.sh
|
||||
@@ -14,7 +14,7 @@ depends() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local _d
|
||||
- inst_multiple umount poweroff reboot halt losetup
|
||||
+ inst_multiple umount poweroff reboot halt losetup stat
|
||||
inst_multiple -o kexec
|
||||
inst "$moddir/shutdown.sh" "$prefix/shutdown"
|
||||
[ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
|
||||
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
|
||||
index afee051..918a8a4 100755
|
||||
--- a/modules.d/99shutdown/shutdown.sh
|
||||
+++ b/modules.d/99shutdown/shutdown.sh
|
||||
@@ -12,6 +12,10 @@ export TERM=linux
|
||||
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
+if [ "$(stat -c '%T' -f /)" = "tmpfs" ]; then
|
||||
+ mount -o remount,rw /
|
||||
+fi
|
||||
+
|
||||
mkdir /oldsys
|
||||
for i in sys proc run dev; do
|
||||
mkdir /oldsys/$i
|
@ -1,30 +0,0 @@
|
||||
From ce9a398771d6e8503d767b450282db52b7a4b482 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 1 Dec 2015 08:52:00 +0100
|
||||
Subject: [PATCH] dmsquash-live/dmsquash-live-root.sh: SQUASHED can be set
|
||||
earlier
|
||||
|
||||
8b5ee88ff667693b2d8da85a8552ad8f5ab95127 removed the check for SQUASHED,
|
||||
assuming, that the if clause above was the only place, where SQUASHED is
|
||||
set.
|
||||
|
||||
This patch reverts to the old logic, because SQUASHED can be set
|
||||
earlier.
|
||||
---
|
||||
modules.d/90dmsquash-live/dmsquash-live-root.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
index fa44a03..68d076c 100755
|
||||
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
@@ -203,6 +203,9 @@ fi
|
||||
# we might have an embedded fs image on squashfs (compressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then
|
||||
SQUASHED="/run/initramfs/live/${live_dir}/${squash_image}"
|
||||
+fi
|
||||
+
|
||||
+if [ -e "$SQUASHED" ] ; then
|
||||
if [ -n "$live_ram" ]; then
|
||||
echo "Copying live image to RAM..."
|
||||
echo "(this may take a few minutes)"
|
@ -0,0 +1,21 @@
|
||||
From c603419030136570b5944dc4620f62d07b9e82bb Mon Sep 17 00:00:00 2001
|
||||
From: pallotron <pallotron@fb.com>
|
||||
Date: Tue, 4 Apr 2017 08:31:21 -0700
|
||||
Subject: [PATCH] wait for IPv6 RA if using none/static IPv6 assignment
|
||||
|
||||
---
|
||||
modules.d/40network/net-lib.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index 75051544..b74fdbdd 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -671,6 +671,7 @@ wait_for_ipv6_dad() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
+ && [ -n "$(ip -6 route list proto ra dev "$1")" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
|
||||
&& return 1
|
@ -0,0 +1,23 @@
|
||||
From 4c3d99f9665118198ec68a93ecdcc15c88e23c98 Mon Sep 17 00:00:00 2001
|
||||
From: pallotron <pallotron@fb.com>
|
||||
Date: Tue, 4 Apr 2017 12:59:45 -0700
|
||||
Subject: [PATCH] enabling some ipv6 config before running wait_for_ipv6_dad
|
||||
|
||||
---
|
||||
modules.d/40network/ifup.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
|
||||
index fd721e74..f979b59b 100755
|
||||
--- a/modules.d/40network/ifup.sh
|
||||
+++ b/modules.d/40network/ifup.sh
|
||||
@@ -108,6 +108,9 @@ do_static() {
|
||||
if strglobin $ip '*:*:*'; then
|
||||
# note no ip addr flush for ipv6
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
|
||||
+ echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
||||
+ echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
||||
+ echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
||||
wait_for_ipv6_dad $netif
|
||||
else
|
||||
if command -v arping2 >/dev/null; then
|
@ -1,26 +0,0 @@
|
||||
From 8d26b5661ea2fd9fb41c83048b7590e44b1c95df Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 9 Dec 2015 14:14:46 +0100
|
||||
Subject: [PATCH] kernel-modules: include all HID driver in hostonly mode
|
||||
|
||||
If a kernel is updated in the undocked state and later on docked, some
|
||||
keyboard modules can be missing.
|
||||
|
||||
Thus include all HID drivers.
|
||||
---
|
||||
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 41bf37d..c5f2397 100755
|
||||
--- a/modules.d/90kernel-modules/module-setup.sh
|
||||
+++ b/modules.d/90kernel-modules/module-setup.sh
|
||||
@@ -41,7 +41,7 @@ installkernel() {
|
||||
uhci-hcd \
|
||||
xhci-hcd xhci-pci xhci-plat-hcd
|
||||
|
||||
- instmods \
|
||||
+ hostonly='' instmods \
|
||||
"=drivers/hid" \
|
||||
"=drivers/input/serio" \
|
||||
"=drivers/input/keyboard"
|
45
0007-more-ipv6-improvements.patch
Normal file
45
0007-more-ipv6-improvements.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 96b708e178930b0891daab8dcc9d1d7375637a29 Mon Sep 17 00:00:00 2001
|
||||
From: pallotron <pallotron@fb.com>
|
||||
Date: Wed, 5 Apr 2017 00:15:16 -0700
|
||||
Subject: [PATCH] more ipv6 improvements
|
||||
|
||||
---
|
||||
modules.d/40network/net-lib.sh | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index b74fdbdd..e0f761f3 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -653,7 +653,9 @@ wait_for_ipv6_dad_link() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
+ echo "wait_for_ipv6_dad_link..." 1>&2
|
||||
[ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||
+ && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
|
||||
&& return 1
|
||||
@@ -670,8 +672,9 @@ wait_for_ipv6_dad() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
+ echo "wait_for_ipv6_dad..." 1>&2
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
- && [ -n "$(ip -6 route list proto ra dev "$1")" ] \
|
||||
+ && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
|
||||
&& return 1
|
||||
@@ -688,8 +691,9 @@ wait_for_ipv6_auto() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
+ echo "wait_for_ipv6_auto..." 1>&2
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
- && [ -n "$(ip -6 route list proto ra dev "$1")" ] \
|
||||
+ && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
&& return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
@ -1,21 +0,0 @@
|
||||
From 4bcd41389cabe7a41c4bb3a17eaf668b12cc0668 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Dec 2015 11:16:12 +0100
|
||||
Subject: [PATCH] systemd: include machine-info
|
||||
|
||||
---
|
||||
modules.d/00systemd/module-setup.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
|
||||
index 50b3b8c..ed59beb 100755
|
||||
--- a/modules.d/00systemd/module-setup.sh
|
||||
+++ b/modules.d/00systemd/module-setup.sh
|
||||
@@ -162,6 +162,7 @@ install() {
|
||||
/etc/systemd/system.conf \
|
||||
/etc/hostname \
|
||||
/etc/machine-id \
|
||||
+ /etc/machine-info \
|
||||
/etc/vconsole.conf \
|
||||
/etc/locale.conf \
|
||||
/etc/modules-load.d/*.conf \
|
@ -1,24 +0,0 @@
|
||||
From efd3a6db74ebcc453e216966a5914b63e2b29aff Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Dec 2015 11:16:42 +0100
|
||||
Subject: [PATCH] livenet/module-setup.sh: only include systemd generator if
|
||||
systemd included
|
||||
|
||||
---
|
||||
modules.d/90livenet/module-setup.sh | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/90livenet/module-setup.sh b/modules.d/90livenet/module-setup.sh
|
||||
index 3a8d4ba..11738b8 100755
|
||||
--- a/modules.d/90livenet/module-setup.sh
|
||||
+++ b/modules.d/90livenet/module-setup.sh
|
||||
@@ -17,6 +17,8 @@ install() {
|
||||
inst_hook cmdline 29 "$moddir/parse-livenet.sh"
|
||||
inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh"
|
||||
inst_script "$moddir/livenetroot.sh" "/sbin/livenetroot"
|
||||
- inst_script "$moddir/livenet-generator.sh" $systemdutildir/system-generators/dracut-livenet-generator
|
||||
+ if dracut_module_included "systemd-initrd"; then
|
||||
+ inst_script "$moddir/livenet-generator.sh" $systemdutildir/system-generators/dracut-livenet-generator
|
||||
+ fi
|
||||
dracut_need_initqueue
|
||||
}
|
37
0008-remove-prints.patch
Normal file
37
0008-remove-prints.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From a0545765e8cec749e59a664ef09944786132327b Mon Sep 17 00:00:00 2001
|
||||
From: pallotron <pallotron@fb.com>
|
||||
Date: Wed, 5 Apr 2017 00:16:16 -0700
|
||||
Subject: [PATCH] remove prints
|
||||
|
||||
---
|
||||
modules.d/40network/net-lib.sh | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index e0f761f3..fea45be2 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -653,7 +653,6 @@ wait_for_ipv6_dad_link() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
- echo "wait_for_ipv6_dad_link..." 1>&2
|
||||
[ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
&& return 0
|
||||
@@ -672,7 +671,6 @@ wait_for_ipv6_dad() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
- echo "wait_for_ipv6_dad..." 1>&2
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
&& return 0
|
||||
@@ -691,7 +689,6 @@ wait_for_ipv6_auto() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
- echo "wait_for_ipv6_auto..." 1>&2
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
&& return 0
|
40
0009-more-ipv6-improvements.patch
Normal file
40
0009-more-ipv6-improvements.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 031e2f7bb8aea447cd87e455b184106acb4aa435 Mon Sep 17 00:00:00 2001
|
||||
From: pallotron <pallotron@fb.com>
|
||||
Date: Wed, 5 Apr 2017 00:23:36 -0700
|
||||
Subject: [PATCH] more ipv6 improvements
|
||||
|
||||
---
|
||||
modules.d/40network/net-lib.sh | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index fea45be2..71a665cd 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -654,7 +654,7 @@ wait_for_ipv6_dad_link() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||
- && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
+ && [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
|
||||
&& return 1
|
||||
@@ -672,7 +672,7 @@ wait_for_ipv6_dad() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
- && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
+ && [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
|
||||
&& return 1
|
||||
@@ -690,7 +690,7 @@ wait_for_ipv6_auto() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
- && [ -n "$(ip -6 route list proto ra dev "$1" | grep default)" ] \
|
||||
+ && [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
|
||||
&& return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
@ -1,167 +0,0 @@
|
||||
From df95b1003c8e7564da73de92403013763eb028fe Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Dec 2015 13:10:05 +0100
|
||||
Subject: [PATCH] network: fix carrier detection
|
||||
|
||||
rename iface_has_link() to iface_has_carrier() to clarify usage
|
||||
|
||||
Only assign static "wildcard interface" settings, if the interface has a
|
||||
carrier.
|
||||
|
||||
If the interface name was specified with a name, do not do carrier
|
||||
checking for static configurations.
|
||||
---
|
||||
modules.d/40network/ifup.sh | 42 ++++++++++++++++++++-----------------
|
||||
modules.d/40network/net-lib.sh | 47 ++++++++++++++++++++++++++----------------
|
||||
2 files changed, 52 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
|
||||
index 109fb4b..eca7478 100755
|
||||
--- a/modules.d/40network/ifup.sh
|
||||
+++ b/modules.d/40network/ifup.sh
|
||||
@@ -100,7 +100,7 @@ do_dhcp() {
|
||||
|
||||
[ -e /tmp/dhclient.$netif.pid ] && return 0
|
||||
|
||||
- if ! iface_has_link $netif; then
|
||||
+ if ! iface_has_carrier $netif; then
|
||||
warn "No carrier detected on interface $netif"
|
||||
return 1
|
||||
fi
|
||||
@@ -150,7 +150,10 @@ do_ipv6auto() {
|
||||
do_static() {
|
||||
strglobin $ip '*:*:*' && load_ipv6
|
||||
|
||||
- if ! linkup $netif; then
|
||||
+ if [ -z "$dev" ] && ! iface_has_carrier "$netif"; then
|
||||
+ warn "No carrier detected on interface $netif"
|
||||
+ return 1
|
||||
+ elif ! linkup "$netif"; then
|
||||
warn "Could not bring interface $netif up!"
|
||||
return 1
|
||||
fi
|
||||
@@ -375,27 +378,28 @@ for p in $(getargs ip=); do
|
||||
done
|
||||
ret=$?
|
||||
|
||||
- > /tmp/net.${netif}.up
|
||||
+ if [ $ret -eq 0 ]; then
|
||||
+ > /tmp/net.${netif}.up
|
||||
|
||||
- if [ -e /sys/class/net/${netif}/address ]; then
|
||||
- > /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
- fi
|
||||
+ if [ -e /sys/class/net/${netif}/address ]; then
|
||||
+ > /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
+ fi
|
||||
|
||||
- case $autoconf in
|
||||
- dhcp|on|any|dhcp6)
|
||||
+ case $autoconf in
|
||||
+ dhcp|on|any|dhcp6)
|
||||
;;
|
||||
- *)
|
||||
- if [ $ret -eq 0 ]; then
|
||||
- setup_net $netif
|
||||
- source_hook initqueue/online $netif
|
||||
- if [ -z "$manualup" ]; then
|
||||
- /sbin/netroot $netif
|
||||
+ *)
|
||||
+ if [ $ret -eq 0 ]; then
|
||||
+ setup_net $netif
|
||||
+ source_hook initqueue/online $netif
|
||||
+ if [ -z "$manualup" ]; then
|
||||
+ /sbin/netroot $netif
|
||||
+ fi
|
||||
fi
|
||||
- fi
|
||||
- ;;
|
||||
- esac
|
||||
-
|
||||
- exit 0
|
||||
+ ;;
|
||||
+ esac
|
||||
+ exit $ret
|
||||
+ fi
|
||||
done
|
||||
|
||||
# netif isn't the top stack? Then we should exit here.
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index 135c378..256826e 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -537,22 +537,20 @@ wait_for_if_up() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -o link show up dev $1)
|
||||
- if ! strstr "$li" "NO-CARRIER"; then
|
||||
- if [ -n "$li" ]; then
|
||||
- case "$li" in
|
||||
- *\<UP*)
|
||||
- return 0;;
|
||||
- *\<*,UP\>*)
|
||||
- return 0;;
|
||||
- *\<*,UP,*\>*)
|
||||
- return 0;;
|
||||
- esac
|
||||
- fi
|
||||
- if strstr "$li" "LOWER_UP" \
|
||||
- && strstr "$li" "state UNKNOWN" \
|
||||
- && ! strstr "$li" "DORMANT"; then
|
||||
- return 0
|
||||
- fi
|
||||
+ if [ -n "$li" ]; then
|
||||
+ case "$li" in
|
||||
+ *\<UP*)
|
||||
+ return 0;;
|
||||
+ *\<*,UP\>*)
|
||||
+ return 0;;
|
||||
+ *\<*,UP,*\>*)
|
||||
+ return 0;;
|
||||
+ esac
|
||||
+ fi
|
||||
+ if strstr "$li" "LOWER_UP" \
|
||||
+ && strstr "$li" "state UNKNOWN" \
|
||||
+ && ! strstr "$li" "DORMANT"; then
|
||||
+ return 0
|
||||
fi
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
@@ -620,7 +618,7 @@ type hostname >/dev/null 2>&1 || \
|
||||
cat /proc/sys/kernel/hostname
|
||||
}
|
||||
|
||||
-iface_has_link() {
|
||||
+iface_has_carrier() {
|
||||
local cnt=0
|
||||
local interface="$1" flags=""
|
||||
[ -n "$interface" ] || return 2
|
||||
@@ -631,14 +629,27 @@ iface_has_link() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
linkup "$1"
|
||||
+
|
||||
+ li=$(ip -o link show up dev $1)
|
||||
+ strstr "$li" "NO-CARRIER" && _no_carrier_flag=1
|
||||
+
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
- [ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
+ if [ -n "$_no_carrier_flag" ]; then
|
||||
+ # NO-CARRIER flag was cleared
|
||||
+ strstr "$li" "NO-CARRIER" || return 0
|
||||
+ fi
|
||||
+ # double check the syscfs carrier flag
|
||||
+ [ -e "$interface/carrier" ] && [ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
+iface_has_link() {
|
||||
+ iface_has_carrier "$@"
|
||||
+}
|
||||
+
|
||||
find_iface_with_link() {
|
||||
local iface_path="" iface=""
|
||||
for iface_path in /sys/class/net/*; do
|
@ -0,0 +1,33 @@
|
||||
From ea765c0ee17178fe74c73873505f7c86f40f9ec7 Mon Sep 17 00:00:00 2001
|
||||
From: Frederick Grose <fgrose@sugarlabs.org>
|
||||
Date: Sat, 8 Apr 2017 21:01:19 -0400
|
||||
Subject: [PATCH] dmsquash-live-root: Avoid mount source conflict on
|
||||
$BASE_LOOPDEV.
|
||||
|
||||
The newer mount utilities are more strict about directly shared
|
||||
devices. For OverlayFS boots, which mount $BASE_LOOPDEV directly,
|
||||
avoid a mount error by indirectly sharing the read-only base
|
||||
filesystem through a second, over-attached $BASE_LOOPDEV for
|
||||
the DM live-base target.
|
||||
---
|
||||
modules.d/90dmsquash-live/dmsquash-live-root.sh | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
index 264983f5..3a25465c 100755
|
||||
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
|
||||
@@ -241,7 +241,12 @@ do_live_overlay() {
|
||||
fi
|
||||
|
||||
# Create a device that always points to a ro base image
|
||||
- echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base
|
||||
+ if [ -n "$overlayfs" ]; then
|
||||
+ BASE_LOOPDUP=$(losetup -f --show -r $BASE_LOOPDEV)
|
||||
+ echo 0 $sz linear $BASE_LOOPDUP 0 | dmsetup create --readonly live-base
|
||||
+ else
|
||||
+ echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base
|
||||
+ fi
|
||||
}
|
||||
|
||||
# we might have a genMinInstDelta delta file for anaconda to take advantage of
|
@ -1,287 +0,0 @@
|
||||
From b070c1d360e86db69a8049b2f040b8223bc484c9 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Dec 2015 13:10:33 +0100
|
||||
Subject: [PATCH] nbd: add systemd generator and use nbd export names instead
|
||||
of port numbers
|
||||
|
||||
Add a systemd generator for root=nbd:.. so that systemd has a correct
|
||||
sysroot.mount unit.
|
||||
|
||||
Use export names instead of port numbers, because port number based
|
||||
exports are deprecated and were removed.
|
||||
---
|
||||
dracut.cmdline.7.asc | 14 +++++++++++---
|
||||
modules.d/95nbd/module-setup.sh | 3 +++
|
||||
modules.d/95nbd/nbdroot.sh | 11 +++++------
|
||||
modules.d/95nbd/parse-nbdroot.sh | 10 ++++++++--
|
||||
test/TEST-40-NBD/dhcpd.conf | 10 +++++-----
|
||||
test/TEST-40-NBD/server-init.sh | 3 +--
|
||||
test/TEST-40-NBD/test.sh | 41 ++++++++++++++++++++++++----------------
|
||||
7 files changed, 58 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
|
||||
index c34b45b..e160e3b 100644
|
||||
--- a/dracut.cmdline.7.asc
|
||||
+++ b/dracut.cmdline.7.asc
|
||||
@@ -755,13 +755,21 @@ NOTE: letters in the MAC-address must be lowercase!
|
||||
|
||||
NBD
|
||||
~~~
|
||||
-**root=**??? **netroot=**nbd:__<server>__:__<port>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
- mount nbd share from <server>
|
||||
+**root=**??? **netroot=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
+ mount nbd share from <server>.
|
||||
++
|
||||
+NOTE:
|
||||
+ If "exportname" instead of "port" is given the standard port is used.
|
||||
+ Newer versions of nbd are only supported with "exportname".
|
||||
|
||||
-**root=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
+**root=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
|
||||
options can be specified. This syntax is only usable in cases where you are
|
||||
directly mounting the volume as the rootfs.
|
||||
++
|
||||
+NOTE:
|
||||
+ If "exportname" instead of "port" is given the standard port is used.
|
||||
+ Newer versions of nbd are only supported with "exportname".
|
||||
|
||||
DASD
|
||||
~~~~
|
||||
diff --git a/modules.d/95nbd/module-setup.sh b/modules.d/95nbd/module-setup.sh
|
||||
index 3cb6f49..22f6a3b 100755
|
||||
--- a/modules.d/95nbd/module-setup.sh
|
||||
+++ b/modules.d/95nbd/module-setup.sh
|
||||
@@ -34,6 +34,9 @@ install() {
|
||||
inst nbd-client
|
||||
inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
|
||||
inst_script "$moddir/nbdroot.sh" "/sbin/nbdroot"
|
||||
+ if dracut_module_included "systemd-initrd"; then
|
||||
+ inst_script "$moddir/nbd-generator.sh" $systemdutildir/system-generators/dracut-nbd-generator
|
||||
+ fi
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh
|
||||
index dd2bb55..7057f23 100755
|
||||
--- a/modules.d/95nbd/nbdroot.sh
|
||||
+++ b/modules.d/95nbd/nbdroot.sh
|
||||
@@ -28,11 +28,6 @@ nbdfstype=${nroot%%:*}; nroot=${nroot#*:}
|
||||
nbdflags=${nroot%%:*}
|
||||
nbdopts=${nroot#*:}
|
||||
|
||||
-# If nbdport not an integer, then assume name based import
|
||||
-if [ ! -z $(echo "$nbdport" | sed 's/[0-9]//g') ]; then
|
||||
- nbdport="-N $nbdport"
|
||||
-fi
|
||||
-
|
||||
if [ "$nbdopts" = "$nbdflags" ]; then
|
||||
unset nbdopts
|
||||
fi
|
||||
@@ -113,7 +108,11 @@ if strstr "$(nbd-client --help 2>&1)" "systemd-mark"; then
|
||||
preopts="--systemd-mark $preopts"
|
||||
fi
|
||||
|
||||
-nbd-client $preopts "$nbdserver" $nbdport /dev/nbd0 $opts || exit 1
|
||||
+if [ "$nbdport" -gt 0 ] 2>/dev/null; then
|
||||
+ nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1
|
||||
+else
|
||||
+ nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts || exit 1
|
||||
+fi
|
||||
|
||||
# NBD doesn't emit uevents when it gets connected, so kick it
|
||||
echo change > /sys/block/nbd0/uevent
|
||||
diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh
|
||||
index 746fb14..902e9a9 100755
|
||||
--- a/modules.d/95nbd/parse-nbdroot.sh
|
||||
+++ b/modules.d/95nbd/parse-nbdroot.sh
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Preferred format:
|
||||
-# root=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
|
||||
-# [root=*] netroot=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
|
||||
+# root=nbd:srv:port/exportname[:fstype[:rootflags[:nbdopts]]]
|
||||
+# [root=*] netroot=nbd:srv:port/exportname[:fstype[:rootflags[:nbdopts]]]
|
||||
#
|
||||
# nbdopts is a comma separated list of options to give to nbd-client
|
||||
#
|
||||
@@ -45,6 +45,12 @@ fi
|
||||
# If it's not nbd we don't continue
|
||||
[ "${netroot%%:*}" = "nbd" ] || return
|
||||
|
||||
+
|
||||
+if [ -n "${DRACUT_SYSTEMD}" ] && [ "$root" = "dhcp" ]; then
|
||||
+ echo "root=$netroot" > /etc/cmdline.d/root.conf
|
||||
+ systemctl --no-block daemon-reload
|
||||
+fi
|
||||
+
|
||||
# Check required arguments
|
||||
netroot_to_var $netroot
|
||||
[ -z "$server" ] && die "Argument server for nbdroot is missing"
|
||||
diff --git a/test/TEST-40-NBD/dhcpd.conf b/test/TEST-40-NBD/dhcpd.conf
|
||||
index 942bc6a..08461f9 100644
|
||||
--- a/test/TEST-40-NBD/dhcpd.conf
|
||||
+++ b/test/TEST-40-NBD/dhcpd.conf
|
||||
@@ -20,7 +20,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
|
||||
|
||||
group {
|
||||
host nbd-2 {
|
||||
- option root-path "nbd:192.168.50.1:2000";
|
||||
+ option root-path "nbd:192.168.50.1:raw";
|
||||
|
||||
hardware ethernet 52:54:00:12:34:01;
|
||||
fixed-address 192.168.50.101;
|
||||
@@ -29,7 +29,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
|
||||
|
||||
group {
|
||||
host nbd-3 {
|
||||
- option root-path "nbd:192.168.50.1:2000:ext2";
|
||||
+ option root-path "nbd:192.168.50.1:raw:ext2";
|
||||
|
||||
hardware ethernet 52:54:00:12:34:02;
|
||||
fixed-address 192.168.50.101;
|
||||
@@ -38,7 +38,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
|
||||
|
||||
group {
|
||||
host nbd-4 {
|
||||
- option root-path "nbd:192.168.50.1:2000::errors=panic";
|
||||
+ option root-path "nbd:192.168.50.1:raw::errors=panic";
|
||||
|
||||
hardware ethernet 52:54:00:12:34:03;
|
||||
fixed-address 192.168.50.101;
|
||||
@@ -47,7 +47,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
|
||||
|
||||
group {
|
||||
host nbd-5 {
|
||||
- option root-path "nbd:192.168.50.1:2000:ext2:errors=panic";
|
||||
+ option root-path "nbd:192.168.50.1:raw:ext2:errors=panic";
|
||||
|
||||
hardware ethernet 52:54:00:12:34:04;
|
||||
fixed-address 192.168.50.101;
|
||||
@@ -57,7 +57,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
|
||||
group {
|
||||
host nbd-6 {
|
||||
# Use the encrypted image
|
||||
- option root-path "nbd:192.168.50.1:2001:ext2:errors=panic";
|
||||
+ option root-path "nbd:192.168.50.1:encrypted:ext2:errors=panic";
|
||||
|
||||
hardware ethernet 52:54:00:12:34:05;
|
||||
fixed-address 192.168.50.101;
|
||||
diff --git a/test/TEST-40-NBD/server-init.sh b/test/TEST-40-NBD/server-init.sh
|
||||
index 73c64d6..0039753 100755
|
||||
--- a/test/TEST-40-NBD/server-init.sh
|
||||
+++ b/test/TEST-40-NBD/server-init.sh
|
||||
@@ -13,8 +13,7 @@ ip link set dev eth0 name ens3
|
||||
ip addr add 192.168.50.1/24 dev ens3
|
||||
ip link set ens3 up
|
||||
modprobe af_packet
|
||||
-nbd-server 2000 /dev/sdb -C /dev/null
|
||||
-nbd-server 2001 /dev/sdc -C /dev/null
|
||||
+nbd-server
|
||||
>/var/lib/dhcpd/dhcpd.leases
|
||||
chmod 777 /var/lib/dhcpd/dhcpd.leases
|
||||
dhcpd -d -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases &
|
||||
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
|
||||
index 39966ac..28ba6aa 100755
|
||||
--- a/test/TEST-40-NBD/test.sh
|
||||
+++ b/test/TEST-40-NBD/test.sh
|
||||
@@ -5,8 +5,8 @@ TEST_DESCRIPTION="root filesystem on NBD"
|
||||
KVERSION=${KVERSION-$(uname -r)}
|
||||
|
||||
# Uncomment this to debug failures
|
||||
-#DEBUGFAIL="rd.shell rd.break"
|
||||
-#SERIAL="udp:127.0.0.1:9999"
|
||||
+#DEBUGFAIL="rd.shell rd.break rd.debug"
|
||||
+SERIAL="tcp:127.0.0.1:9999"
|
||||
SERIAL="null"
|
||||
|
||||
run_server() {
|
||||
@@ -104,36 +104,36 @@ test_run() {
|
||||
client_run() {
|
||||
# The default is ext3,errors=continue so use that to determine
|
||||
# if our options were parsed and used
|
||||
+ client_test "NBD root=nbd:IP:port" 52:54:00:12:34:00 \
|
||||
+ "root=nbd:192.168.50.1:raw rd.luks=0" || return 1
|
||||
+
|
||||
client_test "NBD root=nbd:IP:port::fsopts" 52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000::errors=panic rd.luks=0" \
|
||||
+ "root=nbd:192.168.50.1:raw::errors=panic rd.luks=0" \
|
||||
ext3 errors=panic || return 1
|
||||
|
||||
- client_test "NBD root=nbd:IP:port" 52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000 rd.luks=0" || return 1
|
||||
-
|
||||
client_test "NBD root=nbd:IP:port:fstype" 52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000:ext2 rd.luks=0" ext2 || return 1
|
||||
+ "root=nbd:192.168.50.1:raw:ext2 rd.luks=0" ext2 || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype:fsopts" 52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000:ext2:errors=panic rd.luks=0" \
|
||||
+ "root=nbd:192.168.50.1:raw:ext2:errors=panic rd.luks=0" \
|
||||
ext2 errors=panic || return 1
|
||||
|
||||
client_test "NBD Bridge root=nbd:IP:port:fstype:fsopts" 52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000:ext2:errors=panic bridge rd.luks=0" \
|
||||
+ "root=nbd:192.168.50.1:raw:ext2:errors=panic bridge rd.luks=0" \
|
||||
ext2 errors=panic || return 1
|
||||
|
||||
# There doesn't seem to be a good way to validate the NBD options, so
|
||||
# just check that we don't screw up the other options
|
||||
|
||||
client_test "NBD root=nbd:IP:port:::NBD opts" 52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000:::bs=2048 rd.luks=0" || return 1
|
||||
+ "root=nbd:192.168.50.1:raw:::bs=2048 rd.luks=0" || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype::NBD opts" 52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000:ext2::bs=2048 rd.luks=0" ext2 || return 1
|
||||
+ "root=nbd:192.168.50.1:raw:ext2::bs=2048 rd.luks=0" ext2 || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype:fsopts:NBD opts" \
|
||||
52:54:00:12:34:00 \
|
||||
- "root=nbd:192.168.50.1:2000:ext2:errors=panic:bs=2048 rd.luks=0" \
|
||||
+ "root=nbd:192.168.50.1:raw:ext2:errors=panic:bs=2048 rd.luks=0" \
|
||||
ext2 errors=panic || return 1
|
||||
|
||||
# DHCP root-path parsing
|
||||
@@ -156,7 +156,7 @@ client_run() {
|
||||
# netroot handling
|
||||
|
||||
client_test "NBD netroot=nbd:IP:port" 52:54:00:12:34:00 \
|
||||
- "netroot=nbd:192.168.50.1:2000 rd.luks=0" || return 1
|
||||
+ "netroot=nbd:192.168.50.1:raw rd.luks=0" || return 1
|
||||
|
||||
client_test "NBD netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
|
||||
52:54:00:12:34:04 "netroot=dhcp rd.luks=0" ext2 errors=panic || return 1
|
||||
@@ -167,7 +167,7 @@ client_run() {
|
||||
|
||||
client_test "NBD root=LABEL=dracut netroot=nbd:IP:port" \
|
||||
52:54:00:12:34:00 \
|
||||
- "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=nbd:192.168.50.1:2001" || return 1
|
||||
+ "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=nbd:192.168.50.1:encrypted" || return 1
|
||||
|
||||
# XXX This should be ext2,errors=panic but that doesn't currently
|
||||
# XXX work when you have a real root= line in addition to netroot=
|
||||
@@ -308,11 +308,20 @@ make_server_root() {
|
||||
mkdir -p "$initdir"
|
||||
(
|
||||
cd "$initdir";
|
||||
- mkdir -p dev sys proc etc var/run var/lib/dhcpd tmp
|
||||
+ mkdir -p dev sys proc etc var/run var/lib/dhcpd tmp etc/nbd-server
|
||||
)
|
||||
+ cat > "$initdir/etc/nbd-server/config" <<EOF
|
||||
+[generic]
|
||||
+[raw]
|
||||
+exportname = /dev/sdb
|
||||
+port = 2000
|
||||
+[encrypted]
|
||||
+exportname = /dev/sdc
|
||||
+port = 2001
|
||||
+EOF
|
||||
inst_multiple sh ls shutdown poweroff stty cat ps ln ip \
|
||||
dmesg mkdir cp ping grep \
|
||||
- sleep nbd-server chmod
|
||||
+ sleep nbd-server chmod modprobe vi
|
||||
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||
[ -f ${_terminfodir}/l/linux ] && break
|
||||
done
|
@ -1,22 +0,0 @@
|
||||
From b830a313319f93162456ce10d73747c5fb036fa6 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Dec 2015 13:59:33 +0100
|
||||
Subject: [PATCH] TEST-16-DMSQUASH: do not use "--" with ldconfig -r
|
||||
|
||||
---
|
||||
test/TEST-16-DMSQUASH/test.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
|
||||
index f2b9963..53a45d6 100755
|
||||
--- a/test/TEST-16-DMSQUASH/test.sh
|
||||
+++ b/test/TEST-16-DMSQUASH/test.sh
|
||||
@@ -98,7 +98,7 @@ test_setup() {
|
||||
inst "$VMLINUZ" "/boot/vmlinuz-${KVERSION}"
|
||||
find_binary plymouth >/dev/null && inst_multiple plymouth
|
||||
cp -a -- /etc/ld.so.conf* "$initdir"/etc
|
||||
- sudo ldconfig -r -- "$initdir"
|
||||
+ sudo ldconfig -r "$initdir"
|
||||
)
|
||||
python create.py -d -c livecd-fedora-minimal.ks
|
||||
return 0
|
18
0011-add-.mailmap.patch
Normal file
18
0011-add-.mailmap.patch
Normal file
@ -0,0 +1,18 @@
|
||||
From 538ff0fd802589587734ccdcc811d78e2c0816a4 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 10 Apr 2017 14:50:21 +0200
|
||||
Subject: [PATCH] add .mailmap
|
||||
|
||||
---
|
||||
.mailmap | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/.mailmap b/.mailmap
|
||||
index 53d61f2a..fd7ab839 100644
|
||||
--- a/.mailmap
|
||||
+++ b/.mailmap
|
||||
@@ -16,3 +16,4 @@ Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
|
||||
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org> <sfalken@opensuse.org>
|
||||
Kyle McMartin <kmcmarti@redhat.com> <kyle@redhat.com>
|
||||
+Angelo "pallotron" Failla <pallotron@fb.com> <pallotron@fb.com>
|
24
0012-fix-build-with-KMOD.patch
Normal file
24
0012-fix-build-with-KMOD.patch
Normal file
@ -0,0 +1,24 @@
|
||||
From f59548aeab5da479493e2c49400993a6502f6f8e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= <tpgxyz@gmail.com>
|
||||
Date: Mon, 24 Apr 2017 21:37:56 +0200
|
||||
Subject: [PATCH] fix build with KMOD
|
||||
|
||||
---
|
||||
Makefile | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 64b46e75..414fb330 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -12,8 +12,8 @@ pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
-CFLAGS ?= -O2 -g -Wall $(KMOD_CFLAGS)
|
||||
-CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
+CFLAGS ?= -O2 -g -Wall
|
||||
+CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 $(KMOD_CFLAGS)
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
|
@ -1,29 +0,0 @@
|
||||
From b8bccd398a4214376474c330ee4b756a4d0c1d19 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Dec 2015 15:12:24 +0100
|
||||
Subject: [PATCH] test/TEST-04-FULL-SYSTEMD: optionally install machine-info
|
||||
and *-id
|
||||
|
||||
---
|
||||
test/TEST-04-FULL-SYSTEMD/test.sh | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
index 6ea9281..f5a9d48 100755
|
||||
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
@@ -264,9 +264,13 @@ EOF
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
+
|
||||
+ [ -e /etc/machine-id ] && EXTRA_MACHINE="/etc/machine-id"
|
||||
+ [ -e /etc/machine-info ] && EXTRA_MACHINE+=" /etc/machine-info"
|
||||
+
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-a "debug systemd i18n" \
|
||||
- -I "/etc/machine-id /etc/hostname" \
|
||||
+ ${EXTRA_MACHINE:+-I "$EXTRA_MACHINE"} \
|
||||
-o "dash network plymouth lvm mdraid resume crypt caps dm terminfo usrmount kernel-network-modules" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \
|
||||
--no-hostonly-cmdline -N \
|
@ -1,29 +0,0 @@
|
||||
From c41df7e1db1adc51399ab2c22f251b15eb2065b1 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Tsoy <alexander@tsoy.me>
|
||||
Date: Tue, 5 Jan 2016 22:11:57 +0300
|
||||
Subject: [PATCH] base/dracut-lib.sh:dev_unit_name() guard against $dev
|
||||
beginning with "-"
|
||||
|
||||
crypt/parse-crypt.sh generate initqueue job which always call
|
||||
dev_unit_name() with an argument beginning with "-". This results
|
||||
in the following error:
|
||||
|
||||
dracut-initqueue[307]: + systemd-escape -p -cfb4aa43-2f02-4c6b-a313-60ea99288087
|
||||
dracut-initqueue[307]: systemd-escape: invalid option -- 'c'
|
||||
---
|
||||
modules.d/99base/dracut-lib.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
|
||||
index ad03394..0a0b1b9 100755
|
||||
--- a/modules.d/99base/dracut-lib.sh
|
||||
+++ b/modules.d/99base/dracut-lib.sh
|
||||
@@ -874,7 +874,7 @@ dev_unit_name()
|
||||
local dev="$1"
|
||||
|
||||
if command -v systemd-escape >/dev/null; then
|
||||
- systemd-escape -p "$dev"
|
||||
+ systemd-escape -p -- "$dev"
|
||||
return
|
||||
fi
|
||||
|
27
0013-mkinitrd-suse.sh-Fix-prefix-calculation.patch
Normal file
27
0013-mkinitrd-suse.sh-Fix-prefix-calculation.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 7cf2c21798b537a5553ecc23df5ce8cfda631e9c Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Molkentin <dmolkentin@suse.com>
|
||||
Date: Tue, 25 Apr 2017 15:25:20 +0200
|
||||
Subject: [PATCH] mkinitrd-suse.sh: Fix prefix calculation
|
||||
|
||||
The previous algorithm was incorrect and would return
|
||||
incorrect results e.g. for a /20 mask. Also gets rid
|
||||
of an undocumented depencency on bc(1).
|
||||
|
||||
Reference: bsc#1035743
|
||||
---
|
||||
mkinitrd-suse.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh
|
||||
index bc49d731..d9de81b9 100755
|
||||
--- a/mkinitrd-suse.sh
|
||||
+++ b/mkinitrd-suse.sh
|
||||
@@ -104,7 +104,7 @@ calc_netmask() {
|
||||
local prefix=$1
|
||||
|
||||
[ -z "$prefix" ] && return
|
||||
- mask=$(echo "(2 ^ 32) - (2 ^ $prefix)" | bc -l)
|
||||
+ mask=$(( 0xffffffff << (32 - $prefix) ))
|
||||
byte1=$(( mask >> 24 ))
|
||||
byte2=$(( mask >> 16 ))
|
||||
byte3=$(( mask >> 8 ))
|
42
0014-TEST-50-MULTINIC-fix-bridge-test.patch
Normal file
42
0014-TEST-50-MULTINIC-fix-bridge-test.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 29fd71b23dc1aca1301510bf68ee8e1a5e336496 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 26 Apr 2017 09:39:20 +0200
|
||||
Subject: [PATCH] TEST-50-MULTINIC: fix bridge test
|
||||
|
||||
Bridge with nics on a different vlan, otherwise we will see:
|
||||
|
||||
[ 117.750825] bridge0: received packet on ens5 with own address as source address
|
||||
---
|
||||
test/TEST-50-MULTINIC/test.sh | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
|
||||
index 84792fe6..917272d8 100755
|
||||
--- a/test/TEST-50-MULTINIC/test.sh
|
||||
+++ b/test/TEST-50-MULTINIC/test.sh
|
||||
@@ -51,10 +51,12 @@ client_test() {
|
||||
fi
|
||||
|
||||
$testdir/run-qemu -drive format=raw,index=0,media=disk,file="$TESTDIR"/client.img -m 512M -smp 2 -nographic \
|
||||
- -net socket,connect=127.0.0.1:12350 \
|
||||
- -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \
|
||||
- -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \
|
||||
- -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \
|
||||
+ -net socket,vlan=0,connect=127.0.0.1:12350 \
|
||||
+ -net nic,vlan=0,macaddr=52:54:00:12:34:$mac1,model=e1000 \
|
||||
+ -net nic,vlan=0,macaddr=52:54:00:12:34:$mac2,model=e1000 \
|
||||
+ -net nic,vlan=0,macaddr=52:54:00:12:34:$mac3,model=e1000 \
|
||||
+ -net nic,vlan=1,macaddr=52:54:00:12:34:98,model=e1000 \
|
||||
+ -net nic,vlan=2,macaddr=52:54:00:12:34:99,model=e1000 \
|
||||
-watchdog i6300esb -watchdog-action poweroff \
|
||||
-no-reboot \
|
||||
-append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \
|
||||
@@ -146,7 +148,7 @@ test_client() {
|
||||
|
||||
client_test "MULTINIC bridging" \
|
||||
00 01 02 \
|
||||
- "root=nfs:192.168.50.1:/nfs/client ip=bridge0:dhcp bridge=bridge0:ens3,ens4,ens5" \
|
||||
+ "root=nfs:192.168.50.1:/nfs/client ip=bridge0:dhcp bridge=bridge0:ens3,ens6,ens7" \
|
||||
"bridge0" || return 1
|
||||
return 0
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
From 07149fe6bea01026b3ae37afb51b0fa831e9f27a Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 7 Jan 2016 09:56:36 +0100
|
||||
Subject: [PATCH] nbd: add missing generator
|
||||
|
||||
---
|
||||
modules.d/95nbd/nbd-generator.sh | 55 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 55 insertions(+)
|
||||
create mode 100755 modules.d/95nbd/nbd-generator.sh
|
||||
|
||||
diff --git a/modules.d/95nbd/nbd-generator.sh b/modules.d/95nbd/nbd-generator.sh
|
||||
new file mode 100755
|
||||
index 0000000..de52d11
|
||||
--- /dev/null
|
||||
+++ b/modules.d/95nbd/nbd-generator.sh
|
||||
@@ -0,0 +1,55 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
+
|
||||
+[ -z "$root" ] && root=$(getarg root=)
|
||||
+
|
||||
+[ "${root%%:*}" = "nbd" ] || exit 0
|
||||
+
|
||||
+GENERATOR_DIR="$2"
|
||||
+[ -z "$GENERATOR_DIR" ] && exit 1
|
||||
+
|
||||
+[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||
+
|
||||
+ROOTFLAGS="$(getarg rootflags)"
|
||||
+
|
||||
+nroot=${root#nbd:}
|
||||
+nbdserver=${nroot%%:*}; nroot=${nroot#*:}
|
||||
+nbdport=${nroot%%:*}; nroot=${nroot#*:}
|
||||
+nbdfstype=${nroot%%:*}; nroot=${nroot#*:}
|
||||
+nbdflags=${nroot%%:*}
|
||||
+
|
||||
+if [ "$nbdflags" = "$nbdfstype" ]; then
|
||||
+ unset nbdflags
|
||||
+fi
|
||||
+if [ "$nbdfstype" = "$nbdport" ]; then
|
||||
+ unset nbdfstype
|
||||
+fi
|
||||
+
|
||||
+[ -n "$nbdflags" ] && ROOTFLAGS="$nbdflags"
|
||||
+
|
||||
+if getarg "ro"; then
|
||||
+ if [ -n "$ROOTFLAGS" ]; then
|
||||
+ ROOTFLAGS="$ROOTFLAGS,ro"
|
||||
+ else
|
||||
+ ROOTFLAGS="ro"
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if [ -n "$nbdfstype" ]; then
|
||||
+ ROOTFSTYPE="$nbdfstype"
|
||||
+else
|
||||
+ ROOTFSTYPE=$(getarg rootfstype=) || unset ROOTFSTYPE
|
||||
+fi
|
||||
+
|
||||
+{
|
||||
+ echo "[Unit]"
|
||||
+ echo "Before=initrd-root-fs.target"
|
||||
+ echo "[Mount]"
|
||||
+ echo "Where=/sysroot"
|
||||
+ echo "What=/dev/root"
|
||||
+ [ -n "$ROOTFSTYPE" ] && echo "Type=${ROOTFSTYPE}"
|
||||
+ [ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
+} > "$GENERATOR_DIR"/sysroot.mount
|
||||
+
|
||||
+exit 0
|
@ -0,0 +1,22 @@
|
||||
From ab66ef2d4a4297642fa059e9df4f86ccefbed4aa Mon Sep 17 00:00:00 2001
|
||||
From: Jason Dana <jasondana@quarksecurity.com>
|
||||
Date: Thu, 27 Apr 2017 07:55:58 -0400
|
||||
Subject: [PATCH] Check the proper variable for a custom IMA keys directory
|
||||
|
||||
---
|
||||
modules.d/98integrity/ima-keys-load.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/98integrity/ima-keys-load.sh b/modules.d/98integrity/ima-keys-load.sh
|
||||
index 659b7222..e142f74d 100755
|
||||
--- a/modules.d/98integrity/ima-keys-load.sh
|
||||
+++ b/modules.d/98integrity/ima-keys-load.sh
|
||||
@@ -13,7 +13,7 @@ load_x509_keys()
|
||||
. ${IMACONFIG}
|
||||
fi
|
||||
|
||||
- if [ -z "${IMAKEYDIR}" ]; then
|
||||
+ if [ -z "${IMAKEYSDIR}" ]; then
|
||||
IMAKEYSDIR="/etc/keys/ima"
|
||||
fi
|
||||
|
@ -1,28 +0,0 @@
|
||||
From e93ff1cf9aac8f97131b3101a5da240ce5f45239 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 7 Jan 2016 10:44:31 +0100
|
||||
Subject: [PATCH] fcoe: no need to copy lldpad state
|
||||
|
||||
/dev/shm should be available later on by the normal switch root bind mount.
|
||||
---
|
||||
modules.d/95fcoe/cleanup-fcoe.sh | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/modules.d/95fcoe/cleanup-fcoe.sh b/modules.d/95fcoe/cleanup-fcoe.sh
|
||||
index 5ff4d05..856e2d9 100644
|
||||
--- a/modules.d/95fcoe/cleanup-fcoe.sh
|
||||
+++ b/modules.d/95fcoe/cleanup-fcoe.sh
|
||||
@@ -2,9 +2,8 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
-if [ -e /var/run/lldpad.pid ]; then
|
||||
- lldpad -k
|
||||
- mkdir -m 0755 -p /run/initramfs/state/dev/shm
|
||||
- cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1
|
||||
- echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab
|
||||
+if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
+ if [ -e /var/run/lldpad.pid ]; then
|
||||
+ lldpad -k
|
||||
+ fi
|
||||
fi
|
99
0016-Handle-curl-using-libnssckbi-for-TLS-RHBZ-1447777.patch
Normal file
99
0016-Handle-curl-using-libnssckbi-for-TLS-RHBZ-1447777.patch
Normal file
@ -0,0 +1,99 @@
|
||||
From 892b1fe6b74a04e7901db306231136a430326ee3 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Williamson <awilliam@redhat.com>
|
||||
Date: Wed, 3 May 2017 12:32:43 -0700
|
||||
Subject: [PATCH] Handle curl using libnssckbi for TLS (RHBZ #1447777)
|
||||
|
||||
curl in Fedora recently changed its default CA trust store. The
|
||||
Fedora package no longer specifies an OpenSSL-format bundle file
|
||||
during build, and curl itself has been patched to use an NSS
|
||||
plugin called libnssckbi.so when no bundle file or directory is
|
||||
specified. There are (at present) two possible providers of the
|
||||
libnssckbi.so module: the original NSS implementation, which
|
||||
uses a trust bundle built in at build time, and a compatible
|
||||
implementation from the p11-kit project, which reads a trust
|
||||
bundle at run time. So if we find a string in libcurl.so that
|
||||
suggests libnssckbi might be in use, we must both install it and
|
||||
make an effort to install any trust bundle files it may use.
|
||||
|
||||
The p11-kit libnssckbi implementation does include a string that
|
||||
lists the top-level trust directories it will use, so we try to
|
||||
find that string, though the best effort I can come up with will
|
||||
also find many false positives too. To weed out the false
|
||||
positives, we check whether the matches actually exist as dirs,
|
||||
and if so, whether they contain some specific subdirectories we
|
||||
know p11-kit trust dirs must have (thanks, @kaie). For the NSS
|
||||
libnssckbi implementation, we will likely wind up not finding any
|
||||
dirs that match the requirements, so we will simply install the
|
||||
libnssckbi.so file itself, which is the correct action.
|
||||
|
||||
This fixes TLS transactions in the initramfs environment when
|
||||
using a curl that's built this new way; it's significant for
|
||||
use of kickstarts and update images with the Fedora / RHEL
|
||||
installer, as these are retrieved in the initramfs environment,
|
||||
and are frequently retrieved via HTTPS.
|
||||
---
|
||||
modules.d/45url-lib/module-setup.sh | 38 +++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 36 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.d/45url-lib/module-setup.sh b/modules.d/45url-lib/module-setup.sh
|
||||
index 1ece400f..b3fe55a6 100755
|
||||
--- a/modules.d/45url-lib/module-setup.sh
|
||||
+++ b/modules.d/45url-lib/module-setup.sh
|
||||
@@ -15,7 +15,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
- local _dir _crt _found _lib
|
||||
+ local _dir _crt _found _lib _nssckbi _p11roots _p11root _p11item
|
||||
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
|
||||
inst_multiple -o ctorrent
|
||||
inst_multiple curl
|
||||
@@ -29,6 +29,7 @@ install() {
|
||||
[[ -d $_dir ]] || continue
|
||||
for _lib in $_dir/libcurl.so.*; do
|
||||
[[ -e $_lib ]] || continue
|
||||
+ [[ $_nssckbi ]] || _nssckbi=$(grep -F --binary-files=text -z libnssckbi $_lib)
|
||||
_crt=$(grep -F --binary-files=text -z .crt $_lib)
|
||||
[[ $_crt ]] || continue
|
||||
[[ $_crt == /*/* ]] || continue
|
||||
@@ -39,6 +40,39 @@ install() {
|
||||
_found=1
|
||||
done
|
||||
done
|
||||
- [[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
|
||||
+ # If we found no cert bundle files referenced in libcurl but we
|
||||
+ # *did* find a mention of libnssckbi (checked above), install it.
|
||||
+ # If its truly NSS libnssckbi, it includes its own trust bundle,
|
||||
+ # but if it's really p11-kit-trust.so, we need to find the dirs
|
||||
+ # where it will look for a trust bundle and install them too.
|
||||
+ if ! [[ $_found ]] && [[ $_nssckbi ]] ; then
|
||||
+ _found=1
|
||||
+ inst_libdir_file "libnssckbi.so*" || _found=
|
||||
+ for _dir in $libdirs; do
|
||||
+ [[ -e $_dir/libnssckbi.so ]] || continue
|
||||
+ # this looks for directory-ish strings in the file
|
||||
+ for _p11roots in $(grep -o --binary-files=text "/[[:alpha:]][[:print:]]*" $_dir/libnssckbi.so) ; do
|
||||
+ # the string can be a :-separated list of dirs
|
||||
+ for _p11root in $(echo "$_p11roots" | tr ':' '\n') ; do
|
||||
+ # check if it's actually a directory (there are
|
||||
+ # several false positives in the results)
|
||||
+ [[ -d "$_p11root" ]] || continue
|
||||
+ # check if it has some specific subdirs that all
|
||||
+ # p11-kit trust dirs have
|
||||
+ [[ -d "${_p11root}/anchors" ]] || continue
|
||||
+ [[ -d "${_p11root}/blacklist" ]] || continue
|
||||
+ # so now we know it's really a p11-kit trust dir;
|
||||
+ # install everything in it
|
||||
+ for _p11item in $(find "$_p11root") ; do
|
||||
+ if ! inst "$_p11item" ; then
|
||||
+ dwarn "Couldn't install '$_p11item' from p11-kit trust dir '$_p11root'; HTTPS might not work."
|
||||
+ continue
|
||||
+ fi
|
||||
+ done
|
||||
+ done
|
||||
+ done
|
||||
+ done
|
||||
+ fi
|
||||
+ [[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle or libnssckbi.so; HTTPS won't work."
|
||||
}
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 60928f36b6c9a855077506444ea5edbe6be9ec4c Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 8 Jan 2016 11:37:25 +0100
|
||||
Subject: [PATCH] dracut.sh: restorecon final image file
|
||||
|
||||
Instead of "mv" use "cp --reflink=auto" and restorecon the final image
|
||||
---
|
||||
dracut.sh | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dracut.sh b/dracut.sh
|
||||
index a2fc496..6dc9858 100755
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -1724,6 +1724,8 @@ if (( maxloglvl >= 5 )); then
|
||||
fi
|
||||
fi
|
||||
|
||||
+umask 077
|
||||
+
|
||||
if [[ $uefi = yes ]]; then
|
||||
if [[ $kernel_cmdline ]]; then
|
||||
echo -n "$kernel_cmdline" > "$uefi_outdir/cmdline.txt"
|
||||
@@ -1749,7 +1751,7 @@ if [[ $uefi = yes ]]; then
|
||||
--add-section .linux="$kernel_image" --change-section-vma .linux=0x40000 \
|
||||
--add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd=0x3000000 \
|
||||
"$uefi_stub" "${uefi_outdir}/linux.efi" \
|
||||
- && mv "${uefi_outdir}/linux.efi" "$outfile"; then
|
||||
+ && cp --reflink=auto "${uefi_outdir}/linux.efi" "$outfile"; then
|
||||
dinfo "*** Creating UEFI image file '$outfile' done ***"
|
||||
else
|
||||
rm -f -- "$outfile"
|
||||
@@ -1757,7 +1759,7 @@ if [[ $uefi = yes ]]; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
- if mv "${DRACUT_TMPDIR}/initramfs.img" "$outfile"; then
|
||||
+ if cp --reflink=auto "${DRACUT_TMPDIR}/initramfs.img" "$outfile"; then
|
||||
dinfo "*** Creating initramfs image file '$outfile' done ***"
|
||||
else
|
||||
rm -f -- "$outfile"
|
||||
@@ -1766,5 +1768,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
+command -v restorecon &>/dev/null && restorecon -- "$outfile"
|
||||
|
||||
exit 0
|
@ -1,22 +0,0 @@
|
||||
From 0a7d7f63106ce5a7f9869aacb21d0474621811e7 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 13 Jan 2016 09:17:40 +0100
|
||||
Subject: [PATCH] dracut.cmdline: remove extra ":" from ip= doc
|
||||
|
||||
---
|
||||
dracut.cmdline.7.asc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
|
||||
index e160e3b..c4c5588 100644
|
||||
--- a/dracut.cmdline.7.asc
|
||||
+++ b/dracut.cmdline.7.asc
|
||||
@@ -492,7 +492,7 @@ cannot be used in conjunction with the **ifname** argument for the
|
||||
same <interface>.
|
||||
=====================
|
||||
|
||||
-**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__:[:[__<mtu>__][:__<macaddr>__]]::
|
||||
+**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__[:[__<mtu>__][:__<macaddr>__]]::
|
||||
explicit network configuration. If you want do define a IPv6 address, put it
|
||||
in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple
|
||||
times. __<peer>__ is optional and is the address of the remote endpoint
|
37
0017-drm-Install-pwm-modules-on-all-architectures.patch
Normal file
37
0017-drm-Install-pwm-modules-on-all-architectures.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From feaaee4278077dd67fe24acebfbe47ba20738955 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Sat, 13 May 2017 17:23:36 +0200
|
||||
Subject: [PATCH] drm: Install pwm modules on all architectures
|
||||
|
||||
At least on x86 on Bay and Cherry Trail devices the pmw-lpss modules must
|
||||
be in the initrd too, otherwise the i915 driver will still load, but
|
||||
it will report the following error:
|
||||
|
||||
[drm:pwm_setup_backlight [i915]] *ERROR* Failed to own the pwm chip
|
||||
|
||||
And not register /sys/class/backlight/intel_backlight and users will
|
||||
not be able to control their backlight.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
modules.d/50drm/module-setup.sh | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
|
||||
index 42a5e7bc..2014539a 100755
|
||||
--- a/modules.d/50drm/module-setup.sh
|
||||
+++ b/modules.d/50drm/module-setup.sh
|
||||
@@ -21,12 +21,11 @@ installkernel() {
|
||||
"=drivers/gpu/drm/i2c" \
|
||||
"=drivers/gpu/drm/panel" \
|
||||
"=drivers/gpu/drm/bridge" \
|
||||
- "=drivers/pwm" \
|
||||
"=drivers/video/backlight" \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
- instmods amdkfd hyperv_fb
|
||||
+ instmods amdkfd hyperv_fb "=drivers/pwm"
|
||||
|
||||
# if the hardware is present, include module even if it is not currently loaded,
|
||||
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
|
@ -1,30 +0,0 @@
|
||||
From b019952f6df9b1dae54dd097f012e6c05fe6af00 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 13 Jan 2016 09:32:24 +0100
|
||||
Subject: [PATCH] dracut.sh: fail hard, if we find modules and modules.dep is
|
||||
missing
|
||||
|
||||
If modules are present in /lib/modules/<kernelversion> and modules.dep
|
||||
is empty, depmod was not run most likely.
|
||||
---
|
||||
dracut.sh | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dracut.sh b/dracut.sh
|
||||
index 6dc9858..98dbe0b 100755
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -925,7 +925,12 @@ abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
|
||||
|
||||
if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then
|
||||
if ! [[ -f $srcmods/modules.dep ]]; then
|
||||
- dwarn "$srcmods/modules.dep is missing. Did you run depmod?"
|
||||
+ if [[ -n "$(find "$srcmods" -name '*.ko*')" ]]; then
|
||||
+ dfatal "$srcmods/modules.dep is missing. Did you run depmod?"
|
||||
+ exit 1
|
||||
+ else
|
||||
+ dwarn "$srcmods/modules.dep is missing. Did you run depmod?"
|
||||
+ fi
|
||||
elif ! ( command -v gzip &>/dev/null && command -v xz &>/dev/null); then
|
||||
read _mod < $srcmods/modules.dep
|
||||
_mod=${_mod%%:*}
|
@ -1,25 +0,0 @@
|
||||
From efbc47b8e43ad173d3319f3f6e87b0a60aad9f37 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 13 Jan 2016 13:43:38 +0100
|
||||
Subject: [PATCH] network/net-lib.sh: correctly set mac address for
|
||||
ip=...:<mtu>:<mac>
|
||||
|
||||
if ip=...:<mtu>:<mac> was specified, macadress was not set
|
||||
---
|
||||
modules.d/40network/net-lib.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index 256826e..31f1a56 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -427,6 +427,9 @@ ip_to_var() {
|
||||
;;
|
||||
[0-9]*)
|
||||
mtu="$8"
|
||||
+ if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
||||
+ macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
||||
+ fi
|
||||
;;
|
||||
*)
|
||||
if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
@ -1,25 +0,0 @@
|
||||
From 2fd8588da51a0e43684852dcdabe327aca684a9f Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 18 Jan 2016 16:59:42 +0100
|
||||
Subject: [PATCH] dracut-functions.sh:fix check_vol_slaves() volume group name
|
||||
stripping
|
||||
|
||||
commit 466a59984a095f33993cffd5a3bea40826469b03 removed whitespace
|
||||
stripping from lvm volume group names.
|
||||
---
|
||||
dracut-functions.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
||||
index 59747ec..c7ea9f5 100755
|
||||
--- a/dracut-functions.sh
|
||||
+++ b/dracut-functions.sh
|
||||
@@ -580,7 +580,7 @@ check_vol_slaves() {
|
||||
if [[ $_lv = $2 ]]; then
|
||||
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
|
||||
# strip space
|
||||
- _vg=$(printf "%s\n" "$_vg")
|
||||
+ _vg="${_vg//[[:space:]]/}"
|
||||
if [[ $_vg ]]; then
|
||||
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
|
||||
do
|
@ -1,38 +0,0 @@
|
||||
From 28058a2e373eb268d9b1cd5b65c2ad607961dad1 Mon Sep 17 00:00:00 2001
|
||||
From: Pekka Wallendahl <wyrmiyu@gmail.com>
|
||||
Date: Mon, 18 Jan 2016 20:28:22 +0200
|
||||
Subject: [PATCH] multipath: fix majmin_to_mpath_dev()
|
||||
|
||||
* Multipath device names only start with the mpath-prefix if the option
|
||||
use_userfriendly_names is set true in /etc/multipath.conf and if user
|
||||
has not set any aliases in the said file. Thus the for-loop should go
|
||||
through all files in /dev/mapper/, not just ones starting with 'mpath'
|
||||
|
||||
* Bash is perfectly capable to extend `/dev/mapper/*` notation without a
|
||||
need to pass it to an external ls
|
||||
|
||||
* Changed the function to use a local variable $_dev instead of the
|
||||
global $dev, which seemed to be the original intention as the local
|
||||
_dev was defined but not used
|
||||
---
|
||||
modules.d/90multipath/module-setup.sh | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
|
||||
index 831c99f..a808678 100755
|
||||
--- a/modules.d/90multipath/module-setup.sh
|
||||
+++ b/modules.d/90multipath/module-setup.sh
|
||||
@@ -9,9 +9,10 @@ is_mpath() {
|
||||
|
||||
majmin_to_mpath_dev() {
|
||||
local _dev
|
||||
- for i in `ls -1 /dev/mapper/mpath*`; do
|
||||
- dev=$(get_maj_min $i)
|
||||
- if [ "$dev" = "$1" ]; then
|
||||
+ for i in /dev/mapper/*; do
|
||||
+ [[ $i == /dev/mapper/control ]] && continue
|
||||
+ _dev=$(get_maj_min $i)
|
||||
+ if [ "$_dev" = "$1" ]; then
|
||||
echo $i
|
||||
return
|
||||
fi
|
@ -1,805 +0,0 @@
|
||||
From 24a78b269745b0b16a2bdc03c35015b2cb9d0408 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 19 Jan 2016 11:34:10 +0100
|
||||
Subject: [PATCH] Fixed vlan, bonding, bridging, team logic
|
||||
|
||||
Call ifup for the slaves and assemble afterwards.
|
||||
---
|
||||
modules.d/40network/ifup.sh | 364 ++++++++++++++++++------------------
|
||||
modules.d/40network/net-genrules.sh | 26 ++-
|
||||
modules.d/40network/parse-bond.sh | 25 +--
|
||||
modules.d/40network/parse-bridge.sh | 28 +--
|
||||
modules.d/40network/parse-team.sh | 26 +--
|
||||
modules.d/40network/parse-vlan.sh | 4 +-
|
||||
modules.d/45ifcfg/write-ifcfg.sh | 21 +--
|
||||
test/TEST-20-NFS/test.sh | 4 +-
|
||||
test/TEST-30-ISCSI/test.sh | 4 +-
|
||||
test/TEST-50-MULTINIC/test.sh | 17 +-
|
||||
10 files changed, 249 insertions(+), 270 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
|
||||
index eca7478..14ca86d 100755
|
||||
--- a/modules.d/40network/ifup.sh
|
||||
+++ b/modules.d/40network/ifup.sh
|
||||
@@ -15,76 +15,12 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
-use_bridge='false'
|
||||
-use_vlan='false'
|
||||
|
||||
-# enslave this interface to bond?
|
||||
-for i in /tmp/bond.*.info; do
|
||||
- [ -e "$i" ] || continue
|
||||
- unset bondslaves
|
||||
- unset bondname
|
||||
- . "$i"
|
||||
- for slave in $bondslaves ; do
|
||||
- if [ "$netif" = "$slave" ] ; then
|
||||
- netif=$bondname
|
||||
- break 2
|
||||
- fi
|
||||
- done
|
||||
-done
|
||||
-
|
||||
-if [ -e /tmp/team.info ]; then
|
||||
- . /tmp/team.info
|
||||
- for slave in $teamslaves ; do
|
||||
- if [ "$netif" = "$slave" ] ; then
|
||||
- netif=$teammaster
|
||||
- fi
|
||||
- done
|
||||
-fi
|
||||
-
|
||||
-if [ -e /tmp/vlan.info ]; then
|
||||
- . /tmp/vlan.info
|
||||
- if [ "$netif" = "$phydevice" ]; then
|
||||
- if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
- : # We need to really setup bond (recursive call)
|
||||
- elif [ "$netif" = "$teammaster" ] && [ -n "$DO_TEAM_SETUP" ] ; then
|
||||
- : # We need to really setup team (recursive call)
|
||||
- else
|
||||
- netif="$vlanname"
|
||||
- use_vlan='true'
|
||||
- fi
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
-# bridge this interface?
|
||||
-if [ -e /tmp/bridge.info ]; then
|
||||
- . /tmp/bridge.info
|
||||
- for ethname in $bridgeslaves ; do
|
||||
- if [ "$netif" = "$ethname" ]; then
|
||||
- if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
- : # We need to really setup bond (recursive call)
|
||||
- elif [ "$netif" = "$teammaster" ] && [ -n "$DO_TEAM_SETUP" ] ; then
|
||||
- : # We need to really setup team (recursive call)
|
||||
- elif [ "$netif" = "$vlanname" ] && [ -n "$DO_VLAN_SETUP" ]; then
|
||||
- : # We need to really setup vlan (recursive call)
|
||||
- else
|
||||
- netif="$bridgename"
|
||||
- use_bridge='true'
|
||||
- fi
|
||||
- fi
|
||||
- done
|
||||
-fi
|
||||
-
|
||||
-# disable manual ifup while netroot is set for simplifying our logic
|
||||
-# in netroot case we prefer netroot to bringup $netif automaticlly
|
||||
-[ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
|
||||
-
|
||||
-if [ -n "$manualup" ]; then
|
||||
- >/tmp/net.$netif.manualup
|
||||
- rm -f /tmp/net.${netif}.did-setup
|
||||
-else
|
||||
- [ -e /tmp/net.${netif}.did-setup ] && exit 0
|
||||
- [ -e /sys/class/net/$netif/address ] && \
|
||||
- [ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && exit 0
|
||||
+# loopback is always handled the same way
|
||||
+if [ "$netif" = "lo" ] ; then
|
||||
+ ip link set lo up
|
||||
+ ip addr add 127.0.0.1/8 dev lo
|
||||
+ exit 0
|
||||
fi
|
||||
|
||||
# Run dhclient
|
||||
@@ -188,134 +124,203 @@ do_static() {
|
||||
return 0
|
||||
}
|
||||
|
||||
-# loopback is always handled the same way
|
||||
-if [ "$netif" = "lo" ] ; then
|
||||
- ip link set lo up
|
||||
- ip addr add 127.0.0.1/8 dev lo
|
||||
+get_vid() {
|
||||
+ case "$1" in
|
||||
+ vlan*)
|
||||
+ echo ${1#vlan}
|
||||
+ ;;
|
||||
+ *.*)
|
||||
+ echo ${1##*.}
|
||||
+ ;;
|
||||
+ esac
|
||||
+}
|
||||
+
|
||||
+# check, if we need VLAN's for this interface
|
||||
+if [ -z "$DO_VLAN_PHY" ] && [ -e /tmp/vlan.${netif}.phy ]; then
|
||||
+ NO_AUTO_DHCP=yes DO_VLAN_PHY=yes ifup "$netif"
|
||||
+ modprobe -b -q 8021q
|
||||
+
|
||||
+ for i in /tmp/vlan.*.${netif}; do
|
||||
+ [ -e "$i" ] || continue
|
||||
+ read vlanname < "$i"
|
||||
+ if [ -n "$vlanname" ]; then
|
||||
+ linkup "$phydevice"
|
||||
+ ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname)"
|
||||
+ ifup "$vlanname"
|
||||
+ fi
|
||||
+ done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
-# start bond if needed
|
||||
-if [ -e /tmp/bond.${netif}.info ]; then
|
||||
- . /tmp/bond.${netif}.info
|
||||
-
|
||||
- if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
|
||||
- modprobe bonding
|
||||
- echo "+$netif" > /sys/class/net/bonding_masters
|
||||
- ip link set $netif down
|
||||
-
|
||||
- # Stolen from ifup-eth
|
||||
- # add the bits to setup driver parameters here
|
||||
- for arg in $bondoptions ; do
|
||||
- key=${arg%%=*};
|
||||
- value=${arg##*=};
|
||||
- # %{value:0:1} is replaced with non-bash specific construct
|
||||
- if [ "${key}" = "arp_ip_target" -a "${#value}" != "0" -a "+${value%%+*}" != "+" ]; then
|
||||
- OLDIFS=$IFS;
|
||||
- IFS=',';
|
||||
- for arp_ip in $value; do
|
||||
- echo +$arp_ip > /sys/class/net/${netif}/bonding/$key
|
||||
- done
|
||||
- IFS=$OLDIFS;
|
||||
- else
|
||||
- echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
+# bridge this interface?
|
||||
+if [ -z "$NO_BRIDGE_MASTER" ]; then
|
||||
+ for i in /tmp/bridge.*.info; do
|
||||
+ [ -e "$i" ] || continue
|
||||
+ unset bridgeslaves
|
||||
+ unset bridgename
|
||||
+ . "$i"
|
||||
+ for ethname in $bridgeslaves ; do
|
||||
+ [ "$netif" != "$ethname" ] && continue
|
||||
+
|
||||
+ NO_BRIDGE_MASTER=yes NO_AUTO_DHCP=yes ifup $ethname
|
||||
+ linkup $ethname
|
||||
+ if [ ! -e /tmp/bridge.$bridgename.up ]; then
|
||||
+ brctl addbr $bridgename
|
||||
+ brctl setfd $bridgename 0
|
||||
+ > /tmp/bridge.$bridgename.up
|
||||
fi
|
||||
+ brctl addif $bridgename $ethname
|
||||
+ ifup $bridgename
|
||||
+ exit 0
|
||||
done
|
||||
+ done
|
||||
+fi
|
||||
|
||||
- linkup $netif
|
||||
-
|
||||
+# enslave this interface to bond?
|
||||
+if [ -z "$NO_BOND_MASTER" ]; then
|
||||
+ for i in /tmp/bond.*.info; do
|
||||
+ [ -e "$i" ] || continue
|
||||
+ unset bondslaves
|
||||
+ unset bondname
|
||||
+ . "$i"
|
||||
for slave in $bondslaves ; do
|
||||
- ip link set $slave down
|
||||
- cat /sys/class/net/$slave/address > /tmp/net.${netif}.${slave}.hwaddr
|
||||
- echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
|
||||
- linkup $slave
|
||||
- done
|
||||
+ [ "$netif" != "$slave" ] && continue
|
||||
|
||||
- # add the bits to setup the needed post enslavement parameters
|
||||
- for arg in $BONDING_OPTS ; do
|
||||
- key=${arg%%=*};
|
||||
- value=${arg##*=};
|
||||
- if [ "${key}" = "primary" ]; then
|
||||
- echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
- fi
|
||||
+ # already setup
|
||||
+ [ -e /tmp/bond.$bondname.up ] && exit 0
|
||||
+
|
||||
+ # wait for all slaves to show up
|
||||
+ for slave in $bondslaves ; do
|
||||
+ # try to create the slave (maybe vlan or bridge)
|
||||
+ NO_BOND_MASTER=yes NO_AUTO_DHCP=yes ifup $slave
|
||||
+
|
||||
+ if ! ip link show dev $slave >/dev/null 2>&1; then
|
||||
+ # wait for the last slave to show up
|
||||
+ exit 0
|
||||
+ fi
|
||||
+ done
|
||||
+
|
||||
+ modprobe -q -b bonding
|
||||
+ echo "+$bondname" > /sys/class/net/bonding_masters 2>/dev/null
|
||||
+ ip link set $bondname down
|
||||
+
|
||||
+ # Stolen from ifup-eth
|
||||
+ # add the bits to setup driver parameters here
|
||||
+ for arg in $bondoptions ; do
|
||||
+ key=${arg%%=*};
|
||||
+ value=${arg##*=};
|
||||
+ # %{value:0:1} is replaced with non-bash specific construct
|
||||
+ if [ "${key}" = "arp_ip_target" -a "${#value}" != "0" -a "+${value%%+*}" != "+" ]; then
|
||||
+ OLDIFS=$IFS;
|
||||
+ IFS=',';
|
||||
+ for arp_ip in $value; do
|
||||
+ echo +$arp_ip > /sys/class/net/${bondname}/bonding/$key
|
||||
+ done
|
||||
+ IFS=$OLDIFS;
|
||||
+ else
|
||||
+ echo $value > /sys/class/net/${bondname}/bonding/$key
|
||||
+ fi
|
||||
+ done
|
||||
+
|
||||
+ linkup $bondname
|
||||
+
|
||||
+ for slave in $bondslaves ; do
|
||||
+ cat /sys/class/net/$slave/address > /tmp/net.${bondname}.${slave}.hwaddr
|
||||
+ ip link set $slave down
|
||||
+ echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
|
||||
+ linkup $slave
|
||||
+ done
|
||||
+
|
||||
+ # add the bits to setup the needed post enslavement parameters
|
||||
+ for arg in $bondoptions ; do
|
||||
+ key=${arg%%=*};
|
||||
+ value=${arg##*=};
|
||||
+ if [ "${key}" = "primary" ]; then
|
||||
+ echo $value > /sys/class/net/${bondname}/bonding/$key
|
||||
+ fi
|
||||
+ done
|
||||
+
|
||||
+ > /tmp/bond.$bondname.up
|
||||
+
|
||||
+ NO_BOND_MASTER=yes ifup $bondname
|
||||
+ exit $?
|
||||
done
|
||||
- fi
|
||||
+ done
|
||||
fi
|
||||
|
||||
-if [ -e /tmp/team.info ]; then
|
||||
- . /tmp/team.info
|
||||
- if [ "$netif" = "$teammaster" ] && [ ! -e /tmp/net.$teammaster.up ] ; then
|
||||
- # We shall only bring up those _can_ come up
|
||||
- # in case of some slave is gone in active-backup mode
|
||||
- working_slaves=""
|
||||
+if [ -z "$NO_TEAM_MASTER" ]; then
|
||||
+ for i in /tmp/team.*.info; do
|
||||
+ [ -e "$i" ] || continue
|
||||
+ unset teammaster
|
||||
+ unset teamslaves
|
||||
+ . "$i"
|
||||
for slave in $teamslaves ; do
|
||||
- ip link set $slave up 2>/dev/null
|
||||
- if wait_for_if_up $slave; then
|
||||
- working_slaves+="$slave "
|
||||
- fi
|
||||
- done
|
||||
- # Do not add slaves now
|
||||
- teamd -d -U -n -N -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
- for slave in $working_slaves; do
|
||||
- # team requires the slaves to be down before joining team
|
||||
- ip link set $slave down
|
||||
- teamdctl $teammaster port add $slave
|
||||
- done
|
||||
- ip link set $teammaster up
|
||||
- fi
|
||||
-fi
|
||||
+ [ "$netif" != "$slave" ] && continue
|
||||
|
||||
-# XXX need error handling like dhclient-script
|
||||
+ [ -e /tmp/team.$teammaster.up ] && exit 0
|
||||
|
||||
-if [ -e /tmp/bridge.info ]; then
|
||||
- . /tmp/bridge.info
|
||||
-# start bridge if necessary
|
||||
- if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
- brctl addbr $bridgename
|
||||
- brctl setfd $bridgename 0
|
||||
- for ethname in $bridgeslaves ; do
|
||||
- if [ "$ethname" = "$bondname" ] ; then
|
||||
- DO_BOND_SETUP=yes ifup $bondname -m
|
||||
- elif [ "$ethname" = "$teammaster" ] ; then
|
||||
- DO_TEAM_SETUP=yes ifup $teammaster -m
|
||||
- elif [ "$ethname" = "$vlanname" ]; then
|
||||
- DO_VLAN_SETUP=yes ifup $vlanname -m
|
||||
- else
|
||||
- linkup $ethname
|
||||
+ # wait for all slaves to show up
|
||||
+ for slave in $teamslaves ; do
|
||||
+ # try to create the slave (maybe vlan or bridge)
|
||||
+ NO_BOND_MASTER=yes NO_AUTO_DHCP=yes ifup $slave
|
||||
+
|
||||
+ if ! ip link show dev $slave >/dev/null 2>&1; then
|
||||
+ # wait for the last slave to show up
|
||||
+ exit 0
|
||||
+ fi
|
||||
+ done
|
||||
+
|
||||
+ if [ ! -e /tmp/team.$teammaster.up ] ; then
|
||||
+ # We shall only bring up those _can_ come up
|
||||
+ # in case of some slave is gone in active-backup mode
|
||||
+ working_slaves=""
|
||||
+ for slave in $teamslaves ; do
|
||||
+ ip link set $slave up 2>/dev/null
|
||||
+ if wait_for_if_up $slave; then
|
||||
+ working_slaves+="$slave "
|
||||
+ fi
|
||||
+ done
|
||||
+ # Do not add slaves now
|
||||
+ teamd -d -U -n -N -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
+ for slave in $working_slaves; do
|
||||
+ # team requires the slaves to be down before joining team
|
||||
+ ip link set $slave down
|
||||
+ teamdctl $teammaster port add $slave
|
||||
+ done
|
||||
+
|
||||
+ ip link set $teammaster up
|
||||
+
|
||||
+ > /tmp/team.$teammaster.up
|
||||
+ NO_TEAM_MASTER=yes ifup $teammaster
|
||||
+ exit $?
|
||||
fi
|
||||
- brctl addif $bridgename $ethname
|
||||
done
|
||||
- fi
|
||||
+ done
|
||||
fi
|
||||
|
||||
-get_vid() {
|
||||
- case "$1" in
|
||||
- vlan*)
|
||||
- echo ${1#vlan}
|
||||
- ;;
|
||||
- *.*)
|
||||
- echo ${1##*.}
|
||||
- ;;
|
||||
- esac
|
||||
-}
|
||||
+# all synthetic interfaces done.. now check if the interface is available
|
||||
+if ! ip link show dev $netif >/dev/null 2>&1; then
|
||||
+ exit 1
|
||||
+fi
|
||||
|
||||
-if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
|
||||
- modprobe 8021q
|
||||
- if [ "$phydevice" = "$bondname" ] ; then
|
||||
- DO_BOND_SETUP=yes ifup $phydevice -m
|
||||
- elif [ "$phydevice" = "$teammaster" ] ; then
|
||||
- DO_TEAM_SETUP=yes ifup $phydevice -m
|
||||
- else
|
||||
- linkup "$phydevice"
|
||||
- fi
|
||||
- ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname)"
|
||||
- ip link set "$vlanname" up
|
||||
+# disable manual ifup while netroot is set for simplifying our logic
|
||||
+# in netroot case we prefer netroot to bringup $netif automaticlly
|
||||
+[ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
|
||||
+
|
||||
+if [ -n "$manualup" ]; then
|
||||
+ >/tmp/net.$netif.manualup
|
||||
+ rm -f /tmp/net.${netif}.did-setup
|
||||
+else
|
||||
+ [ -e /tmp/net.${netif}.did-setup ] && exit 0
|
||||
+ [ -e /sys/class/net/$netif/address ] && \
|
||||
+ [ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && exit 0
|
||||
fi
|
||||
|
||||
+
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
|
||||
-if [ -z "$ip" ]; then
|
||||
+if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then
|
||||
for s in $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
@@ -348,9 +353,7 @@ for p in $(getargs ip=); do
|
||||
esac
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
- [ -n "$dev" ] && [ "$dev" != "$netif" ] && \
|
||||
- [ "$use_bridge" != 'true' ] && \
|
||||
- [ "$use_vlan" != 'true' ] && continue
|
||||
+ [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
|
||||
# setup nameserver
|
||||
for s in "$dns1" "$dns2" $(getargs nameserver); do
|
||||
@@ -402,15 +405,8 @@ for p in $(getargs ip=); do
|
||||
fi
|
||||
done
|
||||
|
||||
-# netif isn't the top stack? Then we should exit here.
|
||||
-# eg. netif is bond0. br0 is on top of it. dhcp br0 is correct but dhcp
|
||||
-# bond0 doesn't make sense.
|
||||
-if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then
|
||||
- exit 0
|
||||
-fi
|
||||
-
|
||||
# no ip option directed at our interface?
|
||||
-if [ ! -e /tmp/net.${netif}.up ]; then
|
||||
+if [ -z "$NO_AUTO_DHCP" ] && [ ! -e /tmp/net.${netif}.up ]; then
|
||||
if [ -e /tmp/net.bootdev ]; then
|
||||
BOOTDEV=$(cat /tmp/net.bootdev)
|
||||
if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then
|
||||
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
|
||||
index b1c156c..5df50bd 100755
|
||||
--- a/modules.d/40network/net-genrules.sh
|
||||
+++ b/modules.d/40network/net-genrules.sh
|
||||
@@ -12,11 +12,14 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
# Write udev rules
|
||||
{
|
||||
# bridge: attempt only the defined interface
|
||||
- if [ -e /tmp/bridge.info ]; then
|
||||
- . /tmp/bridge.info
|
||||
+ for i in /tmp/bridge.*.info; do
|
||||
+ [ -e "$i" ] || continue
|
||||
+ unset bridgeslaves
|
||||
+ unset bridgename
|
||||
+ . "$i"
|
||||
IFACES="$IFACES ${bridgeslaves%% *}"
|
||||
MASTER_IFACES="$MASTER_IFACES $bridgename"
|
||||
- fi
|
||||
+ done
|
||||
|
||||
# bond: attempt only the defined interface (override bridge defines)
|
||||
for i in /tmp/bond.*.info; do
|
||||
@@ -35,11 +38,18 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
MASTER_IFACES="$MASTER_IFACES ${teammaster}"
|
||||
fi
|
||||
|
||||
- if [ -e /tmp/vlan.info ]; then
|
||||
- . /tmp/vlan.info
|
||||
- IFACES="$IFACES $phydevice"
|
||||
- MASTER_IFACES="$MASTER_IFACES ${vlanname}"
|
||||
- fi
|
||||
+ for j in /tmp/vlan.*.phy; do
|
||||
+ [ -e "$j" ] || continue
|
||||
+ unset phydevice
|
||||
+ . "$j"
|
||||
+ for i in /tmp/vlan.*.${phydevice}; do
|
||||
+ [ -e "$i" ] || continue
|
||||
+ unset vlanname
|
||||
+ . "$i"
|
||||
+ IFACES="$IFACES $phydevice"
|
||||
+ MASTER_IFACES="$MASTER_IFACES ${vlanname}"
|
||||
+ done
|
||||
+ done
|
||||
|
||||
if [ -z "$IFACES" ]; then
|
||||
[ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
|
||||
diff --git a/modules.d/40network/parse-bond.sh b/modules.d/40network/parse-bond.sh
|
||||
index 25c51b8..80b3b07 100755
|
||||
--- a/modules.d/40network/parse-bond.sh
|
||||
+++ b/modules.d/40network/parse-bond.sh
|
||||
@@ -10,14 +10,6 @@
|
||||
# bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr
|
||||
#
|
||||
|
||||
-# return if bond already parsed
|
||||
-[ -n "$bondname" ] && return
|
||||
-
|
||||
-# Check if bond parameter is valid
|
||||
-if getarg bond= >/dev/null ; then
|
||||
- :
|
||||
-fi
|
||||
-
|
||||
# We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
|
||||
# Ditto for bonding options
|
||||
parsebond() {
|
||||
@@ -28,7 +20,6 @@ parsebond() {
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
- unset bondname bondslaves bondoptions
|
||||
case $# in
|
||||
0) bondname=bond0; bondslaves="eth0 eth1" ;;
|
||||
1) bondname=$1; bondslaves="eth0 eth1" ;;
|
||||
@@ -38,14 +29,13 @@ parsebond() {
|
||||
esac
|
||||
}
|
||||
|
||||
-unset bondname bondslaves bondoptions
|
||||
-
|
||||
# Parse bond for bondname, bondslaves, bondmode and bondoptions
|
||||
-if getarg bond >/dev/null; then
|
||||
- # Read bond= parameters if they exist
|
||||
- bond="$(getarg bond=)"
|
||||
- if [ ! "$bond" = "bond" ]; then
|
||||
- parsebond "$(getarg bond=)"
|
||||
+for bond in $(getargs bond=); do
|
||||
+ unset bondname
|
||||
+ unset bondslaves
|
||||
+ unset bondoptions
|
||||
+ if [ "$bond" != "bond" ]; then
|
||||
+ parsebond "$bond"
|
||||
fi
|
||||
# Simple default bond
|
||||
if [ -z "$bondname" ]; then
|
||||
@@ -57,5 +47,4 @@ if getarg bond >/dev/null; then
|
||||
echo "bondname=$bondname" > /tmp/bond.${bondname}.info
|
||||
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.${bondname}.info
|
||||
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.${bondname}.info
|
||||
- return
|
||||
-fi
|
||||
+done
|
||||
diff --git a/modules.d/40network/parse-bridge.sh b/modules.d/40network/parse-bridge.sh
|
||||
index 212f259..5c3af29 100755
|
||||
--- a/modules.d/40network/parse-bridge.sh
|
||||
+++ b/modules.d/40network/parse-bridge.sh
|
||||
@@ -7,14 +7,6 @@
|
||||
# bridge without parameters assumes bridge=br0:eth0
|
||||
#
|
||||
|
||||
-# return if bridge already parsed
|
||||
-[ -n "$bridgename" ] && return
|
||||
-
|
||||
-# Check if bridge parameter is valid
|
||||
-if getarg bridge= >/dev/null ; then
|
||||
- command -v brctl >/dev/null 2>&1 || die "No 'brctl' installed"
|
||||
-fi
|
||||
-
|
||||
parsebridge() {
|
||||
local v=${1}:
|
||||
set --
|
||||
@@ -22,8 +14,6 @@ parsebridge() {
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
-
|
||||
- unset bridgename bridgeslaves
|
||||
case $# in
|
||||
0) bridgename=br0; bridgeslaves=$iface ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
@@ -32,14 +22,13 @@ parsebridge() {
|
||||
esac
|
||||
}
|
||||
|
||||
-unset bridgename bridgeslaves
|
||||
-
|
||||
-iface=eth0
|
||||
-
|
||||
# Parse bridge for bridgename and bridgeslaves
|
||||
-if bridge="$(getarg bridge)"; then
|
||||
+for bridge in $(getargs bridge=); do
|
||||
+ unset bridgename
|
||||
+ unset bridgeslaves
|
||||
+ iface=eth0
|
||||
# Read bridge= parameters if they exist
|
||||
- if [ -n "$bridge" ]; then
|
||||
+ if [ "$bridge" != "bridge" ]; then
|
||||
parsebridge $bridge
|
||||
fi
|
||||
# Simple default bridge
|
||||
@@ -47,7 +36,6 @@ if bridge="$(getarg bridge)"; then
|
||||
bridgename=br0
|
||||
bridgeslaves=$iface
|
||||
fi
|
||||
- echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
- echo "bridgeslaves=\"$bridgeslaves\"" >> /tmp/bridge.info
|
||||
- return
|
||||
-fi
|
||||
+ echo "bridgename=$bridgename" > /tmp/bridge.${bridgename}.info
|
||||
+ echo "bridgeslaves=\"$bridgeslaves\"" >> /tmp/bridge.${bridgename}.info
|
||||
+done
|
||||
diff --git a/modules.d/40network/parse-team.sh b/modules.d/40network/parse-team.sh
|
||||
index 318c0e1..cc5cba7 100755
|
||||
--- a/modules.d/40network/parse-team.sh
|
||||
+++ b/modules.d/40network/parse-team.sh
|
||||
@@ -6,14 +6,6 @@
|
||||
# teamslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
#
|
||||
|
||||
-# return if team already parsed
|
||||
-[ -n "$teammaster" ] && return
|
||||
-
|
||||
-# Check if team parameter is valid
|
||||
-if getarg team= >/dev/null ; then
|
||||
- :
|
||||
-fi
|
||||
-
|
||||
parseteam() {
|
||||
local v=${1}:
|
||||
set --
|
||||
@@ -22,23 +14,17 @@ parseteam() {
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
- unset teammaster teamslaves
|
||||
case $# in
|
||||
2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;;
|
||||
*) die "team= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
-unset teammaster teamslaves
|
||||
|
||||
-if getarg team>/dev/null; then
|
||||
- # Read team= parameters if they exist
|
||||
- team="$(getarg team=)"
|
||||
- if [ ! "$team" = "team" ]; then
|
||||
- parseteam "$(getarg team=)"
|
||||
- fi
|
||||
+for team in $(getargs team=); do
|
||||
+ unset teammaster teamslaves
|
||||
+ parseteam "$(getarg team=)"
|
||||
|
||||
- echo "teammaster=$teammaster" > /tmp/team.info
|
||||
- echo "teamslaves=\"$teamslaves\"" >> /tmp/team.info
|
||||
- return
|
||||
-fi
|
||||
+ echo "teammaster=$teammaster" > /tmp/team.${teammaster}.info
|
||||
+ echo "teamslaves=\"$teamslaves\"" >> /tmp/team.${teammaster}.info
|
||||
+done
|
||||
diff --git a/modules.d/40network/parse-vlan.sh b/modules.d/40network/parse-vlan.sh
|
||||
index 3ba2289..b2a9c1c 100755
|
||||
--- a/modules.d/40network/parse-vlan.sh
|
||||
+++ b/modules.d/40network/parse-vlan.sh
|
||||
@@ -36,7 +36,7 @@ if getarg vlan >/dev/null; then
|
||||
parsevlan "$(getarg vlan=)"
|
||||
fi
|
||||
|
||||
- echo "vlanname=\"$vlanname\"" > /tmp/vlan.info
|
||||
- echo "phydevice=\"$phydevice\"" >> /tmp/vlan.info
|
||||
+ echo "$phydevice" > /tmp/vlan.${phydevice}.phy
|
||||
+ echo "$vlanname" > /tmp/vlan.${vlanname}.${phydevice}
|
||||
return
|
||||
fi
|
||||
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
|
||||
index 251d684..c3774ae 100755
|
||||
--- a/modules.d/45ifcfg/write-ifcfg.sh
|
||||
+++ b/modules.d/45ifcfg/write-ifcfg.sh
|
||||
@@ -5,14 +5,6 @@ type is_persistent_ethernet_name >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
udevadm settle --timeout=30
|
||||
|
||||
-if [ -e /tmp/bridge.info ]; then
|
||||
- . /tmp/bridge.info
|
||||
-fi
|
||||
-
|
||||
-if [ -e /tmp/vlan.info ]; then
|
||||
- . /tmp/vlan.info
|
||||
-fi
|
||||
-
|
||||
mkdir -m 0755 -p /tmp/ifcfg/
|
||||
mkdir -m 0755 -p /tmp/ifcfg-leases/
|
||||
|
||||
@@ -129,6 +121,8 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
unset bondslaves
|
||||
unset bondname
|
||||
unset bondoptions
|
||||
+ unset bridgename
|
||||
+ unset bridgeslaves
|
||||
unset uuid
|
||||
unset ip
|
||||
unset gw
|
||||
@@ -140,17 +134,22 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
unset vlan
|
||||
|
||||
[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
|
||||
+ [ -e /tmp/bridge.${netif}.info ] && . /tmp/bridge.${netif}.info
|
||||
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
elif [ "$netif" = "$bondname" ]; then
|
||||
- # $netif can't be bridge and bond at the same time
|
||||
+ # $netif can't be bridge and bond at the same time
|
||||
bond=yes
|
||||
fi
|
||||
- if [ "$netif" = "$vlanname" ]; then
|
||||
+
|
||||
+ for i in /tmp/vlan.${netif}.*; do
|
||||
+ [ ! -e "$i" ] && continue
|
||||
+ . "$i"
|
||||
vlan=yes
|
||||
- fi
|
||||
+ break
|
||||
+ done
|
||||
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
|
||||
index 61e4c1a..ceca1f0 100755
|
||||
--- a/test/TEST-20-NFS/test.sh
|
||||
+++ b/test/TEST-20-NFS/test.sh
|
||||
@@ -16,8 +16,8 @@ run_server() {
|
||||
-drive format=raw,index=0,media=disk,file=$TESTDIR/server.ext3 \
|
||||
-m 256M -smp 2 \
|
||||
-display none \
|
||||
- -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
|
||||
-net socket,listen=127.0.0.1:12320 \
|
||||
+ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
|
||||
-serial ${SERIAL:-null} \
|
||||
-watchdog i6300esb -watchdog-action poweroff \
|
||||
-append "rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
|
||||
@@ -134,7 +134,7 @@ test_nfsv3() {
|
||||
"root=nfs:192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
|
||||
|
||||
client_test "NFSv3 Bridge root=nfs:..." 52:54:00:12:34:04 \
|
||||
- "root=nfs:192.168.50.1:/nfs/client bridge" 192.168.50.1 -wsize=4096 || return 1
|
||||
+ "root=nfs:192.168.50.1:/nfs/client bridge net.ifnames=0" 192.168.50.1 -wsize=4096 || return 1
|
||||
|
||||
client_test "NFSv3 Legacy root=IP:path" 52:54:00:12:34:04 \
|
||||
"root=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
|
||||
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
|
||||
index fc4bdce..00c1fbd 100755
|
||||
--- a/test/TEST-30-ISCSI/test.sh
|
||||
+++ b/test/TEST-30-ISCSI/test.sh
|
||||
@@ -85,7 +85,7 @@ do_test_run() {
|
||||
"rd.iscsi.initiator=$initiator" \
|
||||
|| return 1
|
||||
|
||||
- run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0" \
|
||||
+ run_client "FAILME: netroot=iscsi target1 target2 rd.iscsi.waitnet=0" \
|
||||
"root=LABEL=sysroot" \
|
||||
"ip=192.168.50.101:::255.255.255.0::ens3:off" \
|
||||
"ip=192.168.51.101:::255.255.255.0::ens4:off" \
|
||||
@@ -94,7 +94,7 @@ do_test_run() {
|
||||
"rd.iscsi.firmware" \
|
||||
"rd.iscsi.initiator=$initiator" \
|
||||
"rd.iscsi.waitnet=0" \
|
||||
- || return 1
|
||||
+ || return 0
|
||||
|
||||
run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0 rd.iscsi.testroute=0" \
|
||||
"root=LABEL=sysroot" \
|
||||
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
|
||||
index fdeb840..484ebee 100755
|
||||
--- a/test/TEST-50-MULTINIC/test.sh
|
||||
+++ b/test/TEST-50-MULTINIC/test.sh
|
||||
@@ -18,7 +18,7 @@ run_server() {
|
||||
-display none \
|
||||
-net socket,listen=127.0.0.1:12350 \
|
||||
-net nic,macaddr=52:54:01:12:34:56,model=e1000 \
|
||||
- ${SERIAL:+-serial "$SERIAL"} \
|
||||
+ -serial ${SERIAL:-null} \
|
||||
-watchdog i6300esb -watchdog-action poweroff \
|
||||
-append "loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
|
||||
-initrd "$TESTDIR"/initramfs.server \
|
||||
@@ -90,7 +90,10 @@ test_run() {
|
||||
echo "Failed to start server" 1>&2
|
||||
return 1
|
||||
fi
|
||||
- test_client || { kill_server; return 1; }
|
||||
+ test_client
|
||||
+ ret=$?
|
||||
+ kill_server
|
||||
+ return $ret
|
||||
}
|
||||
|
||||
test_client() {
|
||||
@@ -133,7 +136,15 @@ test_client() {
|
||||
"root=dhcp ip=ens3:dhcp ip=ens4:dhcp ip=ens5:dhcp bootdev=ens5" \
|
||||
"ens3 ens4 ens5" || return 1
|
||||
|
||||
- kill_server
|
||||
+ client_test "MULTINIC bonding" \
|
||||
+ 00 01 02 \
|
||||
+ "root=nfs:192.168.50.1:/nfs/client ip=bond0:dhcp bond=bond0:ens3,ens4,ens5:mode=balance-rr" \
|
||||
+ "bond0" || return 1
|
||||
+
|
||||
+ client_test "MULTINIC bridging" \
|
||||
+ 00 01 02 \
|
||||
+ "root=nfs:192.168.50.1:/nfs/client ip=bridge0:dhcp bridge=bridge0:ens3,ens4,ens5" \
|
||||
+ "bridge0" || return 1
|
||||
return 0
|
||||
}
|
||||
|
@ -1,56 +0,0 @@
|
||||
From bb1b924792a688ea3da7e7f4503527e5bc0b18fb Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 19 Jan 2016 14:43:43 +0100
|
||||
Subject: [PATCH] TEST-30-ISCSI: some tests have unknown return code
|
||||
|
||||
by design
|
||||
---
|
||||
test/TEST-30-ISCSI/test.sh | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
|
||||
index 00c1fbd..940edb6 100755
|
||||
--- a/test/TEST-30-ISCSI/test.sh
|
||||
+++ b/test/TEST-30-ISCSI/test.sh
|
||||
@@ -85,7 +85,7 @@ do_test_run() {
|
||||
"rd.iscsi.initiator=$initiator" \
|
||||
|| return 1
|
||||
|
||||
- run_client "FAILME: netroot=iscsi target1 target2 rd.iscsi.waitnet=0" \
|
||||
+ run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0" \
|
||||
"root=LABEL=sysroot" \
|
||||
"ip=192.168.50.101:::255.255.255.0::ens3:off" \
|
||||
"ip=192.168.51.101:::255.255.255.0::ens4:off" \
|
||||
@@ -94,9 +94,9 @@ do_test_run() {
|
||||
"rd.iscsi.firmware" \
|
||||
"rd.iscsi.initiator=$initiator" \
|
||||
"rd.iscsi.waitnet=0" \
|
||||
- || return 0
|
||||
+ || return 1
|
||||
|
||||
- run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0 rd.iscsi.testroute=0" \
|
||||
+ run_client "FAILME: netroot=iscsi target1 target2 rd.iscsi.waitnet=0 rd.iscsi.testroute=0" \
|
||||
"root=LABEL=sysroot" \
|
||||
"ip=192.168.50.101:::255.255.255.0::ens3:off" \
|
||||
"ip=192.168.51.101:::255.255.255.0::ens4:off" \
|
||||
@@ -105,9 +105,9 @@ do_test_run() {
|
||||
"rd.iscsi.firmware" \
|
||||
"rd.iscsi.initiator=$initiator" \
|
||||
"rd.iscsi.waitnet=0 rd.iscsi.testroute=0" \
|
||||
- || return 1
|
||||
+ || :
|
||||
|
||||
- run_client "netroot=iscsi target1 target2 rd.iscsi.waitnet=0 rd.iscsi.testroute=0 default GW" \
|
||||
+ run_client "FAILME: netroot=iscsi target1 target2 rd.iscsi.waitnet=0 rd.iscsi.testroute=0 default GW" \
|
||||
"root=LABEL=sysroot" \
|
||||
"ip=192.168.50.101::192.168.50.1:255.255.255.0::ens3:off" \
|
||||
"ip=192.168.51.101::192.168.51.1:255.255.255.0::ens4:off" \
|
||||
@@ -116,7 +116,7 @@ do_test_run() {
|
||||
"rd.iscsi.firmware" \
|
||||
"rd.iscsi.initiator=$initiator" \
|
||||
"rd.iscsi.waitnet=0 rd.iscsi.testroute=0" \
|
||||
- || return 1
|
||||
+ || :
|
||||
|
||||
return 0
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
From 9542f2fee4a398ed00730e6ffb7de5fe315aa093 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 19 Jan 2016 15:12:39 +0100
|
||||
Subject: [PATCH] network: add mtu to list of variables to store in override
|
||||
|
||||
---
|
||||
modules.d/40network/ifup.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
|
||||
index 14ca86d..7c179bd 100755
|
||||
--- a/modules.d/40network/ifup.sh
|
||||
+++ b/modules.d/40network/ifup.sh
|
||||
@@ -362,7 +362,7 @@ for p in $(getargs ip=); do
|
||||
done
|
||||
|
||||
# Store config for later use
|
||||
- for i in ip srv gw mask hostname macaddr dns1 dns2; do
|
||||
+ for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
@ -1,46 +0,0 @@
|
||||
From 43819af68c7789ec932c25e699c56889fdf7276c Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Vogt <fvogt@suse.com>
|
||||
Date: Thu, 21 Jan 2016 17:13:07 +0100
|
||||
Subject: [PATCH] Correctly handle module aliases
|
||||
|
||||
Handle module aliases correctly to not generate unbootable
|
||||
initrds with different kernel versions when modules were renamed
|
||||
or replaced.
|
||||
|
||||
Signed-off-by: Fabian Vogt <fvogt@suse.com>
|
||||
---
|
||||
dracut.sh | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/dracut.sh b/dracut.sh
|
||||
index 98dbe0b..ae8772b 100755
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -1195,6 +1195,27 @@ if [[ $hostonly ]]; then
|
||||
while read m rest || [ -n "$m" ]; do
|
||||
host_modules["$m"]=1
|
||||
done </proc/modules
|
||||
+
|
||||
+ # Explanation of the following section:
|
||||
+ # Since kernel 4.4, mpt3sas is a complete replacement for mpt2sas.
|
||||
+ # mpt3sas has an alias to mpt2sas now, but since mpt3sas isn't loaded
|
||||
+ # when generating the initrd from kernel < 4.4, it's not included.
|
||||
+ # The other direction has the same issue:
|
||||
+ # When generating the initrd from kernel >= 4.4, mpt2sas isn't loaded,
|
||||
+ # so it's not included.
|
||||
+ # Both ways result in an unbootable initrd.
|
||||
+
|
||||
+ # also add aliases of loaded modules
|
||||
+ for mod in "${!host_modules[@]}"; do
|
||||
+ aliases=$(modinfo -F alias "$mod" 2>&1)
|
||||
+ for alias in $aliases; do
|
||||
+ host_modules["$alias"]=1
|
||||
+ done
|
||||
+ # mod might be an alias in the target kernel, find the real module
|
||||
+ mod_filename=$(modinfo -k "$kernel" "$mod" -F filename)
|
||||
+ [ $? -ne 0 ] && continue
|
||||
+ host_modules["$(basename -s .ko "$mod_filename")"]=1
|
||||
+ done
|
||||
fi
|
||||
|
||||
unset m
|
@ -1,44 +0,0 @@
|
||||
From f4f8fb5c10cc8d0047123324197aff25f0a63e04 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 26 Jan 2016 12:26:03 +0100
|
||||
Subject: [PATCH] network: if rd.neednet=0 we don't need a bootdev
|
||||
|
||||
otherwise dracut would wait for the bootdev interface to appear and be
|
||||
setup
|
||||
---
|
||||
modules.d/40network/parse-ip-opts.sh | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh
|
||||
index 12f4765..5779ef8 100755
|
||||
--- a/modules.d/40network/parse-ip-opts.sh
|
||||
+++ b/modules.d/40network/parse-ip-opts.sh
|
||||
@@ -40,6 +40,8 @@ if [ -n "$NEEDBOOTDEV" ] && getargbool 1 rd.neednet; then
|
||||
#[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf
|
||||
info "Multiple ip= arguments: assuming rd.neednet=1"
|
||||
+else
|
||||
+ unset NEEDBOOTDEV
|
||||
fi
|
||||
|
||||
# Check ip= lines
|
||||
@@ -48,17 +50,14 @@ for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# make first device specified the BOOTDEV
|
||||
- if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
|
||||
+ if [ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
|
||||
BOOTDEV="$dev"
|
||||
- [ -n "$NEEDBOOTDEV" ] && info "Setting bootdev to '$BOOTDEV'"
|
||||
+ info "Setting bootdev to '$BOOTDEV'"
|
||||
fi
|
||||
|
||||
# skip ibft since we did it above
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
- # We need to have an ip= line for the specified bootdev
|
||||
- [ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
||||
-
|
||||
# Empty autoconf defaults to 'dhcp'
|
||||
if [ -z "$autoconf" ] ; then
|
||||
warn "Empty autoconf values default to dhcp"
|
@ -1,25 +0,0 @@
|
||||
From b4dd861a0b916368bad9413fdc5d90482fcbd65a Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 26 Jan 2016 14:56:05 +0100
|
||||
Subject: [PATCH] kernel-modules: add usb-storage
|
||||
|
||||
To save the rdsosreport.txt to a USB stick, the usb-storage module is
|
||||
needed
|
||||
---
|
||||
modules.d/90kernel-modules/module-setup.sh | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
|
||||
index c5f2397..13f48c9 100755
|
||||
--- a/modules.d/90kernel-modules/module-setup.sh
|
||||
+++ b/modules.d/90kernel-modules/module-setup.sh
|
||||
@@ -47,7 +47,8 @@ installkernel() {
|
||||
"=drivers/input/keyboard"
|
||||
|
||||
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 hv-vmbus \
|
||||
+ usb-storage
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
@ -1,48 +0,0 @@
|
||||
From 6bc2096cf58c4b52f23ecc1bf8dc301d6122dfb5 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 26 Jan 2016 14:59:28 +0100
|
||||
Subject: [PATCH] kernel-modules: join instmods and install all usb/storage
|
||||
|
||||
---
|
||||
modules.d/90kernel-modules/module-setup.sh | 18 ++++++++----------
|
||||
1 file changed, 8 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
|
||||
index 13f48c9..300adc7 100755
|
||||
--- a/modules.d/90kernel-modules/module-setup.sh
|
||||
+++ b/modules.d/90kernel-modules/module-setup.sh
|
||||
@@ -39,16 +39,17 @@ installkernel() {
|
||||
ehci-hcd ehci-pci ehci-platform \
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
- xhci-hcd xhci-pci xhci-plat-hcd
|
||||
-
|
||||
- hostonly='' instmods \
|
||||
+ xhci-hcd xhci-pci xhci-plat-hcd \
|
||||
"=drivers/hid" \
|
||||
"=drivers/input/serio" \
|
||||
- "=drivers/input/keyboard"
|
||||
+ "=drivers/input/keyboard" \
|
||||
+ "=drivers/usb/storage"
|
||||
|
||||
- instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
- atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
|
||||
- usb-storage
|
||||
+ instmods \
|
||||
+ yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
+ atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
|
||||
+ virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
|
||||
+ "=drivers/pcmcia" =ide
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
@@ -61,9 +62,6 @@ installkernel() {
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
- # install virtual machine support
|
||||
- instmods virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
|
||||
- "=drivers/pcmcia" =ide "=drivers/usb/storage"
|
||||
|
||||
find_kernel_modules | block_module_filter | instmods
|
||||
|
@ -1,54 +0,0 @@
|
||||
From eddca3c9c24e4cb9c5def0b98920e36b16fafaac Mon Sep 17 00:00:00 2001
|
||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Date: Mon, 15 Feb 2016 08:29:40 +0000
|
||||
Subject: [PATCH] dracut-systemd/dracut-cmdline-ask: fix dracut
|
||||
--kernel-cmdline=rd.cmdline=ask
|
||||
|
||||
How to reproduce:
|
||||
|
||||
host# dracut --kernel-cmdline='rd.cmdline=ask' initramfs.img
|
||||
host# qemu-system-x86_64 -initrd initramfs.img ... -append root=/dev/sda1 ...
|
||||
...
|
||||
|
||||
qemu-host# journalctl -b | grep dracut-cmdline-ask
|
||||
...
|
||||
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Installed new job dracut-cmdline-ask.service/start as 42
|
||||
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: ConditionKernelCommandLine=rd.cmdline=ask failed.
|
||||
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Starting requested but condition failed. Not starting unit.
|
||||
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Job dracut-cmdline-ask.service/start finished, result=done
|
||||
...
|
||||
|
||||
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
---
|
||||
modules.d/98dracut-systemd/dracut-cmdline-ask.service | 3 ++-
|
||||
modules.d/98dracut-systemd/dracut-cmdline-ask.sh | 4 ++++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/98dracut-systemd/dracut-cmdline-ask.service b/modules.d/98dracut-systemd/dracut-cmdline-ask.service
|
||||
index 9a34b35..8bc7d80 100644
|
||||
--- a/modules.d/98dracut-systemd/dracut-cmdline-ask.service
|
||||
+++ b/modules.d/98dracut-systemd/dracut-cmdline-ask.service
|
||||
@@ -14,7 +14,8 @@ Before=dracut-cmdline.service
|
||||
After=systemd-journald.socket
|
||||
Wants=systemd-journald.socket
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
-ConditionKernelCommandLine=rd.cmdline=ask
|
||||
+ConditionKernelCommandLine=|rd.cmdline=ask
|
||||
+ConditionPathExistsGlob=|/etc/cmdline.d/*.conf
|
||||
|
||||
[Service]
|
||||
Environment=DRACUT_SYSTEMD=1
|
||||
diff --git a/modules.d/98dracut-systemd/dracut-cmdline-ask.sh b/modules.d/98dracut-systemd/dracut-cmdline-ask.sh
|
||||
index ab8933a..f410f46 100755
|
||||
--- a/modules.d/98dracut-systemd/dracut-cmdline-ask.sh
|
||||
+++ b/modules.d/98dracut-systemd/dracut-cmdline-ask.sh
|
||||
@@ -1,5 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
+
|
||||
+getarg "rd.cmdline=ask" || exit 0
|
||||
+
|
||||
sleep 0.5
|
||||
echo
|
||||
sleep 0.5
|
@ -1,39 +0,0 @@
|
||||
From 4ab6447c2a9ed105e7fba26ded2b3f3b725de8e9 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Date: Mon, 15 Feb 2016 13:47:18 +0000
|
||||
Subject: [PATCH] base/init.sh: don't remove 99-cmdline-ask on 'hostonly'
|
||||
cleanup
|
||||
|
||||
How to reproduce:
|
||||
host# ./dracut.sh -o 'dracut-systemd systemd systemd-initrd' --local -f ./initramfs.img
|
||||
|
||||
host# qemu-system-x86_64 -initrd ./initramfs.img \
|
||||
-append 'root=/dev/sda1 rd.cmdline=ask rd.hostonly=0' \
|
||||
...
|
||||
|
||||
Enter additional kernel command line parameter (end with ctrl-d or .)
|
||||
> rd.break
|
||||
> .
|
||||
...
|
||||
There is no "Break before switch_root"
|
||||
...
|
||||
|
||||
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
|
||||
---
|
||||
modules.d/99base/init.sh | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
|
||||
index e2e4029..bd7ef70 100755
|
||||
--- a/modules.d/99base/init.sh
|
||||
+++ b/modules.d/99base/init.sh
|
||||
@@ -120,7 +120,9 @@ if getarg "rd.cmdline=ask"; then
|
||||
fi
|
||||
|
||||
if ! getargbool 1 'rd.hostonly'; then
|
||||
+ [ -f /etc/cmdline.d/99-cmdline-ask.conf ] && mv /etc/cmdline.d/99-cmdline-ask.conf /tmp/99-cmdline-ask.conf
|
||||
remove_hostonly_files
|
||||
+ [ -f /tmp/99-cmdline-ask.conf ] && mv /tmp/99-cmdline-ask.conf /etc/cmdline.d/99-cmdline-ask.conf
|
||||
fi
|
||||
|
||||
# run scriptlets to parse the command line
|
@ -1,42 +0,0 @@
|
||||
From fe6455a6e8f4b070ffa8116ef26d423a25d56049 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 29 Feb 2016 13:12:02 +0100
|
||||
Subject: [PATCH] documentation: "--hostonly-i18n" "--no-hostonly-i18n"
|
||||
"i18n_install_all"
|
||||
|
||||
---
|
||||
dracut.8.asc | 6 ++++++
|
||||
dracut.conf.5.asc | 3 +++
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
diff --git a/dracut.8.asc b/dracut.8.asc
|
||||
index aee84c4..3b80000 100644
|
||||
--- a/dracut.8.asc
|
||||
+++ b/dracut.8.asc
|
||||
@@ -323,6 +323,12 @@ provide a valid _/etc/fstab_.
|
||||
**--no-hostonly-cmdline**:
|
||||
Do not store kernel command line arguments needed in the initramfs
|
||||
|
||||
+**--hostonly-i18n**:
|
||||
+ Install only needed keyboard and font files according to the host configuration (default).
|
||||
+
|
||||
+**--no-hostonly-i18n**:
|
||||
+ Install all keyboard and font files available.
|
||||
+
|
||||
**--persistent-policy** _<policy>_::
|
||||
Use _<policy>_ to address disks and partitions.
|
||||
_<policy>_ can be any directory name found in /dev/disk.
|
||||
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc
|
||||
index 0460d4f..e07c247 100644
|
||||
--- a/dracut.conf.5.asc
|
||||
+++ b/dracut.conf.5.asc
|
||||
@@ -99,6 +99,9 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
*hostonly_cmdline=*"__{yes|no}__"::
|
||||
If set, store the kernel command line arguments needed in the initramfs
|
||||
|
||||
+*i18n_install_all=*"__{yes|no}__"::
|
||||
+ If set to yes, install all available fonts and keyboard files.
|
||||
+
|
||||
*persistent_policy=*"__<policy>__"::
|
||||
Use _<policy>_ to address disks and partitions.
|
||||
_<policy>_ can be any directory name found in /dev/disk.
|
@ -1,91 +0,0 @@
|
||||
From caf12d6717379769e4f12296405edc4d547d46f8 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 29 Feb 2016 14:52:16 +0100
|
||||
Subject: [PATCH] network/dhclient-script.sh: add classless-static-routes
|
||||
support
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1260955
|
||||
(cherry picked from commit a48ea27debb926a30810c9f1a42f096494c727e2)
|
||||
---
|
||||
modules.d/40network/dhclient-script.sh | 48 ++++++++++++++++++++++++++++++++++
|
||||
modules.d/40network/dhclient.conf | 5 +++-
|
||||
2 files changed, 52 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
|
||||
index 9aac2b1..13d2dc2 100755
|
||||
--- a/modules.d/40network/dhclient-script.sh
|
||||
+++ b/modules.d/40network/dhclient-script.sh
|
||||
@@ -95,6 +95,51 @@ setup_interface6() {
|
||||
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
}
|
||||
|
||||
+function parse_option_121() {
|
||||
+ while [ $# -ne 0 ]; do
|
||||
+ mask="$1"
|
||||
+ shift
|
||||
+
|
||||
+ # Is the destination a multicast group?
|
||||
+ if [ $1 -ge 224 -a $1 -lt 240 ]; then
|
||||
+ multicast=1
|
||||
+ else
|
||||
+ multicast=0
|
||||
+ fi
|
||||
+
|
||||
+ # Parse the arguments into a CIDR net/mask string
|
||||
+ if [ $mask -gt 24 ]; then
|
||||
+ destination="$1.$2.$3.$4/$mask"
|
||||
+ shift; shift; shift; shift
|
||||
+ elif [ $mask -gt 16 ]; then
|
||||
+ destination="$1.$2.$3.0/$mask"
|
||||
+ shift; shift; shift
|
||||
+ elif [ $mask -gt 8 ]; then
|
||||
+ destination="$1.$2.0.0/$mask"
|
||||
+ shift; shift
|
||||
+ else
|
||||
+ destination="$1.0.0.0/$mask"
|
||||
+ shift
|
||||
+ fi
|
||||
+
|
||||
+ # Read the gateway
|
||||
+ gateway="$1.$2.$3.$4"
|
||||
+ shift; shift; shift; shift
|
||||
+
|
||||
+ # Multicast routing on Linux
|
||||
+ # - If you set a next-hop address for a multicast group, this breaks with Cisco switches
|
||||
+ # - If you simply leave it link-local and attach it to an interface, it works fine.
|
||||
+ if [ $multicast -eq 1 ]; then
|
||||
+ temp_result="$destination dev $interface"
|
||||
+ else
|
||||
+ temp_result="$destination via $gateway dev $interface"
|
||||
+ fi
|
||||
+
|
||||
+ echo "/sbin/ip route add $temp_result"
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+
|
||||
case $reason in
|
||||
PREINIT)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
@@ -129,6 +174,9 @@ case $reason in
|
||||
{
|
||||
echo '. /lib/net-lib.sh'
|
||||
echo "setup_net $netif"
|
||||
+ if [ -n "$new_classless_static_routes" ]; then
|
||||
+ modify_routes add "$(parse_option_121 $new_classless_static_routes)"
|
||||
+ fi
|
||||
echo "source_hook initqueue/online $netif"
|
||||
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
|
||||
echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh"
|
||||
diff --git a/modules.d/40network/dhclient.conf b/modules.d/40network/dhclient.conf
|
||||
index dbf5882..7b06763 100644
|
||||
--- a/modules.d/40network/dhclient.conf
|
||||
+++ b/modules.d/40network/dhclient.conf
|
||||
@@ -1,3 +1,6 @@
|
||||
+
|
||||
+option classless-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;
|
||||
+ root-path, interface-mtu classless-routes;
|
@ -1,29 +0,0 @@
|
||||
From 556ff7c76a5c365889ea9972c1878eaf7073bde8 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 7 Mar 2016 12:38:23 +0100
|
||||
Subject: [PATCH] dracut-systemd/dracut-pre-pivot.sh: Break at switch_root only
|
||||
for bare rd.break
|
||||
|
||||
similar to commit ddfea6b54cfa8f8f6c970d970318568c8a8a4c78
|
||||
|
||||
Previously, any rd.break=breakpoint would cause a break at the
|
||||
given breakpoint and also at switch_root.
|
||||
---
|
||||
modules.d/98dracut-systemd/dracut-pre-pivot.sh | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/98dracut-systemd/dracut-pre-pivot.sh b/modules.d/98dracut-systemd/dracut-pre-pivot.sh
|
||||
index a07cf3e..cc70e3c 100755
|
||||
--- a/modules.d/98dracut-systemd/dracut-pre-pivot.sh
|
||||
+++ b/modules.d/98dracut-systemd/dracut-pre-pivot.sh
|
||||
@@ -18,7 +18,9 @@ source_hook pre-pivot
|
||||
getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
|
||||
source_hook cleanup
|
||||
|
||||
-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
|
||||
|
||||
# remove helper symlink
|
||||
[ -h /dev/root ] && rm -f -- /dev/root
|
@ -1,24 +0,0 @@
|
||||
From b127294def5efecc27fac730f784f8bf03a5e52d Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Mar 2016 10:59:29 +0100
|
||||
Subject: [PATCH] dracut-install: catch ldd message "cannot execute binary
|
||||
file"
|
||||
|
||||
---
|
||||
install/dracut-install.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/install/dracut-install.c b/install/dracut-install.c
|
||||
index a7bfdb8..8f65d8d 100644
|
||||
--- a/install/dracut-install.c
|
||||
+++ b/install/dracut-install.c
|
||||
@@ -393,6 +393,9 @@ static int resolve_deps(const char *src)
|
||||
break;
|
||||
|
||||
/* glibc */
|
||||
+ if (strstr(buf, "cannot execute binary file"))
|
||||
+ break;
|
||||
+
|
||||
if (strstr(buf, "not a dynamic executable"))
|
||||
break;
|
||||
|
@ -1,22 +0,0 @@
|
||||
From 472928ec3dcbfcc7ea0c1fd7e821843739f03bfc Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 14 Mar 2016 14:16:12 +0100
|
||||
Subject: [PATCH] dracut.conf.5.asc: fix bold
|
||||
|
||||
---
|
||||
dracut.conf.5.asc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc
|
||||
index e07c247..8f362b2 100644
|
||||
--- a/dracut.conf.5.asc
|
||||
+++ b/dracut.conf.5.asc
|
||||
@@ -187,7 +187,7 @@ provide a valid _/etc/fstab_.
|
||||
*show_modules=*"__{yes|no}__"::
|
||||
Print the name of the included modules to standard output during build.
|
||||
|
||||
-*i18n_vars="__<variable mapping>__"::
|
||||
+*i18n_vars=*"__<variable mapping>__"::
|
||||
Distribution specific variable mapping.
|
||||
See dracut/modules.d/10i18n/README for a detailed description.
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 89da227de991ef3c1bb9ad3dc4f23d07535317d2 Mon Sep 17 00:00:00 2001
|
||||
From: Pratyush Anand <panand@redhat.com>
|
||||
Date: Wed, 16 Mar 2016 09:09:09 +0530
|
||||
Subject: [PATCH] watchdog: Do not add hooks if systemd module is included
|
||||
|
||||
When systemd is present, let it manage watchdog feed.
|
||||
|
||||
Signed-off-by: Pratyush Anand <panand@redhat.com>
|
||||
Cc: Dave Young <dyoung@redhat.com>
|
||||
Cc: Don Zickus <dzickus@redhat.com>
|
||||
Cc: Harald Hoyer <harald@redhat.com>
|
||||
---
|
||||
modules.d/04watchdog/module-setup.sh | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
|
||||
index 576c589..7ec757a 100755
|
||||
--- a/modules.d/04watchdog/module-setup.sh
|
||||
+++ b/modules.d/04watchdog/module-setup.sh
|
||||
@@ -12,6 +12,11 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
+ # Do not add watchdog hooks if systemd module is included
|
||||
+ # In that case, systemd will manage watchdog kick
|
||||
+ if dracut_module_included "systemd"; then
|
||||
+ return
|
||||
+ fi
|
||||
inst_hook cmdline 00 "$moddir/watchdog.sh"
|
||||
inst_hook cmdline 50 "$moddir/watchdog.sh"
|
||||
inst_hook pre-trigger 00 "$moddir/watchdog.sh"
|
@ -1,94 +0,0 @@
|
||||
From 3aac6827444c897aab59d7638aa191d510fd4758 Mon Sep 17 00:00:00 2001
|
||||
From: Pratyush Anand <panand@redhat.com>
|
||||
Date: Wed, 16 Mar 2016 09:09:10 +0530
|
||||
Subject: [PATCH] watchdog: install module for active watchdog
|
||||
|
||||
Recently following patches have been added in upstream Linux kernel, which
|
||||
(1) fixes parent of watchdog_device so that
|
||||
/sys/class/watchdog/watchdogn/device is populated. (2) adds some sysfs
|
||||
device attributes so that different watchdog status can be read.
|
||||
|
||||
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6551881c86c791237a3bebf11eb3bd70b60ea782
|
||||
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=906d7a5cfeda508e7361f021605579a00cd82815
|
||||
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=33b711269ade3f6bc9d9d15e4343e6fa922d999b
|
||||
|
||||
With the above support, now we can find out whether a watchdog is active or
|
||||
not. We can also find out the driver/module responsible for that watchdog
|
||||
device.
|
||||
|
||||
Proposed patch uses above support and then adds module of active watchdog
|
||||
in initramfs generated by dracut for hostonly mode. Kernel module for
|
||||
inactive watchdog will be added as well for none hostonly mode.
|
||||
|
||||
When an user does not want to add kernel module, then one should exclude
|
||||
complete dracut watchdog module with --omit.
|
||||
|
||||
Testing:
|
||||
-- When watchdog is active watchdog modules were added
|
||||
# cat /sys/class/watchdog/watchdog0/identity
|
||||
iTCO_wdt
|
||||
# cat /sys/class/watchdog/watchdog0/state
|
||||
active
|
||||
# dracut --hostonly initramfs-test.img -a watchdog
|
||||
# lsinitrd initramfs-test.img | grep iTCO
|
||||
-rw-r--r-- 1 root root 9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
|
||||
-rw-r--r-- 1 root root 19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko
|
||||
|
||||
-- When watchdog is inactive then watchdog modules were not added
|
||||
# cat /sys/class/watchdog/watchdog0/state
|
||||
inactive
|
||||
# dracut --hostonly initramfs-test.img -a watchdog
|
||||
# lsinitrd initramfs-test.img | grep iTCO
|
||||
|
||||
-- When watchdog is inactive, but no hostonly mode, watchdog modules were added
|
||||
# cat /sys/class/watchdog/watchdog0/state
|
||||
inactive
|
||||
# dracut --no-hostonly initramfs-test.img -a watchdog
|
||||
# lsinitrd initramfs-test.img | grep iTCO
|
||||
-rw-r--r-- 1 root root 9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
|
||||
-rw-r--r-- 1 root root 19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko
|
||||
|
||||
Signed-off-by: Pratyush Anand <panand@redhat.com>
|
||||
Cc: Dave Young <dyoung@redhat.com>
|
||||
Cc: Don Zickus <dzickus@redhat.com>
|
||||
Cc: Harald Hoyer <harald@redhat.com>
|
||||
---
|
||||
modules.d/04watchdog/module-setup.sh | 28 ++++++++++++++++++++++++++++
|
||||
1 file changed, 28 insertions(+)
|
||||
|
||||
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
|
||||
index 7ec757a..0ffaa96 100755
|
||||
--- a/modules.d/04watchdog/module-setup.sh
|
||||
+++ b/modules.d/04watchdog/module-setup.sh
|
||||
@@ -32,3 +32,31 @@ install() {
|
||||
inst_multiple -o wdctl
|
||||
}
|
||||
|
||||
+installkernel() {
|
||||
+ [[ -d /sys/class/watchdog/ ]] || return
|
||||
+ for dir in /sys/class/watchdog/*; do
|
||||
+ [[ -d "$dir" ]] || continue
|
||||
+ [[ -f "$dir/state" ]] || continue
|
||||
+ active=$(< "$dir/state")
|
||||
+ ! [[ $hostonly ]] || [[ "$active" = "active" ]] || continue
|
||||
+ # device/modalias will return driver of this device
|
||||
+ wdtdrv=$(< "$dir/device/modalias")
|
||||
+ # There can be more than one module represented by same
|
||||
+ # modalias. Currently load all of them.
|
||||
+ # TODO: Need to find a way to avoid any unwanted module
|
||||
+ # represented by modalias
|
||||
+ wdtdrv=$(modprobe -R $wdtdrv)
|
||||
+ instmods $wdtdrv
|
||||
+ # however in some cases, we also need to check that if there is
|
||||
+ # a specific driver for the parent bus/device. In such cases
|
||||
+ # we also need to enable driver for parent bus/device.
|
||||
+ wdtppath=$(readlink -f "$dir/device/..")
|
||||
+ while [ -f "$wdtppath/modalias" ]
|
||||
+ do
|
||||
+ wdtpdrv=$(< "$wdtppath/modalias")
|
||||
+ wdtpdrv=$(modprobe -R $wdtpdrv)
|
||||
+ instmods $wdtpdrv
|
||||
+ wdtppath=$(readlink -f "$wdtppath/..")
|
||||
+ done
|
||||
+ done
|
||||
+}
|
@ -1,56 +0,0 @@
|
||||
From e343c85763e7b981a5e9b53b04f90f0d83bffaaf Mon Sep 17 00:00:00 2001
|
||||
From: Pratyush Anand <panand@redhat.com>
|
||||
Date: Wed, 16 Mar 2016 09:16:24 +0530
|
||||
Subject: [PATCH] watchdog: ensure that module is loaded as early as possible
|
||||
|
||||
It is expected that a watchdog module will disable an active watchdog when
|
||||
its probe is called ie, when it is loaded. So an early load of the module
|
||||
will help to disable it earlier.
|
||||
This can be helpful in some corner cases where kdump and watchdog daemon
|
||||
both are active.
|
||||
|
||||
Testing:
|
||||
-- When watchdog kernel modules were added
|
||||
# dracut --no-hostonly initramfs-test.img -a watchdog
|
||||
# lsinitrd initramfs-test.img -f etc/cmdline.d/00-watchdog.conf
|
||||
rd.driver.pre=iTCO_wdt,lpc_ich,
|
||||
|
||||
Signed-off-by: Pratyush Anand <panand@redhat.com>
|
||||
Cc: Dave Young <dyoung@redhat.com>
|
||||
Cc: Don Zickus <dzickus@redhat.com>
|
||||
Cc: Harald Hoyer <harald@redhat.com>
|
||||
---
|
||||
modules.d/04watchdog/module-setup.sh | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
|
||||
index 0ffaa96..c9da148 100755
|
||||
--- a/modules.d/04watchdog/module-setup.sh
|
||||
+++ b/modules.d/04watchdog/module-setup.sh
|
||||
@@ -34,6 +34,7 @@ install() {
|
||||
|
||||
installkernel() {
|
||||
[[ -d /sys/class/watchdog/ ]] || return
|
||||
+ wdtcmdline=""
|
||||
for dir in /sys/class/watchdog/*; do
|
||||
[[ -d "$dir" ]] || continue
|
||||
[[ -f "$dir/state" ]] || continue
|
||||
@@ -47,6 +48,7 @@ installkernel() {
|
||||
# represented by modalias
|
||||
wdtdrv=$(modprobe -R $wdtdrv)
|
||||
instmods $wdtdrv
|
||||
+ wdtcmdline="$wdtcmdline$(echo $wdtdrv | tr " " ","),"
|
||||
# however in some cases, we also need to check that if there is
|
||||
# a specific driver for the parent bus/device. In such cases
|
||||
# we also need to enable driver for parent bus/device.
|
||||
@@ -56,7 +58,10 @@ installkernel() {
|
||||
wdtpdrv=$(< "$wdtppath/modalias")
|
||||
wdtpdrv=$(modprobe -R $wdtpdrv)
|
||||
instmods $wdtpdrv
|
||||
+ wdtcmdline="$wdtcmdline$(echo $wdtpdrv | tr " " ","),"
|
||||
wdtppath=$(readlink -f "$wdtppath/..")
|
||||
done
|
||||
done
|
||||
+ # ensure that watchdog module is loaded as early as possible
|
||||
+ [[ $wdtcmdline = "" ]] || echo "rd.driver.pre=$wdtcmdline" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
From 97bbba6938fc22605026b4cff3c5cc524c7bdf38 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 17 Mar 2016 14:45:24 +0100
|
||||
Subject: [PATCH] lsinitrd: add "--unpack" to lsinitrd
|
||||
|
||||
also "--unpackearly" and "--verbose"
|
||||
---
|
||||
lsinitrd.1.asc | 9 +++++++++
|
||||
lsinitrd.sh | 43 ++++++++++++++++++++++++++++++++-----------
|
||||
2 files changed, 41 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/lsinitrd.1.asc b/lsinitrd.1.asc
|
||||
index 4293910..b6a704c 100644
|
||||
--- a/lsinitrd.1.asc
|
||||
+++ b/lsinitrd.1.asc
|
||||
@@ -34,6 +34,15 @@ OPTIONS
|
||||
**-k, --kver** _<kernel version>_::
|
||||
inspect the initramfs of <kernel version>.
|
||||
|
||||
+**--unpack**::
|
||||
+ unpack the initramfs to the current directory, instead of displaying the contents.
|
||||
+
|
||||
+**--unpackearly**::
|
||||
+ unpack the early microcode initramfs to the current directory, instead of displaying the contents.
|
||||
+
|
||||
+**-v, --verbose**::
|
||||
+ unpack verbosely
|
||||
+
|
||||
AVAILABILITY
|
||||
------------
|
||||
The lsinitrd command is part of the dracut package and is available from
|
||||
diff --git a/lsinitrd.sh b/lsinitrd.sh
|
||||
index 441fb92..224b9c1 100755
|
||||
--- a/lsinitrd.sh
|
||||
+++ b/lsinitrd.sh
|
||||
@@ -27,6 +27,9 @@ usage()
|
||||
echo "-s, --size sort the contents of the initramfs by size."
|
||||
echo "-m, --mod list modules."
|
||||
echo "-f, --file <filename> print the contents of <filename>."
|
||||
+ echo "--unpack unpack the initramfs, instead of displaying the contents."
|
||||
+ echo "--unpackearly unpack the early microcode part of the initramfs."
|
||||
+ echo "-v, --verbose unpack verbosely."
|
||||
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
|
||||
echo
|
||||
} >&2
|
||||
@@ -37,16 +40,21 @@ usage()
|
||||
|
||||
sorted=0
|
||||
modules=0
|
||||
+unpack=0
|
||||
+unset verbose
|
||||
declare -A filenames
|
||||
|
||||
unset POSIXLY_CORRECT
|
||||
TEMP=$(getopt \
|
||||
- -o "shmf:k:" \
|
||||
+ -o "vshmf:k:" \
|
||||
--long kver: \
|
||||
--long file: \
|
||||
--long mod \
|
||||
--long help \
|
||||
--long size \
|
||||
+ --long unpack \
|
||||
+ --long unpackearly \
|
||||
+ --long verbose \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
@@ -58,13 +66,16 @@ eval set -- "$TEMP"
|
||||
|
||||
while (($# > 0)); do
|
||||
case $1 in
|
||||
- -k|--kver) KERNEL_VERSION="$2"; shift;;
|
||||
- -f|--file) filenames[${2#/}]=1; shift;;
|
||||
- -s|--size) sorted=1;;
|
||||
- -h|--help) usage; exit 0;;
|
||||
- -m|--mod) modules=1;;
|
||||
- --) shift;break;;
|
||||
- *) usage; exit 1;;
|
||||
+ -k|--kver) KERNEL_VERSION="$2"; shift;;
|
||||
+ -f|--file) filenames[${2#/}]=1; shift;;
|
||||
+ -s|--size) sorted=1;;
|
||||
+ -h|--help) usage; exit 0;;
|
||||
+ -m|--mod) modules=1;;
|
||||
+ -v|--verbose) verbose="--verbose";;
|
||||
+ --unpack) unpack=1;;
|
||||
+ --unpackearly) unpackearly=1;;
|
||||
+ --) shift;break;;
|
||||
+ *) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
@@ -147,8 +158,14 @@ list_files()
|
||||
echo "========================================================================"
|
||||
}
|
||||
|
||||
+unpack_files()
|
||||
+{
|
||||
+ $CAT "$image" | cpio -id --quiet $verbose
|
||||
+ ((ret+=$?))
|
||||
+}
|
||||
+
|
||||
|
||||
-if (( ${#filenames[@]} <= 0 )); then
|
||||
+if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]]; then
|
||||
echo "Image: $image: $(du -h $image | while read a b || [ -n "$a" ]; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
fi
|
||||
@@ -159,7 +176,9 @@ case $bin in
|
||||
CAT="cat --"
|
||||
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null)
|
||||
if [[ "$is_early" ]]; then
|
||||
- if (( ${#filenames[@]} > 0 )); then
|
||||
+ if [[ -n "$unpackearly" ]]; then
|
||||
+ unpack_files
|
||||
+ elif (( ${#filenames[@]} > 0 )); then
|
||||
extract_files
|
||||
else
|
||||
echo "Early CPIO image"
|
||||
@@ -218,7 +237,9 @@ fi
|
||||
|
||||
ret=0
|
||||
|
||||
-if (( ${#filenames[@]} > 0 )); then
|
||||
+if [[ -n "$unpack" ]]; then
|
||||
+ unpack_files
|
||||
+elif (( ${#filenames[@]} > 0 )); then
|
||||
extract_files
|
||||
else
|
||||
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
@ -1,172 +0,0 @@
|
||||
From 9430ae301e3599d355e8b128a7faffa81dade6ff Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
|
||||
Date: Mon, 28 Mar 2016 11:38:34 +0300
|
||||
Subject: [PATCH] Do not use deprecated egrep/fgrep
|
||||
|
||||
---
|
||||
dracut-init.sh | 8 ++++----
|
||||
install/dracut-install.c | 2 +-
|
||||
modules.d/00systemd/module-setup.sh | 10 +++++-----
|
||||
modules.d/02systemd-networkd/module-setup.sh | 8 ++++----
|
||||
modules.d/95debug/module-setup.sh | 2 +-
|
||||
modules.d/95nfs/module-setup.sh | 8 ++++----
|
||||
modules.d/95udev-rules/module-setup.sh | 4 ++--
|
||||
modules.d/99base/module-setup.sh | 4 ++--
|
||||
test/TEST-04-FULL-SYSTEMD/test.sh | 2 +-
|
||||
9 files changed, 24 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index fc35d7b..a67aca2 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -328,15 +328,15 @@ inst_rule_group_owner() {
|
||||
|
||||
if grep -qE 'OWNER=?"[^ "]+' "$1"; then
|
||||
for i in $(grep -E 'OWNER=?"[^ "]+' "$1" | sed -r 's/.*OWNER=?"([^ "]+).*/\1/'); do
|
||||
- if ! egrep -q "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
|
||||
- egrep "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
+ if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
|
||||
+ grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if grep -qE 'GROUP=?"[^ "]+' "$1"; then
|
||||
for i in $(grep -E 'GROUP=?"[^ "]+' "$1" | sed -r 's/.*GROUP=?"([^ "]+).*/\1/'); do
|
||||
- if ! egrep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
|
||||
- egrep "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
+ if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then
|
||||
+ grep -E "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
diff --git a/install/dracut-install.c b/install/dracut-install.c
|
||||
index 8f65d8d..3b48ba8 100644
|
||||
--- a/install/dracut-install.c
|
||||
+++ b/install/dracut-install.c
|
||||
@@ -287,7 +287,7 @@ static int library_install(const char *src, const char *lib)
|
||||
|
||||
/* Also try to install the same library from one directory above.
|
||||
This fixes the case, where only the HWCAP lib would be installed
|
||||
- # ldconfig -p|fgrep libc.so
|
||||
+ # ldconfig -p|grep -F libc.so
|
||||
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
|
||||
libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
|
||||
libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6
|
||||
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
|
||||
index ed59beb..deb5e06 100755
|
||||
--- a/modules.d/00systemd/module-setup.sh
|
||||
+++ b/modules.d/00systemd/module-setup.sh
|
||||
@@ -179,11 +179,11 @@ install() {
|
||||
|
||||
# install adm user/group for journald
|
||||
inst_multiple nologin
|
||||
- egrep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
- egrep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
- egrep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
- egrep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
- egrep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
+ grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
+ grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
+ grep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
+ grep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
+ grep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
ln_r $systemdutildir/systemd "/init"
|
||||
ln_r $systemdutildir/systemd "/sbin/init"
|
||||
diff --git a/modules.d/02systemd-networkd/module-setup.sh b/modules.d/02systemd-networkd/module-setup.sh
|
||||
index 58842c0..b86751e 100755
|
||||
--- a/modules.d/02systemd-networkd/module-setup.sh
|
||||
+++ b/modules.d/02systemd-networkd/module-setup.sh
|
||||
@@ -48,10 +48,10 @@ install() {
|
||||
|
||||
# inst_dir /var/lib/systemd/clock
|
||||
|
||||
- egrep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
- egrep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
- # egrep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
- # egrep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
+ grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
+ grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
+ # grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
+ # grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
_arch=$(uname -m)
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
diff --git a/modules.d/95debug/module-setup.sh b/modules.d/95debug/module-setup.sh
|
||||
index ce5e8e8..97b2a30 100755
|
||||
--- a/modules.d/95debug/module-setup.sh
|
||||
+++ b/modules.d/95debug/module-setup.sh
|
||||
@@ -18,6 +18,6 @@ install() {
|
||||
tcpdump cp less hostname mkdir \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||
|
||||
- egrep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
+ grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
}
|
||||
|
||||
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
|
||||
index 9b5b8c8..aefbc2a 100755
|
||||
--- a/modules.d/95nfs/module-setup.sh
|
||||
+++ b/modules.d/95nfs/module-setup.sh
|
||||
@@ -105,14 +105,14 @@ install() {
|
||||
|
||||
# Rather than copy the passwd file in, just set a user for rpcbind
|
||||
# We'll save the state and restart the daemon from the root anyway
|
||||
- egrep '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
|
||||
- egrep '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group"
|
||||
+ grep -E '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd"
|
||||
+ grep -E '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
# rpc user needs to be able to write to this directory to save the warmstart
|
||||
# file
|
||||
chmod 770 "$initdir/var/lib/rpcbind"
|
||||
- egrep -q '^rpc:' /etc/passwd \
|
||||
- && egrep -q '^rpc:' /etc/group \
|
||||
+ grep -q '^rpc:' /etc/passwd \
|
||||
+ && grep -q '^rpc:' /etc/group \
|
||||
&& chown rpc.rpc "$initdir/var/lib/rpcbind"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh
|
||||
index 6a0625a..a59eca2 100755
|
||||
--- a/modules.d/95udev-rules/module-setup.sh
|
||||
+++ b/modules.d/95udev-rules/module-setup.sh
|
||||
@@ -63,8 +63,8 @@ install() {
|
||||
|
||||
{
|
||||
for i in cdrom tape dialout floppy; do
|
||||
- if ! egrep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
|
||||
- if ! egrep "^$i:" /etc/group 2>/dev/null; then
|
||||
+ if ! grep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then
|
||||
+ if ! grep "^$i:" /etc/group 2>/dev/null; then
|
||||
case $i in
|
||||
cdrom) echo "$i:x:11:";;
|
||||
dialout) echo "$i:x:18:";;
|
||||
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
|
||||
index cc94d00..5fbf6f7 100755
|
||||
--- a/modules.d/99base/module-setup.sh
|
||||
+++ b/modules.d/99base/module-setup.sh
|
||||
@@ -27,8 +27,8 @@ install() {
|
||||
fi
|
||||
|
||||
#add common users in /etc/passwd, it will be used by nfs/ssh currently
|
||||
- egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
|
||||
- egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
|
||||
+ grep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
|
||||
+ grep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
|
||||
|
||||
# install our scripts and hooks
|
||||
inst_script "$moddir/init.sh" "/init"
|
||||
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
index f5a9d48..c7e08bf 100755
|
||||
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
@@ -197,7 +197,7 @@ EOF
|
||||
ln -fs /proc/self/mounts $initdir/etc/mtab
|
||||
|
||||
# install any Execs from the service files
|
||||
- egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
|
||||
+ grep -Eho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
|
||||
| while read i || [ -n "$i" ]; do
|
||||
i=${i##Exec*=}; i=${i##-}
|
||||
inst_multiple -o $i
|
@ -1,22 +0,0 @@
|
||||
From dec3dfa4b3215e08581794bd76591023ed7984c8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
|
||||
Date: Mon, 28 Mar 2016 11:39:36 +0300
|
||||
Subject: [PATCH] nfs/module-setup.sh: Use colon instead of dot for chown
|
||||
user/group separator
|
||||
|
||||
---
|
||||
modules.d/95nfs/module-setup.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
|
||||
index aefbc2a..6f039bd 100755
|
||||
--- a/modules.d/95nfs/module-setup.sh
|
||||
+++ b/modules.d/95nfs/module-setup.sh
|
||||
@@ -113,6 +113,6 @@ install() {
|
||||
chmod 770 "$initdir/var/lib/rpcbind"
|
||||
grep -q '^rpc:' /etc/passwd \
|
||||
&& grep -q '^rpc:' /etc/group \
|
||||
- && chown rpc.rpc "$initdir/var/lib/rpcbind"
|
||||
+ && chown rpc:rpc "$initdir/var/lib/rpcbind"
|
||||
dracut_need_initqueue
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
From bcabe0fe2570d8cd39ab6af380bce44f13092450 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
|
||||
Date: Mon, 28 Mar 2016 11:52:14 +0300
|
||||
Subject: [PATCH] Clean up some bashisms from /bin/sh scripts
|
||||
|
||||
---
|
||||
modules.d/40network/dhclient-script.sh | 2 +-
|
||||
modules.d/40network/ifup.sh | 2 +-
|
||||
modules.d/95fcoe/fcoe-edd.sh | 2 +-
|
||||
modules.d/95nfs/nfs-lib.sh | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
|
||||
index 13d2dc2..94ee9d1 100755
|
||||
--- a/modules.d/40network/dhclient-script.sh
|
||||
+++ b/modules.d/40network/dhclient-script.sh
|
||||
@@ -95,7 +95,7 @@ setup_interface6() {
|
||||
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
}
|
||||
|
||||
-function parse_option_121() {
|
||||
+parse_option_121() {
|
||||
while [ $# -ne 0 ]; do
|
||||
mask="$1"
|
||||
shift
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
|
||||
index 7c179bd..1185523 100755
|
||||
--- a/modules.d/40network/ifup.sh
|
||||
+++ b/modules.d/40network/ifup.sh
|
||||
@@ -277,7 +277,7 @@ if [ -z "$NO_TEAM_MASTER" ]; then
|
||||
for slave in $teamslaves ; do
|
||||
ip link set $slave up 2>/dev/null
|
||||
if wait_for_if_up $slave; then
|
||||
- working_slaves+="$slave "
|
||||
+ working_slaves="$working_slaves$slave "
|
||||
fi
|
||||
done
|
||||
# Do not add slaves now
|
||||
diff --git a/modules.d/95fcoe/fcoe-edd.sh b/modules.d/95fcoe/fcoe-edd.sh
|
||||
index 3b07ad3..1e002d3 100755
|
||||
--- a/modules.d/95fcoe/fcoe-edd.sh
|
||||
+++ b/modules.d/95fcoe/fcoe-edd.sh
|
||||
@@ -29,7 +29,7 @@ for disk in /sys/firmware/edd/int13_*; do
|
||||
driver=${driver##*/}
|
||||
fi
|
||||
# i40e uses dev_port 1 for a virtual fcoe function
|
||||
- if [ "${driver}" == "i40e" ]; then
|
||||
+ if [ "${driver}" = "i40e" ]; then
|
||||
dev_port=1
|
||||
fi
|
||||
for nic in "${disk}"/pci_dev/net/*; do
|
||||
diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh
|
||||
index 58aa7e3..67608b1 100755
|
||||
--- a/modules.d/95nfs/nfs-lib.sh
|
||||
+++ b/modules.d/95nfs/nfs-lib.sh
|
||||
@@ -110,7 +110,7 @@ nfsroot_from_dhcp() {
|
||||
[ -f $f ] && . $f
|
||||
done
|
||||
[ -n "$new_root_path" ] && nfsroot_to_var "$nfs:$new_root_path"
|
||||
- [ -z "$path" ] && [ "$(getarg root=)" == "/dev/nfs" ] && path=/tftpboot/%s
|
||||
+ [ -z "$path" ] && [ "$(getarg root=)" = "/dev/nfs" ] && path=/tftpboot/%s
|
||||
[ -z "$server" ] && server=$srv
|
||||
[ -z "$server" ] && server=$new_dhcp_server_identifier
|
||||
[ -z "$server" ] && server=$new_next_server
|
@ -1,131 +0,0 @@
|
||||
From 06a1d0769055f437c938edd40bd9fbd622475864 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
|
||||
Date: Mon, 28 Mar 2016 12:09:06 +0300
|
||||
Subject: [PATCH] dracut-init.sh: Simplify udev rule grepping
|
||||
|
||||
---
|
||||
dracut-init.sh | 102 ++++++++++++++++++++++++++-------------------------------
|
||||
1 file changed, 46 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index a67aca2..b176421 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -275,71 +275,61 @@ rev_lib_symlinks() {
|
||||
inst_rule_programs() {
|
||||
local _prog _bin
|
||||
|
||||
- if grep -qE 'PROGRAM==?"[^ "]+' "$1"; then
|
||||
- for _prog in $(grep -E 'PROGRAM==?"[^ "]+' "$1" | sed -r 's/.*PROGRAM==?"([^ "]+).*/\1/'); do
|
||||
- _bin=""
|
||||
- if [ -x ${udevdir}/$_prog ]; then
|
||||
- _bin=${udevdir}/$_prog
|
||||
- elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
|
||||
- _bin=$(find_binary "$_prog") || {
|
||||
- dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
|
||||
- continue;
|
||||
- }
|
||||
- fi
|
||||
+ for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p'); do
|
||||
+ _bin=""
|
||||
+ if [ -x ${udevdir}/$_prog ]; then
|
||||
+ _bin=${udevdir}/$_prog
|
||||
+ elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
|
||||
+ _bin=$(find_binary "$_prog") || {
|
||||
+ dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
|
||||
+ continue;
|
||||
+ }
|
||||
+ fi
|
||||
|
||||
- [[ $_bin ]] && inst_binary "$_bin"
|
||||
- done
|
||||
- fi
|
||||
- if grep -qE 'RUN[+=]=?"[^ "]+' "$1"; then
|
||||
- for _prog in $(grep -E 'RUN[+=]=?"[^ "]+' "$1" | sed -r 's/.*RUN[+=]=?"([^ "]+).*/\1/'); do
|
||||
- _bin=""
|
||||
- if [ -x ${udevdir}/$_prog ]; then
|
||||
- _bin=${udevdir}/$_prog
|
||||
- elif [[ "${_prog/\$env\{/}" == "$_prog" ]] && [[ "${_prog}" != "/sbin/initqueue" ]]; then
|
||||
- _bin=$(find_binary "$_prog") || {
|
||||
- dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
|
||||
- continue;
|
||||
- }
|
||||
- fi
|
||||
+ [[ $_bin ]] && inst_binary "$_bin"
|
||||
+ done
|
||||
+ for _prog in $(sed -nr 's/.*RUN[+=]=?"([^ "]+).*/\1/p'); do
|
||||
+ _bin=""
|
||||
+ if [ -x ${udevdir}/$_prog ]; then
|
||||
+ _bin=${udevdir}/$_prog
|
||||
+ elif [[ "${_prog/\$env\{/}" == "$_prog" ]] && [[ "${_prog}" != "/sbin/initqueue" ]]; then
|
||||
+ _bin=$(find_binary "$_prog") || {
|
||||
+ dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
|
||||
+ continue;
|
||||
+ }
|
||||
+ fi
|
||||
|
||||
- [[ $_bin ]] && inst_binary "$_bin"
|
||||
- done
|
||||
- fi
|
||||
- if grep -qE 'IMPORT\{program\}==?"[^ "]+' "$1"; then
|
||||
- for _prog in $(grep -E 'IMPORT\{program\}==?"[^ "]+' "$1" | sed -r 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/'); do
|
||||
- _bin=""
|
||||
- if [ -x ${udevdir}/$_prog ]; then
|
||||
- _bin=${udevdir}/$_prog
|
||||
- elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
|
||||
- _bin=$(find_binary "$_prog") || {
|
||||
- dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
|
||||
- continue;
|
||||
- }
|
||||
- fi
|
||||
+ [[ $_bin ]] && inst_binary "$_bin"
|
||||
+ done
|
||||
+ for _prog in $(sed -nr 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/p'); do
|
||||
+ _bin=""
|
||||
+ if [ -x ${udevdir}/$_prog ]; then
|
||||
+ _bin=${udevdir}/$_prog
|
||||
+ elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
|
||||
+ _bin=$(find_binary "$_prog") || {
|
||||
+ dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
|
||||
+ continue;
|
||||
+ }
|
||||
+ fi
|
||||
|
||||
- [[ $_bin ]] && dracut_install "$_bin"
|
||||
- done
|
||||
- fi
|
||||
+ [[ $_bin ]] && dracut_install "$_bin"
|
||||
+ done
|
||||
}
|
||||
|
||||
# attempt to install any programs specified in a udev rule
|
||||
inst_rule_group_owner() {
|
||||
local i
|
||||
|
||||
- if grep -qE 'OWNER=?"[^ "]+' "$1"; then
|
||||
- for i in $(grep -E 'OWNER=?"[^ "]+' "$1" | sed -r 's/.*OWNER=?"([^ "]+).*/\1/'); do
|
||||
- if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
|
||||
- grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
- fi
|
||||
- done
|
||||
- fi
|
||||
- if grep -qE 'GROUP=?"[^ "]+' "$1"; then
|
||||
- for i in $(grep -E 'GROUP=?"[^ "]+' "$1" | sed -r 's/.*GROUP=?"([^ "]+).*/\1/'); do
|
||||
- if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then
|
||||
- grep -E "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
- fi
|
||||
- done
|
||||
- fi
|
||||
+ for i in $(sed -nr 's/.*OWNER=?"([^ "]+).*/\1/p'); do
|
||||
+ if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
|
||||
+ grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
+ fi
|
||||
+ done
|
||||
+ for i in $(sed -nr 's/.*GROUP=?"([^ "]+).*/\1/p' "$1"); do
|
||||
+ if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then
|
||||
+ grep -E "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
+ fi
|
||||
+ done
|
||||
}
|
||||
|
||||
inst_rule_initqueue() {
|
@ -1,26 +0,0 @@
|
||||
From f7f5b82b4323210efc343132e3ae8fa91b26a68d Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 21 Mar 2016 11:56:50 +0100
|
||||
Subject: [PATCH] dracut.sh: call dracut-install with "-f" in FIPS mode
|
||||
|
||||
in fips mode, dracut-install was called with "-H" instead of "-f" in
|
||||
FIPS mode
|
||||
|
||||
missed conversion of commit 26cd262a6a575a50ea384a2ceac6a6829efe8106
|
||||
---
|
||||
dracut.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dracut.sh b/dracut.sh
|
||||
index 98dbe0b..37ae350 100755
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -1496,7 +1496,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then
|
||||
dinfo "*** Resolving executable dependencies ***"
|
||||
find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \
|
||||
- | xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-H} --
|
||||
+ | xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-f} --
|
||||
dinfo "*** Resolving executable dependencies done***"
|
||||
fi
|
||||
|
@ -1,50 +0,0 @@
|
||||
From 374ef3ed2bff30db35126dd694b4234709398a2f Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 11 Apr 2016 13:36:06 +0200
|
||||
Subject: [PATCH] dracut-init.sh: Add file argument to sed's
|
||||
|
||||
fixup for 06a1d0769055f437c938edd40bd9fbd622475864
|
||||
---
|
||||
dracut-init.sh | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index b176421..2431171 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -275,7 +275,7 @@ rev_lib_symlinks() {
|
||||
inst_rule_programs() {
|
||||
local _prog _bin
|
||||
|
||||
- for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p'); do
|
||||
+ for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p' "$1"); do
|
||||
_bin=""
|
||||
if [ -x ${udevdir}/$_prog ]; then
|
||||
_bin=${udevdir}/$_prog
|
||||
@@ -288,7 +288,7 @@ inst_rule_programs() {
|
||||
|
||||
[[ $_bin ]] && inst_binary "$_bin"
|
||||
done
|
||||
- for _prog in $(sed -nr 's/.*RUN[+=]=?"([^ "]+).*/\1/p'); do
|
||||
+ for _prog in $(sed -nr 's/.*RUN[+=]=?"([^ "]+).*/\1/p' "$1"); do
|
||||
_bin=""
|
||||
if [ -x ${udevdir}/$_prog ]; then
|
||||
_bin=${udevdir}/$_prog
|
||||
@@ -301,7 +301,7 @@ inst_rule_programs() {
|
||||
|
||||
[[ $_bin ]] && inst_binary "$_bin"
|
||||
done
|
||||
- for _prog in $(sed -nr 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/p'); do
|
||||
+ for _prog in $(sed -nr 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/p' "$1"); do
|
||||
_bin=""
|
||||
if [ -x ${udevdir}/$_prog ]; then
|
||||
_bin=${udevdir}/$_prog
|
||||
@@ -320,7 +320,7 @@ inst_rule_programs() {
|
||||
inst_rule_group_owner() {
|
||||
local i
|
||||
|
||||
- for i in $(sed -nr 's/.*OWNER=?"([^ "]+).*/\1/p'); do
|
||||
+ for i in $(sed -nr 's/.*OWNER=?"([^ "]+).*/\1/p' "$1"); do
|
||||
if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
|
||||
grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
fi
|
@ -1,34 +0,0 @@
|
||||
From 98fd06934c9e10567b4755714191cd2aee8822ac Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 11 Apr 2016 15:22:11 +0200
|
||||
Subject: [PATCH] lsinitrd.sh: fixed unpack and skipcpio search
|
||||
|
||||
---
|
||||
lsinitrd.sh | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lsinitrd.sh b/lsinitrd.sh
|
||||
index 224b9c1..b19a66a 100755
|
||||
--- a/lsinitrd.sh
|
||||
+++ b/lsinitrd.sh
|
||||
@@ -40,7 +40,6 @@ usage()
|
||||
|
||||
sorted=0
|
||||
modules=0
|
||||
-unpack=0
|
||||
unset verbose
|
||||
declare -A filenames
|
||||
|
||||
@@ -184,7 +183,11 @@ case $bin in
|
||||
echo "Early CPIO image"
|
||||
list_files
|
||||
fi
|
||||
- SKIP="$dracutbasedir/skipcpio"
|
||||
+ if [[ -d "$dracutbasedir/skipcpio" ]]; then
|
||||
+ SKIP="$dracutbasedir/skipcpio/skipcpio"
|
||||
+ else
|
||||
+ SKIP="$dracutbasedir/skipcpio"
|
||||
+ fi
|
||||
if ! [[ -x $SKIP ]]; then
|
||||
echo
|
||||
echo "'$SKIP' not found, cannot display remaining contents!" >&2
|
@ -1,78 +0,0 @@
|
||||
From ff8f7026897edf1d0aa9c73b9f7a3d21b1b51da3 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 11 Apr 2016 15:22:56 +0200
|
||||
Subject: [PATCH] dracut-init.sh: mark error messages with FAILED
|
||||
|
||||
---
|
||||
dracut-init.sh | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index 2431171..a8b78ce 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -168,7 +168,7 @@ fi
|
||||
inst_dir() {
|
||||
[[ -e ${initdir}/"$1" ]] && return 0 # already there
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@"
|
||||
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" || :
|
||||
+ (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" || :
|
||||
}
|
||||
|
||||
inst() {
|
||||
@@ -179,7 +179,7 @@ inst() {
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
+ (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_simple() {
|
||||
@@ -191,7 +191,7 @@ inst_simple() {
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"
|
||||
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
+ (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_symlink() {
|
||||
@@ -203,14 +203,14 @@ inst_symlink() {
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -L $1 ]] || return 1
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
+ (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_multiple() {
|
||||
local _ret
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
_ret=$?
|
||||
- (($_ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
+ (($_ret != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
return $_ret
|
||||
}
|
||||
|
||||
@@ -227,17 +227,17 @@ inst_library() {
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
+ (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_binary() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
+ (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
inst_script() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
+ (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
mark_hostonly() {
|
File diff suppressed because it is too large
Load Diff
@ -1,94 +0,0 @@
|
||||
From 607fec3e7965e3d38d764008e2b0c29757d90777 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 13 Apr 2016 11:13:32 +0200
|
||||
Subject: [PATCH] Use pkg-config for libkmod CFLAGS and LIBS
|
||||
|
||||
---
|
||||
Makefile | 4 ++--
|
||||
configure | 7 +++++++
|
||||
dracut.spec | 9 ++++++---
|
||||
3 files changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 0a1ae6c..d28e4cf 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -12,7 +12,7 @@ pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
-CFLAGS ?= -O2 -g -Wall
|
||||
+CFLAGS ?= -O2 -g -Wall $(KMOD_CFLAGS)
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
@@ -61,7 +61,7 @@ install/util.o: install/util.c install/util.h install/macro.h install/log.h
|
||||
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
|
||||
|
||||
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
|
||||
- $(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) -lkmod
|
||||
+ $(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
|
||||
|
||||
dracut-install: install/dracut-install
|
||||
ln -fs $< $@
|
||||
diff --git a/configure b/configure
|
||||
index 0bd3d2d..c92cb99 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -50,6 +50,11 @@ while (($# > 0)); do
|
||||
shift
|
||||
done
|
||||
|
||||
+if ! pkg-config --exists --print-errors " libkmod >= 15 "; then
|
||||
+ echo "dracut needs pkg-config and libkmod >= 15." >&2
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
cat > Makefile.inc.$$ <<EOF
|
||||
prefix ?= ${prefix}
|
||||
libdir ?= ${libdir:-${prefix}/lib}
|
||||
@@ -59,6 +64,8 @@ sbindir ?= ${sbindir:-${prefix}/sbin}
|
||||
mandir ?= ${mandir:-${prefix}/share/man}
|
||||
enable_documentation ?= ${enable_documentation:-yes}
|
||||
bindir ?= ${bindir:-${prefix}/bin}
|
||||
+KMOD_CFLAGS ?= $(pkg-config --cflags " libkmod >= 15 ")
|
||||
+KMOD_LIBS ?= $(pkg-config --libs " libkmod >= 15 ")
|
||||
EOF
|
||||
|
||||
{
|
||||
diff --git a/dracut.spec b/dracut.spec
|
||||
index 9e19fcc..7b9d675 100644
|
||||
--- a/dracut.spec
|
||||
+++ b/dracut.spec
|
||||
@@ -39,6 +39,7 @@ Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||
|
||||
|
||||
BuildRequires: bash git
|
||||
+BuildRequires: kmod-devel >= 15
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
@@ -46,7 +47,6 @@ BuildRequires: pkgconfig
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: bash-completion
|
||||
-BuildRequires: pkgconfig
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
@@ -223,10 +223,13 @@ This package contains tools to assemble the local initrd and host configuration.
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
-%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
|
||||
+%configure --systemdsystemunitdir=%{_unitdir} \
|
||||
+ --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \
|
||||
+ --libdir=%{_prefix}/lib \
|
||||
%if %{without doc}
|
||||
- --disable-documentation
|
||||
+ --disable-documentation \
|
||||
%endif
|
||||
+ ${NULL}
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
@ -1,162 +0,0 @@
|
||||
From 8d9ab2755d1341904ca7889f4e05b2151848a759 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 13 Apr 2016 11:47:20 +0200
|
||||
Subject: [PATCH] Fix regressions with dracut-install with kernel modules
|
||||
|
||||
Make sure, the same modules are installed as before.
|
||||
---
|
||||
install/dracut-install.c | 9 +++++----
|
||||
modules.d/50drm/module-setup.sh | 4 ++--
|
||||
modules.d/90kernel-modules/module-setup.sh | 15 ++++++++-------
|
||||
modules.d/90kernel-network-modules/module-setup.sh | 2 +-
|
||||
modules.d/90multipath/module-setup.sh | 2 +-
|
||||
modules.d/95iscsi/module-setup.sh | 2 +-
|
||||
6 files changed, 18 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/install/dracut-install.c b/install/dracut-install.c
|
||||
index a20e06c..c246201 100644
|
||||
--- a/install/dracut-install.c
|
||||
+++ b/install/dracut-install.c
|
||||
@@ -1202,6 +1202,7 @@ static int install_module(struct kmod_module *mod)
|
||||
if (!check_module_path(path) || !check_module_symbols(mod)) {
|
||||
log_debug("No symbol or patch match for '%s'", path);
|
||||
return 0;
|
||||
+ //return -ENOENT;
|
||||
}
|
||||
|
||||
log_debug("dracut_install '%s'", path);
|
||||
@@ -1295,7 +1296,7 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
- ret = install_module(mod);
|
||||
+ ret += install_module(mod);
|
||||
}
|
||||
kmod_module_unref_list(modlist);
|
||||
modlist = 0;
|
||||
@@ -1364,13 +1365,13 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
- ret = install_module(mod);
|
||||
+ ret += install_module(mod);
|
||||
kmod_module_unref(mod);
|
||||
}
|
||||
kmod_module_unref_list(modlist);
|
||||
modlist = 0;
|
||||
#else
|
||||
- ret = install_module(mod_o);
|
||||
+ ret += install_module(mod_o);
|
||||
kmod_module_unref(mod_o);
|
||||
#endif
|
||||
|
||||
@@ -1413,7 +1414,7 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
- ret = install_module(mod);
|
||||
+ ret += install_module(mod);
|
||||
kmod_module_unref(mod);
|
||||
}
|
||||
kmod_module_unref_list(modlist);
|
||||
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
|
||||
index e0b2959..661dde9 100755
|
||||
--- a/modules.d/50drm/module-setup.sh
|
||||
+++ b/modules.d/50drm/module-setup.sh
|
||||
@@ -34,8 +34,8 @@ installkernel() {
|
||||
if [[ $hostonly ]]; then
|
||||
for i in /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias; do
|
||||
[[ -e $i ]] || continue
|
||||
- if hostonly="" dracut_instmods -s "drm_crtc_init" $(<$i) 2>/dev/null; then
|
||||
- if strstr $(modinfo -F filename $(<$i) 2>/dev/null) radeon.ko; then
|
||||
+ if hostonly="" dracut_instmods -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i) 2>/dev/null; then
|
||||
+ if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
fi
|
||||
fi
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
|
||||
index e97d598..c30715d 100755
|
||||
--- a/modules.d/90kernel-modules/module-setup.sh
|
||||
+++ b/modules.d/90kernel-modules/module-setup.sh
|
||||
@@ -7,20 +7,21 @@ installkernel() {
|
||||
if [[ -z $drivers ]]; then
|
||||
hostonly='' instmods \
|
||||
sr_mod sd_mod scsi_dh ata_piix hid_generic unix \
|
||||
- ehci-hcd ehci-pci \
|
||||
+ ehci-hcd ehci-pci ehci-platform \
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
xhci-hcd xhci-pci xhci-plat-hcd \
|
||||
- ehci-platform
|
||||
-
|
||||
- instmods \
|
||||
"=drivers/hid" \
|
||||
"=drivers/input/serio" \
|
||||
"=drivers/input/keyboard" \
|
||||
+ "=drivers/usb/storage" \
|
||||
+ ${NULL}
|
||||
+
|
||||
+ instmods \
|
||||
yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
|
||||
virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
|
||||
- "=drivers/pcmcia" =ide "=drivers/usb/storage"
|
||||
+ "=drivers/pcmcia" =ide
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
@@ -33,13 +34,13 @@ installkernel() {
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
- dracut_instmods -s "${_blockfuncs}" "=drivers"
|
||||
+ dracut_instmods -o -s "${_blockfuncs}" "=drivers"
|
||||
|
||||
# if not on hostonly mode, install all known filesystems,
|
||||
# if the required list is not set via the filesystems variable
|
||||
if ! [[ $hostonly ]]; then
|
||||
if [[ -z $filesystems ]]; then
|
||||
- dracut_instmods -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
|
||||
+ dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
|
||||
fi
|
||||
else
|
||||
hostonly='' instmods "${host_fs_types[@]}"
|
||||
diff --git a/modules.d/90kernel-network-modules/module-setup.sh b/modules.d/90kernel-network-modules/module-setup.sh
|
||||
index c004ff8..11fbab9 100755
|
||||
--- a/modules.d/90kernel-network-modules/module-setup.sh
|
||||
+++ b/modules.d/90kernel-network-modules/module-setup.sh
|
||||
@@ -21,7 +21,7 @@ installkernel() {
|
||||
_s390drivers="=drivers/s390/net"
|
||||
fi
|
||||
|
||||
- dracut_instmods -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"}
|
||||
+ dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"}
|
||||
|
||||
#instmods() will take care of hostonly
|
||||
instmods \
|
||||
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
|
||||
index 27817bd..0af777d 100755
|
||||
--- a/modules.d/90multipath/module-setup.sh
|
||||
+++ b/modules.d/90multipath/module-setup.sh
|
||||
@@ -58,7 +58,7 @@ installkernel() {
|
||||
_s390drivers="=drivers/s390/scsi"
|
||||
fi
|
||||
|
||||
- hostonly='' dracut_instmods -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
|
||||
+ hostonly='' dracut_instmods -o -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
|
||||
index 203e313..04937b5 100755
|
||||
--- a/modules.d/95iscsi/module-setup.sh
|
||||
+++ b/modules.d/95iscsi/module-setup.sh
|
||||
@@ -166,7 +166,7 @@ installkernel() {
|
||||
_s390drivers="=drivers/s390/scsi"
|
||||
fi
|
||||
|
||||
- dracut_instmods -s "$_funcs" "=drivers/scsi" ${_s390drivers:+"$_s390drivers"}
|
||||
+ dracut_instmods -o -s "$_funcs" "=drivers/scsi" ${_s390drivers:+"$_s390drivers"}
|
||||
|
||||
}
|
||||
|
@ -1,159 +0,0 @@
|
||||
From fe6e0c23adbdafc4fc371107534b3b2681c96393 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 13 Apr 2016 13:28:29 +0200
|
||||
Subject: [PATCH] dracut-install: simplify error logic
|
||||
|
||||
error out early, if "--optional" is not set
|
||||
---
|
||||
install/dracut-install.c | 64 +++++++++++++++++++++++++++++++++++-------------
|
||||
1 file changed, 47 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/install/dracut-install.c b/install/dracut-install.c
|
||||
index c246201..f414f30 100644
|
||||
--- a/install/dracut-install.c
|
||||
+++ b/install/dracut-install.c
|
||||
@@ -1181,8 +1181,10 @@ static int install_module(struct kmod_module *mod)
|
||||
state = kmod_module_get_initstate(mod);
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
- if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))
|
||||
+ if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
+ log_debug("dracut_install '%s' is excluded", name);
|
||||
return 0;
|
||||
+ }
|
||||
|
||||
if (arg_hostonly && (state != KMOD_MODULE_BUILTIN) && (state != KMOD_MODULE_LIVE)) {
|
||||
log_debug("dracut_install '%s' not hostonly", name);
|
||||
@@ -1194,15 +1196,14 @@ static int install_module(struct kmod_module *mod)
|
||||
return -ENOENT;
|
||||
|
||||
if (check_hashmap(items_failed, path))
|
||||
- return 1;
|
||||
+ return -1;
|
||||
|
||||
if (check_hashmap(items, path))
|
||||
return 0;
|
||||
|
||||
if (!check_module_path(path) || !check_module_symbols(mod)) {
|
||||
log_debug("No symbol or patch match for '%s'", path);
|
||||
- return 0;
|
||||
- //return -ENOENT;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
log_debug("dracut_install '%s'", path);
|
||||
@@ -1252,7 +1253,7 @@ static int install_modules(int argc, char **argv)
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
int r = 0;
|
||||
- int ret = 0;
|
||||
+ int ret = -1;
|
||||
log_debug("Handle module '%s'", argv[i]);
|
||||
|
||||
if (argv[i][0] == '/') {
|
||||
@@ -1296,7 +1297,14 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
- ret += install_module(mod);
|
||||
+ r = install_module(mod);
|
||||
+ kmod_module_unref(mod);
|
||||
+ if ((r < 0) && !arg_optional) {
|
||||
+ if (!arg_silent)
|
||||
+ log_error("ERROR: installing module '%s'", modname);
|
||||
+ return -ENOENT;
|
||||
+ };
|
||||
+ ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
kmod_module_unref_list(modlist);
|
||||
modlist = 0;
|
||||
@@ -1341,40 +1349,55 @@ static int install_modules(int argc, char **argv)
|
||||
log_debug("Handling %s", ftsent->fts_accpath);
|
||||
r = kmod_module_new_from_path(ctx, ftsent->fts_accpath, &mod_o);
|
||||
if (r < 0) {
|
||||
- log_debug("Failed to lookup modules path '%s': %m", ftsent->fts_accpath);
|
||||
+ log_debug("Failed to lookup modules path '%s': %m",
|
||||
+ ftsent->fts_accpath);
|
||||
+ if (!arg_optional) {
|
||||
+ return -ENOENT;
|
||||
+ }
|
||||
continue;
|
||||
}
|
||||
-#if 1
|
||||
+
|
||||
/* Check, if we have to load another module with that name instead */
|
||||
modname = kmod_module_get_name(mod_o);
|
||||
if (!modname) {
|
||||
log_error("Failed to get name for module '%s'", ftsent->fts_accpath);
|
||||
+ if (!arg_optional) {
|
||||
+ return -ENOENT;
|
||||
+ }
|
||||
continue;
|
||||
}
|
||||
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
||||
kmod_module_unref(mod_o);
|
||||
if (r < 0) {
|
||||
- log_error("2 Failed to lookup alias '%s': %m", modname);
|
||||
+ log_error("Failed to lookup alias '%s': %m", modname);
|
||||
kmod_module_unref_list(modlist);
|
||||
+ if (!arg_optional) {
|
||||
+ return -ENOENT;
|
||||
+ }
|
||||
continue;
|
||||
}
|
||||
if (!modlist) {
|
||||
- log_error("Failed to find module '%s' %s", modname, ftsent->fts_accpath);
|
||||
+ log_error("Failed to find module '%s' %s", modname,
|
||||
+ ftsent->fts_accpath);
|
||||
kmod_module_unref_list(modlist);
|
||||
+ if (!arg_optional) {
|
||||
+ return -ENOENT;
|
||||
+ }
|
||||
continue;
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
- ret += install_module(mod);
|
||||
+ r = install_module(mod);
|
||||
kmod_module_unref(mod);
|
||||
+ if ((r < 0) && !arg_optional) {
|
||||
+ if (!arg_silent)
|
||||
+ log_error("ERROR: installing module '%s'", modname);
|
||||
+ return -ENOENT;
|
||||
+ };
|
||||
+ ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
kmod_module_unref_list(modlist);
|
||||
modlist = 0;
|
||||
-#else
|
||||
- ret += install_module(mod_o);
|
||||
- kmod_module_unref(mod_o);
|
||||
-#endif
|
||||
-
|
||||
}
|
||||
if (errno) {
|
||||
log_error("FTS ERROR: %m");
|
||||
@@ -1414,8 +1437,14 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
- ret += install_module(mod);
|
||||
+ r = install_module(mod);
|
||||
kmod_module_unref(mod);
|
||||
+ if ((r < 0) && !arg_optional) {
|
||||
+ if (!arg_silent)
|
||||
+ log_error("ERROR: installing '%s'", argv[i]);
|
||||
+ return -ENOENT;
|
||||
+ };
|
||||
+ ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
kmod_module_unref_list(modlist);
|
||||
modlist = 0;
|
||||
@@ -1427,6 +1456,7 @@ static int install_modules(int argc, char **argv)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
+
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
@ -1,64 +0,0 @@
|
||||
From 9bb030c5d8189f42eef3a0a881a361ce811414b0 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 13 Apr 2016 13:57:03 +0200
|
||||
Subject: [PATCH] dracut-init.sh: beautify instmods()
|
||||
|
||||
---
|
||||
dracut-init.sh | 31 ++++++++++++++++++++++++++++---
|
||||
1 file changed, 28 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index e26d97a..8d1d9fa 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -1001,22 +1001,47 @@ instmods() {
|
||||
local _optional="-o"
|
||||
local _silent
|
||||
local _ret
|
||||
+
|
||||
[[ $no_kernel = yes ]] && return
|
||||
+
|
||||
if [[ $1 = '-c' ]]; then
|
||||
- _optional=""
|
||||
+ unset _optional
|
||||
shift
|
||||
fi
|
||||
if [[ $1 = '-s' ]]; then
|
||||
_silent=1
|
||||
shift
|
||||
fi
|
||||
+
|
||||
if (($# == 0)); then
|
||||
read -r -d '' -a args
|
||||
set -- "${args[@]}"
|
||||
fi
|
||||
- $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${_optional:+-o} ${_silent:+--silent} ${srcmods:+--kerneldir "$srcmods"} -m "$@"
|
||||
+
|
||||
+ $DRACUT_INSTALL \
|
||||
+ ${initdir:+-D "$initdir"} \
|
||||
+ ${loginstall:+-L "$loginstall"} \
|
||||
+ ${hostonly:+-H} \
|
||||
+ ${omit_drivers:+-N "$omit_drivers"} \
|
||||
+ ${srcmods:+--kerneldir "$srcmods"} \
|
||||
+ ${_optional:+-o} \
|
||||
+ ${_silent:+--silent} \
|
||||
+ -m "$@"
|
||||
_ret=$?
|
||||
- (($_ret != 0)) && [[ -z "$_silent" ]] && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${_optional:+-o} ${_silent:+--silent} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
+
|
||||
+ if (($_ret != 0)) && [[ -z "$_silent" ]]; then
|
||||
+ derror "FAILED: " \
|
||||
+ $DRACUT_INSTALL \
|
||||
+ ${initdir:+-D "$initdir"} \
|
||||
+ ${loginstall:+-L "$loginstall"} \
|
||||
+ ${hostonly:+-H} \
|
||||
+ ${omit_drivers:+-N "$omit_drivers"} \
|
||||
+ ${srcmods:+--kerneldir "$srcmods"} \
|
||||
+ ${_optional:+-o} \
|
||||
+ ${_silent:+--silent} \
|
||||
+ -m "$@"
|
||||
+ fi
|
||||
+
|
||||
[[ "$optional" ]] && return 0
|
||||
return $_ret
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
From 7ef36aef28eb8f770f3c104d8e88b3b991170f3a Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 6 Apr 2016 10:24:58 +0200
|
||||
Subject: [PATCH] plymouth/plymouth-pretrigger.sh: also trigger acpi subsystem
|
||||
|
||||
Trigger the acpi subsystem. This will ensure hv_vmbus gets loaded before
|
||||
plymouth is started, which will make the graphics device become
|
||||
available before plymouth is started too (and the keyboard ! which might
|
||||
also be important for plymouth in some setups).
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1218130
|
||||
(cherry picked from commit d2846fdcce9b8de0edecdf0e06a4b86fc8de542c)
|
||||
---
|
||||
modules.d/50plymouth/plymouth-pretrigger.sh | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.d/50plymouth/plymouth-pretrigger.sh b/modules.d/50plymouth/plymouth-pretrigger.sh
|
||||
index c3a97f2..6458d78 100755
|
||||
--- a/modules.d/50plymouth/plymouth-pretrigger.sh
|
||||
+++ b/modules.d/50plymouth/plymouth-pretrigger.sh
|
||||
@@ -5,9 +5,14 @@ if type plymouthd >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
- udevadm trigger --action=add --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
+ udevadm trigger --action=add \
|
||||
+ --subsystem-match=graphics \
|
||||
+ --subsystem-match=drm \
|
||||
+ --subsystem-match=tty \
|
||||
+ --subsystem-match=acpi \
|
||||
+ >/dev/null 2>&1
|
||||
|
||||
- udevadm settle --timeout=30 2>&1 | vinfo
|
||||
+ udevadm settle --timeout=180 2>&1 | vinfo
|
||||
|
||||
info "Starting plymouth daemon"
|
||||
mkdir -m 0755 /run/plymouth
|
@ -1,106 +0,0 @@
|
||||
From b14b039e9066f51c3c4cee2123f23f7822dd8e13 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 14 Apr 2016 11:47:50 +0200
|
||||
Subject: [PATCH] dracut-install: add --help documentation
|
||||
|
||||
---
|
||||
install/dracut-install.c | 73 +++++++++++++++++++++++-------------------------
|
||||
1 file changed, 35 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/install/dracut-install.c b/install/dracut-install.c
|
||||
index f414f30..bef08da 100644
|
||||
--- a/install/dracut-install.c
|
||||
+++ b/install/dracut-install.c
|
||||
@@ -17,7 +17,7 @@
|
||||
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
-#define PROGRAM_VERSION_STRING "1"
|
||||
+#define PROGRAM_VERSION_STRING "2"
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
@@ -719,49 +719,46 @@ static void item_free(char *i)
|
||||
|
||||
static void usage(int status)
|
||||
{
|
||||
- /* */
|
||||
+ /* */
|
||||
printf("Usage: %s -D DESTROOTDIR [OPTION]... -a SOURCE...\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... SOURCE DEST\n"
|
||||
+ "or: %s -D DESTROOTDIR [OPTION]... -m KERNELMODULE [KERNELMODULE …]\n"
|
||||
"\n"
|
||||
"Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n"
|
||||
"\n"
|
||||
- " -D --destrootdir Install all files to DESTROOTDIR as the root\n"
|
||||
- " -a --all Install all SOURCE arguments to DESTROOTDIR\n"
|
||||
- " -o --optional If SOURCE does not exist, do not fail\n"
|
||||
- " -d --dir SOURCE is a directory\n"
|
||||
- " -l --ldd Also install shebang executables and libraries\n"
|
||||
- " -L --logdir <DIR> Log files, which were installed from the host to <DIR>\n"
|
||||
- " -R --resolvelazy Only install shebang executables and libraries\n"
|
||||
- " for all SOURCE files\n"
|
||||
- " -H --hostonly Mark all SOURCE files as hostonly\n\n"
|
||||
- " -f --fips Also install all '.SOURCE.hmac' files\n"
|
||||
- " -v --verbose Show more output\n"
|
||||
- " --debug Show debug output\n"
|
||||
- " --version Show package version\n"
|
||||
- " -h --help Show this help\n"
|
||||
+ " KERNELMODULE can have the format:\n"
|
||||
+ " <absolute path> with a leading /\n"
|
||||
+ " =<kernel subdir>[/<kernel subdir>…] like '=drivers/hid'\n"
|
||||
+ " <module name>\n"
|
||||
"\n"
|
||||
- "Example:\n"
|
||||
- "# mkdir -p /var/tmp/test-root\n"
|
||||
- "# %s -D /var/tmp/test-root --ldd -a sh tr\n"
|
||||
- "# tree /var/tmp/test-root\n"
|
||||
- "/var/tmp/test-root\n"
|
||||
- "|-- lib64 -> usr/lib64\n"
|
||||
- "`-- usr\n"
|
||||
- " |-- bin\n"
|
||||
- " | |-- bash\n"
|
||||
- " | |-- sh -> bash\n"
|
||||
- " | `-- tr\n"
|
||||
- " `-- lib64\n"
|
||||
- " |-- ld-2.15.90.so\n"
|
||||
- " |-- ld-linux-x86-64.so.2 -> ld-2.15.90.so\n"
|
||||
- " |-- libc-2.15.90.so\n"
|
||||
- " |-- libc.so\n"
|
||||
- " |-- libc.so.6 -> libc-2.15.90.so\n"
|
||||
- " |-- libdl-2.15.90.so\n"
|
||||
- " |-- libdl.so -> libdl-2.15.90.so\n"
|
||||
- " |-- libdl.so.2 -> libdl-2.15.90.so\n"
|
||||
- " |-- libtinfo.so.5 -> libtinfo.so.5.9\n"
|
||||
- " `-- libtinfo.so.5.9\n", program_invocation_short_name, program_invocation_short_name,
|
||||
+ " -D --destrootdir Install all files to DESTROOTDIR as the root\n"
|
||||
+ " -a --all Install all SOURCE arguments to DESTROOTDIR\n"
|
||||
+ " -o --optional If SOURCE does not exist, do not fail\n"
|
||||
+ " -d --dir SOURCE is a directory\n"
|
||||
+ " -l --ldd Also install shebang executables and libraries\n"
|
||||
+ " -L --logdir <DIR> Log files, which were installed from the host to <DIR>\n"
|
||||
+ " -R --resolvelazy Only install shebang executables and libraries\n"
|
||||
+ " for all SOURCE files\n"
|
||||
+ " -H --hostonly Mark all SOURCE files as hostonly\n\n"
|
||||
+ " -f --fips Also install all '.SOURCE.hmac' files\n"
|
||||
+ "\n"
|
||||
+ " --module,-m Install kernel modules, instead of files\n"
|
||||
+ " --kerneldir Specify the kernel module directory\n"
|
||||
+ " --firmwaredirs Specify the firmware directory search path with : separation\n"
|
||||
+ " --silent Don't display error messages for kernel module install\n"
|
||||
+ " -o --optional If kernel module does not exist, do not fail\n"
|
||||
+ " -p --mod-filter-path Filter kernel modules by path regexp\n"
|
||||
+ " -P --mod-filter-nopath Exclude kernel modules by path regexp\n"
|
||||
+ " -s --mod-filter-symbol Filter kernel modules by symbol regexp\n"
|
||||
+ " -S --mod-filter-nosymbol Exclude kernel modules by symbol regexp\n"
|
||||
+ " -N --mod-filter-noname Exclude kernel modules by name regexp\n"
|
||||
+ "\n"
|
||||
+ " -v --verbose Show more output\n"
|
||||
+ " --debug Show debug output\n"
|
||||
+ " --version Show package version\n"
|
||||
+ " -h --help Show this help\n"
|
||||
+ "\n",
|
||||
+ program_invocation_short_name, program_invocation_short_name,
|
||||
program_invocation_short_name);
|
||||
exit(status);
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
From 6fcd5c8e3b539de4eeccddab2e5da6ee260fbf0b Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 14 Apr 2016 11:53:14 +0200
|
||||
Subject: [PATCH] NEWS: update for 045
|
||||
|
||||
---
|
||||
NEWS | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 84 insertions(+)
|
||||
|
||||
diff --git a/NEWS b/NEWS
|
||||
index ca68302..6d1cd0a 100644
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,3 +1,87 @@
|
||||
+dracut-045
|
||||
+==========
|
||||
+
|
||||
+dracut now requires libkmod for the dracut-install binary helper.
|
||||
+
|
||||
+dracut.sh:
|
||||
+- restorecon final image file
|
||||
+- fail hard, if we find modules and modules.dep is missing
|
||||
+
|
||||
+dracut-functions.sh:
|
||||
+- fix check_vol_slaves() volume group name stripping
|
||||
+
|
||||
+dracut-install:
|
||||
+- catch ldd message "cannot execute binary file"
|
||||
+- added kernel module handling with libkmod
|
||||
+ Added parameters:
|
||||
+ --module,-m
|
||||
+ --mod-filter-path, -p
|
||||
+ --mod-filter-nopath, -P
|
||||
+ --mod-filter-symbol, -s
|
||||
+ --mod-filter-nosymbol, -S
|
||||
+ --mod-filter-noname, -N
|
||||
+ --silent
|
||||
+ --kerneldir
|
||||
+ --firmwaredirs
|
||||
+
|
||||
+lsinitrd:
|
||||
+- new option "--unpack"
|
||||
+- new option "--unpackearly"
|
||||
+- and "--verbose"
|
||||
+
|
||||
+general initramfs fixes:
|
||||
+- don't remove 99-cmdline-ask on 'hostonly' cleanup
|
||||
+- call dracut-cmdline-ask.service, if /etc/cmdline.d/*.conf exists
|
||||
+- break at switch_root only for bare rd.break
|
||||
+
|
||||
+dmsquash-live:
|
||||
+- fixed livenet-generator execution flag
|
||||
+ and include only, if systemd is used
|
||||
+- fixed dmsquash-live-root.sh for cases where the fstype of the liveimage is squashfs
|
||||
+- fixed typo for rootfs.img
|
||||
+
|
||||
+dmraid:
|
||||
+- added "nowatch" option in udev rule, otherwise udev would reread partitions for raid members
|
||||
+
|
||||
+shutdown:
|
||||
+- handle readonly /run on shutdown
|
||||
+
|
||||
+kernel-modules:
|
||||
+- add all HID drivers, regardless of hostonly mode
|
||||
+ people swap keyboards sometimes and should be able to enter their disk password
|
||||
+- add usb-storage
|
||||
+ To save the rdsosreport.txt to a USB stick, the usb-storage module is needed.
|
||||
+
|
||||
+systemd:
|
||||
+- add /etc/machine-info
|
||||
+- fixed systemd-escape call for names beginning with "-"
|
||||
+
|
||||
+network:
|
||||
+- fix carrier detection
|
||||
+- correctly set mac address for ip=...:<mtu>:<mac>
|
||||
+- fixed vlan, bonding, bridging, team logic
|
||||
+ call ifup for the slaves and assemble afterwards
|
||||
+- add mtu to list of variables to store in override
|
||||
+- for rd.neednet=0 a bootdev is not needed anymore
|
||||
+- dhclient-script.sh: add classless-static-routes support
|
||||
+
|
||||
+nbd:
|
||||
+- add systemd generator
|
||||
+- use export names instead of port numbers, because port number based
|
||||
+ exports are deprecated and were removed.
|
||||
+
|
||||
+fcoe:
|
||||
+- no more /dev/shm state copying
|
||||
+
|
||||
+multipath:
|
||||
+- check all /dev/mapper devices if they are multipath devices, not only mpath*
|
||||
+
|
||||
+fips:
|
||||
+- fixed .hmac installation in FIPS mode
|
||||
+
|
||||
+plymouth:
|
||||
+- also trigger the acpi subsystem
|
||||
+
|
||||
dracut-044
|
||||
==========
|
||||
creation:
|
@ -1,32 +0,0 @@
|
||||
From b99e72427b517dea0d91d15fe43cf0a37420af36 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 14 Apr 2016 13:38:24 +0200
|
||||
Subject: [PATCH] Revert "fcoe: no need to copy lldpad state"
|
||||
|
||||
This reverts commit e93ff1cf9aac8f97131b3101a5da240ce5f45239.
|
||||
|
||||
seems like the file has to be copied back in the real root.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1246217
|
||||
---
|
||||
modules.d/95fcoe/cleanup-fcoe.sh | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/modules.d/95fcoe/cleanup-fcoe.sh b/modules.d/95fcoe/cleanup-fcoe.sh
|
||||
index 856e2d9..5ff4d05 100644
|
||||
--- a/modules.d/95fcoe/cleanup-fcoe.sh
|
||||
+++ b/modules.d/95fcoe/cleanup-fcoe.sh
|
||||
@@ -2,8 +2,9 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
-if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
- if [ -e /var/run/lldpad.pid ]; then
|
||||
- lldpad -k
|
||||
- fi
|
||||
+if [ -e /var/run/lldpad.pid ]; then
|
||||
+ lldpad -k
|
||||
+ mkdir -m 0755 -p /run/initramfs/state/dev/shm
|
||||
+ cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1
|
||||
+ echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab
|
||||
fi
|
@ -1,32 +0,0 @@
|
||||
From db7d61cff7f5a5be3a56cff39dc278f004b9c461 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Thu, 14 Apr 2016 14:56:37 +0200
|
||||
Subject: [PATCH] base/init.sh: don't mount /run with noexec, if the initramfs
|
||||
lives there
|
||||
|
||||
If the initramfs was built with prefix=/run/... /run can't be mounted
|
||||
with noexec, otherwise no binary can be run.
|
||||
|
||||
Guard against it by looking where /bin/sh is really located.
|
||||
---
|
||||
modules.d/99base/init.sh | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
|
||||
index bd7ef70..a563393 100755
|
||||
--- a/modules.d/99base/init.sh
|
||||
+++ b/modules.d/99base/init.sh
|
||||
@@ -64,7 +64,12 @@ fi
|
||||
|
||||
if ! ismounted /run; then
|
||||
mkdir -m 0755 /newrun
|
||||
- mount -t tmpfs -o mode=0755,noexec,nosuid,nodev,strictatime tmpfs /newrun >/dev/null
|
||||
+ if ! str_starts "$(readlink -f /bin/sh)" "/run/"; then
|
||||
+ mount -t tmpfs -o mode=0755,noexec,nosuid,nodev,strictatime tmpfs /newrun >/dev/null
|
||||
+ else
|
||||
+ # the initramfs binaries are located in /run, so don't mount it with noexec
|
||||
+ mount -t tmpfs -o mode=0755,nosuid,nodev,strictatime tmpfs /newrun >/dev/null
|
||||
+ fi
|
||||
cp -a /run/* /newrun >/dev/null 2>&1
|
||||
mount --move /newrun /run
|
||||
rm -fr -- /newrun
|
@ -1,24 +0,0 @@
|
||||
From 2db14045c143e7b0709bed78483a208d2df69ab3 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 15 Apr 2016 10:27:48 +0200
|
||||
Subject: [PATCH] kate config
|
||||
|
||||
---
|
||||
.kateproject | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/.kateproject b/.kateproject
|
||||
index 7a84755..0a0d5da 100644
|
||||
--- a/.kateproject
|
||||
+++ b/.kateproject
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
- "name": "Kate"
|
||||
+ "name": "Dracut"
|
||||
, "files": [ { "git": 1 } ]
|
||||
, "build": {
|
||||
- "directory": "build"
|
||||
+ "directory": "./"
|
||||
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
|
||||
, "clean": "make clean"
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
From f3f019d9471bfc93ce8979c6cdcc0de81d0941e2 Mon Sep 17 00:00:00 2001
|
||||
From: Guido Trentalancia <guido@trentalancia.net>
|
||||
Date: Fri, 15 Apr 2016 10:38:04 +0200
|
||||
Subject: [PATCH] 95resume: avoid possible symbolic link creation error on
|
||||
bootup
|
||||
|
||||
Avoid symbolic link creation error.
|
||||
---
|
||||
modules.d/95resume/parse-resume.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/95resume/parse-resume.sh b/modules.d/95resume/parse-resume.sh
|
||||
index 3b97e51..a3beb95 100755
|
||||
--- a/modules.d/95resume/parse-resume.sh
|
||||
+++ b/modules.d/95resume/parse-resume.sh
|
||||
@@ -67,7 +67,7 @@ if ! getarg noresume; then
|
||||
printf -- '%s\n' ' RUN+="/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume"'
|
||||
} >> /etc/udev/rules.d/99-resume.rules
|
||||
|
||||
- printf '[ -e "%s" ] && { ln -s "%s" /dev/resume 2> /dev/null; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
|
||||
+ printf '[ -e "%s" ] && { ln -fs "%s" /dev/resume 2> /dev/null; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
|
||||
"$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
|
||||
|
||||
{
|
@ -1,124 +0,0 @@
|
||||
From 74e2d1e69f5527ab31b01fc19f67143d1f091980 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 15 Apr 2016 11:27:20 +0200
|
||||
Subject: [PATCH] watchdog/module-setup.sh: rewrite
|
||||
|
||||
- use local variables with _
|
||||
- use associative array for the kernel modules
|
||||
- install emergency hook even in the systemd case
|
||||
- follow device path until /sys is reached
|
||||
- set kernel version for modprobe checking
|
||||
---
|
||||
modules.d/04watchdog/module-setup.sh | 92 ++++++++++++++++++++----------------
|
||||
1 file changed, 51 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
|
||||
index c9da148..04686f6 100755
|
||||
--- a/modules.d/04watchdog/module-setup.sh
|
||||
+++ b/modules.d/04watchdog/module-setup.sh
|
||||
@@ -14,54 +14,64 @@ depends() {
|
||||
install() {
|
||||
# Do not add watchdog hooks if systemd module is included
|
||||
# In that case, systemd will manage watchdog kick
|
||||
- if dracut_module_included "systemd"; then
|
||||
- return
|
||||
+ if ! dracut_module_included "systemd"; then
|
||||
+ inst_hook cmdline 00 "$moddir/watchdog.sh"
|
||||
+ inst_hook cmdline 50 "$moddir/watchdog.sh"
|
||||
+ inst_hook pre-trigger 00 "$moddir/watchdog.sh"
|
||||
+ inst_hook initqueue 00 "$moddir/watchdog.sh"
|
||||
+ inst_hook mount 00 "$moddir/watchdog.sh"
|
||||
+ inst_hook mount 50 "$moddir/watchdog.sh"
|
||||
+ inst_hook mount 99 "$moddir/watchdog.sh"
|
||||
+ inst_hook pre-pivot 00 "$moddir/watchdog.sh"
|
||||
+ inst_hook pre-pivot 99 "$moddir/watchdog.sh"
|
||||
+ inst_hook cleanup 00 "$moddir/watchdog.sh"
|
||||
+ inst_hook cleanup 99 "$moddir/watchdog.sh"
|
||||
fi
|
||||
- inst_hook cmdline 00 "$moddir/watchdog.sh"
|
||||
- inst_hook cmdline 50 "$moddir/watchdog.sh"
|
||||
- inst_hook pre-trigger 00 "$moddir/watchdog.sh"
|
||||
- inst_hook initqueue 00 "$moddir/watchdog.sh"
|
||||
- inst_hook mount 00 "$moddir/watchdog.sh"
|
||||
- inst_hook mount 50 "$moddir/watchdog.sh"
|
||||
- inst_hook mount 99 "$moddir/watchdog.sh"
|
||||
- inst_hook pre-pivot 00 "$moddir/watchdog.sh"
|
||||
- inst_hook pre-pivot 99 "$moddir/watchdog.sh"
|
||||
- inst_hook cleanup 00 "$moddir/watchdog.sh"
|
||||
- inst_hook cleanup 99 "$moddir/watchdog.sh"
|
||||
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
|
||||
inst_multiple -o wdctl
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
+ local -A _drivers
|
||||
+ local _alldrivers _active _wdtdrv _wdtppath _dir
|
||||
[[ -d /sys/class/watchdog/ ]] || return
|
||||
- wdtcmdline=""
|
||||
- for dir in /sys/class/watchdog/*; do
|
||||
- [[ -d "$dir" ]] || continue
|
||||
- [[ -f "$dir/state" ]] || continue
|
||||
- active=$(< "$dir/state")
|
||||
- ! [[ $hostonly ]] || [[ "$active" = "active" ]] || continue
|
||||
- # device/modalias will return driver of this device
|
||||
- wdtdrv=$(< "$dir/device/modalias")
|
||||
- # There can be more than one module represented by same
|
||||
- # modalias. Currently load all of them.
|
||||
- # TODO: Need to find a way to avoid any unwanted module
|
||||
- # represented by modalias
|
||||
- wdtdrv=$(modprobe -R $wdtdrv)
|
||||
- instmods $wdtdrv
|
||||
- wdtcmdline="$wdtcmdline$(echo $wdtdrv | tr " " ","),"
|
||||
- # however in some cases, we also need to check that if there is
|
||||
- # a specific driver for the parent bus/device. In such cases
|
||||
- # we also need to enable driver for parent bus/device.
|
||||
- wdtppath=$(readlink -f "$dir/device/..")
|
||||
- while [ -f "$wdtppath/modalias" ]
|
||||
- do
|
||||
- wdtpdrv=$(< "$wdtppath/modalias")
|
||||
- wdtpdrv=$(modprobe -R $wdtpdrv)
|
||||
- instmods $wdtpdrv
|
||||
- wdtcmdline="$wdtcmdline$(echo $wdtpdrv | tr " " ","),"
|
||||
- wdtppath=$(readlink -f "$wdtppath/..")
|
||||
- done
|
||||
+ for _dir in /sys/class/watchdog/*; do
|
||||
+ [[ -d "$_dir" ]] || continue
|
||||
+ [[ -f "$_dir/state" ]] || continue
|
||||
+ _active=$(< "$_dir/state")
|
||||
+ ! [[ $hostonly ]] || [[ "$_active" = "active" ]] || continue
|
||||
+ # device/modalias will return driver of this device
|
||||
+ _wdtdrv=$(< "$_dir/device/modalias")
|
||||
+ # There can be more than one module represented by same
|
||||
+ # modalias. Currently load all of them.
|
||||
+ # TODO: Need to find a way to avoid any unwanted module
|
||||
+ # represented by modalias
|
||||
+ _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
+ if [[ $_wdtdrv ]]; then
|
||||
+ instmods $_wdtdrv
|
||||
+ for i in $_wdtdrv; do
|
||||
+ _drivers[$i]=1
|
||||
+ done
|
||||
+ fi
|
||||
+ # however in some cases, we also need to check that if there is
|
||||
+ # a specific driver for the parent bus/device. In such cases
|
||||
+ # we also need to enable driver for parent bus/device.
|
||||
+ _wdtppath=$(readlink -f "$_dir/device/..")
|
||||
+ while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
|
||||
+ _wdtppath=$(readlink -f "$_wdtppath/..")
|
||||
+ [[ -f "$_wdtppath/modalias" ]] || continue
|
||||
+
|
||||
+ _wdtdrv=$(< "$_wdtppath/modalias")
|
||||
+ _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
+ if [[ $_wdtdrv ]]; then
|
||||
+ instmods $_wdtdrv
|
||||
+ for i in $_wdtdrv; do
|
||||
+ _drivers[$i]=1
|
||||
+ done
|
||||
+ fi
|
||||
+ done
|
||||
done
|
||||
# ensure that watchdog module is loaded as early as possible
|
||||
- [[ $wdtcmdline = "" ]] || echo "rd.driver.pre=$wdtcmdline" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
+ _alldrivers="${!_drivers[*]}"
|
||||
+ [[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
From 9d74747f926d038f2e149d70a9c8f955861ab354 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 15 Apr 2016 12:03:03 +0200
|
||||
Subject: [PATCH] drop to shell on die() if rd.shell=1 is set explicitly
|
||||
|
||||
---
|
||||
modules.d/99base/dracut-lib.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
|
||||
index 0a0b1b9..48fc83d 100755
|
||||
--- a/modules.d/99base/dracut-lib.sh
|
||||
+++ b/modules.d/99base/dracut-lib.sh
|
||||
@@ -457,7 +457,7 @@ die() {
|
||||
|
||||
> /run/initramfs/.die
|
||||
|
||||
- getargbool 0 "rd.debug=" && emergency_shell
|
||||
+ getargbool 0 "rd.shell=" && emergency_shell
|
||||
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl --no-block --force halt
|
@ -1,45 +0,0 @@
|
||||
From fa295f0bcde8c8d1205cf53ebe6e5dc46629200a Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 15 Apr 2016 15:25:27 +0200
|
||||
Subject: [PATCH] dracut_install: honor --silent flag
|
||||
|
||||
---
|
||||
dracut-init.sh | 8 +++++++-
|
||||
modules.d/50drm/module-setup.sh | 2 +-
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index 8d1d9fa..1056a31 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -219,10 +219,16 @@ dracut_install() {
|
||||
}
|
||||
|
||||
dracut_instmods() {
|
||||
+ local _silent=0;
|
||||
+ local i;
|
||||
[[ $no_kernel = yes ]] && return
|
||||
+ for i in "$@"; do
|
||||
+ [[ $i == "--silent" ]] && silent=1
|
||||
+ done
|
||||
+
|
||||
$DRACUT_INSTALL \
|
||||
${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@"
|
||||
- (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
+ (($? != 0)) && (($silent == 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
}
|
||||
|
||||
inst_library() {
|
||||
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
|
||||
index 661dde9..6106d8c 100755
|
||||
--- a/modules.d/50drm/module-setup.sh
|
||||
+++ b/modules.d/50drm/module-setup.sh
|
||||
@@ -34,7 +34,7 @@ installkernel() {
|
||||
if [[ $hostonly ]]; then
|
||||
for i in /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias; do
|
||||
[[ -e $i ]] || continue
|
||||
- if hostonly="" dracut_instmods -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i) 2>/dev/null; then
|
||||
+ if hostonly="" dracut_instmods --silent -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i); then
|
||||
if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
fi
|
@ -1,418 +0,0 @@
|
||||
From eab32bda801e539c276f1b18e7c2b691eeab3d14 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 15 Apr 2016 15:29:52 +0200
|
||||
Subject: [PATCH] dracut-install: make use of _cleanup_ macros and improve
|
||||
hostonly check
|
||||
|
||||
If a module is renamed or another module takes care of the old one,
|
||||
all of the alias strings have to be checked against the current set of
|
||||
loaded modules.
|
||||
|
||||
This is still incomplete, because to be absolutely correct, all the
|
||||
/sys/*...*/modalias files would have to be checked, if they match the
|
||||
modules alias strings.
|
||||
---
|
||||
install/dracut-install.c | 180 ++++++++++++++++++++++++++++++++++-------------
|
||||
1 file changed, 131 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/install/dracut-install.c b/install/dracut-install.c
|
||||
index bef08da..9a0d53f 100644
|
||||
--- a/install/dracut-install.c
|
||||
+++ b/install/dracut-install.c
|
||||
@@ -66,6 +66,7 @@ static char *logfile = NULL;
|
||||
FILE *logfile_f = NULL;
|
||||
static Hashmap *items = NULL;
|
||||
static Hashmap *items_failed = NULL;
|
||||
+static Hashmap *modules_loaded = NULL;
|
||||
static regex_t mod_filter_path;
|
||||
static regex_t mod_filter_nopath;
|
||||
static regex_t mod_filter_symbol;
|
||||
@@ -79,6 +80,39 @@ static bool arg_mod_filter_noname = false;
|
||||
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst);
|
||||
|
||||
+
|
||||
+
|
||||
+static inline void kmod_module_unref_listp(struct kmod_list **p) {
|
||||
+ if (*p)
|
||||
+ kmod_module_unref_list(*p);
|
||||
+}
|
||||
+#define _cleanup_kmod_module_unref_list_ _cleanup_(kmod_module_unref_listp)
|
||||
+
|
||||
+static inline void kmod_module_info_free_listp(struct kmod_list **p) {
|
||||
+ if (*p)
|
||||
+ kmod_module_info_free_list(*p);
|
||||
+}
|
||||
+#define _cleanup_kmod_module_info_free_list_ _cleanup_(kmod_module_info_free_listp)
|
||||
+
|
||||
+static inline void kmod_unrefp(struct kmod_ctx **p) {
|
||||
+ kmod_unref(*p);
|
||||
+}
|
||||
+#define _cleanup_kmod_unref_ _cleanup_(kmod_unrefp)
|
||||
+
|
||||
+static inline void kmod_module_dependency_symbols_free_listp(struct kmod_list **p) {
|
||||
+ if (*p)
|
||||
+ kmod_module_dependency_symbols_free_list(*p);
|
||||
+}
|
||||
+#define _cleanup_kmod_module_dependency_symbols_free_list_ _cleanup_(kmod_module_dependency_symbols_free_listp)
|
||||
+
|
||||
+static inline void fts_closep(FTS **p) {
|
||||
+ if (*p)
|
||||
+ fts_close(*p);
|
||||
+}
|
||||
+#define _cleanup_fts_close_ _cleanup_(fts_closep)
|
||||
+
|
||||
+
|
||||
+
|
||||
static size_t dir_len(char const *file)
|
||||
{
|
||||
size_t length;
|
||||
@@ -1058,7 +1092,8 @@ static int install_all(int argc, char **argv)
|
||||
|
||||
static int install_firmware(struct kmod_module *mod)
|
||||
{
|
||||
- struct kmod_list *l, *list = NULL;
|
||||
+ struct kmod_list *l;
|
||||
+ _cleanup_kmod_module_info_free_list_ struct kmod_list *list = NULL;
|
||||
int ret;
|
||||
|
||||
char **q;
|
||||
@@ -1072,7 +1107,6 @@ static int install_firmware(struct kmod_module *mod)
|
||||
kmod_list_foreach(l, list) {
|
||||
const char *key = kmod_module_info_get_key(l);
|
||||
const char *value = NULL;
|
||||
- char *fwpath = NULL;
|
||||
|
||||
if (!streq("firmware", key))
|
||||
continue;
|
||||
@@ -1081,6 +1115,7 @@ static int install_firmware(struct kmod_module *mod)
|
||||
log_debug("Firmware %s", value);
|
||||
ret = -1;
|
||||
STRV_FOREACH(q, firmwaredirs) {
|
||||
+ _cleanup_free_ char *fwpath = NULL;
|
||||
struct stat sb;
|
||||
int r;
|
||||
|
||||
@@ -1092,8 +1127,6 @@ static int install_firmware(struct kmod_module *mod)
|
||||
|
||||
if (stat(fwpath, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fwpath);
|
||||
- free(fwpath);
|
||||
- fwpath = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1111,7 +1144,8 @@ static int install_firmware(struct kmod_module *mod)
|
||||
|
||||
static bool check_module_symbols(struct kmod_module *mod)
|
||||
{
|
||||
- struct kmod_list *itr, *deplist = NULL;
|
||||
+ struct kmod_list *itr;
|
||||
+ _cleanup_kmod_module_dependency_symbols_free_list_ struct kmod_list *deplist = NULL;
|
||||
|
||||
if (!arg_mod_filter_symbol && !arg_mod_filter_nosymbol)
|
||||
return true;
|
||||
@@ -1128,7 +1162,6 @@ static bool check_module_symbols(struct kmod_module *mod)
|
||||
const char *symbol = kmod_module_symbol_get_symbol(itr);
|
||||
// log_debug("Checking symbol %s", symbol);
|
||||
if (regexec(&mod_filter_nosymbol, symbol, 0, NULL, 0) == 0) {
|
||||
- kmod_module_dependency_symbols_free_list(deplist);
|
||||
log_debug("Module %s: symbol %s matched exclusion filter", kmod_module_get_name(mod), symbol);
|
||||
return false;
|
||||
}
|
||||
@@ -1140,20 +1173,16 @@ static bool check_module_symbols(struct kmod_module *mod)
|
||||
const char *symbol = kmod_module_dependency_symbol_get_symbol(itr);
|
||||
// log_debug("Checking symbol %s", symbol);
|
||||
if (regexec(&mod_filter_symbol, symbol, 0, NULL, 0) == 0) {
|
||||
- kmod_module_dependency_symbols_free_list(deplist);
|
||||
log_debug("Module %s: symbol %s matched inclusion filter", kmod_module_get_name(mod), symbol);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
- kmod_module_dependency_symbols_free_list(deplist);
|
||||
return false;
|
||||
}
|
||||
|
||||
- kmod_module_dependency_symbols_free_list(deplist);
|
||||
return true;
|
||||
}
|
||||
|
||||
-
|
||||
static bool check_module_path(const char *path)
|
||||
{
|
||||
if (arg_mod_filter_nopath && (regexec(&mod_filter_nopath, path, 0, NULL, 0) == 0)) {
|
||||
@@ -1168,14 +1197,23 @@ static bool check_module_path(const char *path)
|
||||
return true;
|
||||
}
|
||||
|
||||
+static bool check_module_hostonly(struct kmod_module *mod)
|
||||
+{
|
||||
+ const char *name = kmod_module_get_name(mod);
|
||||
+
|
||||
+ if (check_hashmap(modules_loaded, name))
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static int install_module(struct kmod_module *mod)
|
||||
{
|
||||
int ret = 0;
|
||||
- int state;
|
||||
- struct kmod_list *itr, *modlist = NULL;
|
||||
+ struct kmod_list *itr;
|
||||
+ _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
const char *path = NULL;
|
||||
const char *name = NULL;
|
||||
- state = kmod_module_get_initstate(mod);
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
@@ -1183,7 +1221,7 @@ static int install_module(struct kmod_module *mod)
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if (arg_hostonly && (state != KMOD_MODULE_BUILTIN) && (state != KMOD_MODULE_LIVE)) {
|
||||
+ if (arg_hostonly && ! check_module_hostonly(mod)) {
|
||||
log_debug("dracut_install '%s' not hostonly", name);
|
||||
return 0;
|
||||
}
|
||||
@@ -1232,15 +1270,17 @@ static int install_module(struct kmod_module *mod)
|
||||
}
|
||||
kmod_module_unref(mod);
|
||||
}
|
||||
- kmod_module_unref_list(modlist);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int install_modules(int argc, char **argv)
|
||||
{
|
||||
- struct kmod_ctx *ctx = NULL;
|
||||
- struct kmod_list *itr, *modlist = NULL;
|
||||
+ _cleanup_kmod_unref_ struct kmod_ctx *ctx = NULL;
|
||||
+ struct kmod_list *loaded_list = NULL;
|
||||
+ struct kmod_list *itr, *l;
|
||||
+ int err;
|
||||
+
|
||||
struct kmod_module *mod = NULL, *mod_o = NULL;
|
||||
|
||||
const char *modname = NULL;
|
||||
@@ -1248,12 +1288,48 @@ static int install_modules(int argc, char **argv)
|
||||
|
||||
ctx = kmod_new(kerneldir, NULL);
|
||||
|
||||
+ err = kmod_module_new_from_loaded(ctx, &loaded_list);
|
||||
+ if (err < 0) {
|
||||
+ errno = err;
|
||||
+ log_error("Could not get list of loaded modules: %m");
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ kmod_list_foreach(itr, loaded_list) {
|
||||
+ _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
+
|
||||
+ struct kmod_module *mod = kmod_module_get_module(itr);
|
||||
+ char *name = strdup(kmod_module_get_name(mod));
|
||||
+ hashmap_put(modules_loaded, name, name);
|
||||
+ kmod_module_unref(mod);
|
||||
+
|
||||
+ /* also put the modules from the new kernel in the hashmap,
|
||||
+ * which resolve the name as an alias, in case a kernel module is
|
||||
+ * renamed.
|
||||
+ */
|
||||
+ err = kmod_module_new_from_lookup(ctx, name, &modlist);
|
||||
+ if (err < 0)
|
||||
+ continue;
|
||||
+ if (!modlist)
|
||||
+ continue;
|
||||
+ kmod_list_foreach(l, modlist) {
|
||||
+ mod = kmod_module_get_module(l);
|
||||
+ char *name = strdup(kmod_module_get_name(mod));
|
||||
+ hashmap_put(modules_loaded, name, name);
|
||||
+ kmod_module_unref(mod);
|
||||
+ }
|
||||
+ }
|
||||
+ kmod_module_unref_list(loaded_list);
|
||||
+
|
||||
for (i = 0; i < argc; i++) {
|
||||
int r = 0;
|
||||
int ret = -1;
|
||||
+
|
||||
log_debug("Handle module '%s'", argv[i]);
|
||||
|
||||
if (argv[i][0] == '/') {
|
||||
+ _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
+
|
||||
r = kmod_module_new_from_path(ctx, argv[i], &mod_o);
|
||||
if (r < 0) {
|
||||
log_debug("Failed to lookup modules path '%s': %m", argv[i]);
|
||||
@@ -1263,6 +1339,7 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
/* Check, if we have to load another module with that name instead */
|
||||
modname = kmod_module_get_name(mod_o);
|
||||
+
|
||||
if (!modname) {
|
||||
if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
@@ -1272,8 +1349,11 @@ static int install_modules(int argc, char **argv)
|
||||
log_info("Failed to get name for module '%s'", argv[i]);
|
||||
continue;
|
||||
}
|
||||
+
|
||||
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
||||
kmod_module_unref(mod_o);
|
||||
+ mod_o = NULL;
|
||||
+
|
||||
if (r < 0) {
|
||||
if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
@@ -1303,37 +1383,38 @@ static int install_modules(int argc, char **argv)
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
- kmod_module_unref_list(modlist);
|
||||
- modlist = 0;
|
||||
} else if (argv[i][0] == '=') {
|
||||
- char *path1, *path2, *path3;
|
||||
- FTS *fts;
|
||||
+ _cleanup_free_ char *path1 = NULL, *path2 = NULL, *path3 = NULL;
|
||||
+ _cleanup_fts_close_ FTS *fts = NULL;
|
||||
+
|
||||
log_debug("Handling =%s", &argv[i][1]);
|
||||
/* FIXME and add more paths*/
|
||||
- {
|
||||
- int r;
|
||||
- r = asprintf(&path2, "%s/kernel/%s", kerneldir, &argv[i][1]);
|
||||
- if (r < 0) {
|
||||
- log_error("Out of memory!");
|
||||
- exit(EXIT_FAILURE);
|
||||
- }
|
||||
+ r = asprintf(&path2, "%s/kernel/%s", kerneldir, &argv[i][1]);
|
||||
+ if (r < 0) {
|
||||
+ log_error("Out of memory!");
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
|
||||
- r = asprintf(&path1, "%s/extra/%s", kerneldir, &argv[i][1]);
|
||||
- if (r < 0) {
|
||||
- log_error("Out of memory!");
|
||||
- exit(EXIT_FAILURE);
|
||||
- }
|
||||
+ r = asprintf(&path1, "%s/extra/%s", kerneldir, &argv[i][1]);
|
||||
+ if (r < 0) {
|
||||
+ log_error("Out of memory!");
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
|
||||
- r = asprintf(&path3, "%s/updates/%s", kerneldir, &argv[i][1]);
|
||||
- if (r < 0) {
|
||||
- log_error("Out of memory!");
|
||||
- exit(EXIT_FAILURE);
|
||||
- }
|
||||
+ r = asprintf(&path3, "%s/updates/%s", kerneldir, &argv[i][1]);
|
||||
+ if (r < 0) {
|
||||
+ log_error("Out of memory!");
|
||||
+ exit(EXIT_FAILURE);
|
||||
+ }
|
||||
|
||||
+ {
|
||||
char *paths[] = { path1, path2, path3, NULL };
|
||||
fts = fts_open(paths, FTS_COMFOLLOW|FTS_NOCHDIR|FTS_NOSTAT|FTS_LOGICAL, NULL);
|
||||
}
|
||||
+
|
||||
for (FTSENT *ftsent = fts_read(fts); ftsent != NULL; ftsent = fts_read(fts)) {
|
||||
+ _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
+
|
||||
if((ftsent->fts_info == FTS_D) && !check_module_path(ftsent->fts_accpath)) {
|
||||
fts_set(fts, ftsent, FTS_SKIP);
|
||||
log_debug("Skipping %s", ftsent->fts_accpath);
|
||||
@@ -1356,6 +1437,7 @@ static int install_modules(int argc, char **argv)
|
||||
|
||||
/* Check, if we have to load another module with that name instead */
|
||||
modname = kmod_module_get_name(mod_o);
|
||||
+
|
||||
if (!modname) {
|
||||
log_error("Failed to get name for module '%s'", ftsent->fts_accpath);
|
||||
if (!arg_optional) {
|
||||
@@ -1365,18 +1447,19 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
||||
kmod_module_unref(mod_o);
|
||||
+ mod_o = NULL;
|
||||
+
|
||||
if (r < 0) {
|
||||
log_error("Failed to lookup alias '%s': %m", modname);
|
||||
- kmod_module_unref_list(modlist);
|
||||
if (!arg_optional) {
|
||||
return -ENOENT;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
+
|
||||
if (!modlist) {
|
||||
log_error("Failed to find module '%s' %s", modname,
|
||||
ftsent->fts_accpath);
|
||||
- kmod_module_unref_list(modlist);
|
||||
if (!arg_optional) {
|
||||
return -ENOENT;
|
||||
}
|
||||
@@ -1393,18 +1476,14 @@ static int install_modules(int argc, char **argv)
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
- kmod_module_unref_list(modlist);
|
||||
- modlist = 0;
|
||||
}
|
||||
if (errno) {
|
||||
log_error("FTS ERROR: %m");
|
||||
}
|
||||
- fts_close(fts);
|
||||
- free(path1); path1 = NULL;
|
||||
- free(path2); path2 = NULL;
|
||||
- free(path3); path3 = NULL;
|
||||
} else {
|
||||
+ _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
char *modname = argv[i];
|
||||
+
|
||||
if (endswith(modname, ".ko")) {
|
||||
int len = strlen(modname);
|
||||
modname[len-3]=0;
|
||||
@@ -1443,8 +1522,6 @@ static int install_modules(int argc, char **argv)
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
- kmod_module_unref_list(modlist);
|
||||
- modlist = 0;
|
||||
}
|
||||
|
||||
if ((ret != 0) && (!arg_optional)) {
|
||||
@@ -1513,8 +1590,9 @@ int main(int argc, char **argv)
|
||||
|
||||
items = hashmap_new(string_hash_func, string_compare_func);
|
||||
items_failed = hashmap_new(string_hash_func, string_compare_func);
|
||||
+ modules_loaded = hashmap_new(string_hash_func, string_compare_func);
|
||||
|
||||
- if (!items || !items_failed) {
|
||||
+ if (!items || !items_failed || !modules_loaded) {
|
||||
log_error("Out of memory");
|
||||
r = EXIT_FAILURE;
|
||||
goto finish;
|
||||
@@ -1570,6 +1648,9 @@ int main(int argc, char **argv)
|
||||
if (logfile_f)
|
||||
fclose(logfile_f);
|
||||
|
||||
+ while ((i = hashmap_steal_first(modules_loaded)))
|
||||
+ item_free(i);
|
||||
+
|
||||
while ((i = hashmap_steal_first(items)))
|
||||
item_free(i);
|
||||
|
||||
@@ -1578,6 +1659,7 @@ int main(int argc, char **argv)
|
||||
|
||||
hashmap_free(items);
|
||||
hashmap_free(items_failed);
|
||||
+ hashmap_free(modules_loaded);
|
||||
|
||||
free(destrootdir);
|
||||
strv_free(firmwaredirs);
|
@ -1,148 +0,0 @@
|
||||
From 3f60444ec1bff8a57a2cf4ada238e782928890eb Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 15 Apr 2016 16:25:59 +0200
|
||||
Subject: [PATCH] removed obsolete kernel module functions and host_modules
|
||||
variable
|
||||
|
||||
module_is_host_only()
|
||||
find_kernel_modules_by_path()
|
||||
find_kernel_modules()
|
||||
---
|
||||
dracut-init.sh | 54 -----------------------------------
|
||||
dracut.sh | 30 +------------------
|
||||
modules.d/90multipath/module-setup.sh | 2 +-
|
||||
3 files changed, 2 insertions(+), 84 deletions(-)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index 1056a31..a195c32 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -943,60 +943,6 @@ dracut_kernel_post() {
|
||||
|
||||
}
|
||||
|
||||
-[[ "$kernel_current" ]] || export kernel_current=$(uname -r)
|
||||
-
|
||||
-module_is_host_only() {
|
||||
- local _mod=$1
|
||||
- local _modenc a i _k _s _v _aliases
|
||||
- _mod=${_mod##*/}
|
||||
- _mod=${_mod%.ko*}
|
||||
- _modenc=${_mod//-/_}
|
||||
-
|
||||
- [[ " $add_drivers " == *\ ${_mod}\ * ]] && return 0
|
||||
-
|
||||
- # check if module is loaded
|
||||
- [[ ${host_modules["$_modenc"]} ]] && return 0
|
||||
-
|
||||
- [[ "$kernel_current" ]] || export kernel_current=$(uname -r)
|
||||
-
|
||||
- if [[ "$kernel_current" != "$kernel" ]]; then
|
||||
- # check if module is loadable on the current kernel
|
||||
- # 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
|
||||
-
|
||||
- # just install the module, better safe than sorry
|
||||
- return 0
|
||||
- fi
|
||||
-
|
||||
- return 1
|
||||
-}
|
||||
-
|
||||
-find_kernel_modules_by_path () {
|
||||
- local _OLDIFS
|
||||
-
|
||||
- [[ -f "$srcmods/modules.dep" ]] || return 0
|
||||
-
|
||||
- _OLDIFS=$IFS
|
||||
- IFS=:
|
||||
- while read a rest || [ -n "$a" ]; do
|
||||
- [[ $a = */$1/* ]] || [[ $a = updates/* ]] || continue
|
||||
- printf "%s\n" "$srcmods/$a"
|
||||
- done < "$srcmods/modules.dep"
|
||||
- IFS=$_OLDIFS
|
||||
- return 0
|
||||
-}
|
||||
-
|
||||
-find_kernel_modules () {
|
||||
- find_kernel_modules_by_path drivers
|
||||
-}
|
||||
-
|
||||
instmods() {
|
||||
# instmods [-c [-s]] <kernel module> [<kernel module> ... ]
|
||||
# instmods [-c [-s]] <kernel subsystem>
|
||||
diff --git a/dracut.sh b/dracut.sh
|
||||
index aaeb0dc..8232fa4 100755
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -1101,8 +1101,6 @@ if (( ${#add_device_l[@]} )); then
|
||||
push_host_devs "${add_device_l[@]}"
|
||||
fi
|
||||
|
||||
-declare -A host_modules
|
||||
-
|
||||
if [[ $hostonly ]]; then
|
||||
# in hostonly mode, determine all devices, which have to be accessed
|
||||
# and examine them for filesystem types
|
||||
@@ -1190,32 +1188,6 @@ if [[ $hostonly ]]; then
|
||||
fi
|
||||
done < /etc/fstab
|
||||
fi
|
||||
-
|
||||
- # check /proc/modules
|
||||
- while read m rest || [ -n "$m" ]; do
|
||||
- host_modules["$m"]=1
|
||||
- done </proc/modules
|
||||
-
|
||||
- # Explanation of the following section:
|
||||
- # Since kernel 4.4, mpt3sas is a complete replacement for mpt2sas.
|
||||
- # mpt3sas has an alias to mpt2sas now, but since mpt3sas isn't loaded
|
||||
- # when generating the initrd from kernel < 4.4, it's not included.
|
||||
- # The other direction has the same issue:
|
||||
- # When generating the initrd from kernel >= 4.4, mpt2sas isn't loaded,
|
||||
- # so it's not included.
|
||||
- # Both ways result in an unbootable initrd.
|
||||
-
|
||||
- # also add aliases of loaded modules
|
||||
- for mod in "${!host_modules[@]}"; do
|
||||
- aliases=$(modinfo -F alias "$mod" 2>&1)
|
||||
- for alias in $aliases; do
|
||||
- host_modules["$alias"]=1
|
||||
- done
|
||||
- # mod might be an alias in the target kernel, find the real module
|
||||
- mod_filename=$(modinfo -k "$kernel" "$mod" -F filename)
|
||||
- [ $? -ne 0 ] && continue
|
||||
- host_modules["$(basename -s .ko "$mod_filename")"]=1
|
||||
- done
|
||||
fi
|
||||
|
||||
unset m
|
||||
@@ -1302,7 +1274,7 @@ export initdir dracutbasedir \
|
||||
debug host_fs_types host_devs swap_devs sshkey add_fstab \
|
||||
DRACUT_VERSION udevdir prefix filesystems drivers \
|
||||
systemdutildir systemdsystemunitdir systemdsystemconfdir \
|
||||
- host_modules hostonly_cmdline loginstall \
|
||||
+ hostonly_cmdline loginstall \
|
||||
tmpfilesdir
|
||||
|
||||
mods_to_load=""
|
||||
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
|
||||
index 0af777d..1676798 100755
|
||||
--- a/modules.d/90multipath/module-setup.sh
|
||||
+++ b/modules.d/90multipath/module-setup.sh
|
||||
@@ -41,7 +41,7 @@ depends() {
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac ; do
|
||||
- if module_is_host_only $m ; then
|
||||
+ if grep -m 1 -q "$m" /proc/modules ; then
|
||||
printf 'rd.driver.pre=%s ' "$m"
|
||||
fi
|
||||
done
|
@ -1,21 +0,0 @@
|
||||
From fe83231e30d5bc94e090d02e65f0e3cbef20c6ac Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 18 Apr 2016 15:49:06 +0200
|
||||
Subject: [PATCH] watchdog: clean return of installkernel()
|
||||
|
||||
return 0, otherwise if _alldrivers is empty, the return code is fail
|
||||
---
|
||||
modules.d/04watchdog/module-setup.sh | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
|
||||
index 04686f6..7b2685d 100755
|
||||
--- a/modules.d/04watchdog/module-setup.sh
|
||||
+++ b/modules.d/04watchdog/module-setup.sh
|
||||
@@ -74,4 +74,6 @@ installkernel() {
|
||||
# ensure that watchdog module is loaded as early as possible
|
||||
_alldrivers="${!_drivers[*]}"
|
||||
[[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
+
|
||||
+ return 0
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
From bf75218e45180b957192f08c3fa5d5b147b66c31 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 18 Apr 2016 15:50:42 +0200
|
||||
Subject: [PATCH] watchdog: start traversing the device tree from the right
|
||||
directory
|
||||
|
||||
start with the device subtree, not with the parent of it
|
||||
---
|
||||
modules.d/04watchdog/module-setup.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
|
||||
index 7b2685d..7566d65 100755
|
||||
--- a/modules.d/04watchdog/module-setup.sh
|
||||
+++ b/modules.d/04watchdog/module-setup.sh
|
||||
@@ -56,7 +56,7 @@ installkernel() {
|
||||
# however in some cases, we also need to check that if there is
|
||||
# a specific driver for the parent bus/device. In such cases
|
||||
# we also need to enable driver for parent bus/device.
|
||||
- _wdtppath=$(readlink -f "$_dir/device/..")
|
||||
+ _wdtppath=$(readlink -f "$_dir/device")
|
||||
while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
|
||||
_wdtppath=$(readlink -f "$_wdtppath/..")
|
||||
[[ -f "$_wdtppath/modalias" ]] || continue
|
@ -1,32 +0,0 @@
|
||||
From 5f91ed0b5345e132d9fe1fa815bfd968778df5ea Mon Sep 17 00:00:00 2001
|
||||
From: Guido Trentalancia <guido@trentalancia.net>
|
||||
Date: Fri, 15 Apr 2016 13:06:45 +0200
|
||||
Subject: [PATCH] dracut: 10i18n: support default loadkeys/setfont data paths
|
||||
using symbolic links
|
||||
|
||||
Avoid keymap/font not found error when loadkeys/setfont
|
||||
are compiled with the default data directory path.
|
||||
|
||||
Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
|
||||
---
|
||||
modules.d/10i18n/module-setup.sh | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
|
||||
index 9439875..9618aa7 100755
|
||||
--- a/modules.d/10i18n/module-setup.sh
|
||||
+++ b/modules.d/10i18n/module-setup.sh
|
||||
@@ -100,6 +100,13 @@ install() {
|
||||
inst_rules ${moddir}/10-console.rules
|
||||
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
|
||||
fi
|
||||
+
|
||||
+ if [[ ${kbddir} != "/usr/share" ]]; then
|
||||
+ inst_dir /usr/share
|
||||
+ for _src in $(eval echo {${KBDSUBDIRS}}); do
|
||||
+ [ ! -e "${initdir}/usr/share/${_src}" ] && ln -s "${kbddir}/${_src}" "${initdir}/usr/share/${_src}"
|
||||
+ done
|
||||
+ fi
|
||||
}
|
||||
|
||||
install_all_kbd() {
|
@ -1,86 +0,0 @@
|
||||
From cf376023e6d0d4abd9816fa954bb917fc2557713 Mon Sep 17 00:00:00 2001
|
||||
From: Xunlei Pang <xlpang@redhat.com>
|
||||
Date: Tue, 26 Apr 2016 18:05:10 +0800
|
||||
Subject: [PATCH] network: dhcp before parsing specified dns through cmdline
|
||||
|
||||
I met a problem when passing kdump dns to dracut via "nameserver=x.x.x.x",
|
||||
the dns I provided didn't appear in the "/etc/resolv.conf".
|
||||
|
||||
After some debugging, found that when setup dhcp DNS, in setup_interface()
|
||||
and setup_interface6(), it has:
|
||||
echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
|
||||
So if "$search $domain" isn't NULL(this is ture in my kdump environment),
|
||||
the dns contents(that is, dns1, dns2, nameserver) in "ifup" before dhcp
|
||||
will be discarded.
|
||||
|
||||
This patch addresses it by handling dhcp first. In fact this is also the
|
||||
way the NetworkManager in 1st kernel works.
|
||||
|
||||
Signed-off-by: Xunlei Pang <xlpang@redhat.com>
|
||||
---
|
||||
modules.d/40network/ifup.sh | 32 ++++++++++++++++----------------
|
||||
1 file changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
|
||||
index 1185523..41282e7 100755
|
||||
--- a/modules.d/40network/ifup.sh
|
||||
+++ b/modules.d/40network/ifup.sh
|
||||
@@ -321,16 +321,16 @@ fi
|
||||
ip=$(getarg ip)
|
||||
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then
|
||||
- for s in $(getargs nameserver); do
|
||||
- [ -n "$s" ] || continue
|
||||
- echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
- done
|
||||
-
|
||||
if [ "$netroot" = "dhcp6" ]; then
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
+
|
||||
+ for s in $(getargs nameserver); do
|
||||
+ [ -n "$s" ] || continue
|
||||
+ echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
+ done
|
||||
fi
|
||||
|
||||
|
||||
@@ -355,17 +355,6 @@ for p in $(getargs ip=); do
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
|
||||
- # setup nameserver
|
||||
- for s in "$dns1" "$dns2" $(getargs nameserver); do
|
||||
- [ -n "$s" ] || continue
|
||||
- echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
- done
|
||||
-
|
||||
- # Store config for later use
|
||||
- for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
|
||||
- eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
- done > /tmp/net.$netif.override
|
||||
-
|
||||
for autoopt in $(str_replace "$autoconf" "," " "); do
|
||||
case $autoopt in
|
||||
dhcp|on|any)
|
||||
@@ -381,6 +370,17 @@ for p in $(getargs ip=); do
|
||||
done
|
||||
ret=$?
|
||||
|
||||
+ # setup nameserver
|
||||
+ for s in "$dns1" "$dns2" $(getargs nameserver); do
|
||||
+ [ -n "$s" ] || continue
|
||||
+ echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
+ done
|
||||
+
|
||||
+ # Store config for later use
|
||||
+ for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
|
||||
+ eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
+ done > /tmp/net.$netif.override
|
||||
+
|
||||
if [ $ret -eq 0 ]; then
|
||||
> /tmp/net.${netif}.up
|
||||
|
@ -1,46 +0,0 @@
|
||||
From 4fa5c235a76c085f5958002826436ed9c40e5034 Mon Sep 17 00:00:00 2001
|
||||
From: Xunlei Pang <xlpang@redhat.com>
|
||||
Date: Tue, 26 Apr 2016 18:05:11 +0800
|
||||
Subject: [PATCH] network/net-lib.sh: delete duplicated DNS items from
|
||||
"/etc/resolv.conf"
|
||||
|
||||
Users can pass the DNS information throught "nameserver=" cmdline,
|
||||
there maybe duplicated inputs.
|
||||
|
||||
"/etc/resolv.conf" have some restrictions on the number of DNS items
|
||||
effective, so make sure that this file contains no duplicated items.
|
||||
|
||||
We achieve this by simply making the file have no duplicated lines.
|
||||
|
||||
Signed-off-by: Xunlei Pang <xlpang@redhat.com>
|
||||
---
|
||||
modules.d/40network/module-setup.sh | 2 +-
|
||||
modules.d/40network/net-lib.sh | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
|
||||
index 4bf93cc..53b4b60 100755
|
||||
--- a/modules.d/40network/module-setup.sh
|
||||
+++ b/modules.d/40network/module-setup.sh
|
||||
@@ -23,7 +23,7 @@ installkernel() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
- inst_multiple ip arping dhclient sed
|
||||
+ inst_multiple ip arping dhclient sed awk
|
||||
inst_multiple -o ping ping6
|
||||
inst_multiple -o brctl
|
||||
inst_multiple -o teamd teamdctl teamnl
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index 31f1a56..005ad1b 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -120,7 +120,7 @@ setup_net() {
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
# set up resolv.conf
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||
- cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||
+ awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# add static route
|
@ -1,21 +0,0 @@
|
||||
From bb44294b62b9469aebaeac8533569ac24b208a45 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen@delfi.ee>
|
||||
Date: Wed, 27 Apr 2016 13:08:42 +0300
|
||||
Subject: [PATCH] ensure parent dir for /usr/lib/initrd-release exists
|
||||
|
||||
---
|
||||
modules.d/99base/module-setup.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
|
||||
index 5fbf6f7..b03772e 100755
|
||||
--- a/modules.d/99base/module-setup.sh
|
||||
+++ b/modules.d/99base/module-setup.sh
|
||||
@@ -77,6 +77,7 @@ install() {
|
||||
VERSION_ID=$DRACUT_VERSION
|
||||
ANSI_COLOR="0;34"
|
||||
|
||||
+ [ -e "${initdir}/usr/lib" ] || mkdir -m 0755 -p ${initdir}/usr/lib
|
||||
{
|
||||
echo NAME=\"$NAME\"
|
||||
echo VERSION=\"$VERSION\"
|
@ -1,22 +0,0 @@
|
||||
From ae753baec0ae5b3c3eeabbe4f70c54cc3c24c292 Mon Sep 17 00:00:00 2001
|
||||
From: Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Date: Fri, 29 Apr 2016 15:34:47 +0200
|
||||
Subject: [PATCH] Fix small typo in dracut.cmdline(7)
|
||||
|
||||
---
|
||||
dracut.cmdline.7.asc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
|
||||
index c4c5588..bf00719 100644
|
||||
--- a/dracut.cmdline.7.asc
|
||||
+++ b/dracut.cmdline.7.asc
|
||||
@@ -32,7 +32,7 @@ line is the value, which is honored.
|
||||
Standard
|
||||
~~~~~~~~
|
||||
**init=**__<path to real init>__::
|
||||
- specify the path to the init programm to be started after the initramfs has
|
||||
+ specify the path to the init program to be started after the initramfs has
|
||||
finished
|
||||
|
||||
**root=**__<path to blockdevice>__::
|
@ -1,30 +0,0 @@
|
||||
From 5dea430e087ec7749080547a6a6fe5b152f665ef Mon Sep 17 00:00:00 2001
|
||||
From: Michael Chapman <mike@very.puzzling.org>
|
||||
Date: Wed, 4 May 2016 10:49:56 +1000
|
||||
Subject: [PATCH] systemd: ensure journal is volatile
|
||||
|
||||
If journald.conf already contains Storage=persistent, journald will
|
||||
write to /var/log/journal/, which ends up at /run/initramfs/log/journal/
|
||||
after switching root. We want to make sure early boot logs are written
|
||||
to /run/log/journal/ so they can be flushed to /var/log/journal/ after
|
||||
switching root.
|
||||
---
|
||||
modules.d/00systemd/module-setup.sh | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
|
||||
index deb5e06..951a5be 100755
|
||||
--- a/modules.d/00systemd/module-setup.sh
|
||||
+++ b/modules.d/00systemd/module-setup.sh
|
||||
@@ -210,9 +210,10 @@ install() {
|
||||
done
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
- # turn off RateLimit for journal
|
||||
+ # We must use a volatile journal, and we don't want rate-limiting
|
||||
{
|
||||
echo "[Journal]"
|
||||
+ echo "Storage=volatile"
|
||||
echo "RateLimitInterval=0"
|
||||
echo "RateLimitBurst=0"
|
||||
} >> "$initdir/etc/systemd/journald.conf"
|
@ -1,43 +0,0 @@
|
||||
From 699414f5a518f039fa74fd314d21994849a90625 Mon Sep 17 00:00:00 2001
|
||||
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
Date: Wed, 4 May 2016 10:18:54 +0200
|
||||
Subject: [PATCH] configure: don't hardcode pkg-config
|
||||
|
||||
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
---
|
||||
configure | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index c92cb99..2368680 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -7,6 +7,8 @@ prefix=/usr
|
||||
|
||||
enable_documentation=yes
|
||||
|
||||
+PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
|
||||
+
|
||||
# Little helper function for reading args from the commandline.
|
||||
# it automatically handles -a b and -a=b variants, and returns 1 if
|
||||
# we need to shift $3.
|
||||
@@ -50,7 +52,7 @@ while (($# > 0)); do
|
||||
shift
|
||||
done
|
||||
|
||||
-if ! pkg-config --exists --print-errors " libkmod >= 15 "; then
|
||||
+if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 15 "; then
|
||||
echo "dracut needs pkg-config and libkmod >= 15." >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -64,8 +66,8 @@ sbindir ?= ${sbindir:-${prefix}/sbin}
|
||||
mandir ?= ${mandir:-${prefix}/share/man}
|
||||
enable_documentation ?= ${enable_documentation:-yes}
|
||||
bindir ?= ${bindir:-${prefix}/bin}
|
||||
-KMOD_CFLAGS ?= $(pkg-config --cflags " libkmod >= 15 ")
|
||||
-KMOD_LIBS ?= $(pkg-config --libs " libkmod >= 15 ")
|
||||
+KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 15 ")
|
||||
+KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 15 ")
|
||||
EOF
|
||||
|
||||
{
|
@ -1,54 +0,0 @@
|
||||
From 016613c774baf3d30c6425a65ead05d8b55d6279 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kurtz <alexander@kurtz.be>
|
||||
Date: Fri, 6 May 2016 17:25:37 +0200
|
||||
Subject: [PATCH] dracut-systemd/dracut-cmdline.sh: Don't error out if there is
|
||||
no root= argument.
|
||||
|
||||
Thanks to systemd's gpt-auto-generator [0] (which implements the Discoverable
|
||||
Partitions Specification [1]), it is no longer necessary to always specify the
|
||||
root= argument.
|
||||
|
||||
However, dracut would still refuse to boot if there was no root= argument (or
|
||||
if it was set to the special value "gpt-auto" [2]). This commit stops dracut
|
||||
from aborting the boot process in these cases and simply lets systemd do its
|
||||
magic.
|
||||
|
||||
[0] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator
|
||||
[1] https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
|
||||
[2] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator/gpt-auto-generator.c#L928
|
||||
---
|
||||
modules.d/98dracut-systemd/dracut-cmdline.sh | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh
|
||||
index a1dcf84..ccf24fb 100755
|
||||
--- a/modules.d/98dracut-systemd/dracut-cmdline.sh
|
||||
+++ b/modules.d/98dracut-systemd/dracut-cmdline.sh
|
||||
@@ -21,7 +21,12 @@ getargbool 0 rd.udev.log-priority=debug -d rd.udev.debug -d -n -y rdudevdebug &&
|
||||
|
||||
source_conf /etc/conf.d
|
||||
|
||||
-root=$(getarg root=)
|
||||
+# Get the "root=" parameter from the kernel command line, but differentiate
|
||||
+# between the case where it was set to the empty string and the case where it
|
||||
+# wasn't specified at all.
|
||||
+if ! root="$(getarg root=)"; then
|
||||
+ root='UNSET'
|
||||
+fi
|
||||
|
||||
rflags="$(getarg rootflags=)"
|
||||
getargbool 0 ro && rflags="${rflags},ro"
|
||||
@@ -65,9 +70,12 @@ case "$root" in
|
||||
/dev/*)
|
||||
root="block:${root}"
|
||||
rootok=1 ;;
|
||||
+ UNSET|gpt-auto)
|
||||
+ # systemd's gpt-auto-generator handles this case.
|
||||
+ rootok=1 ;;
|
||||
esac
|
||||
|
||||
-[ -z "$root" ] && die "No or empty root= argument"
|
||||
+[ -z "$root" ] && die "Empty root= argument"
|
||||
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
|
||||
|
||||
export root rflags fstype netroot NEWROOT
|
@ -1,54 +0,0 @@
|
||||
From 190150018798f88107fba119e92bd32e2a8d4b0b Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 2 May 2016 12:48:12 +0200
|
||||
Subject: [PATCH] move ln_r() to dracut-init.sh
|
||||
|
||||
---
|
||||
dracut-functions.sh | 12 ------------
|
||||
dracut-init.sh | 13 +++++++++++++
|
||||
2 files changed, 13 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
||||
index c7ea9f5..4496bfe 100755
|
||||
--- a/dracut-functions.sh
|
||||
+++ b/dracut-functions.sh
|
||||
@@ -167,18 +167,6 @@ convert_abs_rel() {
|
||||
printf "%s\n" "$__newpath"
|
||||
}
|
||||
|
||||
-if [[ "$(ln --help)" == *--relative* ]]; then
|
||||
- ln_r() {
|
||||
- ln -sfnr "${initdir}/$1" "${initdir}/$2"
|
||||
- }
|
||||
-else
|
||||
- ln_r() {
|
||||
- local _source=$1
|
||||
- local _dest=$2
|
||||
- [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
|
||||
- ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}"
|
||||
- }
|
||||
-fi
|
||||
|
||||
# get_fs_env <device>
|
||||
# Get and the ID_FS_TYPE variable from udev for a device.
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index a195c32..d2bb845 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -997,3 +997,16 @@ instmods() {
|
||||
[[ "$optional" ]] && return 0
|
||||
return $_ret
|
||||
}
|
||||
+
|
||||
+if [[ "$(ln --help)" == *--relative* ]]; then
|
||||
+ ln_r() {
|
||||
+ ln -sfnr "${initdir}/$1" "${initdir}/$2"
|
||||
+ }
|
||||
+else
|
||||
+ ln_r() {
|
||||
+ local _source=$1
|
||||
+ local _dest=$2
|
||||
+ [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
|
||||
+ ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}"
|
||||
+ }
|
||||
+fi
|
@ -1,21 +0,0 @@
|
||||
From d4efc0aeeecc470d9a267b7f3c130f472488905c Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 25 May 2016 15:06:29 +0200
|
||||
Subject: [PATCH] systemd-initrd: add initrd-root-device.target
|
||||
|
||||
---
|
||||
modules.d/01systemd-initrd/module-setup.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh
|
||||
index fb6a9ea..c1ccd2a 100755
|
||||
--- a/modules.d/01systemd-initrd/module-setup.sh
|
||||
+++ b/modules.d/01systemd-initrd/module-setup.sh
|
||||
@@ -28,6 +28,7 @@ install() {
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/initrd.target \
|
||||
$systemdsystemunitdir/initrd-fs.target \
|
||||
+ $systemdsystemunitdir/initrd-root-device.target \
|
||||
$systemdsystemunitdir/initrd-root-fs.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.service \
|
@ -1,26 +0,0 @@
|
||||
From 55b99a0e4c37b3b7ee58e1369ab00430795acdc6 Mon Sep 17 00:00:00 2001
|
||||
From: Colin Guthrie <colin@mageia.org>
|
||||
Date: Tue, 7 Jun 2016 09:16:05 +0100
|
||||
Subject: [PATCH] dracut.sh: fix $tmpfilesdir fallback when systemd-devel is
|
||||
not installed.
|
||||
|
||||
Bug introduced in 3a04bddeed in Dec 2014.
|
||||
---
|
||||
dracut.sh | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dracut.sh b/dracut.sh
|
||||
index 8232fa4..a50eaff 100755
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -1260,8 +1260,8 @@ fi
|
||||
|| tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null)
|
||||
|
||||
if ! [[ -d "$tmpfilesdir" ]]; then
|
||||
- [[ -f /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d
|
||||
- [[ -f /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
|
||||
+ [[ -d /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d
|
||||
+ [[ -d /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
|
||||
fi
|
||||
|
||||
export initdir dracutbasedir \
|
@ -1,30 +0,0 @@
|
||||
From 2602a74edf543f98f2aa1eb79db3de3a1cda13f0 Mon Sep 17 00:00:00 2001
|
||||
From: Nicolas Chauvet <kwizart@gmail.com>
|
||||
Date: Thu, 12 May 2016 17:28:21 +0200
|
||||
Subject: [PATCH] dracut: Add drivers/clk by default on arm
|
||||
|
||||
This will bundle clock drivers into the initramfs on arm
|
||||
|
||||
Tested on ti dm8148-t410 where adpll is needed on 4.6+ kernel
|
||||
This will avoid to rely on (maybe broken) bootloader clocks.
|
||||
|
||||
Theses modules are also usually loaded early. Having them bundled into
|
||||
the initramfs will avoid lot of deferred probes and others delay.
|
||||
|
||||
Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
|
||||
---
|
||||
modules.d/90kernel-modules/module-setup.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
|
||||
index c30715d..7904c02 100755
|
||||
--- a/modules.d/90kernel-modules/module-setup.sh
|
||||
+++ b/modules.d/90kernel-modules/module-setup.sh
|
||||
@@ -26,6 +26,7 @@ installkernel() {
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
instmods \
|
||||
+ "=drivers/clk" \
|
||||
"=drivers/i2c/busses" \
|
||||
"=drivers/regulator" \
|
||||
"=drivers/rtc" \
|
@ -1,59 +0,0 @@
|
||||
From 71867b665cea6b4d9814ea0386baf0500db06806 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 7 Jun 2016 11:11:58 +0200
|
||||
Subject: [PATCH] network: remove awk call and replace it with a shell function
|
||||
|
||||
changes commit 4fa5c235a76c085f5958002826436ed9c40e5034
|
||||
---
|
||||
dracut-functions.sh | 10 ++++++++++
|
||||
modules.d/40network/module-setup.sh | 2 +-
|
||||
modules.d/40network/net-lib.sh | 2 +-
|
||||
3 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
||||
index 4496bfe..146dbea 100755
|
||||
--- a/dracut-functions.sh
|
||||
+++ b/dracut-functions.sh
|
||||
@@ -37,6 +37,16 @@ str_starts() { [ "${1#"$2"*}" != "$1" ]; }
|
||||
# returns OK if $1 contains literal string $2 at the end, and isn't empty
|
||||
str_ends() { [ "${1%*"$2"}" != "$1" ]; }
|
||||
|
||||
+uniq_lines() {
|
||||
+ local -A lines
|
||||
+ while read -r line; do
|
||||
+ if ! [[ ${lines[$line]} ]]; then
|
||||
+ echo "$line"
|
||||
+ lines[$line]=1
|
||||
+ fi
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
# find a binary. If we were not passed the full path directly,
|
||||
# search in the usual places to find the binary.
|
||||
find_binary() {
|
||||
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
|
||||
index 53b4b60..4bf93cc 100755
|
||||
--- a/modules.d/40network/module-setup.sh
|
||||
+++ b/modules.d/40network/module-setup.sh
|
||||
@@ -23,7 +23,7 @@ installkernel() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
- inst_multiple ip arping dhclient sed awk
|
||||
+ inst_multiple ip arping dhclient sed
|
||||
inst_multiple -o ping ping6
|
||||
inst_multiple -o brctl
|
||||
inst_multiple -o teamd teamdctl teamnl
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index 005ad1b..4fd274e 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -120,7 +120,7 @@ setup_net() {
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
# set up resolv.conf
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||
- awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf
|
||||
+ uniq_lines < /tmp/net.$netif.resolv.conf > /etc/resolv.conf
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# add static route
|
@ -1,22 +0,0 @@
|
||||
From 8e010957557621c1a71d7289c4210d3ad5932893 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Wed, 25 May 2016 17:05:03 +0200
|
||||
Subject: [PATCH] dracut-init.sh: set default firmware path, if not specified
|
||||
|
||||
---
|
||||
dracut-init.sh | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/dracut-init.sh b/dracut-init.sh
|
||||
index d2bb845..7f628ce 100644
|
||||
--- a/dracut-init.sh
|
||||
+++ b/dracut-init.sh
|
||||
@@ -69,6 +69,8 @@ srcmods="/lib/modules/$kernel/"
|
||||
}
|
||||
export srcmods
|
||||
|
||||
+[[ $DRACUT_FIRMWARE_PATH ]] || export DRACUT_FIRMWARE_PATH="/lib/firmware/updates:/lib/firmware:/lib/firmware/$kernel"
|
||||
+
|
||||
# export standard hookdirs
|
||||
[[ $hookdirs ]] || {
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot "
|
@ -1,269 +0,0 @@
|
||||
From 4e882b8090e82b0f0ffabfb45f0a2cd69768ef53 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri, 27 May 2016 10:52:28 +0200
|
||||
Subject: [PATCH] use shutdown-emergency hook in testsuite to poweroff the
|
||||
machine
|
||||
|
||||
---
|
||||
modules.d/99base/dracut-lib.sh | 6 +++++-
|
||||
test/TEST-01-BASIC/test.sh | 2 +-
|
||||
test/TEST-02-SYSTEMD/test.sh | 2 +-
|
||||
test/TEST-03-USR-MOUNT/test.sh | 2 +-
|
||||
test/TEST-04-FULL-SYSTEMD/test.sh | 2 +-
|
||||
test/TEST-10-RAID/test.sh | 2 +-
|
||||
test/TEST-11-LVM/test.sh | 2 +-
|
||||
test/TEST-12-RAID-DEG/test.sh | 2 +-
|
||||
test/TEST-13-ENC-RAID-LVM/test.sh | 2 +-
|
||||
test/TEST-14-IMSM/test.sh | 2 +-
|
||||
test/TEST-15-BTRFSRAID/test.sh | 2 +-
|
||||
test/TEST-16-DMSQUASH/test.sh | 2 +-
|
||||
test/TEST-17-LVM-THIN/test.sh | 2 +-
|
||||
test/TEST-20-NFS/test.sh | 4 ++--
|
||||
test/TEST-30-ISCSI/test.sh | 2 +-
|
||||
test/TEST-40-NBD/test.sh | 4 ++--
|
||||
test/TEST-50-MULTINIC/test.sh | 2 +-
|
||||
17 files changed, 23 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
|
||||
index 48fc83d..94e4614 100755
|
||||
--- a/modules.d/99base/dracut-lib.sh
|
||||
+++ b/modules.d/99base/dracut-lib.sh
|
||||
@@ -457,7 +457,11 @@ die() {
|
||||
|
||||
> /run/initramfs/.die
|
||||
|
||||
- getargbool 0 "rd.shell=" && emergency_shell
|
||||
+ if getargbool 0 "rd.shell"; then
|
||||
+ emergency_shell
|
||||
+ else
|
||||
+ source_hook "shutdown-emergency"
|
||||
+ fi
|
||||
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl --no-block --force halt
|
||||
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
|
||||
index 83320e2..959ac05 100755
|
||||
--- a/test/TEST-01-BASIC/test.sh
|
||||
+++ b/test/TEST-01-BASIC/test.sh
|
||||
@@ -89,7 +89,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh
|
||||
index 16f5c26..6dc6f42 100755
|
||||
--- a/test/TEST-02-SYSTEMD/test.sh
|
||||
+++ b/test/TEST-02-SYSTEMD/test.sh
|
||||
@@ -86,7 +86,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh
|
||||
index 61063fd..0aca8cf 100755
|
||||
--- a/test/TEST-03-USR-MOUNT/test.sh
|
||||
+++ b/test/TEST-03-USR-MOUNT/test.sh
|
||||
@@ -124,7 +124,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
index c7e08bf..884f441 100755
|
||||
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
|
||||
@@ -261,7 +261,7 @@ EOF
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
|
||||
index 523b61a..6ec77a6 100755
|
||||
--- a/test/TEST-10-RAID/test.sh
|
||||
+++ b/test/TEST-10-RAID/test.sh
|
||||
@@ -86,7 +86,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst ./cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
mkdir -p $initdir/etc
|
||||
echo "testluks UUID=$ID_FS_UUID /etc/key" > $initdir/etc/crypttab
|
||||
diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh
|
||||
index 34c7736..412a065 100755
|
||||
--- a/test/TEST-11-LVM/test.sh
|
||||
+++ b/test/TEST-11-LVM/test.sh
|
||||
@@ -79,7 +79,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh
|
||||
index f4ec2d0..444dca6 100755
|
||||
--- a/test/TEST-12-RAID-DEG/test.sh
|
||||
+++ b/test/TEST-12-RAID-DEG/test.sh
|
||||
@@ -129,7 +129,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
inst ./cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
mkdir -p $initdir/etc
|
||||
diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh
|
||||
index ea81697..2a814f8 100755
|
||||
--- a/test/TEST-13-ENC-RAID-LVM/test.sh
|
||||
+++ b/test/TEST-13-ENC-RAID-LVM/test.sh
|
||||
@@ -123,7 +123,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
inst ./cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
mkdir -p $initdir/etc
|
||||
diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh
|
||||
index f4ea7ae..315bc5a 100755
|
||||
--- a/test/TEST-14-IMSM/test.sh
|
||||
+++ b/test/TEST-14-IMSM/test.sh
|
||||
@@ -113,7 +113,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh
|
||||
index 5a9b6e1..8e2ea49 100755
|
||||
--- a/test/TEST-15-BTRFSRAID/test.sh
|
||||
+++ b/test/TEST-15-BTRFSRAID/test.sh
|
||||
@@ -87,7 +87,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
|
||||
index 53a45d6..b255492 100755
|
||||
--- a/test/TEST-16-DMSQUASH/test.sh
|
||||
+++ b/test/TEST-16-DMSQUASH/test.sh
|
||||
@@ -43,7 +43,7 @@ test_setup() {
|
||||
export initdir="$TESTDIR"/overlay
|
||||
. "$basedir"/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh
|
||||
index 859d4dc..e337591 100755
|
||||
--- a/test/TEST-17-LVM-THIN/test.sh
|
||||
+++ b/test/TEST-17-LVM-THIN/test.sh
|
||||
@@ -79,7 +79,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
|
||||
index ceca1f0..1dfdfc4 100755
|
||||
--- a/test/TEST-20-NFS/test.sh
|
||||
+++ b/test/TEST-20-NFS/test.sh
|
||||
@@ -141,7 +141,7 @@ test_nfsv3() {
|
||||
|
||||
# This test must fail: nfsroot= requires root=/dev/nfs
|
||||
client_test "NFSv3 Invalid root=dhcp nfsroot=/nfs/client" 52:54:00:12:34:04 \
|
||||
- "root=dhcp nfsroot=/nfs/client failme" 192.168.50.1 -wsize=4096 && return 1
|
||||
+ "root=dhcp nfsroot=/nfs/client failme rd.debug" 192.168.50.1 -wsize=4096 && return 1
|
||||
|
||||
client_test "NFSv3 root=dhcp DHCP path,options" \
|
||||
52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 || return 1
|
||||
@@ -334,7 +334,7 @@ test_setup() {
|
||||
. $basedir/dracut-init.sh
|
||||
mkdir $TESTDIR/overlay
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
|
||||
index 940edb6..1c06b06 100755
|
||||
--- a/test/TEST-30-ISCSI/test.sh
|
||||
+++ b/test/TEST-30-ISCSI/test.sh
|
||||
@@ -213,7 +213,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
|
||||
index 28ba6aa..2061392 100755
|
||||
--- a/test/TEST-40-NBD/test.sh
|
||||
+++ b/test/TEST-40-NBD/test.sh
|
||||
@@ -226,7 +226,7 @@ make_encrypted_root() {
|
||||
done
|
||||
)
|
||||
inst_multiple mke2fs poweroff cp umount tune2fs
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_hook initqueue/finished 01 ./finished-false.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
@@ -362,7 +362,7 @@ test_setup() {
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
inst ./cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
|
||||
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
|
||||
index 484ebee..e0bf7d2 100755
|
||||
--- a/test/TEST-50-MULTINIC/test.sh
|
||||
+++ b/test/TEST-50-MULTINIC/test.sh
|
||||
@@ -269,7 +269,7 @@ test_setup() {
|
||||
export initdir="$TESTDIR"/overlay
|
||||
. "$basedir"/dracut-init.sh
|
||||
inst_multiple poweroff shutdown
|
||||
- inst_hook emergency 000 ./hard-off.sh
|
||||
+ inst_hook shutdown-emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
@ -1,62 +0,0 @@
|
||||
From 9e19c0512d12be15d02125bce0e25d6b9bb2b333 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Tue, 7 Jun 2016 13:24:47 +0200
|
||||
Subject: [PATCH] Revert "network: remove awk call and replace it with a shell
|
||||
function"
|
||||
|
||||
This reverts commit 71867b665cea6b4d9814ea0386baf0500db06806.
|
||||
|
||||
network needs posix shell
|
||||
---
|
||||
dracut-functions.sh | 10 ----------
|
||||
modules.d/40network/module-setup.sh | 2 +-
|
||||
modules.d/40network/net-lib.sh | 2 +-
|
||||
3 files changed, 2 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
||||
index 146dbea..4496bfe 100755
|
||||
--- a/dracut-functions.sh
|
||||
+++ b/dracut-functions.sh
|
||||
@@ -37,16 +37,6 @@ str_starts() { [ "${1#"$2"*}" != "$1" ]; }
|
||||
# returns OK if $1 contains literal string $2 at the end, and isn't empty
|
||||
str_ends() { [ "${1%*"$2"}" != "$1" ]; }
|
||||
|
||||
-uniq_lines() {
|
||||
- local -A lines
|
||||
- while read -r line; do
|
||||
- if ! [[ ${lines[$line]} ]]; then
|
||||
- echo "$line"
|
||||
- lines[$line]=1
|
||||
- fi
|
||||
- done
|
||||
-}
|
||||
-
|
||||
# find a binary. If we were not passed the full path directly,
|
||||
# search in the usual places to find the binary.
|
||||
find_binary() {
|
||||
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
|
||||
index 4bf93cc..53b4b60 100755
|
||||
--- a/modules.d/40network/module-setup.sh
|
||||
+++ b/modules.d/40network/module-setup.sh
|
||||
@@ -23,7 +23,7 @@ installkernel() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
- inst_multiple ip arping dhclient sed
|
||||
+ inst_multiple ip arping dhclient sed awk
|
||||
inst_multiple -o ping ping6
|
||||
inst_multiple -o brctl
|
||||
inst_multiple -o teamd teamdctl teamnl
|
||||
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||||
index 4fd274e..005ad1b 100755
|
||||
--- a/modules.d/40network/net-lib.sh
|
||||
+++ b/modules.d/40network/net-lib.sh
|
||||
@@ -120,7 +120,7 @@ setup_net() {
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
# set up resolv.conf
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||
- uniq_lines < /tmp/net.$netif.resolv.conf > /etc/resolv.conf
|
||||
+ awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# add static route
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user