From: Robin Schneider <ypid@riseup.net>
To: grub-devel@gnu.org
Subject: Re: [PATCH] Allow to add/change menu entry class defaults.
Date: Wed, 23 Dec 2015 21:54:34 +0100 [thread overview]
Message-ID: <567B0A0A.2050804@riseup.net> (raw)
In-Reply-To: <CAA91j0XxsdOXj1BrHPPYHNGoDrqy7eW3irtjfbn2MSZ61zWk6w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 23.12.2015 07:58, Andrei Borzenkov wrote:
> On Tue, Dec 22, 2015 at 6:19 PM, Robin Schneider <ypid@riseup.net> wrote:
>> 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
>>
>
> That's overcomplicated. The first class found wins and you will not define
> them unless you have them. So just having
>
> class="$GRUB_..._CLASS --class ..."
>
> is really enough.
Thanks for the input. I agree that my first patch was probably a bit to
flexible. I attached a updated patch.
>
>> Let me know what you think.
>>
>
> I'm not sure I like turning grub-mkconfig into kitchen sink, but yes, that
> probably makes sense. It allows easy vendor-specific icons without need to
> patch grub every time.
>
>> -CLASS="--class gnu-linux --class gnu --class os --class xen"
>
> I guess "--class xen" should be in front as most specific (unrelated to
> your patch).
>
> I have half baked patch lying around that tries to use more sensible icons
> in os-prober as well. May be it's time to revisit it.
- --
Live long and prosper
Robin `ypid` Schneider
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJWewoKAAoJEIb9mAu/GkD4tJoQAMtvZcUGrksI0VtCVOJvibrr
2/NN2B2191blBIgi9HffciLUDaI3zX1g3dWwhXh0PYLdMmxyfbR3ewK/bzHWN9gg
amCGsyPPbaWBpsE6c2jhLDqFX+on67DCCXiCS4QJX+u31ZwRbZhqhekAvZxvH00W
pju/2WEMQv4CA15lBvBYB/y6Sux1sNyl/4jdC5ZvtAgsNAj+Z1ADebSsi7G+ym48
N1gbjgFOR1p4ORfSKjhHvGAfJ/8JaNatphp1BMYJImozy/ktZC+vbr+7N/tc/LW2
XWxpi3drKM2x8kZerGA4vITVjTxWZyrkQtErRQPROE6r+NxoqUotzny7y2KSZtCB
3ncEn10sA360o5TLnY5WCqrN7XbLh73T/g7ePWCumy/IIKAY9oPuxzFI/vLElzDf
QBAhL/G7GYTRJX5nwRVbeMwwhcx+UrxllSSLswcLZCCpfO2XQXDSjlZiGVfvoRMS
oxmF/kQ5GD2X3Chs33gX4cPCE4NPf1xdg0mQEnpx8e3RcdaLR5kki8p8mi97ME+j
LyMJDUZsbnrz0ylljdieDJWHnHFLrRuj4Qksn0bWUTG/+1zSSX66rzGVzP9/pwKv
/3JkN2D7q3aTBcBts9BzeJgomi1iJtDsbd03ve1SiTX9iUH+6lylToxtuCT3T4jX
SF0yyzjjewj7idRFrhH6
=JF0U
-----END PGP SIGNATURE-----
[-- Attachment #2: 0001-Allow-to-add-change-menu-entry-class-defaults.patch --]
[-- Type: text/x-patch, Size: 3363 bytes --]
From c8a8c9901837f4d4217507cf82a754b99111e721 Mon Sep 17 00:00:00 2001
From: Robin Schneider <ypid@riseup.net>
Date: Wed, 23 Dec 2015 17:23:42 +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 | 7 ++++++-
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, 11 insertions(+), 6 deletions(-)
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 3183744..3f5468c 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -227,7 +227,12 @@ export GRUB_DEFAULT \
GRUB_ENABLE_CRYPTODISK \
GRUB_BADRAM \
GRUB_OS_PROBER_SKIP_LIST \
- GRUB_DISABLE_SUBMENU
+ GRUB_DISABLE_SUBMENU \
+ GRUB_LINUX_MENUENTRY_CLASS \
+ GRUB_XEN_MENUENTRY_CLASS \
+ GRUB_HURD_MENUENTRY_CLASS \
+ GRUB_ILLUMOS_MENUENTRY_CLASS \
+ GRUB_KFREEBSD_MENUENTRY_CLASS
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..9c3ba8e 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"
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..db85554 100644
--- a/util/grub.d/10_illumos.in
+++ b/util/grub.d/10_illumos.in
@@ -25,7 +25,7 @@ datarootdir="@datarootdir@"
export TEXTDOMAIN=@PACKAGE@
export TEXTDOMAINDIR="@localedir@"
-CLASS="--class os"
+CLASS="${GRUB_ILLUMOS_MENUENTRY_CLASS} --class os"
case "${GRUB_DISTRIBUTOR}" in
*)
diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
index 9d8e8fd..fb9f4b0 100644
--- a/util/grub.d/10_kfreebsd.in
+++ b/util/grub.d/10_kfreebsd.in
@@ -25,7 +25,7 @@ datarootdir="@datarootdir@"
export TEXTDOMAIN=@PACKAGE@
export TEXTDOMAINDIR="@localedir@"
-CLASS="--class os"
+CLASS="${GRUB_KFREEBSD_MENUENTRY_CLASS} --class os"
case "${GRUB_DISTRIBUTOR}" in
Debian)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 859b608..266158b 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -26,7 +26,7 @@ datarootdir="@datarootdir@"
export TEXTDOMAIN=@PACKAGE@
export TEXTDOMAINDIR="@localedir@"
-CLASS="--class gnu-linux --class gnu --class os"
+CLASS="${GRUB_LINUX_MENUENTRY_CLASS} --class gnu-linux --class gnu --class os"
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..80d0f9b 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -26,7 +26,7 @@ datarootdir="@datarootdir@"
export TEXTDOMAIN=@PACKAGE@
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"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
--
2.1.4
[-- Attachment #3: 0001-Allow-to-add-change-menu-entry-class-defaults.patch.sig --]
[-- Type: application/pgp-signature, Size: 543 bytes --]
next prev parent reply other threads:[~2015-12-23 20:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-22 15:19 [PATCH] Allow to add/change menu entry class defaults Robin Schneider
2015-12-23 6:58 ` Andrei Borzenkov
2015-12-23 20:54 ` Robin Schneider [this message]
2015-12-24 8:21 ` Andrei Borzenkov
2015-12-26 21:17 ` Robin Schneider
2015-12-27 17:03 ` Andrei Borzenkov
2015-12-27 20:44 ` Robin Schneider
2016-01-13 12:12 ` Robin Schneider
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=567B0A0A.2050804@riseup.net \
--to=ypid@riseup.net \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.