From bae643e1318f414efdc604b3371abefdc4c75521 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 29 Nov 2019 16:47:10 +0100 Subject: [PATCH] mxgrub: Remove submenu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 56916eea6cdcd5c826f7d7f70798e9937cddbdde. It’s not possible to restrict CLI access in the submenu, so remove it. --- mxgrub/mxgrub | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mxgrub/mxgrub b/mxgrub/mxgrub index 07e7dbd..aa5a1e6 100755 --- a/mxgrub/mxgrub +++ b/mxgrub/mxgrub @@ -163,13 +163,11 @@ sub has_esp { return !system('blkid -L ESP>/dev/null'); } -our $submenu="all-other-kernel"; - sub get_chosen { my $chosen; open my $p,'-|','grub-editenv','-','list' or die "$!\n"; while (<$p>) { - /^chosen=(?:$submenu>)?(.+)/ and return $1; + /^chosen=(.+)/ and return $1; } close $p or die "$!\n"; $? and exit 1; @@ -269,11 +267,7 @@ if [ -e /etc/local/USB.usb ]; then menuentry "mariuxUSB" { save_env chosen ; linux /boot/bzImage.x86_64 root=LABEL=rootusb $KERNEL_PARAMETER ; initrd /boot/grub/initramfs.igz } else -menuentry "$MARIUX_DEFAULT" --unrestricted { set chosen="$submenu>$MARIUX_DEFAULT" ; save_env chosen ; linux /boot/bzImage.x86_64 root=LABEL=root $KERNEL_PARAMETER ; initrd /boot/grub/initramfs.igz } - -submenu "$submenu" { $kernellist -} if [ \$chosen ]; then set default=\$chosen unset chosen # must be clear to get a clean value from menuentry @@ -342,7 +336,7 @@ sub cmd_install { if ($label eq 'default') { sys('grub-editenv','-','set',"chosen=$MARIUX_DEFAULT"); } else { - sys('grub-editenv','-','set',"chosen=$submenu>$label"); + sys('grub-editenv','-','set',"chosen=$label"); } }