Skip to content

Commit

Permalink
mxgrub: Remove submenu
Browse files Browse the repository at this point in the history
This reverts commit 56916ee.

It’s not possible to restrict CLI access in the submenu, so remove it.
  • Loading branch information
pmenzel committed Nov 29, 2019
1 parent 0fff9e7 commit bae643e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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");
}
}

Expand Down

0 comments on commit bae643e

Please sign in to comment.