]> git.proxmox.com Git - grub2.git/blob - debian/config.in
Add support for forcing EFI installation to the removable media path
[grub2.git] / debian / config.in
1 #!/bin/sh
2 set -e
3
4 case `dpkg --print-architecture` in
5 kfreebsd-*)
6 # No migration from GRUB Legacy, no Linux cmdline
7 exit 0
8 ;;
9 esac
10
11 . /usr/share/debconf/confmodule
12
13 priority=medium
14
15 case @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
24 kopt=`sed -ne "s/^# kopt=//p" /boot/grub/menu.lst | tr -s " " "\n" | grep -vx "\(ro\|root=[^ ]*\)" | paste -s -d ' '` || true
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
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
43 fi
44 fi
45 ;;
46 esac
47
48 for x in /etc/default/grub /etc/default/grub.d/*.cfg ; do
49 if [ -e "$x" ]; then
50 . "$x"
51 fi
52 done
53
54 if [ "${GRUB_CMDLINE_LINUX+set}" = set ]; then
55 db_set grub2/linux_cmdline "$GRUB_CMDLINE_LINUX"
56 fi
57 if [ "${GRUB_CMDLINE_LINUX_DEFAULT+set}" = set ]; then
58 db_set grub2/linux_cmdline_default "$GRUB_CMDLINE_LINUX_DEFAULT"
59 fi
60
61 case @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
68 elif egrep -qs '^#?[[:space:]]*GRUB_HIDDEN_TIMEOUT=' /etc/default/grub; then
69 db_set grub-pc/hidden_timeout false
70 fi
71 ;;
72 esac
73
74 db_input ${priority} grub2/linux_cmdline || true
75 db_input medium grub2/linux_cmdline_default || true
76 db_input low grub2/force_efi_extra_removable || true
77 db_go