Package: uswsusp
Version: 0.8-1.1

If I reconfigure uswsusp while using a swap file (as opposed to a swap
partition), it warns me that my swap file is not valid.  But it is
valid; it works both for swap and hibernation.

---
Fix "dpkg-reconfigure uswsusp" to recognise swap files as valid

My swap file is on device 0802, but "stat -c '%D' /swapfile" gives "802".
I.e. the leading zero is omitted.  Fix devid to match.

diff --git a/debian/uswsusp.config b/debian/uswsusp.config
index 68b9783..35a309a 100644
--- a/debian/uswsusp.config
+++ b/debian/uswsusp.config
@@ -97,7 +97,7 @@ elif [ -n "$USEROFFSET" ] && [ -x /usr/sbin/swap-offset ]; 
then
     # was removed before, leaving the config file. Now we don't
     # have a way to check the offset. Best is to ask if this is OK
 
-    devid=`printf "%02x%02x" $(stat -c "0x%t 0x%T" $USERSWAP 2> /dev/null)`
+    devid=`printf "%x%02x" $(stat -c "0x%t 0x%T" $USERSWAP 2> /dev/null)`
 
     while read name type rest; do
        [ "$type" == "file" ]  || continue;







-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to