dracut-020-64.git20120709

- fixed plymouth install
- fixed resume
- fixed dhcp
- no dracut systemd services installed in the system
This commit is contained in:
Harald Hoyer 2012-07-09 17:26:31 +02:00
parent c671e470fa
commit 89b080e276
8 changed files with 826 additions and 4 deletions

View File

@ -0,0 +1,32 @@
From d6e8280cd83a08f1b224fa4745de4e3b6f5baa4c Mon Sep 17 00:00:00 2001
From: Dave Young <dyoung@redhat.com>
Date: Mon, 9 Jul 2012 14:57:11 +0800
Subject: [PATCH] 02caps: do not create /bin/sh link
02caps: do not create /bin/sh link
caps.sh use !/bin/bash explictly, so no need to ln -sf bash /bin/sh
OTOH, 00dash will create the symlink /bin/sh, 99base will create it if
there's no /bin/sh symlink. It looks bad to creat /bin/sh in other modules.
If a script want to use bash as command interpreter it should use !/bin/bash
or !/bin/sh in case dash is not installed.
Signed-off-by: Dave Young <dyoung@redhat.com>
---
modules.d/02caps/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/02caps/module-setup.sh b/modules.d/02caps/module-setup.sh
index 6ecb231..c9d94ee 100755
--- a/modules.d/02caps/module-setup.sh
+++ b/modules.d/02caps/module-setup.sh
@@ -14,6 +14,6 @@ install() {
inst_hook pre-pivot 00 "$moddir/caps.sh"
inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh
# capsh wants bash and we need bash also
- inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
+ inst /bin/bash
}

View File

@ -0,0 +1,33 @@
From a17fc9902e3ccd154765cbc8a1b7cc285072ad75 Mon Sep 17 00:00:00 2001
From: Dave Young <dyoung@redhat.com>
Date: Mon, 9 Jul 2012 14:56:35 +0800
Subject: [PATCH] dhclient initqueue hook fix
dhclient initqueue hook fix
setup_net is scheduled in initqueue, sometimes it does not get chance to run
So the default route will not be set properly
Add a check in initqueue/finished to resolve this issue.
Signed-off-by: Dave Young <dyoung@redhat.com>
---
modules.d/40network/dhclient-script.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
index 470444e..1500fe5 100755
--- a/modules.d/40network/dhclient-script.sh
+++ b/modules.d/40network/dhclient-script.sh
@@ -88,9 +88,11 @@ case $reason in
echo "setup_net $netif"
echo "source_hook initqueue/online $netif"
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
+ echo "> /tmp/setup_net_$netif.ok"
echo "rm -f $hookdir/initqueue/setup_net_$netif.sh"
} > $hookdir/initqueue/setup_net_$netif.sh
+ echo "[ -f /tmp/setup_net_$netif.ok ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
>/tmp/net.$netif.up
;;
*) echo "dhcp: $reason";;

View File

@ -0,0 +1,49 @@
From 2023d8eb5b1a92cb830059384f4935a42505eaaa Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 9 Jul 2012 12:41:56 +0200
Subject: [PATCH] Makefile: do not install service from 98systemd. They are
copied to /run
---
Makefile | 11 +----------
dracut.spec | 5 ++---
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index 07741d0..e20ba06 100644
--- a/Makefile
+++ b/Makefile
@@ -83,16 +83,7 @@ install: doc dracut-version.sh
ln -s dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
if [ -n "$(systemdsystemunitdir)" ]; then \
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
- for i in \
- modules.d/98systemd/dracut-initqueue.service \
- modules.d/98systemd/dracut-pre-pivot.service \
- modules.d/98systemd/dracut-pre-trigger.service \
- modules.d/98systemd/dracut-pre-udev.service \
- modules.d/98systemd/initrd-switch-root.service \
- modules.d/98systemd/initrd-switch-root.target \
- dracut-shutdown.service; do \
- install -m 0644 $$i $(DESTDIR)$(systemdsystemunitdir); \
- done; \
+ install -m 0644 dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir); \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants; \
ln -s ../dracut-shutdown.service \
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
diff --git a/dracut.spec b/dracut.spec
index 6be1c3d..c17860d 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -312,9 +312,8 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%dir %{_sharedstatedir}/initramfs
%if %{defined _unitdir}
-%{_unitdir}/*.service
-%{_unitdir}/*.target
-%{_unitdir}/*/*.service
+%{_unitdir}/dracut-shutdown.service
+%{_unitdir}/shutdown.target.wants/dracut-shutdown.service
%endif
%files network

