Re: swappiness=0 makes software suspend fail.

From: Stefan Seyfried
Date: Mon May 31 2004 - 14:10:47 EST


On Mon, May 31, 2004 at 01:50:49PM +0200, Pavel Machek wrote:

> I believe stefan has some script that fixes swap signature using dd if
> it detects suspend signature...

this is in boot.swap initscript:

check_swap_sig () {
local part="$(get_swap_id)"
local where what type rest p c
while read where what type rest ; do
test "$type" = "swap" || continue
c=continue
for p in $part ; do
test "$p" = "$where" && c=true
done
$c
case "$(dd if=$where bs=1 count=6 skip=4086 2>/dev/null)" in
S1SUSP|S2SUSP) mkswap $where
esac
done < /etc/fstab
}

so if the user passes "noresume", the boot scripts fix up the mess :-)
An unconditional "mkswap" on the swap partition is a not-so-good idea
unless you check the ID of the partition from the partition table since
mkswap will create swap on anything you give him which may not always
be what you wanted.

Anyway, i think it is not too bad doing such cleanup stuff in userspace.

--
Stefan Seyfried QA / R&D mobile devices, SUSE LINUX AG

"Any ideas, John?"
"Well, surrounding thems out."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/