Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 437142 - sys-kernel/dracut-023 tries to use systemd when it is not installed or enabled
Summary: sys-kernel/dracut-023 tries to use systemd when it is not installed or enabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amadeusz Żołnowski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-04 09:20 UTC by Nikoli
Modified: 2012-10-07 15:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikoli 2012-10-04 09:20:18 UTC
$ grep -e systemctl -e systemd-cgls -e systemadm -e systemd -Ri /usr/lib64/dracut/
/usr/lib64/dracut/modules.d/90qemu/module-setup.sh:    if type -P systemd-detect-virt &>/dev/null; then
/usr/lib64/dracut/modules.d/90qemu/module-setup.sh:        vm=$(systemd-detect-virt --vm &>/dev/null)
/usr/lib64/dracut/modules.d/99base/module-setup.sh:    [ -x /lib/systemd/systemd-timestamp ] && inst /lib/systemd/systemd-timestamp
/usr/lib64/dracut/modules.d/99base/dracut-lib.sh:if [ -z "$DRACUT_SYSTEMD" ]; then
/usr/lib64/dracut/modules.d/99base/dracut-lib.sh:    if [ -n "$DRACUT_SYSTEMD" ]; then
/usr/lib64/dracut/modules.d/99base/dracut-lib.sh:        systemctl start emergency.service
/usr/lib64/dracut/modules.d/99base/init.sh:if [ -x /lib/systemd/systemd-timestamp ]; then
/usr/lib64/dracut/modules.d/99base/init.sh:    RD_TIMESTAMP=$(/lib/systemd/systemd-timestamp)
/usr/lib64/dracut/modules.d/99base/init.sh:/lib/systemd/systemd-udevd --daemon --resolve-names=never
/usr/lib64/dracut/modules.d/99base/init.sh:    while pidof systemd-udevd >/dev/null 2>&1; do
/usr/lib64/dracut/modules.d/99base/init.sh:        for pid in $(pidof systemd-udevd); do
/usr/lib64/dracut/modules.d/90crypt/parse-crypt.sh:            if [ -z "$DRACUT_SYSTEMD" ]; then
/usr/lib64/dracut/modules.d/90crypt/parse-crypt.sh:        if [ -z "$DRACUT_SYSTEMD" ]; then
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        $systemdutildir/system-generators/systemd-cryptsetup-generator \
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        $systemdutildir/system-generators/systemd-cryptsetup-generator \
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        $systemdutildir/systemd-cryptsetup \
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        $systemdsystemunitdir/systemd-ask-password-console.path \
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        $systemdsystemunitdir/systemd-ask-password-console.service \
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        $systemdsystemunitdir/cryptsetup.target \
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
/usr/lib64/dracut/modules.d/90crypt/module-setup.sh:        systemd-ask-password systemd-tty-ask-password-agent
/usr/lib64/dracut/modules.d/90crypt/crypt-run-generator.sh:/lib/systemd/system-generators/systemd-cryptsetup-generator
/usr/lib64/dracut/modules.d/90crypt/crypt-run-generator.sh:systemctl daemon-reload
/usr/lib64/dracut/modules.d/90crypt/crypt-run-generator.sh:systemctl start cryptsetup.target
/usr/lib64/dracut/modules.d/95rootfs-block/block-genrules.sh:    # if [ -d /lib/systemd/system/ ]; then
/usr/lib64/dracut/modules.d/95rootfs-block/block-genrules.sh:    #    } >/lib/systemd/system/${NEWROOT#/}.mount
/usr/lib64/dracut/modules.d/95rootfs-block/block-genrules.sh:    #    mkdir -p /lib/systemd/system/initrd-switch-root.target.requires
/usr/lib64/dracut/modules.d/95rootfs-block/block-genrules.sh:    #    ln -s ../${NEWROOT#/}.mount /lib/systemd/system/initrd-switch-root.target.requires/${NEWROOT#/}.mount
/usr/lib64/dracut/modules.d/95udev-rules/module-setup.sh:    [ -d ${initdir}/lib/systemd ] || mkdir -p ${initdir}/lib/systemd
/usr/lib64/dracut/modules.d/95udev-rules/module-setup.sh:    for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /sbin/udevd; do
/usr/lib64/dracut/modules.d/95udev-rules/module-setup.sh:        if ! [[ -f  ${initdir}/lib/systemd/systemd-udevd ]]; then
/usr/lib64/dracut/modules.d/95udev-rules/module-setup.sh:            ln -fs "$_i" ${initdir}/lib/systemd/systemd-udevd
/usr/lib64/dracut/modules.d/10i18n/module-setup.sh:    [ -x /lib/systemd/systemd-vconsole-setup ] && dracut_install /lib/systemd/systemd-vconsole-setup
/usr/lib64/dracut/modules.d/10i18n/parse-i18n.sh:if [ -n "$DRACUT_SYSTEMD" ]; then
/usr/lib64/dracut/modules.d/10i18n/console_init.sh:[ -n "$DRACUT_SYSTEMD" ] && exit 0
/usr/lib64/dracut/modules.d/10i18n/console_init.sh:if [ -x /lib/systemd/systemd-vconsole-setup ]; then
/usr/lib64/dracut/modules.d/10i18n/console_init.sh:    /lib/systemd/systemd-vconsole-setup "$@"
/usr/lib64/dracut/modules.d/90qemu-net/module-setup.sh:    if type -P systemd-detect-virt &>/dev/null; then
/usr/lib64/dracut/modules.d/90qemu-net/module-setup.sh:        vm=$(systemd-detect-virt --vm &>/dev/null)



Not all of these systemd commands are inside of checks like '[ -n "$DRACUT_SYSTEMD" ]'.
90crypt module:
'/usr/lib64/dracut/modules.d/90crypt/module-setup.sh' tries to install several systemd files without checking if systemd is enabled.

'/usr/lib64/dracut/modules.d/90crypt/crypt-run-generator.sh' is installed in initramfs as '/sbin/crypt-run-generator' and tries to use systemd without any checks:
/lib/systemd/system-generators/systemd-cryptsetup-generator
systemctl daemon-reload
systemctl start cryptsetup.target
Comment 1 Amadeusz Żołnowski (RETIRED) gentoo-dev 2012-10-07 13:47:57 UTC
I have checked all modules which use systemd binaries:

10i18n			ok
90crypt			fixed
90qemu			ok
90qemu-net		ok
95udev-rules		ok
98systemd		ok
99base			ok

Fix is going to be included in dracut-023-r1.ebuild today.
Comment 2 Amadeusz Żołnowski (RETIRED) gentoo-dev 2012-10-07 15:59:38 UTC
Thank you for the report!

+*dracut-023-r1 (07 Oct 2012)
+
+  07 Oct 2012; Amadeusz Żołnowski <aidecoe@gentoo.org>
+  +files/023-0001-dracut-functions.sh-find_binary-path-s.patch,
+  +files/023-0002-90crypt-call-systemd-commands-only-if-.patch,
+  +dracut-023-r1.ebuild:
+  Fixes for bug #436712, bug #437142 and bug #437270.
+
+  Thanks to Jonathan Callen <abcd@gentoo.org>, Nikoli <nikoli@lavabit.com> and
+  Alexander Tsoy <bugs+gentoo@puleglot.ru>.
+