Blame SOURCES/0147-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch

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