>From f769c045f246859224fbf0037a5617cdf4de35bb Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Tue, 22 Dec 2015 16:11:13 +0100 Subject: [PATCH] Allow to add/change menu entry class defaults. Useful for changing the default access level for menu entries when using GRUBs password protection feature. Ansible role which makes use of this patch: https://github.com/debops/ansible-grub/pull/7 --- util/grub-mkconfig.in | 12 +++++++++++- util/grub.d/10_hurd.in | 2 +- util/grub.d/10_illumos.in | 2 +- util/grub.d/10_kfreebsd.in | 2 +- util/grub.d/10_linux.in | 2 +- util/grub.d/20_linux_xen.in | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 3183744..56a88e2 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -227,7 +227,17 @@ export GRUB_DEFAULT \ GRUB_ENABLE_CRYPTODISK \ GRUB_BADRAM \ GRUB_OS_PROBER_SKIP_LIST \ - GRUB_DISABLE_SUBMENU + GRUB_DISABLE_SUBMENU \ + GRUB_LINUX_MENUENTRY_CLASS \ + GRUB_LINUX_MENUENTRY_CLASS_ADDITIONAL \ + GRUB_XEN_MENUENTRY_CLASS \ + GRUB_XEN_MENUENTRY_CLASS_ADDITIONAL \ + GRUB_HURD_MENUENTRY_CLASS \ + GRUB_HURD_MENUENTRY_CLASS_ADDITIONAL \ + GRUB_ILLUMOS_MENUENTRY_CLASS \ + GRUB_ILLUMOS_MENUENTRY_CLASS_ADDITIONAL \ + GRUB_KFREEBSD_MENUENTRY_CLASS \ + GRUB_KFREEBSD_MENUENTRY_CLASS_ADDITIONAL if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index 59a9a48..4b31d11 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -26,7 +26,7 @@ export TEXTDOMAINDIR="@localedir@" . "$pkgdatadir/grub-mkconfig_lib" -CLASS="--class gnu --class os" +CLASS=${GRUB_HURD_MENUENTRY_CLASS:-"--class gnu --class os ${GRUB_HURD_MENUENTRY_CLASS_ADDITIONAL:-}"} if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU diff --git a/util/grub.d/10_illumos.in b/util/grub.d/10_illumos.in index a133e1b..0f62a24 100644 --- a/util/grub.d/10_illumos.in +++ b/util/grub.d/10_illumos.in @@ -25,7 +25,7 @@ datarootdir="@datarootdir@" export address@hidden@ export TEXTDOMAINDIR="@localedir@" -CLASS="--class os" +CLASS=${GRUB_ILLUMOS_MENUENTRY_CLASS:-"--class os ${GRUB_ILLUMOS_MENUENTRY_CLASS_ADDITIONAL:-}"} case "${GRUB_DISTRIBUTOR}" in *) diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in index 9d8e8fd..773d151 100644 --- a/util/grub.d/10_kfreebsd.in +++ b/util/grub.d/10_kfreebsd.in @@ -25,7 +25,7 @@ datarootdir="@datarootdir@" export address@hidden@ export TEXTDOMAINDIR="@localedir@" -CLASS="--class os" +CLASS=${GRUB_KFREEBSD_MENUENTRY_CLASS:-"--class os ${GRUB_KFREEBSD_MENUENTRY_CLASS_ADDITIONAL:-}"} case "${GRUB_DISTRIBUTOR}" in Debian) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 859b608..18fb521 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -26,7 +26,7 @@ datarootdir="@datarootdir@" export address@hidden@ export TEXTDOMAINDIR="@localedir@" -CLASS="--class gnu-linux --class gnu --class os" +CLASS=${GRUB_LINUX_MENUENTRY_CLASS:-"--class gnu-linux --class gnu --class os ${GRUB_LINUX_MENUENTRY_CLASS_ADDITIONAL:-}"} if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU/Linux diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index f532fb9..fcc8cf9 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -26,7 +26,7 @@ datarootdir="@datarootdir@" export address@hidden@ export TEXTDOMAINDIR="@localedir@" -CLASS="--class gnu-linux --class gnu --class os --class xen" +CLASS=${GRUB_XEN_MENUENTRY_CLASS:-"--class gnu-linux --class gnu --class os --class xen ${GRUB_XEN_MENUENTRY_CLASS_ADDITIONAL:-}"} if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU/Linux -- 2.1.4