From f64f39070537964195571366380390d85eeacec2 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 21 Aug 2017 10:19:42 +0200 Subject: [PATCH] fixed the missing seperator last problem if you use `mxgrub default` -> grub-editenv - set chosen=mariux-4.9.43-170 `mxgrub mariux-4.9.43-170` -> grub-editenv - set chosen=all-other-kernel>mariux-4.9.43-170 --- mxgrub/mxgrub | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mxgrub/mxgrub b/mxgrub/mxgrub index 7053cbd..34a5173 100755 --- a/mxgrub/mxgrub +++ b/mxgrub/mxgrub @@ -86,11 +86,13 @@ sub is_VX50 { return $data=~/VX50/; } +our $submenu="all-other-kernel"; + sub get_chosen { my $chosen; open my $p,'-|','grub-editenv','-','list' or die "$!\n"; while (<$p>) { - /^chosen=(.+)/ and return $1; + /^chosen=$submenu\>(.+)|^chosen=(.+)/ and return $1; } close $p or die "$!\n"; $? and exit 1; @@ -185,9 +187,9 @@ if [ -e /etc/local/USB.usb ]; then menuentry "mariuxUSB" --unrestricted { save_env chosen ; linux /boot/bzImage.x86_64 crashkernel=256M root=LABEL=rootusb ro ; initrd /boot/grub/initramfs.igz } else -menuentry "$MARIUX_DEFAULT" --unrestricted { save_env chosen ; linux /boot/bzImage.x86_64 crashkernel=256M root=LABEL=root ro ; initrd /boot/grub/initramfs.igz } +menuentry "$MARIUX_DEFAULT" --unrestricted { save_env chosen ; linux /boot/bzImage.x86_64 crashkernel=256M root=LABEL=root ro console=ttyS1,115200n8 console=tty0 ; initrd /boot/grub/initramfs.igz } -submenu "all other kernel" --unrestricted { +submenu "$submenu" --unrestricted { $kernellist } if [ \$chosen ]; then @@ -245,7 +247,7 @@ sub cmd_install { if ($label eq 'default') { sys('grub-editenv','-','set',"chosen=$MARIUX_DEFAULT"); } else { - sys('grub-editenv','-','set',"chosen=$label"); + sys('grub-editenv','-','set',"chosen=$submenu>$label"); } }