# Shut up init error check
[ -z "$root" ] && root="dhcp"
+ echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > /initqueue-finished/dhcp.sh
fi
ACTION!="add|change", GOTO="md_inc_end"
SUBSYSTEM!="block", GOTO="md_inc_end"
ENV{ID_FS_TYPE}!="linux_raid_member|isw_raid_member", GOTO="md_inc_end"
+
+ENV{DEVTYPE}!="partition", \
+ RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
+
ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}=="?*", GOTO="md_inc_end"
TEST=="/tmp/.mdraid_start-%k", GOTO="md_inc_end"
LABEL="do_md_inc"
-ENV{DEVTYPE}!="partition", \
- RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
+ENV{rd_MDADMCONF}=="?*", \
+ RUN+="/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto", \
+ RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'", \
+ GOTO="md_inc_end"
RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}"
ACTION=="change", \
- RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k'"
+ RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k'"
+
+RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'"
LABEL="md_inc_end"
LABEL="do_raidstart"
TEST!="/tmp/.mdraid_start-%k", \
- RUN+="/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start"
+ RUN+="/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start", \
+ RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'"
ACTION=="change", \
RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k'"
LABEL="do_container"
TEST!="/tmp/.mdcontainer_start-%k", \
- RUN+="/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}"
+ RUN+="/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}", \
+ RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'"
ACTION=="change", \
RUN+="/bin/sh -c '>/tmp/.mdcontainer_start-%k'"
udevadm control --stop-exec-queue
# and activate any containers
mdadm -IR $md 2>&1 | vinfo
-udevadm control --start-exec-queue
\ No newline at end of file
+[ -f /initqueue-settled/mdraid_start ] || rm /initqueue-finished/mdraid.sh 2>/dev/null
+udevadm control --start-exec-queue
info "Assembling MD RAID arrays"
udevadm control --stop-exec-queue
mdadm -IRs 2>&1 | vinfo
+[ -f /initqueue-settled/mdcontainer_start ] || rm /initqueue-finished/mdraid.sh 2>/dev/null
udevadm control --start-exec-queue
# Shut up init error check
[ -z "$root" ] && root="iscsi"
+
+echo '[ -e /dev/root ]' > /initqueue-finished/iscsi.sh
+
# If we didn't get a root= on the command line, then we need to
# add the udev rules for mounting the nbd0 device
if [ ! -e /etc/udev/rules.d/99-mount.rules ]; then
- ln -s /dev/nbd0 /dev/root
+ echo '[ -e /dev/nbd0 ] && { ln -s /dev/nbd0 /dev/root 2>/dev/null; rm "$job"; }' \
+ >> /initqueue-settled/nbd.sh
+
+ echo '[ -e /dev/root ]' > /initqueue-finished/nbd.sh
+
printf '/bin/mount -t %s -o %s %s %s\n' \
"$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \
> /mount/01-$$-nbd.sh
# Shut up init error check
[ -z "$root" ] && root="nbd"
+
+echo '[ -e /dev/nbd0 ]' > /initqueue-finished/nbd.sh
+
# Shut up init error check or make sure that block parser wont get
# confused by having /dev/nfs[4]
root="$fstype"
+
+echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/nfsroot.sh
printf "SYMLINK==\"%s\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
${resume#/dev/};
} >> /etc/udev/rules.d/99-resume.rules
+
+ printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \
+ "$resume" "$resume" >> /initqueue-settled/resume.sh
+
+ echo '[ -e /dev/resume ]' > /initqueue-finished/resume.sh
+
elif ! getarg noresume; then
{
echo "SUBSYSTEM==\"block\", ACTION==\"add\", ENV{ID_FS_TYPE}==\"suspend\"," \
${root#block:/dev/}
) >> /etc/udev/rules.d/99-mount.rules
(
- printf '[ -e "%s" ] && { ln -s "%s" /dev/root; rm "$job"; }\n' \
+ printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
"${root#block:}" "${root#block:}"
) >> /initqueue-settled/blocksymlink.sh
+
+ echo '[ -e /dev/root ]' > /initqueue-finished/block.sh
fi