Browse Source
Also make changes that will make it easier to udevify resuming from hibernate and mounting root.master

3 changed files with 29 additions and 24 deletions
@ -1,3 +1,4 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
[ "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \ |
if [ ! -s /.resume -a "$root" ]; then |
||||||
ROOTFS_MOUNTED=yes |
mount $fstype -o "$rflags" "$root" "$NEWROOT" && ROOTFS_MOUNTED=yes |
||||||
|
fi |
||||||
|
@ -1,24 +1,27 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
[ "$root" ] || { |
if resume=$(getarg resume=) && ! getarg noresume; then |
||||||
root=$(getarg root=) |
export resume |
||||||
case $root in |
echo "$resume" >/.resume |
||||||
|
else |
||||||
|
unset resume |
||||||
|
fi |
||||||
|
|
||||||
|
root=$(getarg root=) |
||||||
|
case $root in |
||||||
LABEL=*) root=${root#LABEL=} |
LABEL=*) root=${root#LABEL=} |
||||||
root="$(echo $root |sed 's,/,\\x2f,g')" |
root="$(echo $root |sed 's,/,\\x2f,g')" |
||||||
root="/dev/disk/by-label/${root}" ;; |
root="/dev/disk/by-label/${root}" ;; |
||||||
UUID=*) root="/dev/disk/by-uuid/${root#UUID=}" ;; |
UUID=*) root="/dev/disk/by-uuid/${root#UUID=}" ;; |
||||||
'') echo "Warning: no root specified" |
'') echo "Warning: no root specified" |
||||||
root="/dev/sda1" ;; |
root="/dev/sda1" ;; |
||||||
esac |
esac |
||||||
} |
|
||||||
|
|
||||||
[ "$rflags" ] || { |
if rflags="$(getarg rootflags=)"; then |
||||||
if rflags="$(getarg rootflags=)"; then |
|
||||||
getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro" |
getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro" |
||||||
else |
else |
||||||
getarg rw && rflags=rw || rflags=ro |
getarg rw && rflags=rw || rflags=ro |
||||||
fi |
fi |
||||||
} |
|
||||||
|
fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}" |
||||||
|
|
||||||
[ "$fstype" ] || { |
export fstype rflags root |
||||||
fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}" |
|
||||||
} |
|
||||||
|
@ -1,7 +1,8 @@ |
|||||||
#!/bin/sh |
#!/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... |
# parsing the output of ls is Bad, but until there is a better way... |
||||||
ls -lH "$resume" | ( |
ls -lH "$resume" | ( |
||||||
read x x x x maj min x; |
read x x x x maj min x; |
||||||
echo "${maj%,}:$min"> /sys/power/resume) |
echo "${maj%,}:$min"> /sys/power/resume) |
||||||
|
>/.resume |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue