summaryrefslogtreecommitdiff
path: root/modules.d
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d')
-rwxr-xr-xmodules.d/40network/dhcp-root.sh2
-rwxr-xr-xmodules.d/40network/netroot3
-rwxr-xr-xmodules.d/90crypt/parse-crypt.sh4
-rwxr-xr-xmodules.d/90dmsquash-live/dmsquash-live-genrules.sh4
-rwxr-xr-xmodules.d/90dmsquash-live/dmsquash-live-root2
-rwxr-xr-xmodules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh2
-rwxr-xr-xmodules.d/90lvm/lvm_scan.sh4
-rwxr-xr-xmodules.d/90lvm/parse-lvm.sh4
-rw-r--r--modules.d/90mdraid/65-md-incremental-imsm.rules8
-rwxr-xr-xmodules.d/90mdraid/md_finished.sh2
-rwxr-xr-xmodules.d/90mdraid/mdcontainer_start.sh4
-rwxr-xr-xmodules.d/90mdraid/mdraid_start.sh4
-rwxr-xr-xmodules.d/90mdraid/parse-md.sh2
-rwxr-xr-xmodules.d/95iscsi/iscsiroot6
-rwxr-xr-xmodules.d/95iscsi/parse-iscsiroot.sh2
-rwxr-xr-xmodules.d/95nbd/nbdroot4
-rwxr-xr-xmodules.d/95nbd/parse-nbdroot.sh2
-rwxr-xr-xmodules.d/95nfs/nfsroot4
-rwxr-xr-xmodules.d/95nfs/parse-nfsroot.sh2
-rwxr-xr-xmodules.d/95resume/resume-genrules.sh6
-rwxr-xr-xmodules.d/95rootfs-block/block-genrules.sh4
-rwxr-xr-xmodules.d/99base/dracut-lib.sh13
-rwxr-xr-xmodules.d/99base/init22
-rwxr-xr-xmodules.d/99base/initqueue8
-rwxr-xr-xmodules.d/99base/module-setup.sh13
25 files changed, 72 insertions, 59 deletions
diff --git a/modules.d/40network/dhcp-root.sh b/modules.d/40network/dhcp-root.sh
index f716bc6f..8c5d7238 100755
--- a/modules.d/40network/dhcp-root.sh
+++ b/modules.d/40network/dhcp-root.sh
@@ -21,5 +21,5 @@ if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; th
# Shut up init error check
[ -z "$root" ] && root="dhcp"
- echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > /initqueue-finished/dhcp.sh
+ echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > $hookdir/initqueue-finished/dhcp.sh
fi
diff --git a/modules.d/40network/netroot b/modules.d/40network/netroot
index 2fdb1c79..5fdfce4d 100755
--- a/modules.d/40network/netroot
+++ b/modules.d/40network/netroot
@@ -51,7 +51,8 @@ if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
# Set netroot to new_root_path, so cmdline parsers don't call
netroot=$new_root_path
- for f in ./cmdline/90*.sh; do
+ # FIXME!
+ for f in $hookdir/cmdline/90*.sh; do
[ -f "$f" ] && . "$f";
done
else
diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh
index 125e8447..b50f49d3 100755
--- a/modules.d/90crypt/parse-crypt.sh
+++ b/modules.d/90crypt/parse-crypt.sh
@@ -24,11 +24,11 @@ else
} >> /etc/udev/rules.d/70-luks.rules
printf '[ -e /dev/disk/by-uuid/*%s* ] || exit 1\n' $luksid \
- >> /initqueue-finished/90-crypt.sh
+ >> $hookdir/initqueue/finished/90-crypt.sh
{
printf '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
printf 'warn "crypto LUKS UUID "%s" not found"\n' $luksid
- } >> /emergency/90-crypt.sh
+ } >> $hookdir/emergency/90-crypt.sh
done
else
echo 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue' \
diff --git a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
index 12e213bb..1128be43 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
+++ b/modules.d/90dmsquash-live/dmsquash-live-genrules.sh
@@ -15,12 +15,12 @@ case "$root" in
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
${root#live:/dev/}
} >> $UDEVRULESD/99-live-squash.rules
- echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
+ echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
;;
live:*)
if [ -f "${root#live:}" ]; then
/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root "${root#live:}"
- echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
+ echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
fi
;;
esac
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root b/modules.d/90dmsquash-live/dmsquash-live-root
index 9d83c6de..c54a46d8 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root
+++ b/modules.d/90dmsquash-live/dmsquash-live-root
@@ -191,6 +191,6 @@ if [ -n "$ROOTFLAGS" ]; then
fi
ln -s /dev/mapper/live-rw /dev/root
-printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > /mount/01-$$-live.sh
+printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
exit 0
diff --git a/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh b/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh
index f3dde77f..c05fbb90 100755
--- a/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh
+++ b/modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh
@@ -6,5 +6,5 @@ if [ "${root%%:*}" = "liveiso" ]; then
printf 'KERNEL=="loop0", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \
${root#liveiso:}
} >> /etc/udev/rules.d/99-liveiso-mount.rules
- echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
+ echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
fi
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index 3d3afcd1..fab00172 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -120,7 +120,7 @@ fi
if [ "$lvmwritten" ]; then
rm -f /etc/lvm/lvm.conf
- ln -s /sbin/lvm-cleanup /pre-pivot/30-lvm-cleanup.sh 2>/dev/null
- ln -s /sbin/lvm-cleanup /pre-pivot/31-lvm-cleanup.sh 2>/dev/null
+ ln -s /sbin/lvm-cleanup $hookdir/pre-pivot/30-lvm-cleanup.sh 2>/dev/null
+ ln -s /sbin/lvm-cleanup $hookdir/pre-pivot/31-lvm-cleanup.sh 2>/dev/null
fi
unset lvmwritten
diff --git a/modules.d/90lvm/parse-lvm.sh b/modules.d/90lvm/parse-lvm.sh
index 8c0c526d..5ee7f9d5 100755
--- a/modules.d/90lvm/parse-lvm.sh
+++ b/modules.d/90lvm/parse-lvm.sh
@@ -11,11 +11,11 @@ if ! getargbool 1 rd.lvm -n rd_NO_LVM; then
else
for dev in $(getargs rd.lvm.vg rd_LVM_VG=) $(getargs rd.lvm.lv rd_LVM_LV=); do
printf '[ -e "/dev/%s" ] || exit 1\n' $dev \
- >> /initqueue-finished/lvm.sh
+ >> $hookdir/initqueue/finished/lvm.sh
{
printf '[ -e "/dev/%s" ] || ' $dev
printf 'warn "LVM "%s" not found"\n' $dev
- } >> /emergency/90-lvm.sh
+ } >> $hookdir/emergency/90-lvm.sh
done
fi
diff --git a/modules.d/90mdraid/65-md-incremental-imsm.rules b/modules.d/90mdraid/65-md-incremental-imsm.rules
index 57db7984..521a7e11 100644
--- a/modules.d/90mdraid/65-md-incremental-imsm.rules
+++ b/modules.d/90mdraid/65-md-incremental-imsm.rules
@@ -28,7 +28,7 @@ LABEL="do_md_inc"
#
ENV{rd_MDADMCONF}!="?*", GOTO="md_auto_end"
-RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto'"
+RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh $hookdir/initqueue/finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto'"
GOTO="md_inc_end"
@@ -39,7 +39,7 @@ LABEL="md_auto_end"
#
RUN+="/sbin/mdadm -I $env{DEVNAME}"
-RUN+="/bin/ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
+RUN+="/bin/ln -s /sbin/md_finished.sh $hookdir/initqueue/finished/md_finished.sh"
LABEL="md_inc_end"
@@ -61,7 +61,7 @@ LABEL="do_raidstart"
# check if array is not inactive anymore
TEST=="md/array_state", ATTR{md/array_state}!="|inactive", GOTO="end_raidstart"
-RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start'"
+RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh $hookdir/initqueue/finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start'"
LABEL="end_raidstart"
@@ -80,6 +80,6 @@ GOTO="end_container"
LABEL="do_container"
-RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}'"
+RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh $hookdir/initqueue/finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}'"
LABEL="end_container"
diff --git a/modules.d/90mdraid/md_finished.sh b/modules.d/90mdraid/md_finished.sh
index 8c639d39..a06bc4f7 100755
--- a/modules.d/90mdraid/md_finished.sh
+++ b/modules.d/90mdraid/md_finished.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-for f in /initqueue-settled/mdcontainer_start* /initqueue-settled/mdraid_start* /initqueue-settled/mdadm_auto*; do
+for f in $hookdir/initqueue/settled/mdcontainer_start* $hookdir/initqueue/settled/mdraid_start* $hookdir/initqueue/settled/mdadm_auto*; do
[ -e $f ] && return 1
done
diff --git a/modules.d/90mdraid/mdcontainer_start.sh b/modules.d/90mdraid/mdcontainer_start.sh
index 25e41c4b..f2c01521 100755
--- a/modules.d/90mdraid/mdcontainer_start.sh
+++ b/modules.d/90mdraid/mdcontainer_start.sh
@@ -7,6 +7,6 @@ md=$1
udevadm control --stop-exec-queue
# and activate any containers
mdadm -IR $md 2>&1 | vinfo
-ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
-ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
+ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
+ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue
diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh
index 088d9b15..1c9d7fe3 100755
--- a/modules.d/90mdraid/mdraid_start.sh
+++ b/modules.d/90mdraid/mdraid_start.sh
@@ -21,6 +21,6 @@ for md in /dev/md[0-9]* /dev/md/*; do
done
unset udevinfo
-ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
-ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
+ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
+ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue
diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh
index 6cfaac35..b879b075 100755
--- a/modules.d/90mdraid/parse-md.sh
+++ b/modules.d/90mdraid/parse-md.sh
@@ -29,7 +29,7 @@ fi
if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
udevproperty rd_MDADMCONF=1
- rm -f /pre-pivot/*mdraid-cleanup.sh
+ rm -f $hookdir/pre-pivot/*mdraid-cleanup.sh
fi
if ! getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
diff --git a/modules.d/95iscsi/iscsiroot b/modules.d/95iscsi/iscsiroot
index 03ef085a..6f7a6d23 100755
--- a/modules.d/95iscsi/iscsiroot
+++ b/modules.d/95iscsi/iscsiroot
@@ -162,10 +162,10 @@ handle_netroot()
fi
# inject new exit_if_exists
- echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/iscsi-settle.sh
+ echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/iscsi-settle.sh
# force udevsettle to break
- > /initqueue/work
+ > $hookdir/initqueue/work
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
-g $iscsi_target_group -a $iscsi_target_ip \
@@ -178,7 +178,7 @@ handle_netroot()
# install mount script
if [ -n "${root%%block:*}" ]; then
# if root is not specified try to mount the whole iSCSI LUN
- echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/01-$$-iscsi.sh
+ echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh
fi
}
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
index bc82050a..8fcab455 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -77,5 +77,5 @@ rootok=1
# Shut up init error check
[ -z "$root" ] && root="iscsi"
-echo '[ -e /dev/root ]' > /initqueue-finished/iscsi.sh
+echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/iscsi.sh
diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot
index b16b44f9..7ff7b293 100755
--- a/modules.d/95nbd/nbdroot
+++ b/modules.d/95nbd/nbdroot
@@ -96,11 +96,11 @@ nbd-client $preopts "$nbdserver" "$nbdport" /dev/nbd0 $opts || exit 1
# add the udev rules for mounting the nbd0 device
if [ ! -e /etc/udev/rules.d/99-mount.rules ]; then
echo '[ -e /dev/root ] || { info=$(udevadm info --query=env --name=/dev/nbd0); [ -z "${info%%*ID_FS_TYPE*}" ] && { ln -s /dev/nbd0 /dev/root 2>/dev/null; :; };} && rm $job;' \
- > /initqueue-settled/nbd.sh
+ > $hookdir/initqueue/settled/nbd.sh
printf '/bin/mount -t %s -o %s %s %s\n' \
"$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \
- > /mount/01-$$-nbd.sh
+ > $hookdir/mount/01-$$-nbd.sh
fi
# NBD doesn't emit uevents when it gets connected, so kick it
diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh
index 4edcf17a..61e5d53a 100755
--- a/modules.d/95nbd/parse-nbdroot.sh
+++ b/modules.d/95nbd/parse-nbdroot.sh
@@ -57,5 +57,5 @@ rootok=1
# Shut up init error check
[ -z "$root" ] && root="nbd"
-echo '[ -e /dev/root ]' > /initqueue-finished/nbd.sh
+echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/nbd.sh
diff --git a/modules.d/95nfs/nfsroot b/modules.d/95nfs/nfsroot
index b5d62e4b..486c0e1a 100755
--- a/modules.d/95nfs/nfsroot
+++ b/modules.d/95nfs/nfsroot
@@ -114,8 +114,8 @@ else
fi
# inject new exit_if_exists
-echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/nfs.sh
+echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/nfs.sh
# force udevsettle to break
-> /initqueue/work
+> $hookdir/initqueue/work
diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh
index 4d8cbdaa..35b095d4 100755
--- a/modules.d/95nfs/parse-nfsroot.sh
+++ b/modules.d/95nfs/parse-nfsroot.sh
@@ -110,4 +110,4 @@ rootok=1
# confused by having /dev/nfs[4]
root="$fstype"
-echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/nfsroot.sh
+echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/nfsroot.sh
diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
index 92ce2fb3..06b9544d 100755
--- a/modules.d/95resume/resume-genrules.sh
+++ b/modules.d/95resume/resume-genrules.sh
@@ -33,14 +33,14 @@ if [ -n "$resume" ]; then
} >> /etc/udev/rules.d/99-resume.rules
printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \
- "$resume" "$resume" >> /initqueue-settled/resume.sh
+ "$resume" "$resume" >> $hookdir/initqueue/settled/resume.sh
- echo '[ -e /dev/resume ]' > /initqueue-finished/resume.sh
+ echo '[ -e /dev/resume ]' > $hookdir/initqueue/finished/resume.sh
{
printf '[ -e /dev/resume ] || '
printf 'warn "resume device "%s" not found"\n' "$resume"
- } >> /emergency/00-resume.sh
+ } >> $hookdir/emergency/00-resume.sh
elif ! getarg noresume; then
diff --git a/modules.d/95rootfs-block/block-genrules.sh b/modules.d/95rootfs-block/block-genrules.sh
index 5cda7a49..968528b7 100755
--- a/modules.d/95rootfs-block/block-genrules.sh
+++ b/modules.d/95rootfs-block/block-genrules.sh
@@ -11,7 +11,7 @@ if [ "${root%%:*}" = "block" ]; then
} >> $UDEVRULESD/99-root.rules
printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
- "${root#block:}" "${root#block:}" >> /initqueue-settled/blocksymlink.sh
+ "${root#block:}" "${root#block:}" >> $hookdir/initqueue/settled/blocksymlink.sh
- echo '[ -e /dev/root ]' > /initqueue-finished/block.sh
+ echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/block.sh
fi
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index b4e00c2e..c870bd23 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -215,9 +215,16 @@ source_all() {
for f in "/$1"/*.sh; do [ -e "$f" ] && . "$f"; done
}
+hookdir=/lib/dracut/hooks
+export hookdir
+
+source_hook() {
+ source_all "/lib/dracut/hooks/$1"
+}
+
check_finished() {
local f
- for f in /initqueue-finished/*.sh; do { [ -e "$f" ] && ( . "$f" ) ; } || return 1 ; done
+ for f in $hookdir/initqueue/finished/*.sh; do { [ -e "$f" ] && ( . "$f" ) ; } || return 1 ; done
return 0
}
@@ -237,7 +244,7 @@ die() {
echo "warn dracut: FATAL: \"$@\"";
echo "warn dracut: Refusing to continue";
echo "exit 1"
- } >> /emergency/01-die.sh
+ } >> $hookdir/emergency/01-die.sh
> /.die
exit 1
@@ -305,7 +312,7 @@ udevsettle() {
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
if [ $UDEVVERSION -ge 143 ]; then
- udevadm settle --exit-if-exists=/initqueue/work $settle_exit_if_exists
+ udevadm settle --exit-if-exists=$hookdir/initqueue/work $settle_exit_if_exists
else
udevadm settle --timeout=30
fi
diff --git a/modules.d/99base/init b/modules.d/99base/init
index fcd6ad72..ffab217d 100755
--- a/modules.d/99base/init
+++ b/modules.d/99base/init
@@ -47,7 +47,7 @@ emergency_shell()
fi
echo ; echo
warn $@
- source_all emergency
+ source_hook emergency
echo
wait_for_loginit
[ -e /.die ] && exit 1
@@ -146,7 +146,7 @@ source_conf /etc/conf.d
# run scriptlets to parse the command line
getarg 'rd.break=cmdline' 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
-source_all cmdline
+source_hook cmdline
[ -z "$root" ] && die "No or empty root= argument"
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
@@ -163,7 +163,7 @@ source_all cmdline
# pre-udev scripts run before udev starts, and are run only once.
getarg 'rd.break=pre-udev' 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break before pre-udev"
-source_all pre-udev
+source_hook pre-udev
# start up udev and trigger cold plugs
udevd --daemon --resolve-names=never
@@ -180,7 +180,7 @@ getargbool 0 rd.udev.info -y rdudevinfo && udevadm control $UDEV_LOG_PRIO_ARG=in
getargbool 0 rd.udev.debug -y rdudevdebug && udevadm control $UDEV_LOG_PRIO_ARG=debug
getarg 'rd.break=pre-trigger' 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break before pre-trigger"
-source_all pre-trigger
+source_hook pre-trigger
# then the rest
udevadm trigger --action=add $udevtriggeropts >/dev/null 2>&1
@@ -200,11 +200,11 @@ while :; do
check_finished && break
- if [ -f /initqueue/work ]; then
- rm /initqueue/work
+ if [ -f $hookdir/initqueue/work ]; then
+ rm $hookdir/initqueue/work
fi
- for job in /initqueue/*.sh; do
+ for job in $hookdir/initqueue/*.sh; do
[ -e "$job" ] || break
job=$job . $job
check_finished && break 2
@@ -212,7 +212,7 @@ while :; do
$UDEV_QUEUE_EMPTY >/dev/null 2>&1 || continue
- for job in /initqueue-settled/*.sh; do
+ for job in $hookdir/initqueue/settled/*.sh; do
[ -e "$job" ] || break
job=$job . $job
check_finished && break 2
@@ -258,7 +258,7 @@ done
# pre-mount happens before we try to mount the root filesystem,
# and happens once.
getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
-source_all pre-mount
+source_hook pre-mount
getarg 'rd.break=mount' 'rdbreak=mount' && emergency_shell -n mount "Break mount"
@@ -267,7 +267,7 @@ getarg 'rd.break=mount' 'rdbreak=mount' && emergency_shell -n mount "Break mount
i=0
while :; do
[ -d "$NEWROOT/proc" ] && break;
- for f in /mount/*.sh; do
+ for f in $hookdir/mount/*.sh; do
[ -f "$f" ] && . "$f"
[ -d "$NEWROOT/proc" ] && break;
done
@@ -284,7 +284,7 @@ done
# pre pivot scripts are sourced just before we switch over to the new root.
getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot"
-source_all pre-pivot
+source_hook pre-pivot
# by the time we get here, the root filesystem should be mounted.
# Try to find init.
diff --git a/modules.d/99base/initqueue b/modules.d/99base/initqueue
index b5395512..d3f6c5dc 100755
--- a/modules.d/99base/initqueue
+++ b/modules.d/99base/initqueue
@@ -7,14 +7,14 @@
# Copyright 2008-2010, Red Hat, Inc.
# Harald Hoyer <harald@redhat.com>
-type getarg >/dev/null || . /lib/dracut-lib.sh
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
while [ $# -gt 0 ]; do
case "$1" in
--onetime)
onetime="yes";;
--settled)
- settled="-settled";;
+ settled="/settled";;
--unique)
unique="yes";;
--name)
@@ -42,6 +42,6 @@ else
echo "$@" > "/tmp/$$-${job}.sh"
fi
-mv -f "/tmp/$$-${job}.sh" "/initqueue${settled}/${job}.sh"
-[ -z "$settled" ] && >> /initqueue/work
+mv -f "/tmp/$$-${job}.sh" "$hookdir/initqueue${settled}/${job}.sh"
+[ -z "$settled" ] && >> $hookdir/initqueue/work
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index c219d8f9..5597fb38 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -23,10 +23,15 @@ install() {
inst "$moddir/init" "/init"
inst "$moddir/initqueue" "/sbin/initqueue"
inst "$moddir/loginit" "/sbin/loginit"
- mkdir -p ${initdir}/initqueue
- mkdir -p ${initdir}/emergency
- mkdir -p ${initdir}/initqueue-finished
- mkdir -p ${initdir}/initqueue-settled
+
+ mkdir -m 0755 -p ${initdir}/lib
+ mkdir -m 0755 -p ${initdir}/lib/dracut
+ mkdir -m 0755 -p ${initdir}/lib/dracut/hooks
+ for d in $hookdirs emergency \
+ initqueue initqueue/finished initqueue/settled; do
+ mkdir -m 0755 -p ${initdir}/lib/dracut/hooks/$d
+ done
+
mkdir -p ${initdir}/tmp
# Bail out if switch_root does not exist
if type -P switch_root >/dev/null; then