View File

@ -0,0 +1,25 @@
From 3c1feedfd1e175119c26f0dd29e4c03eac1f1f7c Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Sat, 7 Jul 2012 16:48:01 +0100
Subject: [PATCH] plymouth: Use latest plymouth's populate script.
The latest plymouth no longer relies on dracut to provide functions
needed to install binaries/libs so the check for a variable name
no longer works and the old, built-in script is used instead thus
breaking the new drm and framebuffer plymouth module installation.
---
modules.d/50plymouth/module-setup.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
index 9cdcc63..10aa0da 100755
--- a/modules.d/50plymouth/module-setup.sh
+++ b/modules.d/50plymouth/module-setup.sh
@@ -65,7 +65,6 @@ installkernel() {
install() {
if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \
- || ! grep -q PLYMOUTH_POPULATE_SOURCE_FUNCTIONS /usr/libexec/plymouth/plymouth-populate-initrd \
|| [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
. "$moddir"/plymouth-populate-initrd.sh
else

View File

@ -0,0 +1,488 @@
From 27fa604418517c8e8a8e771ce6a804d4886e9f2f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 9 Jul 2012 15:30:15 +0200
Subject: [PATCH] test: export initdir
---
test/TEST-01-BASIC/test.sh | 6 +++---
test/TEST-02-SYSTEMD/test.sh | 6 +++---
test/TEST-03-USR-MOUNT/test.sh | 6 +++---
test/TEST-10-RAID/test.sh | 6 +++---
test/TEST-11-LVM/test.sh | 6 +++---
test/TEST-12-RAID-DEG/test.sh | 6 +++---
test/TEST-13-ENC-RAID-LVM/test.sh | 6 +++---
test/TEST-15-BTRFSRAID/test.sh | 6 +++---
test/TEST-16-DMSQUASH/test.sh | 4 ++--
test/TEST-20-NFS/test.sh | 6 +++---
test/TEST-30-ISCSI/test.sh | 8 ++++----
test/TEST-40-NBD/test.sh | 10 +++++-----
test/TEST-50-MULTINIC/test.sh | 6 +++---
test/old.TEST-14-IMSM/test.sh | 6 +++---
test/test-functions | 2 +-
15 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index 35e05bb..f8522e6 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -27,7 +27,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
mkdir -p $initdir
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
@@ -49,7 +49,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mkfs.ext3 poweroff cp umount sync
inst_hook initqueue 01 ./create-root.sh
@@ -77,7 +77,7 @@ test_setup() {
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh
index b535dbe..5a121c0 100755
--- a/test/TEST-02-SYSTEMD/test.sh
+++ b/test/TEST-02-SYSTEMD/test.sh
@@ -23,7 +23,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
mkdir -p $initdir
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
@@ -45,7 +45,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mkfs.ext3 poweroff cp umount
inst_hook initqueue 01 ./create-root.sh
@@ -73,7 +73,7 @@ test_setup() {
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh
index d966c3c..f3237d3 100755
--- a/test/TEST-03-USR-MOUNT/test.sh
+++ b/test/TEST-03-USR-MOUNT/test.sh
@@ -54,7 +54,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
mkdir -p $initdir
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
@@ -77,7 +77,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mkfs.btrfs btrfs poweroff cp umount sync
inst_hook initqueue 01 ./create-root.sh
@@ -112,7 +112,7 @@ test_setup() {
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
index ef6d0c2..d2b1921 100755
--- a/test/TEST-10-RAID/test.sh
+++ b/test/TEST-10-RAID/test.sh
@@ -25,7 +25,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
(mkdir -p "$initdir"; cd "$initdir"; mkdir -p dev sys proc etc var/run tmp run)
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
@@ -46,7 +46,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mke2fs poweroff cp umount
inst_hook initqueue 01 ./create-root.sh
@@ -72,7 +72,7 @@ test_setup() {
grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh
index 034cc4c..61ebdfa 100755
--- a/test/TEST-11-LVM/test.sh
+++ b/test/TEST-11-LVM/test.sh
@@ -23,7 +23,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient
@@ -44,7 +44,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mke2fs poweroff cp umount
inst_hook initqueue 01 ./create-root.sh
@@ -66,7 +66,7 @@ test_setup() {
-initrd $TESTDIR/initramfs.makeroot || return 1
grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh
index c6038bd..05e5f8a 100755
--- a/test/TEST-12-RAID-DEG/test.sh
+++ b/test/TEST-12-RAID-DEG/test.sh
@@ -58,7 +58,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient
@@ -78,7 +78,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mke2fs poweroff cp umount dd grep
inst_hook initqueue 01 ./create-root.sh
@@ -106,7 +106,7 @@ test_setup() {
grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
eval $(grep --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2)
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh
index 658de8f..f0f7d34 100755
--- a/test/TEST-13-ENC-RAID-LVM/test.sh
+++ b/test/TEST-13-ENC-RAID-LVM/test.sh
@@ -59,7 +59,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient
@@ -79,7 +79,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mke2fs poweroff cp umount grep
inst_hook initqueue 01 ./create-root.sh
@@ -108,7 +108,7 @@ test_setup() {
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh
index 5918b5e..61ccae3 100755
--- a/test/TEST-15-BTRFSRAID/test.sh
+++ b/test/TEST-15-BTRFSRAID/test.sh
@@ -25,7 +25,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient
@@ -45,7 +45,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mkfs.btrfs poweroff cp umount
inst_hook initqueue 01 ./create-root.sh
@@ -74,7 +74,7 @@ test_setup() {
grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
index 5cd9986..4dc133c 100755
--- a/test/TEST-16-DMSQUASH/test.sh
+++ b/test/TEST-16-DMSQUASH/test.sh
@@ -29,7 +29,7 @@ test_run() {
test_setup() {
mkdir -p $TESTDIR/overlay
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
@@ -47,7 +47,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/root-source
+ export initdir=$TESTDIR/root-source
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient \
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index 57bf512..a44f6c0 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -217,7 +217,7 @@ test_setup() {
# Detect lib paths
(
- initdir=$TESTDIR/mnt
+ export initdir=$TESTDIR/mnt
. $basedir/dracut-functions.sh
for _f in modules.builtin.bin modules.builtin; do
@@ -282,7 +282,7 @@ test_setup() {
# Make client root inside server root
(
- initdir=$TESTDIR/mnt/nfs/client
+ export initdir=$TESTDIR/mnt/nfs/client
. $basedir/dracut-functions.sh
dracut_install sh shutdown poweroff stty cat ps ln ip \
@@ -325,7 +325,7 @@ test_setup() {
# Make an overlay with needed tools for the test harness
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
mkdir $TESTDIR/overlay
dracut_install poweroff shutdown
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
index 8c577f0..c5dba80 100755
--- a/test/TEST-30-ISCSI/test.sh
+++ b/test/TEST-30-ISCSI/test.sh
@@ -102,7 +102,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
. $basedir/dracut-functions.sh
dracut_install sh shutdown poweroff stty cat ps ln ip \
mount dmesg mkdir cp ping grep
@@ -118,7 +118,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mkfs.ext3 poweroff cp umount
inst_hook initqueue 01 ./create-root.sh
@@ -153,7 +153,7 @@ test_setup() {
grep -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1
rm $TESTDIR/client.img
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
@@ -173,7 +173,7 @@ test_setup() {
kernel=$KVERSION
(
- initdir=$TESTDIR/mnt
+ export initdir=$TESTDIR/mnt
. $basedir/dracut-functions.sh
(
cd "$initdir";
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
index f5465b6..94efb8a 100755
--- a/test/TEST-40-NBD/test.sh
+++ b/test/TEST-40-NBD/test.sh
@@ -190,7 +190,7 @@ make_encrypted_root() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
. $basedir/dracut-functions.sh
mkdir -p "$initdir"
(cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
@@ -208,7 +208,7 @@ make_encrypted_root() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install mke2fs poweroff cp umount tune2fs
inst_hook initqueue 01 ./create-root.sh
@@ -244,7 +244,7 @@ make_client_root() {
kernel=$KVERSION
(
- initdir=$TESTDIR/mnt
+ export initdir=$TESTDIR/mnt
. $basedir/dracut-functions.sh
mkdir -p "$initdir"
(cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
@@ -278,7 +278,7 @@ make_server_root() {
kernel=$KVERSION
(
- initdir=$TESTDIR/mnt
+ export initdir=$TESTDIR/mnt
. $basedir/dracut-functions.sh
mkdir -p "$initdir"
(
@@ -323,7 +323,7 @@ test_setup() {
# Make the test image
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
index a96669e..74f10d8 100755
--- a/test/TEST-50-MULTINIC/test.sh
+++ b/test/TEST-50-MULTINIC/test.sh
@@ -132,7 +132,7 @@ test_setup() {
sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
(
- initdir=$TESTDIR/mnt
+ export initdir=$TESTDIR/mnt
. $basedir/dracut-functions.sh
(
@@ -197,7 +197,7 @@ test_setup() {
# Make client root inside server root
(
- initdir=$TESTDIR/mnt/nfs/client
+ export initdir=$TESTDIR/mnt/nfs/client
. $basedir/dracut-functions.sh
dracut_install sh shutdown poweroff stty cat ps ln ip \
mount dmesg mkdir cp ping grep ls
@@ -236,7 +236,7 @@ test_setup() {
# Make an overlay with needed tools for the test harness
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/old.TEST-14-IMSM/test.sh b/test/old.TEST-14-IMSM/test.sh
index 5b9438e..cd2d715 100755
--- a/test/old.TEST-14-IMSM/test.sh
+++ b/test/old.TEST-14-IMSM/test.sh
@@ -57,7 +57,7 @@ test_setup() {
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
- initdir=$TESTDIR/overlay/source
+ export initdir=$TESTDIR/overlay/source
. $basedir/dracut-functions.sh
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
mount dmesg ifconfig dhclient mkdir cp ping dhclient
@@ -78,7 +78,7 @@ test_setup() {
# second, install the files needed to make the root filesystem
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install sfdisk mke2fs poweroff cp umount
inst_hook initqueue 01 ./create-root.sh
@@ -104,7 +104,7 @@ test_setup() {
-initrd $TESTDIR/initramfs.makeroot || return 1
grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
(
- initdir=$TESTDIR/overlay
+ export initdir=$TESTDIR/overlay
. $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
diff --git a/test/test-functions b/test/test-functions
index 451837f..10d78ed 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -6,7 +6,7 @@ export PATH
[[ -e .testdir ]] && . .testdir
if [[ -z "$TESTDIR" ]] || [[ ! -d "$TESTDIR" ]]; then
- TESTDIR=$(mktemp -d -t dracut-test.XXXXXX)
+ TESTDIR=$(mktemp -d --tmpdir="/var/tmp" -t dracut-test.XXXXXX)
fi
echo "TESTDIR=\"$TESTDIR\"" > .testdir
export TESTDIR

View File

@ -0,0 +1,120 @@
From 4eafdbdbe8ee3486ae96bdc6b5fa34112064a3ea Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 9 Jul 2012 16:28:47 +0200
Subject: [PATCH] test: new test TEST-99-RPM
This test installs the dracut rpm together with the kernel in an
installroot. rpm -Va and rpm -qf are used, to ensure nothing modified
files in the real root.
---
test/TEST-99-RPM/Makefile | 10 ++++++
test/TEST-99-RPM/test.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+)
create mode 100644 test/TEST-99-RPM/Makefile
create mode 100755 test/TEST-99-RPM/test.sh
diff --git a/test/TEST-99-RPM/Makefile b/test/TEST-99-RPM/Makefile
new file mode 100644
index 0000000..5513c52
--- /dev/null
+++ b/test/TEST-99-RPM/Makefile
@@ -0,0 +1,10 @@
+all:
+ @make -s --no-print-directory -C ../.. clean all rpm
+ @basedir=../.. testdir=../ ./test.sh --all
+setup:
+ @make --no-print-directory -C ../.. clean rpm
+ @basedir=../.. testdir=../ ./test.sh --setup
+clean:
+ @basedir=../.. testdir=../ ./test.sh --clean
+run:
+ @basedir=../.. testdir=../ ./test.sh --run
diff --git a/test/TEST-99-RPM/test.sh b/test/TEST-99-RPM/test.sh
new file mode 100755
index 0000000..25c1895
--- /dev/null
+++ b/test/TEST-99-RPM/test.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+TEST_DESCRIPTION="rpm integrity after dracut and kernel install"
+$TESTDIR
+
+test_run() {
+ set -x
+ export rootdir=$TESTDIR/root
+
+ mkdir -p $rootdir
+
+ mkdir -p "$rootdir/proc"
+ mkdir -p "$rootdir/sys"
+ mkdir -p "$rootdir/dev"
+
+ mount --bind /proc "$rootdir/proc"
+ mount --bind /sys "$rootdir/sys"
+ mount -t devtmpfs devtmpfs "$rootdir/dev"
+
+ yum --nogpgcheck --releasever=/ --installroot "$rootdir"/ install -y \
+ yum \
+ passwd \
+ rootfiles \
+ systemd \
+ kernel \
+ fedora-release \
+ device-mapper-multipath \
+ lvm2 \
+ mdadm \
+ bash \
+ iscsi-initiator-utils \
+ $basedir/dracut-[0-9]*.$(arch).rpm \
+ $basedir/dracut-network-[0-9]*.$(arch).rpm
+
+ cat >"$rootdir"/test.sh <<EOF
+#!/bin/bash
+set -x
+export LC_MESSAGES=C
+rpm -Va &> /test.output
+find / -xdev -type f -not -path '/var/*' \
+ -not -path '/usr/lib/modules/*/modules.*' \
+ -not -path '/etc/*-' \
+ -not -path '/etc/.pwd.lock' \
+ -not -path '/run/mount/utab' \
+ -not -path '/test.sh' \
+ -not -path '/test.output' \
+ -not -path '/etc/nsswitch.conf.bak' \
+ -not -path '/etc/iscsi/initiatorname.iscsi' \
+ -not -path '/dev/null' \
+ -exec rpm -qf '{}' ';' | \
+ fgrep 'not owned' &> /test.output
+exit
+EOF
+
+ chmod 0755 "$rootdir/test.sh"
+
+ chroot "$rootdir" /test.sh
+
+ if [[ -s "$rootdir"/test.output ]]; then
+ failed=1
+ echo TEST Failed >&2
+ cat "$rootdir"/test.output >&2
+ fi
+
+ umount "$rootdir/proc"
+ umount "$rootdir/sys"
+ umount "$rootdir/dev"
+
+ [[ $failed ]] && return 1
+ return 0
+
+}
+
+test_setup() {
+ return 0
+}
+
+test_cleanup() {
+ return 0
+}
+
+. $testdir/test-functions

View File

@ -0,0 +1,63 @@
From 450b5f336d1f433d333b78979388aa2477bc487e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 9 Jul 2012 17:06:51 +0200
Subject: [PATCH] resume: move resume process to initqueue
---
modules.d/95resume/parse-resume.sh | 2 ++
modules.d/95resume/resume-genrules.sh | 14 +++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules.d/95resume/parse-resume.sh b/modules.d/95resume/parse-resume.sh
index 32680c3..b460a16 100755
--- a/modules.d/95resume/parse-resume.sh
+++ b/modules.d/95resume/parse-resume.sh
@@ -15,6 +15,8 @@ case "$resume" in
resume="/dev/disk/by-label/${resume#LABEL=}" ;;
UUID=*) \
resume="/dev/disk/by-uuid/${resume#UUID=}" ;;
+ PARTUUID=*) \
+ resume="/dev/disk/by-partuuid/${resume#PARTUUID=}" ;;
esac
if splash=$(getarg splash=); then
diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
index ee4eacb..34511d7 100755
--- a/modules.d/95resume/resume-genrules.sh
+++ b/modules.d/95resume/resume-genrules.sh
@@ -21,18 +21,18 @@ if [ -n "$resume" ]; then
{
if [ -x /usr/sbin/resume ]; then
- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/usr/sbin/resume %s '%s'\"\n" \
+ printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \
${resume#/dev/} "$a_splash" "$resume";
- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/usr/sbin/resume %s '%s'\"\n" \
+ printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \
${resume#/dev/} "$a_splash" "$resume";
fi
- printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
+ printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
${resume#/dev/};
- printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
+ printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
${resume#/dev/};
} >> /etc/udev/rules.d/99-resume.rules
- printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \
+ printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; udevadm settle; }\n' \
"$resume" "$resume" >> $hookdir/initqueue/settled/resume.sh
printf 'warn "Cancelling resume operation. Device not found."; cancel_wait_for_dev /dev/resume; rm "$job" "%s/initqueue/settled/resume.sh";' \
@@ -43,9 +43,9 @@ if [ -n "$resume" ]; then
elif ! getarg noresume; then
{
if [ -x /usr/sbin/resume ]; then
- printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/usr/sbin/resume %s '\$tempnode'\"\n" "$a_splash"
+ printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '\$tempnode'\"\n" "$a_splash"
fi
echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \
- " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
+ " RUN+=\"/sbin/initqueue /bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
} >> /etc/udev/rules.d/99-resume.rules
fi

View File

@ -10,7 +10,7 @@
Name: dracut Name: dracut
Version: 020 Version: 020
Release: 57.git20120709%{?dist} Release: 64.git20120709%{?dist}
Summary: Initramfs generator using udev Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel} %if 0%{?fedora} || 0%{?rhel}
@ -85,6 +85,13 @@ Patch53: 0053-dracut.sh-corrected-error-messages-if-mktemp-failed.patch
Patch54: 0054-require-systemd-186.patch Patch54: 0054-require-systemd-186.patch
Patch55: 0055-systemd-udev-trigger.service-and-systemd-udev-settle.patch Patch55: 0055-systemd-udev-trigger.service-and-systemd-udev-settle.patch
Patch56: 0056-TEST-30-ISCSI-convert-to-ext3.patch Patch56: 0056-TEST-30-ISCSI-convert-to-ext3.patch
Patch57: 0057-02caps-do-not-create-bin-sh-link.patch
Patch58: 0058-dhclient-initqueue-hook-fix.patch
Patch59: 0059-Makefile-do-not-install-service-from-98systemd.-They.patch
Patch60: 0060-plymouth-Use-latest-plymouth-s-populate-script.patch
Patch61: 0061-test-export-initdir.patch
Patch62: 0062-test-new-test-TEST-99-RPM.patch
Patch63: 0063-resume-move-resume-process-to-initqueue.patch
BuildRequires: dash bash git BuildRequires: dash bash git
@ -369,9 +376,8 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log %attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%dir %{_sharedstatedir}/initramfs %dir %{_sharedstatedir}/initramfs
%if %{defined _unitdir} %if %{defined _unitdir}
%{_unitdir}/*.service %{_unitdir}/dracut-shutdown.service
%{_unitdir}/*.target %{_unitdir}/shutdown.target.wants/dracut-shutdown.service
%{_unitdir}/*/*.service
%endif %endif
%files network %files network
@ -412,6 +418,12 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay %dir /var/lib/dracut/overlay
%changelog %changelog
* Mon Jul 09 2012 Harald Hoyer <harald@redhat.com> 020-64.git20120709
- fixed plymouth install
- fixed resume
- fixed dhcp
- no dracut systemd services installed in the system
* Mon Jul 09 2012 Harald Hoyer <harald@redhat.com> 020-57.git20120709 * Mon Jul 09 2012 Harald Hoyer <harald@redhat.com> 020-57.git20120709
- more fixups for systemd-udevd unit renaming - more fixups for systemd-udevd unit renaming