Skip to content

Commit

Permalink
grub2-mkconfig: Simplify os_name detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lukoshko authored and nfrayer committed Aug 12, 2024
1 parent 2b9a830 commit b271a74
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions util/grub-mkconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,7 @@ do
esac
done

os_name=$(grep '^ID=' /etc/os-release | sed 's/ID=//')
if test "$os_name" = '"rhel"'; then
os_name=redhat
elif test "$os_name" = '"centos"'; then
os_name=centos
fi
os_name=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
if test "x${grub_cfg}" = "x/boot/efi/EFI/$os_name/grub.cfg" &&\
mountpoint -q /boot/efi; then
gettext_printf "Running \`grub2-mkconfig -o %s' will overwrite the GRUB wrapper.\n" "$grub_cfg" 1>&2
Expand Down

0 comments on commit b271a74

Please sign in to comment.