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