Contents of /smage/branches/alx-0_6_0/core/grub/alx/files/10_alx
Parent Directory | Revision Log
Revision 3356 -
(show annotations)
(download)
Tue Mar 20 14:19:04 2012 UTC (12 years, 1 month ago) by niro
File size: 6944 byte(s)
Tue Mar 20 14:19:04 2012 UTC (12 years, 1 month ago) by niro
File size: 6944 byte(s)
-no bootsplash for i845 chipsets
1 | #! /bin/sh |
2 | set -e |
3 | |
4 | # grub-mkconfig helper script. |
5 | # Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc. |
6 | # |
7 | # GRUB is free software: you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by |
9 | # the Free Software Foundation, either version 3 of the License, or |
10 | # (at your option) any later version. |
11 | # |
12 | # GRUB is distributed in the hope that it will be useful, |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | # GNU General Public License for more details. |
16 | # |
17 | # You should have received a copy of the GNU General Public License |
18 | # along with GRUB. If not, see <http://www.gnu.org/licenses/>. |
19 | |
20 | prefix=/usr |
21 | exec_prefix=${prefix} |
22 | bindir=/bin |
23 | libdir=/lib |
24 | . ${libdir}/grub/grub-mkconfig_lib |
25 | |
26 | export TEXTDOMAIN=grub |
27 | export TEXTDOMAINDIR=${prefix}/share/locale |
28 | |
29 | CLASS="--class gnu-linux --class gnu --class os" |
30 | |
31 | if [ "x${GRUB_CMDLINE_ALX_HWDETECT}" = "x" ]; then |
32 | GRUB_CMDLINE_ALX_HWDETECT="splash=verbose,theme=default hardware-auto-detection" |
33 | fi |
34 | |
35 | if [ "x${GRUB_CMDLINE_ALX_RESET}" = "x" ]; then |
36 | GRUB_CMDLINE_ALX_RESET="splash=verbose,theme=default alx-reset-settings" |
37 | fi |
38 | |
39 | if [ "x${GRUB_ALX_FB_FALLBACK}" = "x" ]; then |
40 | # use vesafb instead of uvesafb, 1024x768-16@60 |
41 | GRUB_ALX_FB_FALLBACK="video=vesafb:mtrr:3,ywrap vga=791" |
42 | fi |
43 | |
44 | if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then |
45 | OS=ALX |
46 | else |
47 | OS="${GRUB_DISTRIBUTOR}" |
48 | CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}" |
49 | fi |
50 | |
51 | if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ |
52 | || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ |
53 | || uses_abstraction "${GRUB_DEVICE}" lvm; then |
54 | LINUX_ROOT_DEVICE=${GRUB_DEVICE} |
55 | else |
56 | LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} |
57 | fi |
58 | |
59 | if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then |
60 | rootsubvol="`make_system_path_relative_to_its_root /`" |
61 | rootsubvol="${rootsubvol#/}" |
62 | if [ "x${rootsubvol}" != x ]; then |
63 | GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}" |
64 | fi |
65 | fi |
66 | |
67 | # check for special hardware |
68 | if [ -x "`which hwinfo`" ] |
69 | then |
70 | hwinfo="`hwinfo --bios --storage --pci`" |
71 | |
72 | # zotac |
73 | if [ "x`echo ${hwinfo} | grep -i zotac 2> /dev/null || true`" != x ] |
74 | then |
75 | GRUB_CMDLINE_LINUX="rootdelay=8 ${GRUB_CMDLINE_LINUX}" |
76 | fi |
77 | |
78 | # rangee / VIA CLE-266 chipset |
79 | if [ "x`echo ${hwinfo} | grep -i CLE266 2> /dev/null || true`" != x ] |
80 | then |
81 | # use fallback |
82 | GRUB_CMDLINE_LINUX="${GRUB_ALX_FB_FALLBACK} ${GRUB_CMDLINE_LINUX}" |
83 | fi |
84 | |
85 | # maxdata / Intel i810 / i815 chipset |
86 | if [ "x`echo ${hwinfo} | grep -i i810 2> /dev/null || true`" != x ] |
87 | then |
88 | # disable KMS |
89 | GRUB_CMDLINE_LINUX="nomodeset ${GRUB_CMDLINE_LINUX}" |
90 | fi |
91 | if [ "x`echo ${hwinfo} | grep -i i815 2> /dev/null || true`" != x ] |
92 | then |
93 | # disable KMS |
94 | GRUB_CMDLINE_LINUX="nomodeset ${GRUB_CMDLINE_LINUX}" |
95 | fi |
96 | |
97 | # disable bootsplash for i845, which must have kms, but fbmode is not supported with kms |
98 | if [ "x`echo ${hwinfo} | grep -i i815 2> /dev/null || true`" != x ] |
99 | then |
100 | GRUB_CMDLINE_LINUX="splash=verbose,theme=default ${GRUB_CMDLINE_LINUX}" |
101 | fi |
102 | fi |
103 | |
104 | linux_entry () |
105 | { |
106 | os="$1" |
107 | version="$2" |
108 | recovery="$3" |
109 | args="$4" |
110 | if ${recovery} ; then |
111 | title="$(gettext_quoted "%s [ %s ] (recovery mode)")" |
112 | else |
113 | title="$(gettext_quoted "%s [ %s ]")" |
114 | fi |
115 | printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}" |
116 | if ! ${recovery} ; then |
117 | save_default_entry | sed -e "s/^/\t/" |
118 | fi |
119 | |
120 | # Use ELILO's generic "efifb" when it's known to be available. |
121 | # FIXME: We need an interface to select vesafb in case efifb can't be used. |
122 | if [ "x$GRUB_GFXPAYLOAD_LINUX" = x ]; then |
123 | cat << EOF |
124 | load_video |
125 | EOF |
126 | else |
127 | if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then |
128 | cat << EOF |
129 | load_video |
130 | EOF |
131 | fi |
132 | cat << EOF |
133 | set gfxpayload=$GRUB_GFXPAYLOAD_LINUX |
134 | EOF |
135 | fi |
136 | |
137 | cat << EOF |
138 | insmod gzio |
139 | EOF |
140 | |
141 | if [ x$dirname = x/ ]; then |
142 | if [ -z "${prepare_root_cache}" ]; then |
143 | prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")" |
144 | fi |
145 | printf '%s\n' "${prepare_root_cache}" |
146 | else |
147 | if [ -z "${prepare_boot_cache}" ]; then |
148 | prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" |
149 | fi |
150 | printf '%s\n' "${prepare_boot_cache}" |
151 | fi |
152 | message="$(gettext_printf "Loading Linux %s ..." ${version})" |
153 | cat << EOF |
154 | echo '$message' |
155 | linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} |
156 | EOF |
157 | if test -n "${initrd}" ; then |
158 | message="$(gettext_printf "Loading initial ramdisk ...")" |
159 | cat << EOF |
160 | echo '$message' |
161 | initrd ${rel_dirname}/${initrd} |
162 | EOF |
163 | fi |
164 | cat << EOF |
165 | } |
166 | EOF |
167 | } |
168 | |
169 | case x`uname -m` in |
170 | xi?86 | xx86_64) |
171 | list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do |
172 | if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi |
173 | done` ;; |
174 | *) |
175 | list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do |
176 | if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi |
177 | done` ;; |
178 | esac |
179 | |
180 | prepare_boot_cache= |
181 | prepare_root_cache= |
182 | |
183 | while [ "x$list" != "x" ] ; do |
184 | linux=`version_find_latest $list` |
185 | echo "Found linux image: $linux" >&2 |
186 | basename=`basename $linux` |
187 | dirname=`dirname $linux` |
188 | rel_dirname=`make_system_path_relative_to_its_root $dirname` |
189 | version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` |
190 | alt_version=`echo $version | sed -e "s,\.old$,,g"` |
191 | linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" |
192 | |
193 | initrd= |
194 | for i in "initrd-${version}.img" \ |
195 | "initramfs-${version}.img" \ |
196 | "initrd-${alt_version}.img" \ |
197 | "initramfs-${alt_version}.img"; do |
198 | if test -e "${dirname}/${i}" ; then |
199 | initrd="$i" |
200 | break |
201 | fi |
202 | done |
203 | |
204 | config= |
205 | for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do |
206 | if test -e "${i}" ; then |
207 | config="${i}" |
208 | break |
209 | fi |
210 | done |
211 | |
212 | initramfs= |
213 | if test -n "${config}" ; then |
214 | initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"` |
215 | fi |
216 | |
217 | if test -n "${initrd}" ; then |
218 | echo "Found initrd image: ${dirname}/${initrd}" >&2 |
219 | elif test -z "${initramfs}" ; then |
220 | # "UUID=" magic is parsed by initrd or initramfs. Since there's |
221 | # no initrd or builtin initramfs, it can't work here. |
222 | linux_root_device_thisversion=${GRUB_DEVICE} |
223 | fi |
224 | |
225 | linux_entry "${OS}" "${version}" false \ |
226 | "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" |
227 | |
228 | linux_entry "${OS} - Re-run hardware detection" "${version}" false \ |
229 | "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} ${GRUB_CMDLINE_ALX_HWDETECT}" |
230 | |
231 | linux_entry "${OS} - Reset *all* local settings" "${version}" false \ |
232 | "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} ${GRUB_CMDLINE_ALX_RESET}" |
233 | |
234 | list=`echo $list | tr ' ' '\n' | grepvx $linux | tr '\n' ' '` |
235 | done |