From: Stefan Seyfried <seife@suse.de>
To: ncunningham@cyclades.com
Cc: Pavel Machek <pavel@ucw.cz>, LKML <linux-kernel@vger.kernel.org>,
dtor_core@ameritech.net
Subject: Re: Swsusp, resume and kernel versions
Date: Thu, 17 Feb 2005 22:05:00 +0100 [thread overview]
Message-ID: <421506FC.3060909@suse.de> (raw)
In-Reply-To: <1108627778.4471.54.camel@desktop.cunningham.myip.net.au>
Nigel Cunningham wrote:
> If the mistakenly booted kernel isn't suspend enabled, however, you need
> a more generic method of removing the image, such as mkswapping the
> storage device. This is what I was speaking of.
The following code is used in the SUSE bootscripts to do exactly this:
----------------------------------------------------
get_swap_id() {
local line;
fdisk -l | while read line; do
case "$line" in
/*Linux\ [sS]wap*) echo "${line%% *}"
esac
done
}
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
}
---------------------------------------------------------------------
This invalidates the suspend signature if the kernel has not already
done it. It probably does not cover the softwaresuspend2 signature but
that should be trivial to add.
Regards,
Stefan
next prev parent reply other threads:[~2005-02-18 9:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-17 4:46 Swsusp, resume and kernel versions Dmitry Torokhov
2005-02-17 5:15 ` Nigel Cunningham
2005-02-17 5:38 ` Dmitry Torokhov
2005-02-17 8:09 ` Nigel Cunningham
2005-02-17 21:05 ` Stefan Seyfried [this message]
2005-02-18 10:34 ` Nigel Cunningham
2005-02-18 11:23 ` Stefan Seyfried
2005-02-17 11:07 ` Pavel Machek
2005-02-17 16:28 ` John M Flinchbaugh
2005-02-17 17:30 ` Dmitry Torokhov
2005-02-17 19:56 ` Pavel Machek
2005-02-17 20:09 ` Dmitry Torokhov
2005-02-18 2:02 ` Bernard Blackham
2005-02-18 11:24 ` Pavel Machek
2005-02-18 12:26 ` Bernard Blackham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=421506FC.3060909@suse.de \
--to=seife@suse.de \
--cc=dtor_core@ameritech.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ncunningham@cyclades.com \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox