Using the disk read hook mechanism, setup a read hook on the source disk which will read from the given header file during the scan and recovery cryptodisk backend functions. Disk read hooks are executed after the data has been read from the disk. This is okay, because the read hook is given the read buffer before its sent back to the caller. In this case, the hook can then overwrite the data read from the disk device with data from the header file sent in as the read hook data. This is transparent to the read caller. Since the callers of this function have just opened the source disk, there are no current read hooks, so there's no need to save/restore them nor consider if they should be called or not. This hook assumes that the header is at the start of the volume, which is not the case for some formats (e.g. GELI). So GELI will return an error if a detached header is specified. It also can only be used with formats where the detached header file can be written to the first blocks of the volume and the volume could still be unlocked. So the header file can not be formatted differently from the on-disk header. If these assumpts are not met, detached header file processing must be specially handled in the cryptodisk backend module. The hook will be called potentially many times by a backend. This is fine because of the assumptions mentioned and the read hook reads from absolute offsets and is stateless. Also add a --header (short -H) option to cryptomount which takes a file argument. Signed-off-by: Glenn Washburn <development@efficientek.com> Reviewed-by: Patrick Steinhardt <ps@pks.im> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This is GRUB 2, the second version of the GRand Unified Bootloader. GRUB 2 is rewritten from scratch to make GNU GRUB cleaner, safer, more robust, more powerful, and more portable. See the file NEWS for a description of recent changes to GRUB 2. See the file INSTALL for instructions on how to build and install the GRUB 2 data and program files. See the file MAINTAINERS for information about the GRUB maintainers, etc. If you found a security vulnerability in the GRUB please check the SECURITY file to get more information how to properly report this kind of bugs to the maintainers. Please visit the official web page of GRUB 2, for more information. The URL is <http://www.gnu.org/software/grub/grub.html>. More extensive documentation is available in the Info manual, accessible using 'info grub' after building and installing GRUB 2. There are a number of important user-visible differences from the first version of GRUB, now known as GRUB Legacy. For a summary, please see: info grub Introduction 'Changes from GRUB Legacy'
Description
Languages
C
82.5%
Assembly
13.6%
M4
1.4%
Shell
1.3%
Makefile
0.5%
Other
0.5%