From 08211a18b7d36268e4a4ed84f7ee0f550b6fbdad Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 11 Jul 2012 16:05:12 +0200 Subject: [PATCH] dracut-020-83.git20120711 - more systemd journal fixes - nfs module fix - install also /lib/modprobe.d/* - fixed dracut-shutdown service - safeguards for dracut-install - for --include also copy symlinks --- ....sh-redirect-stdin-out-err-to-dev-co.patch | 57 +++ ...witch-root.target-add-ConditionPathE.patch | 18 + ...odule-setup.sh-also-install-lib-modp.patch | 25 + 0075-nfs-install-modprobe-config-file.patch | 57 +++ ...rt-for-make-V-1-TESTS-01-20-40-check.patch | 307 ++++++++++++ ...service-s-reboot.service-systemd-reb.patch | 23 + ...L-SYSTEMD-full-test-with-systemd-and.patch | 443 ++++++++++++++++++ 0079-test-silence-make-all.patch | 218 +++++++++ ...emd-fixed-initrd-switch-root.service.patch | 28 ++ ...include-copy-also-the-symbolic-links.patch | 25 + ...install.c-check-for-empty-or-destdir.patch | 65 +++ dracut.spec | 21 +- 12 files changed, 1286 insertions(+), 1 deletion(-) create mode 100644 0072-test-server-init.sh-redirect-stdin-out-err-to-dev-co.patch create mode 100644 0073-systemd-initrd-switch-root.target-add-ConditionPathE.patch create mode 100644 0074-kernel-modules-module-setup.sh-also-install-lib-modp.patch create mode 100644 0075-nfs-install-modprobe-config-file.patch create mode 100644 0076-test-add-support-for-make-V-1-TESTS-01-20-40-check.patch create mode 100644 0077-dracut-shutdown.service-s-reboot.service-systemd-reb.patch create mode 100644 0078-test-TEST-04-FULL-SYSTEMD-full-test-with-systemd-and.patch create mode 100644 0079-test-silence-make-all.patch create mode 100644 0080-systemd-fixed-initrd-switch-root.service.patch create mode 100644 0081-dracut.sh-for-include-copy-also-the-symbolic-links.patch create mode 100644 0082-install-dracut-install.c-check-for-empty-or-destdir.patch diff --git a/0072-test-server-init.sh-redirect-stdin-out-err-to-dev-co.patch b/0072-test-server-init.sh-redirect-stdin-out-err-to-dev-co.patch new file mode 100644 index 0000000..6c9ffa7 --- /dev/null +++ b/0072-test-server-init.sh-redirect-stdin-out-err-to-dev-co.patch @@ -0,0 +1,57 @@ +From 4dda0095a1aabb86486f1e4c1b9a8b32250cc960 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 08:40:45 +0200 +Subject: [PATCH] test/*/server-init.sh: redirect stdin,out,err to + /dev/console + +--- + test/TEST-20-NFS/server-init.sh | 2 +- + test/TEST-30-ISCSI/server-init.sh | 2 ++ + test/TEST-40-NBD/server-init.sh | 2 ++ + test/TEST-50-MULTINIC/server-init.sh | 2 +- + 4 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/test/TEST-20-NFS/server-init.sh b/test/TEST-20-NFS/server-init.sh +index c3c0238..58fdeee 100755 +--- a/test/TEST-20-NFS/server-init.sh ++++ b/test/TEST-20-NFS/server-init.sh +@@ -1,5 +1,5 @@ + #!/bin/sh +-exec >/dev/console 2>&1 ++exec /dev/console 2>&1 + set -x + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + export TERM=linux +diff --git a/test/TEST-30-ISCSI/server-init.sh b/test/TEST-30-ISCSI/server-init.sh +index 6f24b60..091f4ee 100755 +--- a/test/TEST-30-ISCSI/server-init.sh ++++ b/test/TEST-30-ISCSI/server-init.sh +@@ -1,4 +1,6 @@ + #!/bin/sh ++exec /dev/console 2>&1 ++set -x + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + export TERM=linux + export PS1='nfstest-server:\w\$ ' +diff --git a/test/TEST-40-NBD/server-init.sh b/test/TEST-40-NBD/server-init.sh +index e8f899c..8d2dd6d 100755 +--- a/test/TEST-40-NBD/server-init.sh ++++ b/test/TEST-40-NBD/server-init.sh +@@ -1,4 +1,6 @@ + #!/bin/sh ++exec /dev/console 2>&1 ++set -x + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + export TERM=linux + export PS1='nbdtest-server:\w\$ ' +diff --git a/test/TEST-50-MULTINIC/server-init.sh b/test/TEST-50-MULTINIC/server-init.sh +index 01470e1..43d7f40 100755 +--- a/test/TEST-50-MULTINIC/server-init.sh ++++ b/test/TEST-50-MULTINIC/server-init.sh +@@ -1,5 +1,5 @@ + #!/bin/sh +-exec >/dev/console 2>&1 ++exec /dev/console 2>&1 + set -x + export PATH=/sbin:/bin:/usr/sbin:/usr/bin + export TERM=linux diff --git a/0073-systemd-initrd-switch-root.target-add-ConditionPathE.patch b/0073-systemd-initrd-switch-root.target-add-ConditionPathE.patch new file mode 100644 index 0000000..8419cbb --- /dev/null +++ b/0073-systemd-initrd-switch-root.target-add-ConditionPathE.patch @@ -0,0 +1,18 @@ +From fc5b6b03281b10fc7c4de460574f1d5efb5f309a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 08:41:31 +0200 +Subject: [PATCH] systemd/initrd-switch-root.target: add ConditionPathExist + +--- + modules.d/98systemd/initrd-switch-root.target | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/98systemd/initrd-switch-root.target b/modules.d/98systemd/initrd-switch-root.target +index feb7162..74647a5 100644 +--- a/modules.d/98systemd/initrd-switch-root.target ++++ b/modules.d/98systemd/initrd-switch-root.target +@@ -14,3 +14,4 @@ Requires=initrd-switch-root.service + Before=initrd-switch-root.service + AllowIsolate=yes + Wants=systemd-journald.service ++ConditionPathExists=/etc/initrd-release diff --git a/0074-kernel-modules-module-setup.sh-also-install-lib-modp.patch b/0074-kernel-modules-module-setup.sh-also-install-lib-modp.patch new file mode 100644 index 0000000..9feb309 --- /dev/null +++ b/0074-kernel-modules-module-setup.sh-also-install-lib-modp.patch @@ -0,0 +1,25 @@ +From 9f5c98a76a2c319045c7f6091a1083da1b74f740 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 08:42:21 +0200 +Subject: [PATCH] kernel-modules/module-setup.sh: also install + /lib/modprobe.d/*.conf + +In theory we should only install /lib/modprobe.d/*.conf and only for +host-only the /etc/modprobe.d. +--- + 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 8822fa7..1744e53 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -77,7 +77,7 @@ installkernel() { + install() { + local _f i + [ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf +- dracut_install $(find -L /etc/modprobe.d/ -maxdepth 1 -type f -name '*.conf') ++ dracut_install $(find -L /{etc,lib}/modprobe.d/ -maxdepth 1 -type f -name '*.conf') + inst_hook cmdline 01 "$moddir/parse-kernel.sh" + inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh + } diff --git a/0075-nfs-install-modprobe-config-file.patch b/0075-nfs-install-modprobe-config-file.patch new file mode 100644 index 0000000..12c2d2f --- /dev/null +++ b/0075-nfs-install-modprobe-config-file.patch @@ -0,0 +1,57 @@ +From 83a420674b7c1328ffb944678619595a431ffa48 Mon Sep 17 00:00:00 2001 +From: Dave Young +Date: Wed, 11 Jul 2012 13:08:18 +0800 +Subject: [PATCH] nfs: install modprobe config file + +install nfs modprobe config file + +For nfs4, in case nfs.ko is not loaded mount.nfs4 will try to load +nfs4.ko instead of nfs.ko. Fedora nfs-utils creates a lib/modprobe.d/nfs.conf +in which there's below alias: +alias nfs4 nfs + +Dracut also need this file to auto load nfs kernel module. + +Tested booting to a fedora 17 nfsroot share. + +Signed-off-by: Dave Young +--- + modules.d/95nfs/module-setup.sh | 6 ++++++ + modules.d/95nfs/parse-nfsroot.sh | 7 ------- + 2 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh +index b170de5..0c07725 100755 +--- a/modules.d/95nfs/module-setup.sh ++++ b/modules.d/95nfs/module-setup.sh +@@ -35,6 +35,12 @@ install() { + mount.nfs4 umount rpc.idmapd sed /etc/netconfig + dracut_install /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf + ++ if [ -f /lib/modprobe.d/nfs.conf ]; then ++ dracut_install /lib/modprobe.d/nfs.conf ++ else ++ echo "alias nfs4 nfs" > $initdir/etc/modprobe.d/nfs.conf ++ fi ++ + inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*' + + _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ +diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh +index 4e69edc..769d233 100755 +--- a/modules.d/95nfs/parse-nfsroot.sh ++++ b/modules.d/95nfs/parse-nfsroot.sh +@@ -88,13 +88,6 @@ nfsroot_to_var $netroot + # Set fstype, might help somewhere + fstype=${nfs#/dev/} + +-# NFS actually supported? Some more uglyness here: nfs3 or nfs4 might not +-# be in the module... +-if ! incol2 /proc/filesystems $fstype ; then +- modprobe nfs +- incol2 /proc/filesystems $fstype || die "nfsroot type $fstype requested but kernel/initrd does not support nfs" +-fi +- + # Rewrite root so we don't have to parse this uglyness later on again + netroot="$fstype:$server:$path:$options" + diff --git a/0076-test-add-support-for-make-V-1-TESTS-01-20-40-check.patch b/0076-test-add-support-for-make-V-1-TESTS-01-20-40-check.patch new file mode 100644 index 0000000..e2d5b3e --- /dev/null +++ b/0076-test-add-support-for-make-V-1-TESTS-01-20-40-check.patch @@ -0,0 +1,307 @@ +From 3e1d48fd1279b46a837ed3835f6e686ac9120c4d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 09:33:32 +0200 +Subject: [PATCH] test: add support for: make V=1 TESTS="01 20 40" check + +$ sudo make V=1 clean check +now runs the testsuite in verbose mode + +$ sudo make TESTS="01 20 40" clean check +now only runs the 01, 20 and 40 tests. +--- + test/Makefile | 5 +++-- + test/TEST-01-BASIC/Makefile | 6 +++--- + test/TEST-02-SYSTEMD/Makefile | 6 +++--- + test/TEST-03-USR-MOUNT/Makefile | 6 +++--- + test/TEST-10-RAID/Makefile | 6 +++--- + test/TEST-11-LVM/Makefile | 6 +++--- + test/TEST-12-RAID-DEG/Makefile | 6 +++--- + test/TEST-13-ENC-RAID-LVM/Makefile | 6 +++--- + test/TEST-15-BTRFSRAID/Makefile | 6 +++--- + test/TEST-16-DMSQUASH/Makefile | 6 +++--- + test/TEST-20-NFS/Makefile | 6 +++--- + test/TEST-30-ISCSI/Makefile | 6 +++--- + test/TEST-40-NBD/Makefile | 6 +++--- + test/TEST-50-MULTINIC/Makefile | 6 +++--- + test/TEST-99-RPM/Makefile | 6 +++--- + test/test-functions | 13 +++++++++++++ + 16 files changed, 58 insertions(+), 44 deletions(-) + +diff --git a/test/Makefile b/test/Makefile +index 38bfecc..f4881b5 100644 +--- a/test/Makefile ++++ b/test/Makefile +@@ -4,14 +4,15 @@ check: + @for i in TEST-[0-9]*; do \ + [ -d $$i ] || continue ; \ + [ -f $$i/Makefile ] || continue ; \ +- make -C $$i all ; \ ++ if [ -n "$$TESTS" ]; then t=$${i##TEST-}; t=$${t%-*}; [ "$${TESTS#*$$t*}" != "$$TESTS" ] || continue; fi; \ ++ $(MAKE) -C $$i all ; \ + done + + clean: + @for i in TEST-[0-9]*; do \ + [ -d $$i ] || continue ; \ + [ -f $$i/Makefile ] || continue ; \ +- make -C $$i clean ; \ ++ $(MAKE) -C $$i clean ; \ + done + + all: +diff --git a/test/TEST-01-BASIC/Makefile b/test/TEST-01-BASIC/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-01-BASIC/Makefile ++++ b/test/TEST-01-BASIC/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-02-SYSTEMD/Makefile b/test/TEST-02-SYSTEMD/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-02-SYSTEMD/Makefile ++++ b/test/TEST-02-SYSTEMD/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-03-USR-MOUNT/Makefile b/test/TEST-03-USR-MOUNT/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-03-USR-MOUNT/Makefile ++++ b/test/TEST-03-USR-MOUNT/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-10-RAID/Makefile b/test/TEST-10-RAID/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-10-RAID/Makefile ++++ b/test/TEST-10-RAID/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-11-LVM/Makefile b/test/TEST-11-LVM/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-11-LVM/Makefile ++++ b/test/TEST-11-LVM/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-12-RAID-DEG/Makefile b/test/TEST-12-RAID-DEG/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-12-RAID-DEG/Makefile ++++ b/test/TEST-12-RAID-DEG/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-13-ENC-RAID-LVM/Makefile b/test/TEST-13-ENC-RAID-LVM/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-13-ENC-RAID-LVM/Makefile ++++ b/test/TEST-13-ENC-RAID-LVM/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-15-BTRFSRAID/Makefile b/test/TEST-15-BTRFSRAID/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-15-BTRFSRAID/Makefile ++++ b/test/TEST-15-BTRFSRAID/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-16-DMSQUASH/Makefile b/test/TEST-16-DMSQUASH/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-16-DMSQUASH/Makefile ++++ b/test/TEST-16-DMSQUASH/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-20-NFS/Makefile b/test/TEST-20-NFS/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-20-NFS/Makefile ++++ b/test/TEST-20-NFS/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-30-ISCSI/Makefile b/test/TEST-30-ISCSI/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-30-ISCSI/Makefile ++++ b/test/TEST-30-ISCSI/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-40-NBD/Makefile b/test/TEST-40-NBD/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-40-NBD/Makefile ++++ b/test/TEST-40-NBD/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-50-MULTINIC/Makefile b/test/TEST-50-MULTINIC/Makefile +index bc0ddb6..3cc8993 100644 +--- a/test/TEST-50-MULTINIC/Makefile ++++ b/test/TEST-50-MULTINIC/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. all +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. all ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/TEST-99-RPM/Makefile b/test/TEST-99-RPM/Makefile +index 5513c52..3cc8993 100644 +--- a/test/TEST-99-RPM/Makefile ++++ b/test/TEST-99-RPM/Makefile +@@ -1,8 +1,8 @@ + all: +- @make -s --no-print-directory -C ../.. clean all rpm +- @basedir=../.. testdir=../ ./test.sh --all ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: +- @make --no-print-directory -C ../.. clean rpm ++ @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup + clean: + @basedir=../.. testdir=../ ./test.sh --clean +diff --git a/test/test-functions b/test/test-functions +index 10d78ed..968551f 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -37,6 +37,7 @@ while (($# > 0)); do + echo "[SKIPPED]" + exit 0; + fi ++ if [ "$V" != "1" ]; then + ( + test_setup && test_run + ret=$? +@@ -45,7 +46,19 @@ while (($# > 0)); do + rm -f .testdir + exit $ret + ) test.log 2>&1 ++ else ++ set -o pipefail ++ ( ++ test_setup && test_run ++ ret=$? ++ test_cleanup ++ rm -fr "$TESTDIR" ++ rm -f .testdir ++ exit $ret ++ ) &1 | tee test.log ++ fi + ret=$? ++ set +o pipefail + if [ $ret -eq 0 ]; then + rm test.log + echo "[OK]" diff --git a/0077-dracut-shutdown.service-s-reboot.service-systemd-reb.patch b/0077-dracut-shutdown.service-s-reboot.service-systemd-reb.patch new file mode 100644 index 0000000..f942362 --- /dev/null +++ b/0077-dracut-shutdown.service-s-reboot.service-systemd-reb.patch @@ -0,0 +1,23 @@ +From 0d5727039578d58dd5f9d2e718e3433a3da876b0 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 10:00:10 +0200 +Subject: [PATCH] dracut-shutdown.service: + s/reboot.service/systemd-reboot.service/ + +--- + dracut-shutdown.service | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-shutdown.service b/dracut-shutdown.service +index f96418b..da3a537 100644 +--- a/dracut-shutdown.service ++++ b/dracut-shutdown.service +@@ -8,7 +8,7 @@ + [Unit] + Description=Restore /run/initramfs + After=getty@tty1.service prefdm.service +-Before=reboot.service shutdown.target ++Before=systemd-reboot.service shutdown.target + DefaultDependencies=no + ConditionPathExists=/run/initramfs/.need_shutdown + ConditionPathExists=!/run/initramfs/bin/sh diff --git a/0078-test-TEST-04-FULL-SYSTEMD-full-test-with-systemd-and.patch b/0078-test-TEST-04-FULL-SYSTEMD-full-test-with-systemd-and.patch new file mode 100644 index 0000000..222723e --- /dev/null +++ b/0078-test-TEST-04-FULL-SYSTEMD-full-test-with-systemd-and.patch @@ -0,0 +1,443 @@ +From badda27f61706a4ceed2098b2057c3ec0206617d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 15:15:41 +0200 +Subject: [PATCH] test/TEST-04-FULL-SYSTEMD: full test with systemd and /usr + mount + +--- + test/TEST-04-FULL-SYSTEMD/99-idesymlinks.rules | 8 + + test/TEST-04-FULL-SYSTEMD/Makefile | 10 + + test/TEST-04-FULL-SYSTEMD/create-root.sh | 39 ++++ + test/TEST-04-FULL-SYSTEMD/cryptroot-ask.sh | 6 + + test/TEST-04-FULL-SYSTEMD/fstab | 2 + + test/TEST-04-FULL-SYSTEMD/hard-off.sh | 3 + + test/TEST-04-FULL-SYSTEMD/test-init.sh | 29 +++ + test/TEST-04-FULL-SYSTEMD/test.sh | 273 ++++++++++++++++++++++++ + 8 files changed, 370 insertions(+) + create mode 100644 test/TEST-04-FULL-SYSTEMD/99-idesymlinks.rules + create mode 100644 test/TEST-04-FULL-SYSTEMD/Makefile + create mode 100755 test/TEST-04-FULL-SYSTEMD/create-root.sh + create mode 100755 test/TEST-04-FULL-SYSTEMD/cryptroot-ask.sh + create mode 100644 test/TEST-04-FULL-SYSTEMD/fstab + create mode 100755 test/TEST-04-FULL-SYSTEMD/hard-off.sh + create mode 100755 test/TEST-04-FULL-SYSTEMD/test-init.sh + create mode 100755 test/TEST-04-FULL-SYSTEMD/test.sh + +diff --git a/test/TEST-04-FULL-SYSTEMD/99-idesymlinks.rules b/test/TEST-04-FULL-SYSTEMD/99-idesymlinks.rules +new file mode 100644 +index 0000000..d557790 +--- /dev/null ++++ b/test/TEST-04-FULL-SYSTEMD/99-idesymlinks.rules +@@ -0,0 +1,8 @@ ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hda", SYMLINK+="sda" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hda*", SYMLINK+="sda$env{MINOR}" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdb", SYMLINK+="sdb" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdb*", SYMLINK+="sdb$env{MINOR}" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdc", SYMLINK+="sdc" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdc*", SYMLINK+="sdc$env{MINOR}" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdd", SYMLINK+="sdd" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdd*", SYMLINK+="sdd$env{MINOR}" +diff --git a/test/TEST-04-FULL-SYSTEMD/Makefile b/test/TEST-04-FULL-SYSTEMD/Makefile +new file mode 100644 +index 0000000..3cc8993 +--- /dev/null ++++ b/test/TEST-04-FULL-SYSTEMD/Makefile +@@ -0,0 +1,10 @@ ++all: ++ $(MAKE) -s --no-print-directory -C ../.. all ++ V=$(V) basedir=../.. testdir=../ ./test.sh --all ++setup: ++ @$(MAKE) --no-print-directory -C ../.. all ++ @basedir=../.. testdir=../ ./test.sh --setup ++clean: ++ @basedir=../.. testdir=../ ./test.sh --clean ++run: ++ @basedir=../.. testdir=../ ./test.sh --run +diff --git a/test/TEST-04-FULL-SYSTEMD/create-root.sh b/test/TEST-04-FULL-SYSTEMD/create-root.sh +new file mode 100755 +index 0000000..2e33920 +--- /dev/null ++++ b/test/TEST-04-FULL-SYSTEMD/create-root.sh +@@ -0,0 +1,39 @@ ++#!/bin/sh ++# don't let udev and this script step on eachother's toes ++for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do ++ > "/etc/udev/rules.d/$x" ++done ++rm /etc/lvm/lvm.conf ++udevadm control --reload-rules ++set -e ++# save a partition at the beginning for future flagging purposes ++sfdisk -C 10240 -H 2 -S 32 -L /dev/sda </dev/sda1 ++sync ++poweroff -f ++ +diff --git a/test/TEST-04-FULL-SYSTEMD/cryptroot-ask.sh b/test/TEST-04-FULL-SYSTEMD/cryptroot-ask.sh +new file mode 100755 +index 0000000..db27c5b +--- /dev/null ++++ b/test/TEST-04-FULL-SYSTEMD/cryptroot-ask.sh +@@ -0,0 +1,6 @@ ++#!/bin/sh ++ ++[ -b /dev/mapper/$2 ] && exit 0 ++echo -n test >/keyfile ++/sbin/cryptsetup luksOpen $1 $2 /dev/watchdog ++export PATH=/sbin:/bin:/usr/sbin:/usr/bin ++strstr() { [ "${1#*$2*}" != "$1" ]; } ++CMDLINE=$(while read line; do echo $line;done < /proc/cmdline) ++plymouth --quit ++exec /dev/console 2>&1 ++ ++ismounted() { ++ while read a m a; do ++ [ "$m" = "$1" ] && return 0 ++ done < /proc/mounts ++ return 1 ++} ++ ++if ismounted /usr; then ++ echo "dracut-root-block-success" >/dev/sdc ++fi ++export TERM=linux ++export PS1='initramfs-test:\w\$ ' ++[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab ++[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab ++stty sane ++echo "made it to the rootfs!" ++if strstr "$CMDLINE" "rd.shell"; then ++ strstr "$(setsid --help)" "control" && CTTY="-c" ++ setsid $CTTY sh -i ++fi ++echo "Powering down." +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +new file mode 100755 +index 0000000..921189f +--- /dev/null ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -0,0 +1,273 @@ ++#!/bin/bash ++ ++TEST_DESCRIPTION="Full systemd serialization/deserialization test with /usr mount" ++ ++KVERSION=${KVERSION-$(uname -r)} ++ ++# Uncomment this to debug failures ++#DEBUGFAIL="rd.shell rd.break" ++ ++client_run() { ++ local test_name="$1"; shift ++ local client_opts="$*" ++ ++ echo "CLIENT TEST START: $test_name" ++ ++ dd if=/dev/zero of=$TESTDIR/result bs=1M count=1 ++ $testdir/run-qemu \ ++ -hda $TESTDIR/root.btrfs \ ++ -hdb $TESTDIR/usr.btrfs \ ++ -hdc $TESTDIR/result \ ++ -m 256M -nographic \ ++ -net none -kernel /boot/vmlinuz-$KVERSION \ ++ -append "root=LABEL=dracut $client_opts quiet systemd.log_level=debug systemd.log_target=console loglevel=77 rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ ++ -initrd $TESTDIR/initramfs.testing ++ ++ if (($? != 0)); then ++ echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" ++ return 1 ++ fi ++ ++ if ! grep -m 1 -q dracut-root-block-success $TESTDIR/result; then ++ echo "CLIENT TEST END: $test_name [FAILED]" ++ return 1 ++ fi ++ echo "CLIENT TEST END: $test_name [OK]" ++ ++} ++ ++test_run() { ++ client_run "no option specified" || return 1 ++ client_run "readonly root" "ro" || return 1 ++ client_run "writeable root" "rw" || return 1 ++ return 0 ++} ++ ++test_setup() { ++ rm -f $TESTDIR/root.btrfs ++ rm -f $TESTDIR/usr.btrfs ++ # Create the blank file to use as a root filesystem ++ dd if=/dev/null of=$TESTDIR/root.btrfs bs=1M seek=320 ++ dd if=/dev/null of=$TESTDIR/usr.btrfs bs=1M seek=320 ++ ++ kernel=$KVERSION ++ # Create what will eventually be our root filesystem onto an overlay ++ ( ++ export initdir=$TESTDIR/overlay/source ++ mkdir -p $initdir ++ . $basedir/dracut-functions.sh ++ ++ for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run run/lock run/initramfs; do ++ if [ -L "/$d" ]; then ++ inst_symlink "/$d" ++ else ++ inst_dir "/$d" ++ fi ++ done ++ ++ ln -sfn /run "$initdir/var/run" ++ ln -sfn /run/lock "$initdir/var/lock" ++ ++ dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \ ++ mount dmesg ifconfig dhclient mkdir cp ping dhclient \ ++ umount strace less setsid ++ for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do ++ [ -f ${_terminfodir}/l/linux ] && break ++ done ++ dracut_install -o ${_terminfodir}/l/linux ++ inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script" ++ inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup" ++ dracut_install grep ++ inst_simple ./fstab /etc/fstab ++ rpm -ql systemd | xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -o -a -l ++ inst /lib/systemd/system/systemd-journal-flush.service ++ inst /etc/sysconfig/init ++ # activate kmsg import ++ echo 'ImportKernel=yes' >> $initdir/etc/systemd/journald.conf ++ ++ # make a journal directory ++ mkdir -p $initdir/var/log/journal ++ ++ # install some basic config files ++ dracut_install -o \ ++ /etc/sysconfig/init \ ++ /etc/passwd \ ++ /etc/shadow \ ++ /etc/group \ ++ /etc/shells \ ++ /etc/nsswitch.conf \ ++ /etc/pam.conf \ ++ /etc/securetty \ ++ /etc/os-release \ ++ /etc/localtime ++ ++ # we want an empty environment ++ > $initdir/etc/environment ++ > $initdir/etc/machine-id ++ ++ # set the hostname ++ echo systemd-testsuite > $initdir/etc/hostname ++ ++ # setup the testsuite target ++ cat >$initdir/etc/systemd/system/testsuite.target <$initdir/etc/systemd/system/testsuite.service <$initdir/etc/rc.d/rc.local < +Date: Wed, 11 Jul 2012 15:23:21 +0200 +Subject: [PATCH] test: silence "make all" + +--- + test/TEST-01-BASIC/Makefile | 4 ++-- + test/TEST-02-SYSTEMD/Makefile | 4 ++-- + test/TEST-03-USR-MOUNT/Makefile | 4 ++-- + test/TEST-04-FULL-SYSTEMD/Makefile | 4 ++-- + test/TEST-10-RAID/Makefile | 4 ++-- + test/TEST-11-LVM/Makefile | 4 ++-- + test/TEST-12-RAID-DEG/Makefile | 4 ++-- + test/TEST-13-ENC-RAID-LVM/Makefile | 4 ++-- + test/TEST-15-BTRFSRAID/Makefile | 4 ++-- + test/TEST-16-DMSQUASH/Makefile | 4 ++-- + test/TEST-20-NFS/Makefile | 4 ++-- + test/TEST-30-ISCSI/Makefile | 4 ++-- + test/TEST-40-NBD/Makefile | 4 ++-- + test/TEST-50-MULTINIC/Makefile | 4 ++-- + test/TEST-99-RPM/Makefile | 4 ++-- + 15 files changed, 30 insertions(+), 30 deletions(-) + +diff --git a/test/TEST-01-BASIC/Makefile b/test/TEST-01-BASIC/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-01-BASIC/Makefile ++++ b/test/TEST-01-BASIC/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-02-SYSTEMD/Makefile b/test/TEST-02-SYSTEMD/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-02-SYSTEMD/Makefile ++++ b/test/TEST-02-SYSTEMD/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-03-USR-MOUNT/Makefile b/test/TEST-03-USR-MOUNT/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-03-USR-MOUNT/Makefile ++++ b/test/TEST-03-USR-MOUNT/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-04-FULL-SYSTEMD/Makefile b/test/TEST-04-FULL-SYSTEMD/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-04-FULL-SYSTEMD/Makefile ++++ b/test/TEST-04-FULL-SYSTEMD/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-10-RAID/Makefile b/test/TEST-10-RAID/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-10-RAID/Makefile ++++ b/test/TEST-10-RAID/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-11-LVM/Makefile b/test/TEST-11-LVM/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-11-LVM/Makefile ++++ b/test/TEST-11-LVM/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-12-RAID-DEG/Makefile b/test/TEST-12-RAID-DEG/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-12-RAID-DEG/Makefile ++++ b/test/TEST-12-RAID-DEG/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-13-ENC-RAID-LVM/Makefile b/test/TEST-13-ENC-RAID-LVM/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-13-ENC-RAID-LVM/Makefile ++++ b/test/TEST-13-ENC-RAID-LVM/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-15-BTRFSRAID/Makefile b/test/TEST-15-BTRFSRAID/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-15-BTRFSRAID/Makefile ++++ b/test/TEST-15-BTRFSRAID/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-16-DMSQUASH/Makefile b/test/TEST-16-DMSQUASH/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-16-DMSQUASH/Makefile ++++ b/test/TEST-16-DMSQUASH/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-20-NFS/Makefile b/test/TEST-20-NFS/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-20-NFS/Makefile ++++ b/test/TEST-20-NFS/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-30-ISCSI/Makefile b/test/TEST-30-ISCSI/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-30-ISCSI/Makefile ++++ b/test/TEST-30-ISCSI/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-40-NBD/Makefile b/test/TEST-40-NBD/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-40-NBD/Makefile ++++ b/test/TEST-40-NBD/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-50-MULTINIC/Makefile b/test/TEST-50-MULTINIC/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-50-MULTINIC/Makefile ++++ b/test/TEST-50-MULTINIC/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup +diff --git a/test/TEST-99-RPM/Makefile b/test/TEST-99-RPM/Makefile +index 3cc8993..aad2705 100644 +--- a/test/TEST-99-RPM/Makefile ++++ b/test/TEST-99-RPM/Makefile +@@ -1,6 +1,6 @@ + all: +- $(MAKE) -s --no-print-directory -C ../.. all +- V=$(V) basedir=../.. testdir=../ ./test.sh --all ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all + setup: + @$(MAKE) --no-print-directory -C ../.. all + @basedir=../.. testdir=../ ./test.sh --setup diff --git a/0080-systemd-fixed-initrd-switch-root.service.patch b/0080-systemd-fixed-initrd-switch-root.service.patch new file mode 100644 index 0000000..885f4a6 --- /dev/null +++ b/0080-systemd-fixed-initrd-switch-root.service.patch @@ -0,0 +1,28 @@ +From f60cd2593f39b381be3948811a20107029e717d0 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 15:25:30 +0200 +Subject: [PATCH] systemd: fixed initrd-switch-root.service + +--- + modules.d/98systemd/initrd-switch-root.service | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/modules.d/98systemd/initrd-switch-root.service b/modules.d/98systemd/initrd-switch-root.service +index 493b085..bdc4587 100644 +--- a/modules.d/98systemd/initrd-switch-root.service ++++ b/modules.d/98systemd/initrd-switch-root.service +@@ -10,11 +10,13 @@ Description=Switch Root + DefaultDependencies=no + ConditionPathExists=/etc/initrd-release + OnFailure=emergency.service ++After=initrd-switch-root.target ++Before=systemd-journal-flush.service + + [Service] + Type=oneshot + EnvironmentFile=/run/initramfs/switch-root.conf +-ExecStart=/usr/bin/systemctl --force switch-root ${NEWROOT} ${NEWINIT} ++ExecStart=/usr/bin/systemctl switch-root ${NEWROOT} ${NEWINIT} + ExecStopPost=-/usr/bin/systemctl stop systemd-journald.service + StandardInput=null + StandardOutput=null diff --git a/0081-dracut.sh-for-include-copy-also-the-symbolic-links.patch b/0081-dracut.sh-for-include-copy-also-the-symbolic-links.patch new file mode 100644 index 0000000..c85c703 --- /dev/null +++ b/0081-dracut.sh-for-include-copy-also-the-symbolic-links.patch @@ -0,0 +1,25 @@ +From 98eb6d57dffda383620f237eaee08c97bf35d863 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 15:25:49 +0200 +Subject: [PATCH] dracut.sh: for --include copy also the symbolic links + +--- + dracut.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 9be7cac..afd076a 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -934,9 +934,9 @@ while pop include_src src && pop include_target tgt; do + mkdir -m 0755 -p "$s" + chmod --reference="$i" "$s" + fi +- cp --reflink=auto --sparse=auto -pfLr -t "$s" "$i"/* ++ cp --reflink=auto --sparse=auto -fa -t "$s" "$i"/* + else +- cp --reflink=auto --sparse=auto -pfLr -t "$s" "$i" ++ cp --reflink=auto --sparse=auto -fa -t "$s" "$i" + fi + done + fi diff --git a/0082-install-dracut-install.c-check-for-empty-or-destdir.patch b/0082-install-dracut-install.c-check-for-empty-or-destdir.patch new file mode 100644 index 0000000..521d392 --- /dev/null +++ b/0082-install-dracut-install.c-check-for-empty-or-destdir.patch @@ -0,0 +1,65 @@ +From f6c2faebfafb95ae7ce14fe678582077af20c3c0 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 11 Jul 2012 15:47:10 +0200 +Subject: [PATCH] install/dracut-install.c: check for empty or "/" destdir + +--- + install/dracut-install.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index ee6950a..9351472 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -182,7 +182,7 @@ static int cp(const char *src, const char *dst) + int pid; + int ret; + +- if(use_clone) { ++ if (use_clone) { + struct stat sb; + int dest_desc, source_desc; + +@@ -197,8 +197,8 @@ static int cp(const char *src, const char *dst) + goto normal_copy; + + dest_desc = +- open(dst, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, +- (sb.st_mode) & (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)); ++ open(dst, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, ++ (sb.st_mode) & (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)); + + if (dest_desc < 0) { + close(source_desc); +@@ -379,7 +379,6 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res + } + } + +- + i = strdup(dst); + hashmap_put(items, i, i); + +@@ -731,15 +730,21 @@ int main(int argc, char **argv) + + umask(0022); + +- if (destrootdir == NULL) { ++ if (destrootdir == NULL || strlen(destrootdir) == 0) { + destrootdir = getenv("DESTROOTDIR"); +- if (destrootdir == NULL) { ++ if (destrootdir == NULL || strlen(destrootdir) == 0) { + log_error("Environment DESTROOTDIR or argument -D is not set!"); + usage(EXIT_FAILURE); + } + destrootdir = strdup(destrootdir); + } + ++ if (strcmp(destrootdir, "/") == 0) { ++ log_error("Environment DESTROOTDIR or argument -D is set to '/'!"); ++ usage(EXIT_FAILURE); ++ ++ } ++ + items = hashmap_new(string_hash_func, string_compare_func); + items_failed = hashmap_new(string_hash_func, string_compare_func); + diff --git a/dracut.spec b/dracut.spec index 92977c2..ff1b2d6 100644 --- a/dracut.spec +++ b/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 020 -Release: 72.git20120710%{?dist} +Release: 83.git20120711%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -100,6 +100,17 @@ Patch68: 0068-TEST-01-BASIC-enable-selinux.patch Patch69: 0069-install-dracut-install.c-redirect-stderr-to-stdout-a.patch Patch70: 0070-systemd-initrd-switch-root.service-stop-journald-rat.patch Patch71: 0071-systemd-install-all-dracut-units-in-etc-and-let-the-.patch +Patch72: 0072-test-server-init.sh-redirect-stdin-out-err-to-dev-co.patch +Patch73: 0073-systemd-initrd-switch-root.target-add-ConditionPathE.patch +Patch74: 0074-kernel-modules-module-setup.sh-also-install-lib-modp.patch +Patch75: 0075-nfs-install-modprobe-config-file.patch +Patch76: 0076-test-add-support-for-make-V-1-TESTS-01-20-40-check.patch +Patch77: 0077-dracut-shutdown.service-s-reboot.service-systemd-reb.patch +Patch78: 0078-test-TEST-04-FULL-SYSTEMD-full-test-with-systemd-and.patch +Patch79: 0079-test-silence-make-all.patch +Patch80: 0080-systemd-fixed-initrd-switch-root.service.patch +Patch81: 0081-dracut.sh-for-include-copy-also-the-symbolic-links.patch +Patch82: 0082-install-dracut-install.c-check-for-empty-or-destdir.patch BuildRequires: dash bash git @@ -426,6 +437,14 @@ rm -rf $RPM_BUILD_ROOT %dir /var/lib/dracut/overlay %changelog +* Wed Jul 11 2012 Harald Hoyer 020-83.git20120711 +- more systemd journal fixes +- nfs module fix +- install also /lib/modprobe.d/* +- fixed dracut-shutdown service +- safeguards for dracut-install +- for --include also copy symlinks + * Tue Jul 10 2012 Harald Hoyer 020-72.git20120710 - stop journal rather than restart - copy over dracut services to /run/systemd/system