Lines 98-104
Link Here
|
98 |
fi |
98 |
fi |
99 |
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" |
99 |
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" |
100 |
else |
100 |
else |
101 |
echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" |
101 |
if [ "x$GRUB_SIMPLE_VERSION" = xtrue ]; then |
|
|
102 |
title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" |
103 |
else |
104 |
title="${os}" |
105 |
fi |
106 |
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" |
102 |
fi |
107 |
fi |
103 |
if [ x$type != xrecovery ] ; then |
108 |
if [ x$type != xrecovery ] ; then |
104 |
save_default_entry | grub_add_tab |
109 |
save_default_entry | grub_add_tab |
Lines 161-166
Link Here
|
161 |
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi |
166 |
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi |
162 |
done` ;; |
167 |
done` ;; |
163 |
esac |
168 |
esac |
|
|
169 |
list_simple=(`for i in ${GRUB_MENU_LINUX} ; do |
170 |
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi |
171 |
done`) |
164 |
|
172 |
|
165 |
case "$machine" in |
173 |
case "$machine" in |
166 |
i?86) GENKERNEL_ARCH="x86" ;; |
174 |
i?86) GENKERNEL_ARCH="x86" ;; |
Lines 179-187
Link Here
|
179 |
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab). |
187 |
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab). |
180 |
submenu_indentation="" |
188 |
submenu_indentation="" |
181 |
|
189 |
|
|
|
190 |
submenu_tmpfile=/tmp/grub.10_linux.submenu.$$ |
191 |
exec 3>$submenu_tmpfile |
192 |
|
182 |
is_first_entry=true |
193 |
is_first_entry=true |
183 |
while [ "x$list" != "x" ] ; do |
194 |
while [ "x$list" != "x" ] ; do |
184 |
linux=`version_find_latest $list` |
195 |
linux=`version_find_latest $list` |
|
|
196 |
if [ ${#list_simple[*]} -gt 0 ]; then |
197 |
linux=${list_simple[0]} |
198 |
fi |
185 |
gettext_printf "Found linux image: %s\n" "$linux" >&2 |
199 |
gettext_printf "Found linux image: %s\n" "$linux" >&2 |
186 |
basename=`basename $linux` |
200 |
basename=`basename $linux` |
187 |
dirname=`dirname $linux` |
201 |
dirname=`dirname $linux` |
Lines 189-194
Link Here
|
189 |
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` |
203 |
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` |
190 |
alt_version=`echo $version | sed -e "s,\.old$,,g"` |
204 |
alt_version=`echo $version | sed -e "s,\.old$,,g"` |
191 |
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" |
205 |
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" |
|
|
206 |
cmdline_linux_custom=$(grub_cmdline_linux_custom ${version}) |
192 |
|
207 |
|
193 |
initrd= |
208 |
initrd= |
194 |
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ |
209 |
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \ |
Lines 226-249
Link Here
|
226 |
linux_root_device_thisversion=${GRUB_DEVICE} |
241 |
linux_root_device_thisversion=${GRUB_DEVICE} |
227 |
fi |
242 |
fi |
228 |
|
243 |
|
|
|
244 |
submenu_indentation="" |
229 |
if [ "x$is_first_entry" = xtrue ]; then |
245 |
if [ "x$is_first_entry" = xtrue ]; then |
230 |
linux_entry "${OS}" "${version}" simple \ |
246 |
linux_entry "${OS}" "${version}" simple \ |
231 |
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" |
247 |
"${GRUB_CMDLINE_LINUX} ${cmdline_linux_custom:-${GRUB_CMDLINE_LINUX_DEFAULT}}" |
232 |
|
248 |
|
233 |
submenu_indentation="$grub_tab" |
|
|
234 |
|
235 |
if [ -z "$boot_device_id" ]; then |
249 |
if [ -z "$boot_device_id" ]; then |
236 |
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" |
250 |
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" |
237 |
fi |
251 |
fi |
238 |
# TRANSLATORS: %s is replaced with an OS name |
252 |
# TRANSLATORS: %s is replaced with an OS name |
239 |
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {" |
253 |
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {" >&3 |
|
|
254 |
elif [ ${#list_simple[*]} -gt 0 ]; then |
255 |
linux_entry "${OS}" "${version}" simple \ |
256 |
"${GRUB_CMDLINE_LINUX} ${cmdline_linux_custom:-${GRUB_CMDLINE_LINUX_DEFAULT}}" |
240 |
fi |
257 |
fi |
|
|
258 |
list_simple=(${list_simple[*]:1}) |
241 |
|
259 |
|
242 |
linux_entry "${OS}" "${version}" advanced \ |
260 |
submenu_indentation="$grub_tab" |
243 |
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" |
261 |
linux_entry "${OS}" "${version}" advanced \ |
|
|
262 |
"${GRUB_CMDLINE_LINUX} ${cmdline_linux_custom:-${GRUB_CMDLINE_LINUX_DEFAULT}}" >&3 |
244 |
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then |
263 |
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then |
245 |
linux_entry "${OS}" "${version}" recovery \ |
264 |
linux_entry "${OS}" "${version}" recovery \ |
246 |
"single ${GRUB_CMDLINE_LINUX}" |
265 |
"single ${GRUB_CMDLINE_LINUX}" >&3 |
247 |
fi |
266 |
fi |
248 |
|
267 |
|
249 |
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` |
268 |
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` |
Lines 253-259
Link Here
|
253 |
# If at least one kernel was found, then we need to |
272 |
# If at least one kernel was found, then we need to |
254 |
# add a closing '}' for the submenu command. |
273 |
# add a closing '}' for the submenu command. |
255 |
if [ x"$is_first_entry" != xtrue ]; then |
274 |
if [ x"$is_first_entry" != xtrue ]; then |
256 |
echo '}' |
275 |
echo '}' >&3 |
|
|
276 |
exec 3>&- |
277 |
cat $submenu_tmpfile |
278 |
rm $submenu_tmpfile |
257 |
fi |
279 |
fi |
258 |
|
280 |
|
259 |
echo "$title_correction_code" |
281 |
echo "$title_correction_code" |