From: Harald Hoyer Date: Tue, 24 Mar 2009 10:33:58 +0000 (+0100) Subject: move root command line argument parsing to modules X-Git-Tag: 0.1~282^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4479cb2b4531b51c633394a04ced4368966cf7d8;p=thirdparty%2Fdracut.git move root command line argument parsing to modules --- diff --git a/modules.d/99base/init b/modules.d/99base/init index 2539f6029..04cebfcf9 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -53,44 +53,6 @@ mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts >/dev/null 2>&1 getarg 'break=pre-udev' && emergency_shell source_all pre-udev - -[ "$root" ] || { - root=$(getarg root=) - case $root in - LABEL=*) root=${root#LABEL=} - root="$(echo $root |sed 's,/,\\x2f,g')" - root="/dev/disk/by-label/${root}" ;; - UUID=*) root="/dev/disk/by-uuid/${root#UUID=}" ;; - '') echo "Warning: no root specified" - root="/dev/sda1" ;; - esac -} - -[ "$rflags" ] || { - if rflags="$(getarg rootflags=)"; then - getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro" - else - getarg rw && rflags=rw || rflags=ro - fi -} - -[ "$fstype" ] || { - fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}" -} - -resume=$(getarg resume=) && ! getarg noresume && [ -b "$resume" ] && { - # parsing the output of ls is Bad, but until there is a better way... - ( - echo -e 'NAME=="'${resume#/dev/}'", RUN+="/bin/sh -c \047 echo %M:%m > /sys/power/resume \047 "' - echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/sh -c \047 echo %M:%m > /sys/power/resume \047 "' - ) >> /lib/udev/rules.d/99-resume.rules -} - -( - echo -e ' NAME=="'${root#/dev/}'", RUN+="/bin/sh -c \047 mount '$fstype' -o '$rflags' '$root' '$NEWROOT' \047 " ' - echo -e ' SYMLINK=="'${root#/dev/}'", RUN+="/bin/sh -c \047 mount '$fstype' -o '$rflags' '$root' '$NEWROOT' \047 " ' -) >> /lib/udev/rules.d/99-mount.rules - # start up udev and trigger cold plugs udevd --daemon udevadm trigger >/dev/null 2>&1