prefix="/"
systemdutildir=/usr/lib/systemd
systemdsystemunitdir=/usr/lib/systemd/system
+systemdsystemconfdir=/etc/systemd/system
udevdir=/usr/lib/udev
add_dracutmodules+=" systemd "
hostonly="yes"
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 \
[ -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
}
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"
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"
}
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
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
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
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"
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"