updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / grub2-bios-bzr / archlinux_grub2_mkconfig_fixes.patch
blobf77ac8404e736533be334378e4355eac94f4cfac
1 diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
2 index c408ccc..95424e9 100644
3 --- a/util/grub-mkconfig.in
4 +++ b/util/grub-mkconfig.in
5 @@ -36,7 +36,7 @@ grub_mkconfig_dir=${sysconfdir}/grub.d
7 self=`basename $0`
9 -grub_probe=${sbindir}/`echo grub-probe | sed "${transform}"`
10 +grub_probe="${sbindir}/`echo grub-probe | sed "${transform}"`"
11 grub_script_check="${bindir}/`echo grub-script-check | sed "${transform}"`"
13 GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"`
14 @@ -241,6 +241,8 @@ export GRUB_DEFAULT \
15 GRUB_THEME \
16 GRUB_GFXPAYLOAD_LINUX \
17 GRUB_DISABLE_OS_PROBER \
18 + GRUB_COLOR_NORMAL \
19 + GRUB_COLOR_HIGHLIGHT \
20 GRUB_INIT_TUNE \
21 GRUB_SAVEDEFAULT \
22 GRUB_ENABLE_CRYPTODISK \
23 diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
24 index 54012f8..d7e982b 100644
25 --- a/util/grub.d/00_header.in
26 +++ b/util/grub.d/00_header.in
27 @@ -100,6 +100,14 @@ cat <<EOF
29 EOF
31 +if [ x$GRUB_COLOR_NORMAL != x ] && [ x$GRUB_COLOR_HIGHLIGHT != x ] ; then
32 + cat << EOF
33 +set menu_color_normal=$GRUB_COLOR_NORMAL
34 +set menu_color_highlight=$GRUB_COLOR_HIGHLIGHT
36 +EOF
37 +fi
39 serial=0;
40 gfxterm=0;
41 for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
42 diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
43 index fe4f0e7..46bd092 100644
44 --- a/util/grub.d/10_linux.in
45 +++ b/util/grub.d/10_linux.in
46 @@ -32,8 +32,8 @@ CLASS="--class gnu-linux --class gnu --class os"
47 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
48 OS=GNU/Linux
49 else
50 - OS="${GRUB_DISTRIBUTOR} GNU/Linux"
51 - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
52 + OS="${GRUB_DISTRIBUTOR}"
53 + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | tr -d ' ') ${CLASS}"
56 # loop-AES arranges things so that /dev/loop/X can be our root device, but
57 @@ -49,7 +49,7 @@ if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue"
58 || uses_abstraction "${GRUB_DEVICE}" lvm; then
59 LINUX_ROOT_DEVICE=${GRUB_DEVICE}
60 else
61 - LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
62 + LINUX_ROOT_DEVICE="/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
65 if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
66 @@ -66,7 +66,9 @@ linux_entry ()
67 version="$2"
68 recovery="$3"
69 args="$4"
70 - if ${recovery} ; then
71 + if [ -n "$5" ] ; then
72 + title="$(gettext_quoted "%s, with Linux %s") $5"
73 + elif ${recovery} ; then
74 title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
75 else
76 title="$(gettext_quoted "%s, with Linux %s")"
77 @@ -114,7 +116,9 @@ EOF
79 printf '%s\n' "${prepare_boot_cache}"
82 message="$(gettext_printf "Loading Linux %s ..." ${version})"
84 cat << EOF
85 echo '$message'
86 linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
87 @@ -133,11 +137,11 @@ EOF
89 case x`uname -m` in
90 xi?86 | xx86_64)
91 - list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
92 + list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* /boot/vmlinuz26-* ; do
93 if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
94 done` ;;
95 *)
96 - list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
97 + list=`for i in /boot/vmlinuz* /boot/vmlinux* /vmlinuz* /vmlinux* /boot/kernel-* ; do
98 if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
99 done` ;;
100 esac
101 @@ -152,16 +156,19 @@ while [ "x$list" != "x" ] ; do
102 dirname=`dirname $linux`
103 rel_dirname=`make_system_path_relative_to_its_root $dirname`
104 version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
105 - alt_version=`echo $version | sed -e "s,\.old$,,g"`
106 + base_init=`echo $basename | sed -e "s,vmlinuz,initramfs,g"`
107 + alt_version="${base_init}-fallback"
108 linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
110 initrd=
112 for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
113 "initrd-${version}" "initramfs-${version}.img" \
114 "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
115 "initrd-${alt_version}" "initramfs-${alt_version}.img" \
116 "initramfs-genkernel-${version}" \
117 - "initramfs-genkernel-${alt_version}"; do
118 + "initramfs-genkernel-${alt_version}" \
119 + "${basename/vmlinuz/initramfs}.img" "${basename/vmlinuz/kernel}.img"; do
120 if test -e "${dirname}/${i}" ; then
121 initrd="$i"
122 break
123 @@ -191,6 +198,16 @@ while [ "x$list" != "x" ] ; do
125 linux_entry "${OS}" "${version}" false \
126 "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
127 + for i in "initramfs-${version}-fallback.img" \
128 + "${basename/vmlinuz/initramfs}-fallback.img" "${basename/vmlinuz/kernel}-fallback.img"; do
129 + if test -e "${dirname}/${i}"; then
130 + initrd="$i"
131 + linux_entry "${OS}" "${version}" true \
132 + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" Fallback
133 + break
134 + fi
135 + done
137 if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
138 linux_entry "${OS}" "${version}" true \
139 "single ${GRUB_CMDLINE_LINUX}"