Update update-grub script
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
94897d5530
commit
6614774225
1 changed files with 6 additions and 3 deletions
|
|
@ -1,8 +1,12 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
. /etc/os-release
|
||||
if [ -d /sys/firmware/efi -a -e /boot/efi/EFI/centos/grub.cfg ]; then
|
||||
CONFDIR=/boot/efi/EFI/centos
|
||||
elif [ -d /sys/firmware/efi -a -e /boot/efi/EFI/almalinux/grub.cfg ]; then
|
||||
CONFDIR=/boot/efi/EFI/almalinux
|
||||
elif [ -d /sys/firmware/efi -a -e /boot/efi/EFI/redhat/grub.cfg ]; then
|
||||
CONFDIR=/boot/efi/EFI/redhat
|
||||
else
|
||||
CONFDIR=/boot/grub2
|
||||
fi
|
||||
|
|
@ -24,7 +28,6 @@ done | while read j; do
|
|||
echo $KERNLIST | sed 's/ /\n/g' | grep ^$j | sort -n -u -k3 -t.
|
||||
done | tail -n 1)"
|
||||
|
||||
grub2-set-default "$(grep "^menuentry" "${CONFDIR}"/grub.cfg | cut -d "'" -f2 | grep -Ev '(with debugging$|-rescue-)' | grep ^"$NAME" | grep $LASTKERNEL | sort -n | tail -n 1)"
|
||||
grub2-set-default "$(grep "^menuentry" "${CONFDIR}"/grub.cfg | cut -d \' -f2 | grep -Ev '(with debugging$|-rescue-)' | grep ^"$NAME" | grep $LASTKERNEL | sort -n | tail -n 1)"
|
||||
|
||||
grub2-mkconfig -o "${CONFDIR}"/grub.cfg
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue