From 85a3be8fc73ca019f7ea89c7872ce06c028cfc2f Mon Sep 17 00:00:00 2001
From: "Luke T. Shumaker" <lukeshu@lukeshu.com>
Date: Sat, 13 Jan 2024 16:08:36 -0700
Subject: [PATCH 4/4] 10_linux, 20_linux_xen: rebrand free distros
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Based on the following downstream commits:

 - https://gitlab.archlinux.org/archlinux/packaging/packages/grub/-/commit/df234e54c93f3e4e3f78835ad5bda9fb6dbd2a97

 - https://git.parabola.nu/abslibre.git/commit/?id=554b8e3c70a352c2b80f374661ef6ea5f178617b
 - https://git.parabola.nu/abslibre.git/commit/?id=ad20b5222cc70c36f75acadee9ed477af99c41a3
 - https://git.parabola.nu/abslibre.git/commit/?id=bf492125a9aa1c1f7eee0be6c2794b20fb734381

Co-Authored-By: Ronald van Haren <ronald@archlinux.org> (2013)
Co-Authored-By: André Fabian Silva Delgado <emulatorman@parabola.nu> (2014)
Co-Authored-By: Márcio Alexandre Silva Delgado <coadde@parabola.nu> (2015)
---
 util/grub.d/10_linux.in     | 12 +++++++++++-
 util/grub.d/20_linux_xen.in | 12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 772966b89..5f8c47234 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -31,7 +31,17 @@ CLASS="--class gnu-linux --class gnu --class os"
 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
   OS=GNU/Linux
 else
-  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  if echo ${GRUB_DISTRIBUTOR} | grep -qi Parabola ; then
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+  elif echo ${GRUB_DISTRIBUTOR} | grep -qi Blag ; then
+      OS="${GRUB_DISTRIBUTOR} Linux and GNU"
+  elif echo ${GRUB_DISTRIBUTOR} | grep -qi Musix ; then
+      OS="${GRUB_DISTRIBUTOR} GNU+Linux"
+  elif echo ${GRUB_DISTRIBUTOR} | grep -qi Dragora ; then
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+  else
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  fi
   CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
 fi
 
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index abc2fd7b4..2b2dd5009 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -31,7 +31,17 @@ CLASS="--class gnu-linux --class gnu --class os --class xen"
 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
   OS=GNU/Linux
 else
-  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  if echo ${GRUB_DISTRIBUTOR} | grep -qi Parabola ; then
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+  elif echo ${GRUB_DISTRIBUTOR} | grep -qi Blag ; then
+      OS="${GRUB_DISTRIBUTOR} Linux and GNU"
+  elif echo ${GRUB_DISTRIBUTOR} | grep -qi Musix ; then
+      OS="${GRUB_DISTRIBUTOR} GNU+Linux"
+  elif echo ${GRUB_DISTRIBUTOR} | grep -qi Dragora ; then
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+  else
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  fi
   CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
 fi
 
-- 
2.43.0

