1

Update reboot-windows to look for UEFI boot entry

This commit is contained in:
Jessie Hildebrandt 2024-08-20 14:24:30 -04:00
parent 1c9aed3d3c
commit 1325566857

View File

@ -13,14 +13,15 @@
REBOOT_CMD=$(cat <<EOF REBOOT_CMD=$(cat <<EOF
# Find the exact name of the first Windows menuentry in grub.cfg # Find the ID of the Windows entry in the UEFI boot manager
WINDOWS_ENTRY=\$(sudo grep menuentry /boot/grub2/grub.cfg | grep -Po "'.*Windows.*?'" | grep -o "[^'].*[^']") WINDOWS_ENTRY=\$(efibootmgr | grep -Po "Boot.*Windows" | grep -Po "[[:digit:]]+");
# Set next_entry in grubenv to the Windows menuentry # Set BootNext in the UEFI boot manager to the Windows entry
sudo grub2-reboot "\$WINDOWS_ENTRY"; #sudo grub2-reboot "\$WINDOWS_ENTRY";
sudo efibootmgr --bootnext "\$WINDOWS_ENTRY";
# Copy grubenv to the OpenSUSE grub EFI folder (/boot/grub2/ is not visible on UEFI installs) # Copy grubenv to the OpenSUSE grub EFI folder (/boot/grub2/ is not visible on UEFI installs)
sudo cp /boot/grub2/grubenv /boot/efi/EFI/opensuse/grubenv #sudo cp /boot/grub2/grubenv /boot/efi/EFI/opensuse/grubenv;
# Reboot! # Reboot!
sudo reboot; sudo reboot;