]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Move processing root options into a pre-udev hook.
authorVictor Lowther <victor.lowther@gmail.com>
Thu, 19 Mar 2009 14:31:28 +0000 (09:31 -0500)
committerVictor Lowther <victor.lowther@gmail.com>
Fri, 20 Mar 2009 08:08:39 +0000 (03:08 -0500)
Also make changes that will make it easier to udevify resuming
from hibernate and mounting root.

modules.d/99base/mount-root.sh
modules.d/99base/parse-root-opts.sh
modules.d/99base/resume.sh

index b0c82508591e226501443fec914e26eeae5aeecc..8acd3c5f6baa31225bfbf863b12f7f6418062040 100755 (executable)
@@ -1,3 +1,4 @@
 #!/bin/sh
-[ "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \
-    ROOTFS_MOUNTED=yes
+if [ ! -s /.resume -a "$root" ]; then
+    mount $fstype -o "$rflags" "$root" "$NEWROOT" && ROOTFS_MOUNTED=yes
+fi
index 799c956500608b3b3a74a81d28a0b2a0949534df..473c34dc1e6d9ff1f5a8bcfad0081589890726f6 100755 (executable)
@@ -1,24 +1,27 @@
 #!/bin/sh
-[ "$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
-}
+if resume=$(getarg resume=) && ! getarg noresume; then 
+    export resume
+    echo "$resume" >/.resume
+else
+    unset resume
+fi
 
-[ "$rflags" ] || {
-    if rflags="$(getarg rootflags=)"; then
-       getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro"
-    else
-       getarg rw && rflags=rw || rflags=ro
-    fi
-}
+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
 
-[ "$fstype" ] || {
-    fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}"
-}
+if rflags="$(getarg rootflags=)"; then
+    getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro"
+else
+    getarg rw && rflags=rw || rflags=ro
+fi
+
+fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}"
+
+export fstype rflags root
index a01a61319abb5ff97aa303c5b033ea43eb79bee5..8bb4114f5ef7d772cf1e4529c7972fb5cd5ce01e 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
-resume=$(getarg resume=) && ! getarg noresume && [ -b "$resume" ] && {
+[ -s /.resume -a -b "$resume" ] && {
     # parsing the output of ls is Bad, but until there is a better way...
     ls -lH "$resume" | ( 
        read x x x x maj min x;
        echo "${maj%,}:$min"> /sys/power/resume)
+    >/.resume
 }