mirror of
https://github.com/krizsipeti/custom_blfs_packages.git
synced 2025-01-23 14:32:21 +08:00
Use root=UUID in grub.cfg
This commit is contained in:
parent
17e283c766
commit
de071f7e87
@ -258,10 +258,10 @@ GRUB_SCRIPT=$(find "$DIR_COMMANDS" -type f -iname "1*-grub")
|
||||
if [ -n "$GRUB_SCRIPT" ] ; then
|
||||
sed -i "/^cat /i grub-install $(lsblk -l -o MOUNTPOINT,PATH,NAME,PKNAME | grep "^$1 " | awk '{gsub($3,$4,$2); print $2}')\n" "$GRUB_SCRIPT"
|
||||
KERNEL_NAME=$(grep "$GRUB_SCRIPT" -e vmlinuz | awk '{gsub("/boot/","",$2); print $2}')
|
||||
sed -i "/menuentry/a\ set opts=\"net.ifnames=0\ nvidia_drm.modeset=1\"\n set lnx_root=\"$(lsblk -l -o MOUNTPOINT,PATH | grep "^$1 " | awk '{print $2}')\"\n set knl_name=\"/$KERNEL_NAME\"" "$GRUB_SCRIPT"
|
||||
sed -i "/menuentry/a\ set opts=\"net.ifnames=0\ nvidia_drm.modeset=1\"\n set lnx_root=\"$(lsblk -l -o MOUNTPOINT,UUID | grep "^$1 " | awk '{print $2}')\"\n set knl_name=\"/$KERNEL_NAME\"" "$GRUB_SCRIPT"
|
||||
if [ -z "$(lsblk -l -o MOUNTPOINT,PATH | grep "^$1/boot " | awk '{print $2}')" ] ; then
|
||||
sed -i 's/knl_name="/knl_name="\/boot/g' "$GRUB_SCRIPT"
|
||||
fi
|
||||
sed -i "/set root=/d;/^ .*linux /c\ linux \${knl_name} root=\${lnx_root} ro \${opts}" "$GRUB_SCRIPT"
|
||||
sed -i "/set root=/d;/^ .*linux /c\ linux \${knl_name} root=UUID=\${lnx_root} ro \${opts}" "$GRUB_SCRIPT"
|
||||
sed -i '/set timeout/a set color_normal=white/black\nset color_highlight=yellow/black\nset menu_color_normal=light-blue/black\nset menu_color_highlight=yellow/blue' "$GRUB_SCRIPT"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user