lakpa.net

journal de bord

Add label support in grub2
27 mars 2015

Since I upgraded to Wheezy, I wanted to have grub understand my label.

State of the art

I finally find my cheat sheet for the old Lenny-to-Squeez upgrade and notice that I modified /boot/grub/menu.lst like this :

- #kopt=root=/dev/hda1 ro
+ #kopt=root=LABEL=my_label ro

So I have to hack grub2 a little bit. But the only examples I found on the web was dirty (in my opinion) and hard-coded.

Did you find something ?

One not-so-dirty hack was useful to help me understand how grub2 generate the /boot/grub/grub.cfg I didn't want to edit myself (neither add a 40_custom entry). Of course, thanks to the arch doc and these good researchers too.

Do you propose something new ?

You can see the patch I try today in order to generate proper grub.cfg. I didn't find the time (for the moment) to try a hard reboot, but it seems to work. (You can see I created 2 other /etc/grub.d/-files because I don't have a test machine, and didn't take the time to setup a test VM) Just edit /etc/default/grub and use the existant variable like this :

GRUB_DISABLE_LINUX_UUID=label

And it works ! The legacy behaviour seems to be untouched, so I now have to try it in real. And maybe suggest it to grub maintainer.

Mots-clefs : debian, grub

Généré par Chronicle v4.6