summaryrefslogtreecommitdiff
path: root/libre/grub2/archlinux_grub2_mkconfig_fixes.patch
blob: 62acd2ee8c89bfec3f9a4ac24036b4d71d795738 (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
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index b041a38..6f31dce 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -252,6 +252,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_BADRAM
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 420b3f3..79fd4fb 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -100,6 +100,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 a09c3e6..cf12ea9 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -31,8 +31,8 @@ CLASS="--class gnu-linux --class gnu --class os"
 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
   OS=GNU/Linux
 else
-  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
-  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}"
+  OS="${GRUB_DISTRIBUTOR}"
+  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | tr -d ' ') ${CLASS}"
 fi
 
 # loop-AES arranges things so that /dev/loop/X can be our root device, but
@@ -48,7 +48,7 @@ if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue"
     || uses_abstraction "${GRUB_DEVICE}" lvm; then
   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
 else
-  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+  LINUX_ROOT_DEVICE="/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
 fi
 
 linux_entry ()
@@ -111,7 +111,7 @@ EOF
 EOF
 }
 
-list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* ; do
+list=`for i in /boot/vmlinuz* /boot/vmlinux* /vmlinuz* /vmlinux* ; do
         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
       done`
 prepare_boot_cache=
@@ -123,14 +123,12 @@ while [ "x$list" != "x" ] ; do
   dirname=`dirname $linux`
   rel_dirname=`make_system_path_relative_to_its_root $dirname`
   version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
-  alt_version=`echo $version | sed -e "s,\.old$,,g"`
+  base_init=`echo $basename | sed -e "s,vmlinuz,kernel,g"`
+  alt_version="${base_init}-fallback"
   linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
 
   initrd=
-  for i in "initrd.img-${version}" "initrd-${version}.img" \
-	   "initrd-${version}" "initramfs-${version}.img" \
-	   "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
-	   "initrd-${alt_version}" "initramfs-${alt_version}.img"; do
+  for i in "${base_init}.img"; do
     if test -e "${dirname}/${i}" ; then
       initrd="$i"
       break
@@ -155,6 +153,9 @@ while [ "x$list" != "x" ] ; do
 
   linux_entry "${OS}" "${version}" false \
       "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+  initrd="${alt_version}.img"
+  linux_entry "${OS}" "${version} Fallback" false \
+      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
   if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
     linux_entry "${OS}" "${version}" true \
 	"single ${GRUB_CMDLINE_LINUX}"