Ok, I'm coming at this from a slightly different angle - I just want to use the ability to 'save' a preference manually (grub-set-default) all the while having it reset to ubuntu with each boot.
My solution is, however, pretty similar but perhaps a tad less 'invasive'. The scripts which write grub.cfg use functions in the file /usr/lib/grub/grub-mkconfig_lib. So, using root privileges open the file and change the save_default_entry funtion (line 133) to:
Code:
save_default_entry ()
{
if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then
# echo 'saved_entry=${chosen}'
echo 'saved_entry=0'
echo 'save_env saved_entry'
fi
}
and run grub-update. Naturally, this file will be overwritten whenever the GRUB packages are updated so personally, I just version lock the grub-common package - otherwise just reapply whenever necessary. Not an ideal solution but until something better comes along...
Bookmarks