Last active
February 8, 2022 22:36
-
-
Save blizzardengle/fdf9f0733d2ad1f8d31bf4ffccab0b39 to your computer and use it in GitHub Desktop.
Update the GPT partition UUID in the GRUB configuration when using EFI images of OpenWrt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opkg update | |
opkg install lsblk | |
BOOT="$(sed -n -e "/\s\/boot\s.*$/{s///p;q}" /etc/mtab)" | |
DISK="${BOOT%%[0-9]*}" | |
PART="$((${BOOT##*[^0-9]}+1))" | |
ROOT="${DISK}${PART}" | |
UUID="$(lsblk -n -o PARTUUID ${ROOT})" | |
sed -i -r -e "s|(PARTUUID=)\S+|\1${UUID}|g" /boot/grub/grub.cfg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment