1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
diff -ruN hibernate-script-1.96/scriptlets.d/suspend2 hibernate-script-1.96.fixed/scriptlets.d/suspend2
--- hibernate-script-1.96/scriptlets.d/suspend2 2007-07-16 14:33:09.000000000 +0200
+++ hibernate-script-1.96.fixed/scriptlets.d/suspend2 2007-07-30 18:40:13.000000000 +0200
@@ -74,9 +74,13 @@
/sbin/modprobe --first-time "${mod}" >/dev/null 2>&1 && SWSUSP_RMOD="${mod} ${SWSUSP_RMOD}"
done
+ # signature for filewriter
+ FILEWRITER_SIGNATURE="Suspend2"
+
# Detect where suspend2 is these days.
if [ -d "/sys/power/tuxonice/" ] ; then
SWSUSP_ROOT="/sys/power/tuxonice"
+ FILEWRITER_SIGNATURE="TuxOnIce"
elif [ -d "/sys/power/suspend2/" ] ; then
SWSUSP_ROOT="/sys/power/suspend2"
elif [ -d "/proc/swsusp/" ] ; then
@@ -748,22 +752,31 @@
if ! [ -e "$SWSUSP_FILEWRITER_LOC" ] ; then
vecho 0 "$EXE: Creating $SWSUSP_FILEWRITER_SIZE MB filewriter target."
{
- echo Suspend2
+ echo $FILEWRITER_SIGNATURE
dd if=/dev/zero bs=1M count=$SWSUSP_FILEWRITER_SIZE 2>/dev/null
} > $SWSUSP_FILEWRITER_LOC
sync
fi
case "`dd \"if=$SWSUSP_FILEWRITER_LOC\" bs=8 count=1 2>/dev/null`" in
- Suspend2)
+ $FILEWRITER_SIGNATURE)
# We're good to go.
vecho 1 "$EXE: Detected filewriter image ready for use."
;;
+ Suspend2|TuxOnIce)
+ # Eeek! This is an incompatible image
+ # reliably preserve the starting block.
+ vecho 1 "$EXE: Killing incompatible filewriter image."
+ if ! /bin/echo -ne "$FILEWRITER_SIGNATURE\n\0\0" | dd "of=$SWSUSP_FILEWRITER_LOC" bs=11 count=1 conv=notrunc 2>/dev/null ; then
+ vecho 0 "$EXE: Failed to kill imcompatible image!"
+ return 2 # Abort even with force
+ fi
+ ;;
HaveImag)
# Eeek! There's already an image here. Erase it using dd to
# reliably preserve the starting block.
vecho 1 "$EXE: Killing existing filewriter image."
- if ! /bin/echo -ne "Suspend2\n\0\0" | dd "of=$SWSUSP_FILEWRITER_LOC" bs=11 count=1 conv=notrunc 2>/dev/null ; then
+ if ! /bin/echo -ne "$FILEWRITER_SIGNATURE\n\0\0" | dd "of=$SWSUSP_FILEWRITER_LOC" bs=11 count=1 conv=notrunc 2>/dev/null ; then
vecho 0 "$EXE: Failed to kill existing image!"
return 2 # Abort even with force
fi
@@ -794,17 +807,17 @@
[ x"$SWSUSP_FILEWRITER_NOVERIFY" = "x1" ] && return 0
local new_resume2
- new_resume2="`cat $SWSUSP_ROOT/$RESUME_FILE`"
+ new_resume2="`cat $SWSUSP_ROOT/$RESUME2_FILE`"
if [ -z "$new_resume2" ] ; then
- vecho 0 "ABORTING: $SWSUSP_ROOT/$RESUME_FILE did not return a valid result."
+ vecho 0 "ABORTING: $SWSUSP_ROOT/$RESUME2_FILE did not return a valid result."
return 2 # abort even if forced
fi
if ! grep "$new_resume2" /proc/cmdline ; then
- filewriter_target=`cat $SWSUSP_ROOT/$RESUME_FILE`
- vecho 0 "ABORTING: $RESUME_FILE is not setup correctly. Unless you have setup your bootloader"
+ filewriter_target=`cat $SWSUSP_ROOT/$RESUME2_FILE`
+ vecho 0 "ABORTING: $RESUME2_FILE is not setup correctly. Unless you have setup your bootloader"
vecho 0 " correctly, resuming will most likely fail. To correct this, add"
- vecho 0 " \"$RESUME_FILE=$filewriter_target\" to your kernel command line in your"
+ vecho 0 " \"$RESUME2_FILE=$filewriter_target\" to your kernel command line in your"
vecho 0 " LILO or GRUB configuration file and reboot."
return 2 # abort even if forced
fi
|