summaryrefslogtreecommitdiff
path: root/libre/grub/parabola_grub_mkconfig_fixes.patch
blob: 6e3a524f0214a3e0c554a65679cbd0c21a894bb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 016ee82..2cdbdd8 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -214,6 +214,8 @@ export GRUB_DEFAULT \
   GRUB_THEME \
   GRUB_GFXPAYLOAD_LINUX \
   GRUB_DISABLE_OS_PROBER \
+  GRUB_COLOR_NORMAL \
+  GRUB_COLOR_HIGHLIGHT \
   GRUB_INIT_TUNE \
   GRUB_SAVEDEFAULT \
   GRUB_ENABLE_CRYPTODISK \
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index d2e7252..8259f45 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -125,6 +125,14 @@ cat <<EOF
 
 EOF
 
+if [ x$GRUB_COLOR_NORMAL != x ] && [ x$GRUB_COLOR_HIGHLIGHT != x ] ; then
+    cat << EOF
+set menu_color_normal=$GRUB_COLOR_NORMAL
+set menu_color_highlight=$GRUB_COLOR_HIGHLIGHT
+
+EOF
+fi
+
 serial=0;
 gfxterm=0;
 for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index e27d6f7..a946e71 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -31,7 +31,25 @@ CLASS="--class gnu-linux --class gnu --class os"
 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
   OS=GNU/Linux
 else
-  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+  if [ "${GRUB_DISTRIBUTOR}" = "Parabola" ] ; then
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+  elif [ "${GRUB_DISTRIBUTOR}" = "parabola" ] ; then
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+  elif [ "${GRUB_DISTRIBUTOR}" = "Blag" ] ; then
+      OS="${GRUB_DISTRIBUTOR} Linux and GNU"
+  elif [ "${GRUB_DISTRIBUTOR}" = "blag" ] ; then
+      OS="${GRUB_DISTRIBUTOR} Linux and GNU"
+  elif [ "${GRUB_DISTRIBUTOR}" = "Musix" ] ; then
+      OS="${GRUB_DISTRIBUTOR} GNU+Linux"
+  elif [ "${GRUB_DISTRIBUTOR}" = "musix" ] ; then
+      OS="${GRUB_DISTRIBUTOR} GNU+Linux"
+  elif [ "${GRUB_DISTRIBUTOR}" = "Dragora" ] ; then
+      OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+  elif [ "${GRUB_DISTRIBUTOR}" = "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
 
@@ -87,6 +105,8 @@ linux_entry ()
       case $type in
 	  recovery)
 	      title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
+	  fallback)
+	      title="$(gettext_printf "%s, with Linux %s (Fallback initramfs)" "${os}" "${version}")" ;;
 	  *)
 	      title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
       esac
@@ -100,7 +120,7 @@ linux_entry ()
   else
       echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
   fi      
-  if [ x$type != xrecovery ] ; then
+  if [ x$type != xrecovery ] && [ x$type != xfallback ] ; then
       save_default_entry | grub_add_tab
   fi
 
@@ -132,7 +152,8 @@ linux_entry ()
     fi
     printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
   fi
-  message="$(gettext_printf "Loading Linux %s ..." ${version})"
+
+  message="$(gettext_printf "Loading Linux %s ..." "${version}")"
   sed "s/^/$submenu_indentation/" << EOF
 	echo	'$(echo "$message" | grub_quote)'
 	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
@@ -190,7 +211,22 @@ while [ "x$list" != "x" ] ; do
   alt_version=`echo $version | sed -e "s,\.old$,,g"`
   linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
 
+  if test -e "/etc/parabola-release" ; then
+    if echo "${basename}" | grep -q 'vmlinuz-linux-libre' ; then
+      version="`echo "${basename}" | sed -e 's,vmlinuz-linux-libre,,g'`"
+      
+      if [ "x${version}" = "x" ] ; then
+        version="libre kernel"
+      else
+        version="`echo "${version}" | sed -e 's,-,,g'`"
+        version="libre ${version} kernel"
+      fi
+    fi
+  fi
+  
   initrd=
+  initrd_arch="`echo "${basename}" | sed -e 's,vmlinuz,initramfs,g'`"
+
   for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
 	   "initrd-${version}" "initramfs-${version}.img" \
 	   "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
@@ -198,7 +234,8 @@ while [ "x$list" != "x" ] ; do
 	   "initramfs-genkernel-${version}" \
 	   "initramfs-genkernel-${alt_version}" \
 	   "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
-	   "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
+	   "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+	   "${initrd_arch}.img" ; do
     if test -e "${dirname}/${i}" ; then
       initrd="$i"
       break
@@ -226,6 +263,22 @@ while [ "x$list" != "x" ] ; do
     linux_root_device_thisversion=${GRUB_DEVICE}
   fi
 
+  if test -e "/etc/parabola-release" ; then
+    is_first_entry="false"
+    
+    linux_entry "${OS}" "${version}" true \
+              "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+    
+    for i in "${initrd_arch}-fallback.img" "initramfs-${version}-fallback.img" ; do
+      if test -e "${dirname}/${i}" ; then
+        initrd="${i}"
+        linux_entry "${OS}" "${version}" fallback \
+                    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+        break
+      fi
+    done
+  fi
+
   if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
     linux_entry "${OS}" "${version}" simple \
     "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
@@ -240,8 +293,11 @@ while [ "x$list" != "x" ] ; do
     is_top_level=false
   fi
 
+  if ! test -e "/etc/parabola-release" ; then
   linux_entry "${OS}" "${version}" advanced \
               "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+  fi
+
   if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
     linux_entry "${OS}" "${version}" recovery \
                 "single ${GRUB_CMDLINE_LINUX}"
@@ -252,8 +308,10 @@ done
 
 # If at least one kernel was found, then we need to
 # add a closing '}' for the submenu command.
+if ! test -e "/etc/parabola-release" ; then
 if [ x"$is_top_level" != xtrue ]; then
   echo '}'
 fi
+fi
 
 echo "$title_correction_code"