58fe9aa
From 6c49dab7f960e77a7025cf697b3432bbf480ac96 Mon Sep 17 00:00:00 2001
58fe9aa
From: Peter Jones <pjones@redhat.com>
58fe9aa
Date: Thu, 4 Sep 2014 14:23:23 -0400
58fe9aa
Subject: [PATCH 146/152] Generate OS and CLASS in 10_linux from
58fe9aa
 /etc/os-release
58fe9aa
58fe9aa
This makes us use pretty names in the titles we generate in
58fe9aa
grub2-mkconfig when GRUB_DISTRIBUTOR isn't set.
58fe9aa
58fe9aa
Resolves: rhbz#996794
58fe9aa
58fe9aa
Signed-off-by: Peter Jones <pjones@redhat.com>
58fe9aa
---
58fe9aa
 util/grub.d/10_linux.in | 3 ++-
58fe9aa
 1 file changed, 2 insertions(+), 1 deletion(-)
58fe9aa
58fe9aa
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
58fe9aa
index 6480cd6..ede7175 100644
58fe9aa
--- a/util/grub.d/10_linux.in
58fe9aa
+++ b/util/grub.d/10_linux.in
58fe9aa
@@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@"
58fe9aa
 CLASS="--class gnu-linux --class gnu --class os --unrestricted"
58fe9aa
 
58fe9aa
 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
58fe9aa
-  OS="$(sed 's, release .*$,,g' /etc/system-release)"
58fe9aa
+  OS="$(eval $(grep PRETTY_NAME /etc/os-release) ; echo ${PRETTY_NAME})"
58fe9aa
+  CLASS="--class $(eval $(grep '^ID_LIKE=\|^ID=' /etc/os-release) ; [ -n "${ID_LIKE}" ] && echo ${ID_LIKE} || echo ${ID}) ${CLASS}"
58fe9aa
 else
58fe9aa
   OS="${GRUB_DISTRIBUTOR}"
58fe9aa
   CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
58fe9aa
-- 
58fe9aa
1.9.3
58fe9aa