Comment 21 for bug 439784

Revision history for this message
Felix Zielcke (fzielcke) wrote : Re: invalid: environment block

Colin maybe it makes sense to use something like this in grub.cfg?
Untested but that should work.

if [ -s /boot/grub/grubenv ] ; then
set grubenv_notzero = "true"
fi
if [ -n $grubenv_notzero ] ; then
load_env
[...]
if [ -n $grubenv_notzero ] ; then
save_env
fi

>I couldn´t save it, I got the complaint that I was trying to write to a read-only media.
grub.cfg is made read only for everyone, inclusive root.
With vim you can overwrite it with using ":w!"
If your editor doestn't have something like this then just use sudo chmod u+w grub.cfg
But don't forget that the next update-grub run overwrites your changes nevertheless.