Skip to content

Commit 5986c65

Browse files
Andrew Lukoshkolsandov1
authored andcommitted
grub2-mkconfig: Simplify os_name detection
1 parent 641f003 commit 5986c65

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

util/grub-mkconfig.in

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,7 @@ do
109109
esac
110110
done
111111

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

0 commit comments

Comments
 (0)