From: Harald Hoyer Date: Tue, 15 Sep 2009 06:54:25 +0000 (+0200) Subject: switch modules to initqueue-finished X-Git-Tag: 002~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a8d8dfbb651f65fba078748ef99074618a5c53a;p=platform%2Fupstream%2Fdracut.git switch modules to initqueue-finished --- diff --git a/modules.d/40network/dhcp-root.sh b/modules.d/40network/dhcp-root.sh index c00ba06..8e51ed8 100755 --- a/modules.d/40network/dhcp-root.sh +++ b/modules.d/40network/dhcp-root.sh @@ -17,4 +17,5 @@ if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ] ; then # Shut up init error check [ -z "$root" ] && root="dhcp" + echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > /initqueue-finished/dhcp.sh fi diff --git a/modules.d/90mdraid/65-md-incremental-imsm.rules b/modules.d/90mdraid/65-md-incremental-imsm.rules index ba9131b..883f80c 100644 --- a/modules.d/90mdraid/65-md-incremental-imsm.rules +++ b/modules.d/90mdraid/65-md-incremental-imsm.rules @@ -5,6 +5,10 @@ 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" @@ -16,13 +20,17 @@ KERNEL!="md*", IMPORT{program}="/sbin/mdadm --examine --export $tempnode" 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" @@ -40,7 +48,8 @@ GOTO="end_raidstart" 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'" @@ -61,7 +70,8 @@ GOTO="end_container" 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'" diff --git a/modules.d/90mdraid/mdcontainer_start.sh b/modules.d/90mdraid/mdcontainer_start.sh index 96c3eed..6043dc8 100755 --- a/modules.d/90mdraid/mdcontainer_start.sh +++ b/modules.d/90mdraid/mdcontainer_start.sh @@ -5,4 +5,5 @@ md=$1 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 diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh index ab45986..8a1e063 100755 --- a/modules.d/90mdraid/mdraid_start.sh +++ b/modules.d/90mdraid/mdraid_start.sh @@ -5,4 +5,5 @@ 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 diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh index b48c0d3..7b82b10 100755 --- a/modules.d/95iscsi/parse-iscsiroot.sh +++ b/modules.d/95iscsi/parse-iscsiroot.sh @@ -74,3 +74,6 @@ rootok=1 # Shut up init error check [ -z "$root" ] && root="iscsi" + +echo '[ -e /dev/root ]' > /initqueue-finished/iscsi.sh + diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot index 96f0cf0..37841d6 100755 --- a/modules.d/95nbd/nbdroot +++ b/modules.d/95nbd/nbdroot @@ -95,7 +95,11 @@ nbd-client $preopts "$nbdserver" "$nbdport" /dev/nbd0 $opts || exit 1 # 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 diff --git a/modules.d/95nbd/parse-nbdroot.sh b/modules.d/95nbd/parse-nbdroot.sh index 4e0302a..e2ef5d6 100755 --- a/modules.d/95nbd/parse-nbdroot.sh +++ b/modules.d/95nbd/parse-nbdroot.sh @@ -54,3 +54,6 @@ rootok=1 # Shut up init error check [ -z "$root" ] && root="nbd" + +echo '[ -e /dev/nbd0 ]' > /initqueue-finished/nbd.sh + diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh index 23fc3be..6300351 100755 --- a/modules.d/95nfs/parse-nfsroot.sh +++ b/modules.d/95nfs/parse-nfsroot.sh @@ -132,3 +132,5 @@ rootok=1 # 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 diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh index 002a304..023434b 100644 --- a/modules.d/95resume/resume-genrules.sh +++ b/modules.d/95resume/resume-genrules.sh @@ -5,6 +5,12 @@ if [ -n "$resume" ]; then 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\"," \ diff --git a/modules.d/95rootfs-block/block-genrules.sh b/modules.d/95rootfs-block/block-genrules.sh index f12a6b9..614c7ce 100644 --- a/modules.d/95rootfs-block/block-genrules.sh +++ b/modules.d/95rootfs-block/block-genrules.sh @@ -6,7 +6,9 @@ if [ "${root%%:*}" = "block" ]; then ${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