updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / grub2-efi-bzr / archlinux_grub2_mkconfig_fixes.patch
blob24497911b8278ef46098e51b7d3a55aef9c1fe85
1 diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
2 index c717558..614462b 100644
3 --- a/util/grub-mkconfig.in
4 +++ b/util/grub-mkconfig.in
5 @@ -242,6 +242,8 @@ export GRUB_DEFAULT \
6 GRUB_THEME \
7 GRUB_GFXPAYLOAD_LINUX \
8 GRUB_DISABLE_OS_PROBER \
9 + GRUB_COLOR_NORMAL \
10 + GRUB_COLOR_HIGHLIGHT \
11 GRUB_INIT_TUNE \
12 GRUB_SAVEDEFAULT \
13 GRUB_ENABLE_CRYPTODISK \
14 diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
15 index ece1b90..98a8820 100644
16 --- a/util/grub.d/00_header.in
17 +++ b/util/grub.d/00_header.in
18 @@ -100,6 +100,14 @@ cat <<EOF
20 EOF
22 +if [ x$GRUB_COLOR_NORMAL != x ] && [ x$GRUB_COLOR_HIGHLIGHT != x ] ; then
23 + cat << EOF
24 +set menu_color_normal=$GRUB_COLOR_NORMAL
25 +set menu_color_highlight=$GRUB_COLOR_HIGHLIGHT
27 +EOF
28 +fi
30 serial=0;
31 gfxterm=0;
32 for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
33 diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
34 index d5586b3..56efde1 100644
35 --- a/util/grub.d/10_linux.in
36 +++ b/util/grub.d/10_linux.in
37 @@ -31,8 +31,8 @@ CLASS="--class gnu-linux --class gnu --class os"
38 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
39 OS=GNU/Linux
40 else
41 - OS="${GRUB_DISTRIBUTOR} GNU/Linux"
42 - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
43 + OS="${GRUB_DISTRIBUTOR}"
44 + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | tr -d ' ') ${CLASS}"
47 # loop-AES arranges things so that /dev/loop/X can be our root device, but
48 @@ -48,7 +48,7 @@ if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue"
49 || uses_abstraction "${GRUB_DEVICE}" lvm; then
50 LINUX_ROOT_DEVICE=${GRUB_DEVICE}
51 else
52 - LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
53 + LINUX_ROOT_DEVICE="/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
56 if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
57 @@ -65,7 +65,9 @@ linux_entry ()
58 version="$2"
59 recovery="$3"
60 args="$4"
61 - if ${recovery} ; then
62 + if [ -n "$5" ] ; then
63 + title="$(gettext_quoted "%s, with Linux %s") $5"
64 + elif ${recovery} ; then
65 title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
66 else
67 title="$(gettext_quoted "%s, with Linux %s")"
68 @@ -113,7 +115,9 @@ EOF
70 printf '%s\n' "${prepare_boot_cache}"
73 message="$(gettext_printf "Loading Linux %s ..." ${version})"
75 cat << EOF
76 echo '$message'
77 linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
78 @@ -132,11 +136,11 @@ EOF
80 case x`uname -m` in
81 xi?86 | xx86_64)
82 - list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
83 + list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* /boot/vmlinuz26-* ; do
84 if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
85 done` ;;
86 *)
87 - list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
88 + list=`for i in /boot/vmlinuz* /boot/vmlinux* /vmlinuz* /vmlinux* /boot/kernel-* ; do
89 if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
90 done` ;;
91 esac
92 @@ -151,16 +155,19 @@ while [ "x$list" != "x" ] ; do
93 dirname=`dirname $linux`
94 rel_dirname=`make_system_path_relative_to_its_root $dirname`
95 version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
96 - alt_version=`echo $version | sed -e "s,\.old$,,g"`
97 + base_init=`echo $basename | sed -e "s,vmlinuz,initramfs,g"`
98 + alt_version="${base_init}-fallback"
99 linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
101 initrd=
103 for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
104 "initrd-${version}" "initramfs-${version}.img" \
105 "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
106 "initrd-${alt_version}" "initramfs-${alt_version}.img" \
107 "initramfs-genkernel-${version}" \
108 - "initramfs-genkernel-${alt_version}"; do
109 + "initramfs-genkernel-${alt_version}" \
110 + "${basename/vmlinuz/initramfs}.img" "${basename/vmlinuz/kernel}.img"; do
111 if test -e "${dirname}/${i}" ; then
112 initrd="$i"
113 break
114 @@ -190,6 +197,16 @@ while [ "x$list" != "x" ] ; do
116 linux_entry "${OS}" "${version}" false \
117 "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
118 + for i in "initramfs-${version}-fallback.img" \
119 + "${basename/vmlinuz/initramfs}-fallback.img" "${basename/vmlinuz/kernel}-fallback.img"; do
120 + if test -e "${dirname}/${i}"; then
121 + initrd="$i"
122 + linux_entry "${OS}" "${version}" true \
123 + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" Fallback
124 + break
125 + fi
126 + done
128 if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
129 linux_entry "${OS}" "${version}" true \
130 "single ${GRUB_CMDLINE_LINUX}"