Bug#465144: menu.lst: wrong default entry 0saved

Felix Zielcke fzielcke at z-51.de
Tue Aug 26 18:31:22 UTC 2008


Hello,

the problem is in legacy/update-grub

grub_set_default starting on line 1050

set_default_value() {
    if [ "$use_grub_set_default" = "true" ] ; then
        grub-set-default $1
    else
        value="$1"
        newmenu=$(tempfile)
        sed -e "s/^[[:blank:]]*default[[:blank:]]*[[:digit:]]*\(.*\)/default         ${value}\1/;b" $menu > $newmenu
        cat $newmenu > $menu
        rm -f $newmenu
        unset newmenu
    fi
}

For me this regexp looks a bit stupid.
default <optional number><anything> is converted to default $value<anything>
If that \1 is removed then it's just default 0.

If you want to regenerate menu.lst with chainloading grub2,

# LET_US_TRY_GRUB_2=true /usr/lib/grub-legacy/update-grub

-- 
Felix Zielcke






More information about the Pkg-grub-devel mailing list