zfs/module
Paul Dagnelie 108a454a46
Add support for boot environment data to be stored in the label
Modern bootloaders leverage data stored in the root filesystem to 
enable some of their powerful features. GRUB specifically has a grubenv 
file which can store large amounts of configuration data that can be 
read and written at boot time and during normal operation. This allows 
sysadmins to configure useful features like automated failover after 
failed boot attempts. Unfortunately, due to the Copy-on-Write nature 
of ZFS, the standard behavior of these tools cannot handle writing to
ZFS files safely at boot time. We need an alternative way to store 
data that allows the bootloader to make changes to the data.

This work is very similar to work that was done on Illumos to enable 
similar functionality in the FreeBSD bootloader. This patch is different 
in that the data being stored is a raw grubenv file; this file can store 
arbitrary variables and values, and the scripting provided by grub is 
powerful enough that special structures are not required to implement 
advanced behavior.

We repurpose the second padding area in each label to store the grubenv 
file, protected by an embedded checksum. We add two ioctls to get and 
set this data, and libzfs_core and libzfs functions to access them more 
easily. There are no direct command line interfaces to these functions; 
these will be added directly to the bootloader utilities.

Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Closes #10009
2020-05-07 09:36:33 -07:00
..
avl Wrap Linux module macros 2019-11-01 10:41:03 -07:00
icp Remove checks for null out value in encryption paths 2020-03-26 10:41:57 -07:00
lua Add longjmp support for Thumb-2 2020-04-29 17:30:13 -07:00
nvpair cppcheck: (warning) Possible null pointer dereference: nvh 2019-12-18 17:25:57 -08:00
os Add support for boot environment data to be stored in the label 2020-05-07 09:36:33 -07:00
spl OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
unicode Wrap Linux module macros 2019-11-01 10:41:03 -07:00
zcommon OpenZFS 3254 - add support in zfs for aclmode=restricted 2020-04-30 11:23:59 -07:00
zfs Add support for boot environment data to be stored in the label 2020-05-07 09:36:33 -07:00
.gitignore Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
Makefile.bsd Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
Makefile.in Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00