diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:54:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:54:18 +0000 |
commit | 8e67fbf68ffeb9eb5f026dd482d73b021660bf9b (patch) | |
tree | bb573facd5d02096f9956b2617a722b88acaa8af /debian/config.in | |
parent | Adding upstream version 2.06. (diff) | |
download | grub2-debian.tar.xz grub2-debian.zip |
Adding debian version 2.06-3~deb11u6.debian/2.06-3_deb11u6debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/config.in | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/debian/config.in b/debian/config.in new file mode 100644 index 0000000..c52416d --- /dev/null +++ b/debian/config.in @@ -0,0 +1,87 @@ +#!/bin/sh +set -e + +case `dpkg --print-architecture` in + kfreebsd-*) + # No migration from GRUB Legacy, no Linux cmdline + exit 0 + ;; +esac + +. /usr/share/debconf/confmodule + +priority=medium + +case @PACKAGE@ in + grub-pc) + if test -e /boot/grub/stage2 && test -e /boot/grub/menu.lst && ! test -e /boot/grub/core.img ; then + + db_input high grub-pc/chainload_from_menu.lst || true + + db_get grub-pc/kopt_extracted || true + # this check ensures we only do this once + if [ "$RET" = "false" ] ; then + kopt=`sed -ne "s/^# kopt=//p" /boot/grub/menu.lst | tr -s " " "\n" | grep -vx "\(ro\|root=[^ ]*\)" | paste -s -d ' '` || true + db_set grub2/linux_cmdline "${kopt}" || true + db_set grub-pc/kopt_extracted true || true + if [ "${kopt}" = "" ] ; then + # something smells bad. give user a chance to correct it. + priority=high + else + # if we got something from menu.lst, it must be correct? + priority=medium + fi + timeout=`sed -ne "s/^timeout[[:space:]][[:space:]]*//p" /boot/grub/menu.lst` || true + if [ "${timeout}" != "" ]; then + db_set grub-pc/timeout "${timeout}" || true + fi + if grep -q '^hiddenmenu\([[:space:]]\|$\)' /boot/grub/menu.lst; then + db_set grub-pc/hidden_timeout true || true + else + db_set grub-pc/hidden_timeout false || true + fi + fi + fi + ;; +esac + +# This deliberately doesn't include /etc/default/grub.d/*.cfg, since we're +# only sourcing this configuration file in order to prompt for values to +# write back to /etc/default/grub. +if [ -e /etc/default/grub ]; then + . /etc/default/grub +fi + +if [ "${GRUB_CMDLINE_LINUX+set}" = set ]; then + db_set grub2/linux_cmdline "$GRUB_CMDLINE_LINUX" +fi +if [ "${GRUB_CMDLINE_LINUX_DEFAULT+set}" = set ]; then + db_set grub2/linux_cmdline_default "$GRUB_CMDLINE_LINUX_DEFAULT" +fi + +case @PACKAGE@ in + grub-pc) + if [ "${GRUB_TIMEOUT}" != "" ]; then + db_set grub-pc/timeout "$GRUB_TIMEOUT" + fi + if [ "${GRUB_HIDDEN_TIMEOUT}" != "" ]; then + db_set grub-pc/hidden_timeout true + elif egrep -qs '^#?[[:space:]]*GRUB_HIDDEN_TIMEOUT=' /etc/default/grub; then + db_set grub-pc/hidden_timeout false + fi + ;; +esac + +db_input ${priority} grub2/linux_cmdline || true +db_input medium grub2/linux_cmdline_default || true +case @PACKAGE@ in + grub-*efi*) + db_input low grub2/force_efi_extra_removable || true + ;; +esac +case @PACKAGE@ in + grub-*efi*|grub-ieee1275) + db_input low grub2/update_nvram || true + ;; +esac +db_go |