Skip to contentSkip to conversation

grubenv vs. diskfilter

DISCUSSION Andrey Borzenkov 2 participants 4 messages Jun 3, 2013 – Jun 19, 2013

lore
Share & tools
lore
#0 lore raw

While grub itself can be installed on diskfilter devices (LVM, Linux MD, ...), diskfilter devices are read-only. As grubenv is automatically assumed to be in /boot/grub, this makes it impossible to set variables from within grub. So grub cannot reset boot once indicator, cannot save currently selected menu entry etc.

Just looking for ideas here. Thank you.

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Andrey Borzenkov

While grub itself can be installed on diskfilter devices (LVM, Linux MD, ...), diskfilter devices are read-only. As grubenv is automatically assumed to be in /boot/grub, this makes it impossible to set variables from within grub. So grub cannot reset boot once indicator, cannot save currently selected menu entry etc.

I've been kicking around the thought that grub-pc should just put grubenv in the embed area attached to the core img, and grub-efi should put it in the ESP. That would solve grubenv not working on btrfs too.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRwK2AAAoJEJrBOlT6nu758j8H/iQGytxyoqnlaMmesaDSc40Y yRcG4jDIpbkRuo0jM+Hh+hQKYXU2P3yvQOM38BAzaPsdL5we6oqjQsJcjGchsdhu 7JhOrM7uxFsInJ03FS1obOeOjR89iXoGXuR8bEcq2RMq4aLF5Enh6XK7Sm7Hq/od Zm4/k0H+notE2R3GBaFO7eyrQiHUKR5trJBkuBjOshCv2mXFO6nP9/bKooq8y1de xVJNrXaZDNs9quICLVWkRZfI259lrzQFXI3dZtSVpE2sBISGu132nzIB56m6nMVL efE6sMl2YZTs+X3G62caYboeTlN9QH4py/NaleDQgwMdJqqNoo9D3GDs5uJ4kCE= =eRAC
-----END PGP SIGNATURE-----

#2 lore raw
Quoted 10 lines · Phillip Susi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Andrey Borzenkov

While grub itself can be installed on diskfilter devices (LVM, Linux MD, ...), diskfilter devices are read-only. As grubenv is automatically assumed to be in /boot/grub, this makes it impossible to set variables from within grub. So grub cannot reset boot once indicator, cannot save currently selected menu entry etc.

Quoted 3 lines

I've been kicking around the thought that grub-pc should just put grubenv in the embed area attached to the core img, and grub-efi should put it in the ESP.

This still leaves the case when core.img cannot be embedded (and adding extra space obviously increases chances of that) or delilberate blocklist installs (openSUSE defaults to booting from partition). And we still have PPC, SPARC and hopefully ARM to handle.

And we need some way for user space to auto-detect where environment block is located ...

Quoted 3 lines

That would solve grubenv not working on
btrfs too.

Does btrfs guarantee that bootloader area is always located on a single physical device?

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 9 lines · Andrey Borzenkov
Quoted 3 lines

I've been kicking around the thought that grub-pc should just put grubenv in the embed area attached to the core img, and grub-efi should put it in the ESP.

This still leaves the case when core.img cannot be embedded (and adding extra space obviously increases chances of that) or delilberate blocklist installs (openSUSE defaults to booting from partition). And we still have PPC, SPARC and hopefully ARM to handle.

Blocklist installs already are unsupported and have plenty of problems, including not working with diskfilter. They should still be able to work with grubenv in a regular file on a plain ext4 regular disk partition.

As for embed size, there are really only two classes in practice: 2048 sector, which has plenty of room, and 63 sector, which already doesn't fit for non trivial configurations including diskfilter.

Quoted 2 lines

And we need some way for user space to auto-detect where environment block is located ...

Stick a pointer to the location in the grubenv file?

Quoted 5 lines
Quoted 2 lines

That would solve grubenv not working on btrfs too.

Does btrfs guarantee that bootloader area is always located on a single physical device?

Not sure what you mean.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRwc9pAAoJEJrBOlT6nu75Zp0H/3Ef/f23D0tWNdPj9vzW+CkP l79g0bfbZddPKaunpcOjccSKdjko9sFenRN8HnAegKuu0s+6ro/ir7PaR7wHkA11 +9rO+pZWEluqwcdvlR2C72ErfJ7DHvmVP+togmhzV6aeP2xvw00xr05GKZeryrND FHG1uftp8RTxHGH28py4ta95MRzcVnGzBbkzaDz27bWuTcrijZO6rP5nc3038+8b QMXJJnAXx49Fb7jlC0GxwgFXbdYhzqQy4tZMvQsV2WTiK38yrVnI8sJqeG7seglH 1nV9uUkxGIKGJo0TRNl6vSFkCTXiPfXM7GHny6bwzu9fpBMQZiwXVhuqhCUaqQk= =Fk2C
-----END PGP SIGNATURE-----