]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
move root command line argument parsing to modules
authorHarald Hoyer <harald@redhat.com>
Tue, 24 Mar 2009 10:33:58 +0000 (11:33 +0100)
committerHarald Hoyer <harald@redhat.com>
Tue, 24 Mar 2009 10:33:58 +0000 (11:33 +0100)
modules.d/99base/init

index 2539f602900dee0a1a1b66ecec26245831f5050e..04cebfcf9a8a0c6ba3811d591534aef0a4605028 100755 (executable)
@@ -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