From a66b474ff509e2ff034f4c90cf3639d19130654c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Jul 17 2012 09:13:39 +0000 Subject: dracut-020-96.git20120717 - disabled systemd in the initramfs, until it works correctly --- diff --git a/0084-watchdog-watchdog-stop.sh-forgot-to-add-script.patch b/0084-watchdog-watchdog-stop.sh-forgot-to-add-script.patch new file mode 100644 index 0000000..dcdb945 --- /dev/null +++ b/0084-watchdog-watchdog-stop.sh-forgot-to-add-script.patch @@ -0,0 +1,18 @@ +From 982032fd26d4b671f36a46c0a8564122cc7fde8a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 12 Jul 2012 07:01:27 +0200 +Subject: [PATCH] watchdog/watchdog-stop.sh: forgot to add script + +--- + modules.d/04watchdog/watchdog-stop.sh | 2 ++ + 1 file changed, 2 insertions(+) + create mode 100755 modules.d/04watchdog/watchdog-stop.sh + +diff --git a/modules.d/04watchdog/watchdog-stop.sh b/modules.d/04watchdog/watchdog-stop.sh +new file mode 100755 +index 0000000..91d45d6 +--- /dev/null ++++ b/modules.d/04watchdog/watchdog-stop.sh +@@ -0,0 +1,2 @@ ++#!/bin/sh ++[ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog diff --git a/0085-systemd-initrd-switch-root.service-add-some-more-dep.patch b/0085-systemd-initrd-switch-root.service-add-some-more-dep.patch new file mode 100644 index 0000000..7e1f2af --- /dev/null +++ b/0085-systemd-initrd-switch-root.service-add-some-more-dep.patch @@ -0,0 +1,31 @@ +From e6bec9b793314d248085e7dd50d9d79d9a01486e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 12 Jul 2012 08:56:17 +0200 +Subject: [PATCH] systemd/initrd-switch-root.service: add some more + dependencies + +--- + modules.d/98systemd/initrd-switch-root.service | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/98systemd/initrd-switch-root.service b/modules.d/98systemd/initrd-switch-root.service +index e38f04d..f9fd10b 100644 +--- a/modules.d/98systemd/initrd-switch-root.service ++++ b/modules.d/98systemd/initrd-switch-root.service +@@ -12,14 +12,14 @@ ConditionPathExists=/etc/initrd-release + OnFailure=emergency.service + After=initrd-switch-root.target + Before=systemd-journal-flush.service ++Before=sysinit.target local-fs.target swap.target emergency.service emergency.target + + [Service] + Type=oneshot + EnvironmentFile=/run/initramfs/switch-root.conf + # we have to use "--force" here, otherwise systemd would umount /run + ExecStart=/usr/bin/systemctl --force switch-root ${NEWROOT} ${NEWINIT} +-ExecStopPost=-/usr/bin/systemctl stop systemd-journald.service +-ExecStopPost=-/bin/rm -f /run/initramfs/switch-root.conf ++ExecStopPost=-/usr/bin/systemctl stop systemd-journald.service ; /bin/rm -f /run/initramfs/switch-root.conf + StandardInput=null + StandardOutput=null + StandardError=null diff --git a/0086-systemd-service-to-run.sh-do-not-copy-the-target-sub.patch b/0086-systemd-service-to-run.sh-do-not-copy-the-target-sub.patch new file mode 100644 index 0000000..43111a3 --- /dev/null +++ b/0086-systemd-service-to-run.sh-do-not-copy-the-target-sub.patch @@ -0,0 +1,20 @@ +From f31049c17f76048799017de52cb65c8906070b3e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 12 Jul 2012 08:56:36 +0200 +Subject: [PATCH] systemd/service-to-run.sh: do not copy the target subdirs + +--- + modules.d/98systemd/service-to-run.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/98systemd/service-to-run.sh b/modules.d/98systemd/service-to-run.sh +index 797958e..e09acc5 100755 +--- a/modules.d/98systemd/service-to-run.sh ++++ b/modules.d/98systemd/service-to-run.sh +@@ -1,4 +1,5 @@ + #!/bin/sh + mkdir -p /run/systemd/system/ +-cp -a -t /run/systemd/system/ /etc/systemd/system/* ++cp -d -t /run/systemd/system/ /etc/systemd/system/* ++exit 0 + diff --git a/0087-test-TEST-04-FULL-SYSTEMD-default-to-basic.target-an.patch b/0087-test-TEST-04-FULL-SYSTEMD-default-to-basic.target-an.patch new file mode 100644 index 0000000..81e4542 --- /dev/null +++ b/0087-test-TEST-04-FULL-SYSTEMD-default-to-basic.target-an.patch @@ -0,0 +1,114 @@ +From 3d115217e4db6fc54c9cda87088f3fb212285158 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 12 Jul 2012 08:59:43 +0200 +Subject: [PATCH] test/TEST-04-FULL-SYSTEMD: default to basic.target and + output more debug + +--- + test/TEST-04-FULL-SYSTEMD/test-init.sh | 13 ++++++++++++- + test/TEST-04-FULL-SYSTEMD/test.sh | 19 ++++++++++++------- + 2 files changed, 24 insertions(+), 8 deletions(-) + +diff --git a/test/TEST-04-FULL-SYSTEMD/test-init.sh b/test/TEST-04-FULL-SYSTEMD/test-init.sh +index cc26017..d41f0b0 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test-init.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh +@@ -13,9 +13,19 @@ ismounted() { + return 1 + } + +-if ismounted /usr; then ++systemctl --failed --no-legend --no-pager > /failed ++ ++if ismounted /usr && [ -f /run/systemd/system/initrd-switch-root.service ] && [ ! -s /failed ]; then + echo "dracut-root-block-success" >/dev/sdc + fi ++ ++set -x ++ cat /proc/mounts ++ tree /run ++ dmesg ++ cat /failed ++set +x ++ + export TERM=linux + export PS1='initramfs-test:\w\$ ' + [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab +@@ -23,6 +33,7 @@ export PS1='initramfs-test:\w\$ ' + stty sane + echo "made it to the rootfs!" + if strstr "$CMDLINE" "rd.shell"; then ++# while sleep 1; do sleep 1;done + strstr "$(setsid --help)" "control" && CTTY="-c" + setsid $CTTY sh -i + fi +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index 921189f..9a679a7 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -6,7 +6,9 @@ KVERSION=${KVERSION-$(uname -r)} + + # Uncomment this to debug failures + #DEBUGFAIL="rd.shell rd.break" +- ++#DEBUGFAIL="rd.shell" ++#DEBUGOUT="quiet systemd.log_level=debug systemd.log_target=console loglevel=77 rd.info rd.debug" ++DEBUGOUT="loglevel=0 systemd.log_level=debug systemd.log_target=kmsg" + client_run() { + local test_name="$1"; shift + local client_opts="$*" +@@ -20,7 +22,7 @@ client_run() { + -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" \ ++ -append "root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + + if (($? != 0)); then +@@ -57,7 +59,7 @@ test_setup() { + 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 ++ for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run; do + if [ -L "/$d" ]; then + inst_symlink "/$d" + else +@@ -70,7 +72,8 @@ test_setup() { + + 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 ++ umount strace less setsid tree systemctl ++ + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do + [ -f ${_terminfodir}/l/linux ] && break + done +@@ -112,8 +115,8 @@ test_setup() { + cat >$initdir/etc/systemd/system/testsuite.target <$initdir/etc/systemd/system/testsuite.service < +Date: Thu, 12 Jul 2012 10:20:28 +0200 +Subject: [PATCH] kernel-modules/module-setup.sh: add hid_generic to kernel + modules + +--- + 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 1744e53..f309de8 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -43,7 +43,7 @@ installkernel() { + hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap omapdrm sdhci_dove ahci_platform pata_imx sata_mv + + # install keyboard support +- hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-logitech-dj hid-microsoft ehci-hcd ohci-hcd uhci-hcd xhci-hcd ++ hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-logitech-dj hid-microsoft ehci-hcd ohci-hcd uhci-hcd xhci-hcd hid_generic + # install unix socket support + hostonly='' instmods unix + instmods "=drivers/pcmcia" =ide "=drivers/usb/storage" diff --git a/0089-Fixes-for-systemd-187-which-does-the-right-thing-for.patch b/0089-Fixes-for-systemd-187-which-does-the-right-thing-for.patch new file mode 100644 index 0000000..bc8232b --- /dev/null +++ b/0089-Fixes-for-systemd-187-which-does-the-right-thing-for.patch @@ -0,0 +1,45 @@ +From 030ade759004cb2bf81148bfdcd0ef821f7bd429 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 16 Jul 2012 10:13:53 +0200 +Subject: [PATCH] Fixes for systemd-187, which does the right thing for + switch-root + +--- + dracut.spec | 2 +- + modules.d/98systemd/initrd-switch-root.service | 4 +--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index c17860d..0e853fd 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -84,7 +84,7 @@ Requires: file + Requires: udev > 166 + %if 0%{?fedora} || 0%{?rhel} > 6 + Requires: util-linux >= 2.21 +-Requires: systemd >= 186 ++Conflicts: systemd <= 187 + %else + Requires: util-linux-ng >= 2.21 + %endif +diff --git a/modules.d/98systemd/initrd-switch-root.service b/modules.d/98systemd/initrd-switch-root.service +index f9fd10b..7b59e15 100644 +--- a/modules.d/98systemd/initrd-switch-root.service ++++ b/modules.d/98systemd/initrd-switch-root.service +@@ -11,15 +11,13 @@ DefaultDependencies=no + ConditionPathExists=/etc/initrd-release + OnFailure=emergency.service + After=initrd-switch-root.target +-Before=systemd-journal-flush.service +-Before=sysinit.target local-fs.target swap.target emergency.service emergency.target + + [Service] + Type=oneshot + EnvironmentFile=/run/initramfs/switch-root.conf + # we have to use "--force" here, otherwise systemd would umount /run + ExecStart=/usr/bin/systemctl --force switch-root ${NEWROOT} ${NEWINIT} +-ExecStopPost=-/usr/bin/systemctl stop systemd-journald.service ; /bin/rm -f /run/initramfs/switch-root.conf ++ExecStopPost=-/bin/rm -f /run/initramfs/switch-root.conf + StandardInput=null + StandardOutput=null + StandardError=null diff --git a/0090-dracut.spec-add-suse-version-ifdefs.patch b/0090-dracut.spec-add-suse-version-ifdefs.patch new file mode 100644 index 0000000..636ffa6 --- /dev/null +++ b/0090-dracut.spec-add-suse-version-ifdefs.patch @@ -0,0 +1,64 @@ +From 7a1f355fb51426ec69002cf23ada0aea7fe285c7 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 16 Jul 2012 10:33:27 +0200 +Subject: [PATCH] dracut.spec: add suse version ifdefs + +--- + dracut.spec | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index 0e853fd..9108d1a 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -111,7 +111,7 @@ Provides: dracut-generic = %{version}-%{release} + This package requires everything which is needed to build a generic + all purpose initramfs with network support with dracut. + +-%if 0%{?fedora} || 0%{?rhel} >= 6 ++%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version} + %package fips + Summary: Dracut modules to build a dracut initramfs with an integrity check + Requires: %{name} = %{version}-%{release} +@@ -185,7 +185,7 @@ make install DESTDIR=$RPM_BUILD_ROOT \ + + echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh + +-%if 0%{?fedora} == 0 && 0%{?rhel} == 0 ++%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0 + rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips + rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni + %endif +@@ -210,7 +210,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log + touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log + mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs + +-%if 0%{?fedora} || 0%{?rhel} ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} + install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf + install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/40-fips.conf + %endif +@@ -258,11 +258,13 @@ rm -rf $RPM_BUILD_ROOT + %endif + %dir /etc/dracut.conf.d + %{_mandir}/man8/dracut.8* ++%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 + %{_mandir}/man8/mkinitrd.8* ++%{_mandir}/man1/lsinitrd.1* ++%endif + %{_mandir}/man7/dracut.kernel.7* + %{_mandir}/man7/dracut.cmdline.7* + %{_mandir}/man5/dracut.conf.5* +-%{_mandir}/man1/lsinitrd.1* + %{dracutlibdir}/modules.d/00bootchart + %{dracutlibdir}/modules.d/04watchdog + %{dracutlibdir}/modules.d/05busybox +@@ -329,7 +331,7 @@ rm -rf $RPM_BUILD_ROOT + %{dracutlibdir}/modules.d/45ifcfg + %{dracutlibdir}/modules.d/95znet + +-%if 0%{?fedora} || 0%{?rhel} ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} + %files fips + %defattr(-,root,root,0755) + %{dracutlibdir}/modules.d/01fips diff --git a/0091-dracut-functions.sh-output-more-info-if-dependency-m.patch b/0091-dracut-functions.sh-output-more-info-if-dependency-m.patch new file mode 100644 index 0000000..2d18c12 --- /dev/null +++ b/0091-dracut-functions.sh-output-more-info-if-dependency-m.patch @@ -0,0 +1,62 @@ +From 0f283709c9bbcdc064e1212c42173a3ff9552525 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 16 Jul 2012 12:21:56 +0200 +Subject: [PATCH] dracut-functions.sh: output more info, if dependency modules + are omitted + +--- + dracut-functions.sh | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 3f56316..306b93a 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -1024,7 +1024,10 @@ check_mount() { + + [[ $2 ]] || mods_checked_as_dep+=" $_mod " + +- strstr " $omit_dracutmodules " " $_mod " && return 1 ++ if strstr " $omit_dracutmodules " " $_mod "; then ++ dinfo "Dracut module '$_mod' will not be installed, because it's in the list to be omitted!" ++ return 1 ++ fi + + if [ "${#host_fs_types[*]}" -gt 0 ]; then + module_check_mount $_mod || return 1 +@@ -1040,7 +1043,10 @@ check_mount() { + strstr " $force_add_dracutmodules " " $_moddep " || \ + force_add_dracutmodules+=" $_moddep " + # if a module we depend on fail, fail also +- check_module $_moddep || return 1 ++ if ! check_module $_moddep; then ++ derror "Dracut module '$_mod' depends on '$_moddep', which can't be installed" ++ return 1 ++ fi + done + + strstr " $mods_to_load " " $_mod " || \ +@@ -1067,7 +1073,10 @@ check_module() { + + [[ $2 ]] || mods_checked_as_dep+=" $_mod " + +- strstr " $omit_dracutmodules " " $_mod " && return 1 ++ if strstr " $omit_dracutmodules " " $_mod "; then ++ dinfo "Dracut module '$_mod' will not be installed, because it's in the list to be omitted!" ++ return 1 ++ fi + + if strstr " $dracutmodules $add_dracutmodules $force_add_dracutmodules" " $_mod "; then + if strstr " $force_add_dracutmodules" " $_mod"; then +@@ -1095,7 +1104,10 @@ check_module() { + strstr " $force_add_dracutmodules " " $_moddep " || \ + force_add_dracutmodules+=" $_moddep " + # if a module we depend on fail, fail also +- check_module $_moddep || return 1 ++ if ! check_module $_moddep; then ++ derror "Dracut module '$_mod' depends on '$_moddep', which can't be installed" ++ return 1 ++ fi + done + + strstr " $mods_to_load " " $_mod " || \ diff --git a/0092-Fix-fips-module-list.patch b/0092-Fix-fips-module-list.patch new file mode 100644 index 0000000..c5df148 --- /dev/null +++ b/0092-Fix-fips-module-list.patch @@ -0,0 +1,42 @@ +From 4ee59ab3ed59475923a1fed0a8a52f5a03799c93 Mon Sep 17 00:00:00 2001 +From: Milan Broz +Date: Mon, 16 Jul 2012 16:28:47 +0200 +Subject: [PATCH] Fix fips module list. + +If dracut is build only with fips/fips-aesni (no crypto module), +FIPS mode fails because of missing GCM modules. + +Just add proper modules to list (kernel have both maker as FIPS compliant already). + +Signed-off-by: Milan Broz +--- + modules.d/01fips/module-setup.sh | 2 +- + modules.d/02fips-aesni/module-setup.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index 2d238fb..2517964 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -12,7 +12,7 @@ depends() { + + installkernel() { + local _fipsmodules _mod +- _fipsmodules="aead aes_generic xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr" ++ _fipsmodules="aead aes_generic xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr gcm ghash_generic" + _fipsmodules+=" des deflate ecb eseqiv hmac seqiv sha256 sha256_generic sha512 sha512_generic" + _fipsmodules+=" cryptomgr crypto_null tcrypt dm-mod dm-crypt" + +diff --git a/modules.d/02fips-aesni/module-setup.sh b/modules.d/02fips-aesni/module-setup.sh +index f8fb705..fb4010d 100755 +--- a/modules.d/02fips-aesni/module-setup.sh ++++ b/modules.d/02fips-aesni/module-setup.sh +@@ -12,7 +12,7 @@ depends() { + + installkernel() { + local _fipsmodules _mod +- _fipsmodules="aesni-intel" ++ _fipsmodules="aesni-intel ghash_clmulni_intel" + + mkdir -m 0755 -p "${initdir}/etc/modprobe.d" + diff --git a/0093-systemd-dracut-pre-pivot.service-force-clean-stop-of.patch b/0093-systemd-dracut-pre-pivot.service-force-clean-stop-of.patch new file mode 100644 index 0000000..135a340 --- /dev/null +++ b/0093-systemd-dracut-pre-pivot.service-force-clean-stop-of.patch @@ -0,0 +1,80 @@ +From a43f97c4e35d0d9c7e6e315e11c909e86936e1cc Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 17 Jul 2012 11:06:25 +0200 +Subject: [PATCH] systemd/dracut-pre-pivot.service: force clean stop of udevd + and cleanup-db + +--- + modules.d/98systemd/dracut-pre-pivot.service | 2 +- + modules.d/98systemd/dracut-pre-pivot.sh | 3 +++ + modules.d/98systemd/module-setup.sh | 4 ---- + modules.d/98systemd/udevadm-cleanup-db.service | 20 -------------------- + 4 files changed, 4 insertions(+), 25 deletions(-) + delete mode 100644 modules.d/98systemd/udevadm-cleanup-db.service + +diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service +index 61257cf..317b476 100644 +--- a/modules.d/98systemd/dracut-pre-pivot.service ++++ b/modules.d/98systemd/dracut-pre-pivot.service +@@ -16,7 +16,7 @@ ConditionPathExists=/etc/initrd-release + [Service] + Type=oneshot + ExecStart=-/bin/dracut-pre-pivot +-ExecStopPost=-/usr/bin/systemctl isolate initrd-switch-root.target ++ExecStopPost=-/usr/bin/systemctl --no-block isolate initrd-switch-root.target + StandardInput=null + StandardOutput=syslog + StandardError=syslog+console +diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh +index 31dded5..44afe54 100755 +--- a/modules.d/98systemd/dracut-pre-pivot.sh ++++ b/modules.d/98systemd/dracut-pre-pivot.sh +@@ -39,4 +39,7 @@ echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf + + getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root" + ++/usr/bin/udevadm control --exit || warn "/usr/bin/udevadm control --exit failed" ++/usr/bin/udevadm info --cleanup-db || warn "/usr/bin/udevadm info --cleanup-db failed" ++ + exit 0 +diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh +index 5cb236c..05faf87 100755 +--- a/modules.d/98systemd/module-setup.sh ++++ b/modules.d/98systemd/module-setup.sh +@@ -143,10 +143,6 @@ install() { + inst_simple "$moddir/dracut-pre-pivot.service" ${dracutsystemunitdir}/dracut-pre-pivot.service + ln -fs ../dracut-pre-pivot.service "${initdir}${dracutsystemunitdir}/basic.target.wants/dracut-pre-pivot.service" + +- inst_simple "$moddir/udevadm-cleanup-db.service" ${dracutsystemunitdir}/udevadm-cleanup-db.service +- mkdir -p "${initdir}${dracutsystemunitdir}/initrd-switch-root.target.requires" +- ln -fs ../udevadm-cleanup-db.service "${initdir}${dracutsystemunitdir}/initrd-switch-root.target.requires/udevadm-cleanup-db.service" +- + inst_script "$moddir/service-to-run.sh" "${systemdutildir}/system-generators/service-to-run" + } + +diff --git a/modules.d/98systemd/udevadm-cleanup-db.service b/modules.d/98systemd/udevadm-cleanup-db.service +deleted file mode 100644 +index 368a0dd..0000000 +--- a/modules.d/98systemd/udevadm-cleanup-db.service ++++ /dev/null +@@ -1,20 +0,0 @@ +-# This file is part of systemd. +-# +-# systemd is free software; you can redistribute it and/or modify it +-# under the terms of the GNU Lesser General Public License as published by +-# the Free Software Foundation; either version 2.1 of the License, or +-# (at your option) any later version. +- +-[Unit] +-Description=Cleanup udevd DB +-DefaultDependencies=no +-ConditionPathExists=/etc/initrd-release +-Conflicts=systemd-udevd.service systemd-udevd-control.socket systemd-udevd-kernel.socket +-Before=initrd-switch-root.service +- +-[Service] +-Type=oneshot +-ExecStart=-/usr/bin/udevadm info --cleanup-db +-StandardInput=null +-StandardOutput=null +-StandardError=null diff --git a/0094-systemd-initrd-switch-root.service-call-switch-root-.patch b/0094-systemd-initrd-switch-root.service-call-switch-root-.patch new file mode 100644 index 0000000..54bb820 --- /dev/null +++ b/0094-systemd-initrd-switch-root.service-call-switch-root-.patch @@ -0,0 +1,29 @@ +From 3780d7e44982b0e801622f5ad90ce0e80792b69e Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 17 Jul 2012 11:09:17 +0200 +Subject: [PATCH] systemd/initrd-switch-root.service: call switch-root with + --no-block + +--- + modules.d/98systemd/initrd-switch-root.service | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/98systemd/initrd-switch-root.service b/modules.d/98systemd/initrd-switch-root.service +index 7b59e15..7d1a648 100644 +--- a/modules.d/98systemd/initrd-switch-root.service ++++ b/modules.d/98systemd/initrd-switch-root.service +@@ -11,12 +11,13 @@ DefaultDependencies=no + ConditionPathExists=/etc/initrd-release + OnFailure=emergency.service + After=initrd-switch-root.target ++AllowIsolate=yes + + [Service] + Type=oneshot + EnvironmentFile=/run/initramfs/switch-root.conf + # we have to use "--force" here, otherwise systemd would umount /run +-ExecStart=/usr/bin/systemctl --force switch-root ${NEWROOT} ${NEWINIT} ++ExecStart=-/usr/bin/systemctl --no-block --force switch-root ${NEWROOT} ${NEWINIT} + ExecStopPost=-/bin/rm -f /run/initramfs/switch-root.conf + StandardInput=null + StandardOutput=null diff --git a/0095-dracut.conf.d-fedora.conf.example-disable-systemd-fo.patch b/0095-dracut.conf.d-fedora.conf.example-disable-systemd-fo.patch new file mode 100644 index 0000000..75e0735 --- /dev/null +++ b/0095-dracut.conf.d-fedora.conf.example-disable-systemd-fo.patch @@ -0,0 +1,20 @@ +From b94ae0561f4a431a33af167837b84dcb4dd06bde Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 17 Jul 2012 11:09:51 +0200 +Subject: [PATCH] dracut.conf.d/fedora.conf.example: disable systemd for now + +--- + dracut.conf.d/fedora.conf.example | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example +index 4cb1890..012bdd6 100644 +--- a/dracut.conf.d/fedora.conf.example ++++ b/dracut.conf.d/fedora.conf.example +@@ -9,5 +9,5 @@ prefix="/" + systemdutildir=/usr/lib/systemd + systemdsystemunitdir=/usr/lib/systemd/system + udevdir=/usr/lib/udev +-add_dracutmodules+=" systemd " ++#add_dracutmodules+=" systemd " + realinitpath="/usr/lib/systemd/systemd" diff --git a/dracut.spec b/dracut.spec index eed92f3..957653d 100644 --- a/dracut.spec +++ b/dracut.spec @@ -10,7 +10,7 @@ Name: dracut Version: 020 -Release: 84.git20120711%{?dist} +Release: 96.git20120717%{?dist} Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -112,6 +112,18 @@ 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 Patch83: 0083-systemd-initrd-switch-root.service-add-back-force-to.patch +Patch84: 0084-watchdog-watchdog-stop.sh-forgot-to-add-script.patch +Patch85: 0085-systemd-initrd-switch-root.service-add-some-more-dep.patch +Patch86: 0086-systemd-service-to-run.sh-do-not-copy-the-target-sub.patch +Patch87: 0087-test-TEST-04-FULL-SYSTEMD-default-to-basic.target-an.patch +Patch88: 0088-kernel-modules-module-setup.sh-add-hid_generic-to-ke.patch +Patch89: 0089-Fixes-for-systemd-187-which-does-the-right-thing-for.patch +Patch90: 0090-dracut.spec-add-suse-version-ifdefs.patch +Patch91: 0091-dracut-functions.sh-output-more-info-if-dependency-m.patch +Patch92: 0092-Fix-fips-module-list.patch +Patch93: 0093-systemd-dracut-pre-pivot.service-force-clean-stop-of.patch +Patch94: 0094-systemd-initrd-switch-root.service-call-switch-root-.patch +Patch95: 0095-dracut.conf.d-fedora.conf.example-disable-systemd-fo.patch BuildRequires: dash bash git @@ -168,7 +180,6 @@ Requires: file Requires: udev > 166 %if 0%{?fedora} || 0%{?rhel} > 6 Requires: util-linux >= 2.21 -Requires: systemd >= 186 %else Requires: util-linux-ng >= 2.21 %endif @@ -195,7 +206,7 @@ Provides: dracut-generic = %{version}-%{release} This package requires everything which is needed to build a generic all purpose initramfs with network support with dracut. -%if 0%{?fedora} || 0%{?rhel} >= 6 +%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version} %package fips Summary: Dracut modules to build a dracut initramfs with an integrity check Requires: %{name} = %{version}-%{release} @@ -269,7 +280,7 @@ make install DESTDIR=$RPM_BUILD_ROOT \ echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh -%if 0%{?fedora} == 0 && 0%{?rhel} == 0 +%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0 rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni %endif @@ -294,7 +305,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/40-fips.conf %endif @@ -342,11 +353,13 @@ rm -rf $RPM_BUILD_ROOT %endif %dir /etc/dracut.conf.d %{_mandir}/man8/dracut.8* +%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 %{_mandir}/man8/mkinitrd.8* +%{_mandir}/man1/lsinitrd.1* +%endif %{_mandir}/man7/dracut.kernel.7* %{_mandir}/man7/dracut.cmdline.7* %{_mandir}/man5/dracut.conf.5* -%{_mandir}/man1/lsinitrd.1* %{dracutlibdir}/modules.d/00bootchart %{dracutlibdir}/modules.d/04watchdog %{dracutlibdir}/modules.d/05busybox @@ -413,7 +426,7 @@ rm -rf $RPM_BUILD_ROOT %{dracutlibdir}/modules.d/45ifcfg %{dracutlibdir}/modules.d/95znet -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} %files fips %defattr(-,root,root,0755) %{dracutlibdir}/modules.d/01fips @@ -438,6 +451,9 @@ rm -rf $RPM_BUILD_ROOT %dir /var/lib/dracut/overlay %changelog +* Tue Jul 17 2012 Harald Hoyer 020-96.git20120717 +- disabled systemd in the initramfs, until it works correctly + * Wed Jul 11 2012 Harald Hoyer 020-84.git20120711 - add back "--force" to switch-root, otherwise systemd umounts /run