File: newkernel

package info (click to toggle)
hibernate 2.0%2B15%2Bg88d54a8-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 740 kB
  • ctags: 114
  • sloc: sh: 1,223; makefile: 17
file content (27 lines) | stat: -rw-r--r-- 960 bytes parent folder | download
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
# -*- sh -*-
# vim:ft=sh:ts=8:sw=4:noet
#
# newkernel scriptlet - suggested by Martin F Krafft (madduck), and
# written by Cameron Patrick.  Based (very loosely) on the lockfile
# scriptlet.

NEWKERNELFILE="/var/run/tuxonice-new-kernel"

AddSuspendHook 01 NewKernelFileCheck

# Check to see if $NEWKERNELFILE exists, and if so print a message and
# refuse to hibernate.
NewKernelFileCheck() {
    if ! [ -f "$NEWKERNELFILE" ]; then
	return 0 # no file present, so go ahead and hibernate
    fi
    vecho 0 "$EXE: You have upgraded your kernel, and a suspend image from this"
    vecho 0 "$EXE: kernel will not resume correctly with the new one.  Please"
    vecho 0 "$EXE: reboot your machine before suspending again."
    vecho 0 ""
    vecho 0 "$EXE: If you think this message is incorrect, or you know what you're"
    vecho 0 "$EXE: doing and want to suspend anyway, please remove $NEWKERNELFILE"
    return 2 # refuse to hibernate, even with -f
}

# $Id$