2010-10-05 Jordan Uggla <jordan.uggla@gmail.com>

2010-10-05  Colin Watson  <cjwatson@ubuntu.com>

	* util/grub.d/00_header.in: Define a "savedefault" function for use
	in menu entries.
	* util/grub-mkconfig_lib.in (save_default_entry): Use it.
This commit is contained in:
Colin Watson 2010-01-05 10:41:51 +00:00
parent fcab4f04e5
commit 5c23bb0f52
3 changed files with 15 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2010-10-05 Jordan Uggla <jordan.uggla@gmail.com>
2010-10-05 Colin Watson <cjwatson@ubuntu.com>
* util/grub.d/00_header.in: Define a "savedefault" function for use
in menu entries.
* util/grub-mkconfig_lib.in (save_default_entry): Use it.
2010-10-05 Jordan Uggla <jordan.uggla@gmail.com> 2010-10-05 Jordan Uggla <jordan.uggla@gmail.com>
2010-10-05 Colin Watson <cjwatson@ubuntu.com> 2010-10-05 Colin Watson <cjwatson@ubuntu.com>

View file

@ -94,10 +94,7 @@ save_default_entry ()
{ {
if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then
cat << EOF cat << EOF
if [ -z \${boot_once} ]; then savedefault
set saved_entry=\${chosen}
save_env saved_entry
fi
EOF EOF
fi fi
} }

View file

@ -50,6 +50,13 @@ if [ \${prev_saved_entry} ]; then
save_env prev_saved_entry save_env prev_saved_entry
set boot_once=true set boot_once=true
fi fi
function savedefault {
if [ -z \${boot_once} ]; then
saved_entry=\${chosen}
save_env saved_entry
fi
}
EOF EOF
case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in