Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory cleanmaster
parent
c9f1e3d1f4
commit
0b53ca70b6
5
dracut
5
dracut
|
@ -437,9 +437,6 @@ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount"
|
||||
hookdirs+=" pre-pivot mount emergency"
|
||||
|
||||
[[ $TMPDIR && ! -w $TMPDIR ]] && unset TMPDIR
|
||||
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
|
||||
|
||||
|
@ -451,7 +448,7 @@ trap 'exit 1;' SIGINT
|
|||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||
chmod 755 "$initdir"
|
||||
|
||||
export initdir hookdirs dracutbasedir dracutmodules drivers \
|
||||
export initdir dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||
add_drivers mdadmconf lvmconf filesystems \
|
||||
use_fstab libdir usrlibdir \
|
||||
|
|
|
@ -437,6 +437,12 @@ inst() {
|
|||
return 1
|
||||
}
|
||||
|
||||
[[ $hookdirs ]] || {
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot initqueue pre-mount"
|
||||
hookdirs+=" pre-pivot mount emergency"
|
||||
export hookdirs
|
||||
}
|
||||
|
||||
# install function specialized for hooks
|
||||
# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook
|
||||
# All hooks should be POSIX/SuS compliant, they will be sourced by init.
|
||||
|
@ -449,7 +455,7 @@ inst_hook() {
|
|||
derror "No such hook type $1. Aborting initrd creation."
|
||||
exit 1
|
||||
fi
|
||||
inst_simple "$3" "/${1}/${2}${3##*/}"
|
||||
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
|
||||
}
|
||||
|
||||
dracut_install() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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' \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -40,7 +40,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install sfdisk mke2fs poweroff cp umount
|
||||
inst_simple ./create-root.sh /initqueue/01create-root.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
@ -63,7 +63,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst ./cryptroot-ask /sbin/cryptroot-ask
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
|
|
@ -40,7 +40,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install sfdisk mke2fs poweroff cp umount
|
||||
inst_simple ./create-root.sh /initqueue/01create-root.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
@ -62,7 +62,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut -l -i overlay / \
|
||||
|
|
|
@ -75,7 +75,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install sfdisk mke2fs poweroff cp umount dd grep
|
||||
inst_simple ./create-root.sh /initqueue/01create-root.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
@ -98,7 +98,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
inst ./cryptroot-ask /sbin/cryptroot-ask
|
||||
mkdir -p overlay/etc
|
||||
|
|
|
@ -68,7 +68,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install sfdisk mke2fs poweroff cp umount grep
|
||||
inst_simple ./create-root.sh /initqueue/01create-root.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
@ -97,7 +97,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
inst ./cryptroot-ask /sbin/cryptroot-ask
|
||||
)
|
||||
|
|
|
@ -64,7 +64,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install sfdisk mke2fs poweroff cp umount
|
||||
inst_simple ./create-root.sh /initqueue/01create-root.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
@ -86,7 +86,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut -l -i overlay / \
|
||||
|
|
|
@ -285,7 +285,7 @@ test_setup() {
|
|||
mkdir overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install sfdisk mke2fs poweroff cp umount
|
||||
inst_simple ./create-root.sh /initqueue/01create-root.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
@ -131,7 +131,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut -l -i overlay / \
|
||||
|
|
|
@ -198,7 +198,7 @@ make_encrypted_root() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install mke2fs poweroff cp umount
|
||||
inst_simple ./create-root.sh /initqueue/01create-root.sh
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
@ -302,7 +302,7 @@ test_setup() {
|
|||
initdir=overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
inst ./cryptroot-ask /sbin/cryptroot-ask
|
||||
)
|
||||
|
|
|
@ -217,7 +217,7 @@ test_setup() {
|
|||
mkdir overlay
|
||||
. $basedir/dracut-functions
|
||||
dracut_install poweroff shutdown
|
||||
inst_simple ./hard-off.sh /emergency/000-hard-off.sh
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue