File: lilo

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 (31 lines) | stat: -rw-r--r-- 858 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
28
29
30
31
# -*- sh -*-
# vim:ft=sh:ts=8:sw=4:noet

AddConfigHandler LILOConfigOptions
AddConfigHelp "EnsureLILOResumes <boolean>" "Makes sure that LILO boots the correct kernel image when rebooting to resume. This is useful when you boot into a non-default kernel or want to avoid LILO's menu delay when resuming."

DoLILOHack() {
    [ x"$ENSURE_LILO_RESUMES" != "x1" ] && return 0
    image=`sed -e 's/^.*BOOT_IMAGE=\([^ ]\+\).*$/\1/' < /proc/cmdline`
    vecho 2 "Setting LILO boot-once image to $image"
    lilo -R $image && return 0
    vecho 0 "lilo -R failed with exit status $?."
    return 1
}

LILOConfigOptions() {
    case $1 in
	ensureliloresumes)
	    BoolIsOn "$1" "$2" && ENSURE_LILO_RESUMES=1 || return 0
	    ;;
	*)
	    return 1
    esac
    if [ -z "$LILO_HOOKED" ] ; then
	AddSuspendHook 92 DoLILOHack
	LILO_HOOKED=1
    fi
    return 0
}

# $Id$