dracut-048-6.git20180718

- git snapshot
This commit is contained in:
Harald Hoyer 2018-07-18 12:43:51 +02:00
parent ecc9551941
commit ff2fda3aeb
7 changed files with 397 additions and 35 deletions

View File

@ -1,34 +0,0 @@
From 57bec8020d5941644cacb5f54d735b9543fa35de Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Fri, 22 Jun 2018 11:25:04 -0700
Subject: [PATCH] Include virtio DRM drivers in hostonly initramfs
The code in 50drm which tries to include all DRM drivers for
hardware attached to the system did not look for virtio devices.
So if the system is a VM using the 'virtio' graphics adapter,
the 'virtio-gpu' module which should be included is not. This
extends the code to also look for virtio devices.
https://bugzilla.redhat.com/show_bug.cgi?id=1593028
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
modules.d/50drm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
index eb3fc9d3..23545e34 100755
--- a/modules.d/50drm/module-setup.sh
+++ b/modules.d/50drm/module-setup.sh
@@ -31,7 +31,7 @@ installkernel() {
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
# loading of the driver if needed
if [[ $hostonly ]]; then
- for i in /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias; do
+ for i in /sys/bus/{pci/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
[[ -e $i ]] || continue
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
--
2.18.0.rc2

28
0001.patch Normal file
View File

@ -0,0 +1,28 @@
From 9a9c67d61b1e522a7cb72bfc488f4610b4c5ff0b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 6 Jul 2018 11:56:23 +0200
Subject: [PATCH] TEST-30-ISCSI: readd multiple target test
---
test/TEST-30-ISCSI/test.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
index e667587a..f6cc56d5 100755
--- a/test/TEST-30-ISCSI/test.sh
+++ b/test/TEST-30-ISCSI/test.sh
@@ -76,6 +76,13 @@ do_test_run() {
"rd.iscsi.initiator=$initiator" \
|| return 1
+ run_client "netroot=iscsi target1 target2" \
+ "root=LABEL=sysroot" \
+ "ip=dhcp" \
+ "netroot=iscsi:192.168.51.1::::iqn.2009-06.dracut:target1" \
+ "netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \
+ "rd.iscsi.initiator=$initiator" \
+ || return 1
echo "All tests passed [OK]"
return 0

259
0002.patch Normal file
View File

@ -0,0 +1,259 @@
From d63a4e285ea7f4c2249dd3b53f4ed2fdd1f0e374 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 12 Jul 2018 15:18:48 +0200
Subject: [PATCH] TEST-40-NBD: disable for now
nbd is always broken
---
test/TEST-40-NBD/test.sh | 115 +++++++++++++++++++++++++----------------------
1 file changed, 62 insertions(+), 53 deletions(-)
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
index 4931bb73..12736a15 100755
--- a/test/TEST-40-NBD/test.sh
+++ b/test/TEST-40-NBD/test.sh
@@ -8,6 +8,11 @@ KVERSION=${KVERSION-$(uname -r)}
#DEBUGFAIL="rd.shell rd.break rd.debug systemd.log_target=console loglevel=7 systemd.log_level=debug"
#SERIAL="tcp:127.0.0.1:9999"
+test_check() {
+ echo "nbd is constantly broken. skipping"
+ return 1
+}
+
run_server() {
# Start server first
echo "NBD TEST SETUP: Starting DHCP/NBD server"
@@ -107,76 +112,76 @@ 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
+ "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:raw::errors=panic rd.luks=0" \
- ext3 errors=panic || return 1
+ "root=nbd:192.168.50.1:raw::errors=panic rd.luks=0" \
+ ext3 errors=panic || return 1
client_test "NBD root=nbd:IP:port:fstype" 52:54:00:12:34:00 \
- "root=nbd:192.168.50.1:raw: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:raw:ext2:errors=panic rd.luks=0" \
- ext2 errors=panic || return 1
+ "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:raw:ext2:errors=panic bridge rd.luks=0" \
- ext2 errors=panic || return 1
+ "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
+ # 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:raw:::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:raw: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:raw:ext2:errors=panic:bs=2048 rd.luks=0" \
- ext2 errors=panic || return 1
+ 52:54:00:12:34:00 \
+ "root=nbd:192.168.50.1:raw:ext2:errors=panic:bs=2048 rd.luks=0" \
+ ext2 errors=panic || return 1
# DHCP root-path parsing
client_test "NBD root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
- "root=dhcp rd.luks=0" || return 1
+ "root=dhcp rd.luks=0" || return 1
client_test "NBD Bridge root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
- "root=dhcp bridge rd.luks=0" || return 1
+ "root=dhcp bridge rd.luks=0" || return 1
client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype" \
- 52:54:00:12:34:02 "root=dhcp rd.luks=0" ext2 || return 1
+ 52:54:00:12:34:02 "root=dhcp rd.luks=0" ext2 || return 1
client_test "NBD root=dhcp DHCP root-path nbd:srv:port::fsopts" \
- 52:54:00:12:34:03 "root=dhcp rd.luks=0" ext3 errors=panic || return 1
+ 52:54:00:12:34:03 "root=dhcp rd.luks=0" ext3 errors=panic || return 1
client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
- 52:54:00:12:34:04 "root=dhcp rd.luks=0" ext2 errors=panic || return 1
+ 52:54:00:12:34:04 "root=dhcp rd.luks=0" ext2 errors=panic || return 1
# netroot handling
client_test "NBD netroot=nbd:IP:port" 52:54:00:12:34:00 \
- "netroot=nbd:192.168.50.1:raw 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
+ 52:54:00:12:34:04 "netroot=dhcp rd.luks=0" ext2 errors=panic || return 1
# Encrypted root handling via LVM/LUKS over NBD
. $TESTDIR/luks.uuid
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:encrypted" || return 1
+ 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: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=
# XXX How we should work here needs clarification
client_test "NBD root=LABEL=dracut netroot=dhcp (w/ fstype and opts)" \
- 52:54:00:12:34:05 \
- "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1
+ 52:54:00:12:34:05 \
+ "root=LABEL=dracut rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1
if [[ -s server.pid ]]; then
sudo kill -TERM $(cat $TESTDIR/server.pid)
@@ -197,14 +202,15 @@ make_encrypted_root() {
. $basedir/dracut-init.sh
mkdir -p "$initdir"
(
- cd "$initdir"; mkdir -p dev sys proc etc var/run tmp
- mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
+ cd "$initdir"
+ mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin
for i in bin sbin lib lib64; do
ln -sfnr usr/$i $i
done
+ ln -s ../run var/run
)
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
- mount dmesg mkdir cp ping
+ mount dmesg mkdir cp ping
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
[ -f ${_terminfodir}/l/linux ] && break
done
@@ -221,11 +227,12 @@ make_encrypted_root() {
export initdir=$TESTDIR/overlay
. $basedir/dracut-init.sh
(
- cd "$initdir"; mkdir -p dev sys proc etc var/run tmp
- mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
+ cd "$initdir"
+ mkdir -p dev sys proc etc tmp var run root usr/bin usr/lib usr/lib64 usr/sbin
for i in bin sbin lib lib64; do
ln -sfnr usr/$i $i
done
+ ln -s ../run var/run
)
inst_multiple mke2fs poweroff cp umount tune2fs
inst_hook shutdown-emergency 000 ./hard-off.sh
@@ -239,10 +246,10 @@ make_encrypted_root() {
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
- -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
- -d "piix ide-gd_mod ata_piix ext2 ext3 sd_mod" \
- --no-hostonly-cmdline -N \
- -f $TESTDIR/initramfs.makeroot $KVERSION || return 1
+ -m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
+ -d "piix ide-gd_mod ata_piix ext2 ext3 sd_mod" \
+ --no-hostonly-cmdline -N \
+ -f $TESTDIR/initramfs.makeroot $KVERSION || return 1
rm -rf -- $TESTDIR/overlay
# Invoke KVM and/or QEMU to actually create the target filesystem.
@@ -269,14 +276,15 @@ make_client_root() {
. $basedir/dracut-init.sh
mkdir -p "$initdir"
(
- cd "$initdir"; mkdir -p dev sys proc etc var/run tmp
- mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
+ cd "$initdir"
+ mkdir -p dev sys proc etc var tmp run root usr/bin usr/lib usr/lib64 usr/sbin
for i in bin sbin lib lib64; do
ln -sfnr usr/$i $i
done
+ ln -s ../run var/run
)
inst_multiple sh ls shutdown poweroff stty cat ps ln ip \
- dmesg mkdir cp ping
+ dmesg mkdir cp ping
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
[ -f ${_terminfodir}/l/linux ] && break
done
@@ -311,7 +319,8 @@ make_server_root() {
mkdir -p "$initdir"
(
cd "$initdir";
- mkdir -p dev sys proc etc var/run var/lib/dhcpd tmp etc/nbd-server
+ mkdir -p run dev sys proc etc var var/lib/dhcpd tmp etc/nbd-server
+ ln -s ../run var/run
)
cat > "$initdir/etc/nbd-server/config" <<EOF
[generic]
@@ -323,8 +332,8 @@ 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 modprobe vi
+ dmesg mkdir cp ping grep \
+ sleep nbd-server chmod modprobe vi
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
[ -f ${_terminfodir}/l/linux ] && break
done
@@ -369,9 +378,9 @@ test_setup() {
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
inst ./cryptroot-ask.sh /sbin/cryptroot-ask
-# inst ./debug-shell.service /lib/systemd/system/debug-shell.service
-# mkdir -p "${initdir}/lib/systemd/system/sysinit.target.wants"
-# ln -fs ../debug-shell.service "${initdir}/lib/systemd/system/sysinit.target.wants/debug-shell.service"
+ # inst ./debug-shell.service /lib/systemd/system/debug-shell.service
+ # mkdir -p "${initdir}/lib/systemd/system/sysinit.target.wants"
+ # ln -fs ../debug-shell.service "${initdir}/lib/systemd/system/sysinit.target.wants/debug-shell.service"
. $TESTDIR/luks.uuid
mkdir -p $initdir/etc
@@ -380,17 +389,17 @@ test_setup() {
)
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
- -m "dash udev-rules rootfs-block fs-lib base debug kernel-modules" \
- -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000" \
- --no-hostonly-cmdline -N \
- -f $TESTDIR/initramfs.server $KVERSION || return 1
+ -m "dash udev-rules rootfs-block fs-lib base debug kernel-modules" \
+ -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000" \
+ --no-hostonly-cmdline -N \
+ -f $TESTDIR/initramfs.server $KVERSION || return 1
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
- -o "plymouth" \
- -a "debug watchdog" \
- -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000 i6300esb ib700wdt" \
- --no-hostonly-cmdline -N \
- -f $TESTDIR/initramfs.testing $KVERSION || return 1
+ -o "plymouth" \
+ -a "debug watchdog" \
+ -d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000 i6300esb ib700wdt" \
+ --no-hostonly-cmdline -N \
+ -f $TESTDIR/initramfs.testing $KVERSION || return 1
}
kill_server() {

13
0003.patch Normal file
View File

@ -0,0 +1,13 @@
From 1caaeaae1ecbaadf69e3ac90d77a5da5a9d250b1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 12 Jul 2018 15:19:17 +0200
Subject: [PATCH] modules.d/95fcoe/cleanup-fcoe.sh: chmod +x
---
modules.d/95fcoe/cleanup-fcoe.sh | 0
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/modules.d/95fcoe/cleanup-fcoe.sh b/modules.d/95fcoe/cleanup-fcoe.sh
old mode 100644
new mode 100755

64
0004.patch Normal file
View File

@ -0,0 +1,64 @@
From 7047294617bbdd3ffb2466c73db56fda4e6156db Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Tue, 17 Jul 2018 17:16:07 +0800
Subject: [PATCH] Record loaded kernel modules when hostonly mode is enabled
A hostonly image will not include every possibly required kernel module,
so if any hardware or configuration changed, the image may fail to boot.
One way to know if there are any hardware change or configuration change
that will require an image rebuild or not is to check the loaded kernel
module list. If the loaded kernel module list differs from last build
time, then the image may require to be rebuilt.
This commit will let dracut record the loaded kernel module list when
the image is being built, so other tools or services can compare this
list with currently loaded kernel modules to decide if dracut should be
called to rebuild the image.
To retrieve the loaded kernel modules list when an image is built, use
lsinitrd command:
lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt
---
dracut-functions.sh | 11 +++++++++++
dracut.sh | 3 +++
2 files changed, 14 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index ccc48971..7c408f83 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -676,6 +676,17 @@ get_ucode_file ()
fi
}
+# Get currently loaded modules
+# sorted, and delimited by newline
+get_loaded_kernel_modules ()
+{
+ local modules=( )
+ while read _module _size _used _used_by; do
+ modules+=( "$_module" )
+ done <<< $(lsmod | sed -n '1!p')
+ printf '%s\n' "${modules[@]}" | sort
+}
+
# Not every device in /dev/mapper should be examined.
# If it is an LVM device, touch only devices which have /dev/VG/LV symlink.
lvm_internal_dev() {
diff --git a/dracut.sh b/dracut.sh
index cfa4abde..6614d27d 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1492,6 +1492,9 @@ dinfo "*** Including modules done ***"
## final stuff that has to happen
if [[ $no_kernel != yes ]]; then
+ if [[ $hostonly ]]; then
+ echo "$(get_loaded_kernel_modules)" > $initdir/lib/dracut/loaded-kernel-modules.txt
+ fi
if [[ $drivers ]]; then
hostonly='' instmods $drivers

23
0005.patch Normal file
View File

@ -0,0 +1,23 @@
From e331e06a3910ef3fe6837f3e93a48123a7cc822b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 18 Jul 2018 12:41:01 +0200
Subject: [PATCH] dracut-install: skip modules with empty path
if kmod_module_get_path(module) returns NULL, skip the module
---
install/dracut-install.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index 001225b4..88bca1d4 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -1244,7 +1244,7 @@ static int install_dependent_modules(struct kmod_list *modlist)
path = kmod_module_get_path(mod);
name = kmod_module_get_name(mod);
- if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
+ if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
kmod_module_unref(mod);
continue;
}

View File

@ -5,7 +5,7 @@
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%define dist_free_release 1
%define dist_free_release 6.git20180718
Name: dracut
Version: 048
@ -28,6 +28,12 @@ URL: https://dracut.wiki.kernel.org/
# Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
Patch1: 0001.patch
Patch2: 0002.patch
Patch3: 0003.patch
Patch4: 0004.patch
Patch5: 0005.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
BuildRequires: bash
@ -448,6 +454,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%endif
%changelog
* Wed Jul 18 2018 Harald Hoyer <harald@redhat.com> - 048-6.git20180718
- git snapshot
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 048-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild