Documentation ¶
Overview ¶
Package grub implements a grub config file parser.
See the grub manual https://www.gnu.org/software/grub/manual/grub/ for a reference of the configuration format In particular the following pages: - https://www.gnu.org/software/grub/manual/grub/html_node/Shell_002dlike-scripting.html - https://www.gnu.org/software/grub/manual/grub/html_node/Commands.html
Currently, only the linux[16|efi], initrd[16|efi], menuentry and set directives are partially supported.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseConfigFile ¶
func ParseConfigFile(ctx context.Context, s curl.Schemes, configFile string, wd *url.URL) ([]boot.OSImage, error)
ParseConfigFile parses a grub configuration as specified in https://www.gnu.org/software/grub/manual/grub/
Currently, only the linux[16|efi], initrd[16|efi], menuentry and set directives are partially supported.
`wd` is the default scheme, host, and path for any files named as a relative path - e.g. kernel, include, and initramfs paths are requested relative to the wd.
func ParseLocalConfig ¶
ParseLocalConfig looks for a GRUB config in the disk partition mounted at diskDir and parses out OSes to boot.
This... is at best crude, at worst totally wrong, since we fundamentally assume that the kernels we boot are only on this one partition. But so is this whole parser.
Types ¶
type EnvFile ¶
EnvFile is a GRUB environment file consisting of key-value pairs akin to the GRUB commands load_env and save_env.
func ParseEnvFile ¶
ParseEnvFile reads a key-value pair GRUB environment file.
ParseEnvFile accepts incorrectly padded GRUB env files, as opposed to GRUB.