]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
use systemd*dir variables everywhere
authorHarald Hoyer <harald@redhat.com>
Tue, 26 Mar 2013 15:19:00 +0000 (16:19 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 26 Mar 2013 15:19:00 +0000 (16:19 +0100)
dracut.conf.d/fedora.conf.example
dracut.sh
modules.d/10i18n/console_init.sh
modules.d/10i18n/module-setup.sh
modules.d/90mdraid/module-setup.sh
modules.d/95rootfs-block/block-genrules.sh
modules.d/95udev-rules/module-setup.sh
modules.d/99base/init.sh
modules.d/99base/module-setup.sh

index ba7857c8945421f4a5ddf6bdb627c1903d80542b..6389437f547854f05fe646e9695cab6485086d1f 100644 (file)
@@ -10,6 +10,7 @@ install_items+=" vi /etc/virc ps grep cat rm "
 prefix="/"
 systemdutildir=/usr/lib/systemd
 systemdsystemunitdir=/usr/lib/systemd/system
+systemdsystemconfdir=/etc/systemd/system
 udevdir=/usr/lib/udev
 add_dracutmodules+=" systemd "
 hostonly="yes"
index ecd323741b81a16b6c7b84307322f45d970892bb..5e9ea3ee29dc423fac547862612a7a4ed7f26ab4 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1067,6 +1067,15 @@ if [[ $kernel_only != yes ]]; then
         cat $f >> "${initdir}/etc/fstab"
     done
 
+    if [ -d ${initdir}/$systemdutildir ]; then
+        mkdir -p ${initdir}/etc/conf.d
+        {
+            echo "systemdutildir=\"$systemdutildir\""
+            echo "systemdsystemunitdir=\"$systemdsystemunitdir\""
+            echo "systemdsystemconfdir=\"$systemdsystemconfdir\""
+        } > ${initdir}/etc/conf.d/systemd.conf
+    fi
+
     if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then
         dinfo "*** Resolving executable dependencies ***"
         find "$initdir" -type f \
index 8817f9572a7b1e9e9f63abe0ba5dec4e672a5c9f..aef608a33b89f47e494053c411171b53eda3dfea 100755 (executable)
@@ -4,8 +4,8 @@
 
 [ -n "$DRACUT_SYSTEMD" ] && exit 0
 
-if [ -x /lib/systemd/systemd-vconsole-setup ]; then
-    /lib/systemd/systemd-vconsole-setup "$@"
+if [ -x $systemdutildir/systemd-vconsole-setup ]; then
+    $systemdutildir/systemd-vconsole-setup "$@"
 fi
 
 [ -e /etc/vconsole.conf ] && . /etc/vconsole.conf
index 469e45242b24d2cd99b2d0503faaa6fcb27ca559..fcd82820512f73441075b384cbcc2028f8a2001e 100755 (executable)
@@ -12,7 +12,7 @@ depends() {
 }
 
 install() {
-    [ -x /lib/systemd/systemd-vconsole-setup ] && dracut_install /lib/systemd/systemd-vconsole-setup
+    dracut_install -o $systemdutildir/systemd-vconsole-setup
     KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
     DEFAULT_FONT=LatArCyrHeb-16
     I18N_CONF="/etc/locale.conf"
index 70c27dd6568fbaaf77bf819861839052b581c902..8d63028db66584fe1bf42b7e551cffaffde102c9 100755 (executable)
@@ -88,8 +88,10 @@ install() {
     inst_hook shutdown 30 "$moddir/md-shutdown.sh"
     inst_script "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup
     inst_script "$moddir/mdraid_start.sh" /sbin/mdraid_start
-    if [ -e /lib/systemd/system/mdmon@.service ]; then
-        inst_simple /lib/systemd/system/mdmon@.service
+    if dracut_module_included "systemd"; then
+        if [ -e $systemdsystemunitdir/mdmon@.service ]; then
+            inst_simple $systemdsystemunitdir/mdmon@.service
+        fi
     fi
     inst_hook pre-shutdown 30 "$moddir/mdmon-pre-shutdown.sh"
 }
index 7f894ee28fa65f367148d37a25d23efa7dcd36df..1e6827abf3afeecdc5d89b1529ad0b27cfe4a44d 100755 (executable)
@@ -13,22 +13,5 @@ if [ "${root%%:*}" = "block" ]; then
     printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
         "${root#block:}" "${root#block:}" > $hookdir/initqueue/settled/blocksymlink.sh
 
-    # if [ -d /lib/systemd/system/ ]; then
-    #     echo "${root#block:} $NEWROOT ${fstype:-auto} ${rflags:-defaults} 1 1" >> /etc/fstab
-    #     {
-    #        echo '[Unit]'
-    #        echo 'Description=New Root File System'
-    #        echo 'DefaultDependencies=no'
-    #        echo 'Before=initrd-switch-root.service'
-    #        echo '[Mount]'
-    #        echo "What=${root#block:}"
-    #        echo "Where=$NEWROOT"
-
-    #    } >/lib/systemd/system/${NEWROOT#/}.mount
-
-    #    mkdir -p /lib/systemd/system/initrd-switch-root.target.requires
-    #    ln -s ../${NEWROOT#/}.mount /lib/systemd/system/initrd-switch-root.target.requires/${NEWROOT#/}.mount
-    # fi
-
     wait_for_dev "${root#block:}"
 fi
index 945964662518f9b2bf3d64adc1222e40eebd8dc5..1c4820257f937426b1633d0c67ec909a70c02452 100755 (executable)
@@ -11,17 +11,17 @@ install() {
     dracut_install udevadm cat uname blkid \
         /etc/udev/udev.conf
 
-    [ -d ${initdir}/lib/systemd ] || mkdir -p ${initdir}/lib/systemd
-    for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /lib/systemd/systemd-udevd /sbin/udevd; do
+    [ -d ${initdir}/$systemdutildir ] || mkdir -p ${initdir}/$systemdutildir
+    for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /sbin/udevd; do
         [ -x "$_i" ] || continue
         inst "$_i"
 
-        if ! [[ -f  ${initdir}/lib/systemd/systemd-udevd ]]; then
-            ln -fs "$_i" ${initdir}/lib/systemd/systemd-udevd
+        if ! [[ -f  ${initdir}${systemdutildir}/systemd-udevd ]]; then
+            ln -fs "$_i" ${initdir}${systemdutildir}/systemd-udevd
         fi
         break
     done
-    if ! [[ -e ${initdir}/lib/systemd/systemd-udevd ]]; then
+    if ! [[ -e ${initdir}${systemdutildir}/systemd-udevd ]]; then
         derror "Cannot find [systemd-]udevd binary!"
         exit 1
     fi
index a5a544eeda53940e7703ca7a6752a58250d0087d..b441a2765fcc0aaa54b4e995e1103c805ee06d5d 100755 (executable)
@@ -37,8 +37,8 @@ fi
 RD_DEBUG=""
 . /lib/dracut-lib.sh
 
-if [ -x /lib/systemd/systemd-timestamp ]; then
-    RD_TIMESTAMP=$(/lib/systemd/systemd-timestamp)
+if [ -x $systemdutildir/systemd-timestamp ]; then
+    RD_TIMESTAMP=$($systemdutildir/systemd-timestamp)
 else
     read RD_TIMESTAMP _tmp < /proc/uptime
     unset _tmp
@@ -124,7 +124,7 @@ getarg 'rd.break=pre-udev' -d 'rdbreak=pre-udev' && emergency_shell -n pre-udev
 source_hook pre-udev
 
 # start up udev and trigger cold plugs
-/lib/systemd/systemd-udevd --daemon --resolve-names=never
+$systemdutildir/systemd-udevd --daemon --resolve-names=never
 
 UDEV_LOG_PRIO_ARG=--log-priority
 UDEV_QUEUE_EMPTY="udevadm settle --timeout=0"
index 146947b514d02732b7e366ad744d278288b5ade9..7f2940b79ebf493d915bf3ebb8703bd06f47c6e1 100755 (executable)
@@ -49,7 +49,7 @@ install() {
     fi
 
     mkdir -p "${initdir}/var"
-    [ -x /lib/systemd/systemd-timestamp ] && inst /lib/systemd/systemd-timestamp
+    dracut_install -o $systemdutildir/systemd-timestamp
     if [[ $realinitpath ]]; then
         for i in $realinitpath; do
             echo "rd.distroinit=$i"