1895
by Colin Watson
import remainder of 1.97+20091130-1ubuntu1 |
1 |
#! /bin/sh
|
2 |
### BEGIN INIT INFO
|
|
3 |
# Provides: grub-common
|
|
4 |
# Required-Start: $all
|
|
5 |
# Required-Stop:
|
|
6 |
# Default-Start: 2 3 4 5
|
|
7 |
# Default-Stop:
|
|
8 |
# Short-Description: Record successful boot for GRUB
|
|
9 |
# Description: GRUB displays the boot menu at the next boot if it
|
|
10 |
# believes that the previous boot failed. This script
|
|
11 |
# informs it that the system booted successfully.
|
|
12 |
### END INIT INFO
|
|
13 |
||
14 |
which grub-editenv >/dev/null 2>&1 || exit 0 |
|
15 |
||
16 |
# Load the VERBOSE setting and other rcS variables
|
|
17 |
. /lib/init/vars.sh |
|
18 |
||
19 |
# Define LSB log_* functions.
|
|
20 |
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
|
21 |
. /lib/lsb/init-functions |
|
22 |
||
23 |
case $1 in |
|
24 |
start|restart|force-reload) |
|
25 |
[ "$VERBOSE" != no ] && log_action_msg "Recording successful boot for GRUB" |
|
26 |
[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv |
|
27 |
mkdir -p /boot/grub |
|
28 |
grub-editenv /boot/grub/grubenv unset recordfail
|
|
29 |
[ "$VERBOSE" != no ] && log_end_msg $? |
|
30 |
;;
|
|
31 |
stop)
|
|
32 |
;;
|
|
33 |
status)
|
|
34 |
exit 0 |
|
35 |
;;
|
|
36 |
*)
|
|
37 |
echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 |
|
38 |
exit 3 |
|
39 |
;;
|
|
40 |
esac
|
|
41 |
||
42 |
exit 0 |