[dracut/f16] do not carry over initramfs udev rules Resolves: rhbz#734096

Harald Hoyer harald at fedoraproject.org
Tue Sep 20 07:47:47 UTC 2011


commit 5ee11d717e1c3f974e6eff92fcabd8794156a5d9
Author: Harald Hoyer <harald at redhat.com>
Date:   Tue Sep 20 09:47:29 2011 +0200

    do not carry over initramfs udev rules
    Resolves: rhbz#734096

 ...0dmsquash-live-do-not-symlink-to-dev-live.patch |   27 ++++++++++
 ...9base-init-remove-dev-root-helper-symlink.patch |   16 ++++++
 ...o-not-use-run-udev-rules.d-for-udev-rules.patch |   54 ++++++++++++++++++++
 dracut.spec                                        |   13 ++++-
 4 files changed, 109 insertions(+), 1 deletions(-)
---
diff --git a/0039-90dmsquash-live-do-not-symlink-to-dev-live.patch b/0039-90dmsquash-live-do-not-symlink-to-dev-live.patch
new file mode 100644
index 0000000..29dd0c0
--- /dev/null
+++ b/0039-90dmsquash-live-do-not-symlink-to-dev-live.patch
@@ -0,0 +1,27 @@
+From e41e5b78c6ff62797e1da5655d6acd101ddf2ab3 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Mon, 19 Sep 2011 12:20:11 +0200
+Subject: [PATCH] 90dmsquash-live: do not symlink to /dev/live
+
+/dev/live should not be used anyway
+---
+ .../90dmsquash-live/dmsquash-live-genrules.sh      |    6 ------
+ 1 files changed, 0 insertions(+), 6 deletions(-)
+
+diff --git a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
+index ce1ca82..d6d0aa3 100755
+--- a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
++++ b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
+@@ -4,12 +4,6 @@
+ case "$root" in
+   live:/dev/*)
+     {
+-        printf 'KERNEL=="%s", SYMLINK+="live"\n' \
+-            ${root#live:/dev/}
+-        printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
+-            ${root#live:/dev/}
+-    } >> $UDEVRULESD/99-live-mount.rules
+-    {
+         printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
+             ${root#live:/dev/}
+         printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
diff --git a/0040-99base-init-remove-dev-root-helper-symlink.patch b/0040-99base-init-remove-dev-root-helper-symlink.patch
new file mode 100644
index 0000000..5dcfddb
--- /dev/null
+++ b/0040-99base-init-remove-dev-root-helper-symlink.patch
@@ -0,0 +1,16 @@
+
+Any tool relying on /dev/root has to be fixed.
+Backport of dracut git commit 6d82a0470e7e340eb0353ecc3c524ded2e286e18
+
+--- dracut-013/modules.d/99base/init.orig	2011-09-20 09:43:02.000000000 +0200
++++ dracut-013/modules.d/99base/init	2011-09-20 09:44:18.000000000 +0200
+@@ -447,6 +447,9 @@
+ 
+ wait_for_loginit
+ 
++# remove helper symlink
++[ -h /dev/root ] && rm -f /dev/root
++
+ info "Switching root"
+ 
+ unset PS4
diff --git a/0041-Do-not-use-run-udev-rules.d-for-udev-rules.patch b/0041-Do-not-use-run-udev-rules.d-for-udev-rules.patch
new file mode 100644
index 0000000..e975b5a
--- /dev/null
+++ b/0041-Do-not-use-run-udev-rules.d-for-udev-rules.patch
@@ -0,0 +1,54 @@
+From ca8d4e8933e6124c2a0cf0e37f0296b80976ab33 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald at redhat.com>
+Date: Mon, 19 Sep 2011 12:21:51 +0200
+Subject: [PATCH] Do not use /run/udev/rules.d for udev rules
+
+for rules, which should not be called in the real root.
+
+Stale rules can cause this:
+https://bugzilla.redhat.com/show_bug.cgi?id=734096
+---
+ .../90dmsquash-live/dmsquash-live-genrules.sh      |    2 +-
+ modules.d/95resume/resume-genrules.sh              |    2 +-
+ modules.d/95rootfs-block/block-genrules.sh         |    2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
+index d6d0aa3..aa0654b 100755
+--- a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
++++ b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
+@@ -8,7 +8,7 @@ case "$root" in
+             ${root#live:/dev/}
+         printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
+             ${root#live:/dev/}
+-    } >> $UDEVRULESD/99-live-squash.rules
++    } >> /etc/udev/rules.d/99-live-squash.rules
+     echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
+   ;;
+   live:*)
+diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
+index 06b9544..e1afc26 100755
+--- a/modules.d/95resume/resume-genrules.sh
++++ b/modules.d/95resume/resume-genrules.sh
+@@ -17,7 +17,7 @@ if [ -n "$resume" ]; then
+             ${resume#/dev/};
+         printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
+             ${resume#/dev/};
+-    } >> $UDEVRULESD/99-resume-link.rules
++    } >> /etc/udev/rules.d/99-resume-link.rules
+ 
+     {
+         if [ -x /usr/sbin/resume ]; then
+diff --git a/modules.d/95rootfs-block/block-genrules.sh b/modules.d/95rootfs-block/block-genrules.sh
+index 4a50aac..a2310a0 100755
+--- a/modules.d/95rootfs-block/block-genrules.sh
++++ b/modules.d/95rootfs-block/block-genrules.sh
+@@ -8,7 +8,7 @@ if [ "${root%%:*}" = "block" ]; then
+             ${root#block:/dev/}
+         printf 'SYMLINK=="%s", SYMLINK+="root"\n' \
+             ${root#block:/dev/}
+-    } >> $UDEVRULESD/99-root.rules
++    } >> /etc/udev/rules.d/99-root.rules
+ 
+     printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
+         "${root#block:}" "${root#block:}" > $hookdir/initqueue/settled/blocksymlink.sh
diff --git a/dracut.spec b/dracut.spec
index 81339a7..55ea0bf 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -8,7 +8,7 @@
 
 Name: dracut
 Version: 013
-Release: 8%{?dist}
+Release: 9%{?dist}
 
 Summary: Initramfs generator using udev
 %if 0%{?fedora} || 0%{?rhel} > 6
@@ -32,6 +32,9 @@ Patch27: 0027-95udev-rules-add-input_id.patch
 Patch34: 0034-99base-init-do-not-fail-when-importing-the-original-.patch
 Patch37: 0037-dmsquash-live-root-use-blkid-to-determine-fstype-of-.patch
 Patch38: 0038-dmsquash-live-root-load-filesystem-modules-before-mo.patch
+Patch39: 0039-90dmsquash-live-do-not-symlink-to-dev-live.patch
+Patch40: 0040-99base-init-remove-dev-root-helper-symlink.patch
+Patch41: 0041-Do-not-use-run-udev-rules.d-for-udev-rules.patch
 
 BuildArch: noarch
 BuildRequires: dash bash
@@ -174,6 +177,10 @@ This package contains tools to assemble the local initrd and host configuration.
 %patch34 -p1
 %patch37 -p1
 %patch38 -p1
+%patch39 -p1
+%patch40 -p1
+%patch41 -p1
+
 %build
 make
 
@@ -311,6 +318,10 @@ rm -rf $RPM_BUILD_ROOT
 %dir /var/lib/dracut/overlay
 
 %changelog
+* Tue Sep 20 2011 Harald Hoyer <harald at redhat.com> 013-9
+- do not carry over initramfs udev rules
+Resolves: rhbz#734096
+
 * Fri Sep 02 2011 Harald Hoyer <harald at redhat.com> 013-8
 - hopefully fixed one part of a loop/udev and loop/mount race
 Resolves: rhbz#735199


More information about the scm-commits mailing list