Skip to content

Commit

Permalink
mxgrub/mxgrub: Restrict editing and command line prompt
Browse files Browse the repository at this point in the history
Remove `--unrestricted` from the Linux boot entries, as that allows to
edit the entries. For submenus it allows to enter them, which is what we
want. The documentation is unfortunately not very clear about that.

[1]: https://www.gnu.org/software/grub/manual/grub/grub.html#Security
  • Loading branch information
pmenzel committed Nov 29, 2019
1 parent 5d425a9 commit 361e5f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ sub update_grub_cfg {

for my $label (@MARIUX) {
my $image=label_to_image($label);
$kernellist.="\tmenuentry \"$label\" --unrestricted { save_env chosen ; linux /boot/$image root=LABEL=root $KERNEL_PARAMETER ; initrd /boot/grub/initramfs.igz }\n";
$kernellist.="\tmenuentry \"$label\" { save_env chosen ; linux /boot/$image root=LABEL=root $KERNEL_PARAMETER ; initrd /boot/grub/initramfs.igz }\n";
}

my $GRUB_CFG_NEW=<<"EOF";
Expand All @@ -266,10 +266,10 @@ insmod all_video
if [ -e /etc/local/USB.usb ]; then
set default="mariuxUSB"
menuentry "mariuxUSB" --unrestricted { save_env chosen ; linux /boot/bzImage.x86_64 root=LABEL=rootusb $KERNEL_PARAMETER ; initrd /boot/grub/initramfs.igz }
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 }
menuentry "$MARIUX_DEFAULT" { 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" --unrestricted {
$kernellist
Expand Down

0 comments on commit 361e5f4

Please sign in to comment.