]> git.proxmox.com Git - grub2.git/blame - debian/config.in
Add grub2/update_nvram template to allow users to disable NVRAM updates during packag...
[grub2.git] / debian / config.in
CommitLineData
9e6dbc10
CW
1#!/bin/sh
2set -e
b6e3586c 3
dd66f732 4case `dpkg --print-architecture` in
5 kfreebsd-*)
6 # No migration from GRUB Legacy, no Linux cmdline
7 exit 0
8 ;;
9esac
10
b6e3586c 11. /usr/share/debconf/confmodule
12
ddfa395c 13priority=medium
642638e0 14
15case @PACKAGE@ in
16 grub-pc)
17 if test -e /boot/grub/stage2 && test -e /boot/grub/menu.lst && ! test -e /boot/grub/core.img ; then
18
19 db_input high grub-pc/chainload_from_menu.lst || true
20
21 db_get grub-pc/kopt_extracted || true
22 # this check ensures we only do this once
23 if [ "$RET" = "false" ] ; then
04246346 24 kopt=`sed -ne "s/^# kopt=//p" /boot/grub/menu.lst | tr -s " " "\n" | grep -vx "\(ro\|root=[^ ]*\)" | paste -s -d ' '` || true
642638e0 25 db_set grub2/linux_cmdline "${kopt}" || true
26 db_set grub-pc/kopt_extracted true || true
27 if [ "${kopt}" = "" ] ; then
28 # something smells bad. give user a chance to correct it.
29 priority=high
30 else
31 # if we got something from menu.lst, it must be correct?
32 priority=medium
33 fi
b4ada2ef
CW
34 timeout=`sed -ne "s/^timeout[[:space:]][[:space:]]*//p" /boot/grub/menu.lst` || true
35 if [ "${timeout}" != "" ]; then
36 db_set grub-pc/timeout "${timeout}" || true
37 fi
38 if grep -q '^hiddenmenu\([[:space:]]\|$\)' /boot/grub/menu.lst; then
39 db_set grub-pc/hidden_timeout true || true
40 else
41 db_set grub-pc/hidden_timeout false || true
42 fi
642638e0 43 fi
44 fi
45 ;;
46esac
47
7a110bd0
AC
48for x in /etc/default/grub /etc/default/grub.d/*.cfg ; do
49 if [ -e "$x" ]; then
7a110bd0
AC
50 . "$x"
51 fi
52done
53
50f74fa5 54if [ "${GRUB_CMDLINE_LINUX+set}" = set ]; then
36a14bfa 55 db_set grub2/linux_cmdline "$GRUB_CMDLINE_LINUX"
50f74fa5
CW
56fi
57if [ "${GRUB_CMDLINE_LINUX_DEFAULT+set}" = set ]; then
36a14bfa 58 db_set grub2/linux_cmdline_default "$GRUB_CMDLINE_LINUX_DEFAULT"
59fi
60
b4ada2ef
CW
61case @PACKAGE@ in
62 grub-pc)
63 if [ "${GRUB_TIMEOUT}" != "" ]; then
64 db_set grub-pc/timeout "$GRUB_TIMEOUT"
65 fi
66 if [ "${GRUB_HIDDEN_TIMEOUT}" != "" ]; then
67 db_set grub-pc/hidden_timeout true
f7319022 68 elif egrep -qs '^#?[[:space:]]*GRUB_HIDDEN_TIMEOUT=' /etc/default/grub; then
b4ada2ef
CW
69 db_set grub-pc/hidden_timeout false
70 fi
71 ;;
72esac
73
642638e0 74db_input ${priority} grub2/linux_cmdline || true
609fdab8 75db_input medium grub2/linux_cmdline_default || true
3b539432
SM
76case @PACKAGE@ in
77 grub-*efi*)
78 db_input low grub2/force_efi_extra_removable || true
79 ;;
80esac
dabbd8fe 81case @PACKAGE@ in
82 grub-*efi*|grub-ieee1275)
83 db_input low grub2/update_nvram || true
84 ;;
85esac
b6e3586c 86db_go