uawdijnntqw1x1x1
IP : 216.73.216.110
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
www
/
test
/
..
/
node_modules
/
safe-buffer
/
..
/
debug
/
..
/
..
/
.
/
4d695
/
grub2-common.zip
/
/
PK��\ o�)�)INSTALLnu�[���-*- Text -*- This is the GRUB. Welcome. This file contains instructions for compiling and installing the GRUB. The Requirements ================ GRUB depends on some software packages installed into your system. If you don't have any of them, please obtain and install them before configuring the GRUB. * GCC 5.1.0 or later Experimental support for clang 3.8.0 or later (results in much bigger binaries) for i386, x86_64, arm (including thumb), arm64, mips(el), powerpc, sparc64 * GNU Make * GNU Bison 2.3 or later * GNU gettext 0.17 or later * GNU binutils 2.9.1.0.23 or later * Flex 2.5.35 or later * Other standard GNU/Unix tools * a libc with large file support (e.g. glibc 2.1 or later) On GNU/Linux, you also need: * libdevmapper 1.02.34 or later (recommended) For optional grub-emu features, you need: * SDL (recommended) * libpciaccess (optional) * libusb (optional) To build GRUB's graphical terminal (gfxterm), you need: * FreeType 2 or later * GNU Unifont If you use a development snapshot or want to hack on GRUB you may need the following. * Python 2.6 or later * Autoconf 2.60 or later * Automake 1.10.1 or later Prerequisites for make-check: * qemu, specifically the binary 'qemu-system-i386' * xorriso 1.2.9 or later, for grub-mkrescue and grub-shell Configuring the GRUB ==================== The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. Building the GRUB ================= The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code. 2. Skip this and following step if you use release tarball and proceed to step 4. If you want translations type `./linguas.sh'. 3. Type `./autogen.sh'. * autogen.sh uses python. By default invocation is "python" but can be overriden by setting variable $PYTHON. 4. Type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 6. Type `make' to compile the package. 7. Optionally, type `make check' to run any self-tests that come with the package. 8. Type `make install' to install the programs and any data files and documentation. 9. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Cross-compiling the GRUB ======================== GRUB defines 3 platforms: - "Build" is the one which build systems runs on. - "Host" is where you execute GRUB utils. - "Target" is where GRUB itself runs. For grub-emu host and target must be the same but may differ from build. If build and host are different make check isn't available. If build and host are different man pages are not generated. As an example imagine you have a build system running on FreeBSD on sparc which prepares packages for developers running amd64 GNU/Linux laptop and they need to make images for ARM board running U-boot. In this case: build=sparc64-freebsd host=amd64-linux-gnu target=arm-uboot For this example the configure line might look like (more details below) (some options are optional and included here for completeness but some rarely used options are omitted): ./configure BUILD_CC=gcc BUILD_FREETYPE=freetype-config --host=amd64-linux-gnu CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" FREETYPE=amd64-linux-gnu-freetype-config --target=arm --with-platform=uboot TARGET_CC=arm-elf-gcc TARGET_CFLAGS="-Os -march=armv6" TARGET_CCASFLAGS="-march=armv6" TARGET_OBJCOPY="arm-elf-objcopy" TARGET_STRIP="arm-elf-strip" TARGET_NM=arm-elf-nm TARGET_RANLIB=arm-elf-ranlib LEX=gflex You need to use following options to specify tools and platforms. For minimum version look at prerequisites. All tools not mentioned in this section under corresponding platform are not needed for the platform in question. - For build 1. BUILD_CC= to gcc able to compile for build. This is used, for example, to compile build-gentrigtables which is then run to generate sin and cos tables. 2. BUILD_CFLAGS= for C options for build. 3. BUILD_CPPFLAGS= for C preprocessor options for build. 4. BUILD_LDFLAGS= for linker options for build. 5. BUILD_FREETYPE= for freetype-config for build (optional). - For host 1. --host= to autoconf name of host. 2. CC= for gcc able to compile for host 3. HOST_CFLAGS= for C options for host. 4. HOST_CPPFLAGS= for C preprocessor options for host. 5. HOST_LDFLAGS= for linker options for host. 6. FREETYPE= for freetype-config for host (optional). 7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional). 8. Libfuse if any must be in standard linker folders (-lfuse) (optional). 9. Libzfs if any must be in standard linker folders (-lzfs) (optional). 10. Liblzma if any must be in standard linker folders (-llzma) (optional). - For target 1. --target= to autoconf cpu name of target. 2. --with-platform to choose firmware. 3. TARGET_CC= for gcc able to compile for target 4. TARGET_CFLAGS= for C options for target. 5. TARGET_CPPFLAGS= for C preprocessor options for target. 6. TARGET_CCASFLAGS= for assembler options for target. 7. TARGET_LDFLAGS= for linker options for target. 8. TARGET_OBJCOPY= for objcopy for target. 9. TARGET_STRIP= for strip for target. 10. TARGET_NM= for nm for target. 11. TARGET_RANLIB= for ranlib for target. - Additionally for emu, for host and target. 1. SDL is looked for in standard linker directories (-lSDL) (optional) 2. libpciaccess is looked for in standard linker directories (-lpciaccess) (optional) 3. libusb is looked for in standard linker directories (-lusb) (optional) - Platform-agnostic tools and data. 1. make is the tool you execute after ./configure. 2. Bison is specified in YACC= variable 3. Flex is specified in LEX= variable 4. GNU unifont and Djvu sans are looked for in standard directories. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Please note, however, that the GRUB knows where it is located in the filesystem. If you have installed it in an unusual location, the system might not work properly, or at all. The chief utility of these options for the GRUB is to allow you to "install" in some alternate location, and then copy these to the actual root filesystem later. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. PK��\P��S3W3WNEWSnu�[���New in 2.02: * New/improved filesystem and disk support: * Big-endian UFS1. * Experimental 64-bit ext2 support. * Various fixes for non-512-byte sector devices. * New `proc' filesystem framework, used by LUKS disks. * Fix DM-RAID partition handling. * New `nativedisk' command to switch from firmware to native disk drivers. * Compressed HFS+. * DragonFly BSD labels. * CBFS (coreboot). * Handle partitioned LVM properly. * Use LVM UUIDs whenever possible. * GPT PReP. * New `progress' module that shows progress information while reading files. * ZFS features support. * ZFS LZ4 support. * XFS V5 format support. * LVM RAID1 support. * New/improved terminal and video support: * Monochrome text (matching `hercules' in GRUB Legacy). * Morse code output using system speaker. * `spkmodem' output (simple data protocol using system speaker). * Handle Japanese special keys. * coreboot framebuffer. * Serial on ARC. * Native vt100 handling for grub-emu, replacing the use of the curses library. * New gfxmenu options for terminal window positioning, theme background image handling, and scrollbar padding, plus `item_pixmap_style' and `highlight_overlay'. * Support several more image types (paletted and greyscale). * Boot protocol improvements: * Support Apple FAT binaries on non-Apple platforms. * Improve FreeDOS direct loading support compatibility. * Enable `linux16' on all x86 platforms, not just BIOS. * New TrueCrypt ISO loader. * multiboot2 boot-services EFI specification. * multiboot2 EFI memory map specification. * multiboot2 full-file specfication. * New/improved network support: * New variables `net_default_*' containing properties of the default interface. * Autoload `http' and `tftp' modules if necessary. * Improve TFTP robustness. * Parse `nd' disk names in GRUB Legacy configuration files. * Issue separate DNS queries for IPv4 and IPv6. * Support IPv6 Router Advertisement to configure default router. * New variable net_<interface>_next_server containing next server from BOOTP reply. * Coreboot improvements: * CBFS support both in on-disk images (loopback) and flash. * Ability to launch another payload from flash or disk * Coreboot framebuffer * CBMEMC support (both logging and inspecting logs) * Command for inspecting coreboot timestamps (`coreboot_boottime'). * Command for inspecting coreboot tables (`lscoreboot'). * New target default_payload.elf. * Increased maximal core size. * Prefer pmtimer for TSC calibration. * New/improved platform support: * New `efifwsetup', `lsefi' and `connectefi` commands on EFI platforms. * New `cmosdump' and `cmosset' commands on platforms with CMOS support. * New command `pcidump' for PCI platforms. * Improve opcode parsing in ACPI halt implementation. * Use the TSC as a possible time source on i386-ieee1275. * Merge PowerPC grub-mkrescue implementation with the common one. * Support grub-mkrescue on i386-ieee1275, sparc64, bootinfo machines such as pSeries, and mips-arc. * Make grub-mkrescue better support Apple Intel Macs on CD. * Enable GRUB Legacy configuration file parsing on EFI. * Support halt for Loongson 2E. * ARM U-Boot and EFI ports. * Reorganise platform-dependent code in utilities to avoid #ifdef mess. * AROS and Haiku support for userspace utilities. * Xen PV port. * Fix EFI stack alignment. * ARM64 EFI port. * On Linux, read partition start offsets from sysfs if possible. * New grub-macbless utility, and better integration with Mac firmware in grub-install. * Support Yeeloong 3A. * Add `cpuid --pae' option to detect Physical Address Extension on x86. * Support for USB debug dongles. * Support for *-emu on all platforms (previously only i386/x86_64 worked). * Support *-emu on Windows. * New platform `none' which builds only user level utilities. This is now default if target CPU is not supported. * Support for booting little-endian Linux kernel on powerpc. * Support network boot with Oracle sun4v vnet devices. * Added SAS disks to the IEEE 1275 Open Firmware device list. * Try multiple methods for TSC (timestamp counter) calibration - PIT, pmtimer, EFI Stall. If everything fails, use hardcoded frequency 800MHz. * Support Hyper-V Gen2 platforms which lack PIT for TSC calibration. * Map UEFI Persistent Memory to E820 persistent memory. * New Xen loader on ARM64. * Respect alignment requirement for block device IO buffers on EFI. * Security: * Add optional facility to enforce that all files read by the core image from disk have a valid detached digital signature. * Performance: * Avoid costly division operations in many places. * New boot time analysis framework (`./configure --enable-boot-time'). * Initialise USB ports in parallel. * New `testspeed' command to test file read speed. * Speed-up gfxterm by storing intermediate results in more compact format. * Lazy LVM/mdraid scan. * Disk hints. * Scripting: * New `eval' and `tr' commands. * grub-script-check fails on scripts containing no commands. * Installation and other utility improvements: * Add option to compress files on installation or image creation. * Using grub-reboot no longer requires setting `GRUB_DEFAULT=saved'. * Support probing EFI System Partition (requires os-prober >= 1.58). * Fix inconsistent use of `GRUB_CRYPTODISK_ENABLE' and `GRUB_ENABLE_CRYPTODISK'; the latter is now used consistently. * grub-mount handles symbolic links to directories. * Support disabling submenus with `GRUB_DISABLE_SUBMENU' configuration key for grub-mkconfig. * grub-install, grub-mknetdir, grub-mkrescue, and grub-mkstandalone rewritten in C. They should now work in supported non-Unix-like environments. * Native mingw support. * Ability to install on EFI under windows. * Reorganise timeout handling using new `timeout_style' environment variable and `GRUB_TIMEOUT_STYLE' configuration key for grub-mkconfig. Menu hotkeys pressed during a hidden timeout now boot the corresponding menu entry immediately. * New `file' command and grub-file utility to check file types. * New syslinux configuration file parser. * Set menu entry class to primary OS name returned by os-prober to display OS specific icon. * On Linux x86 detect EFI word size in grub-install and automatically select correct platform (x86_64-efi or i386-efi) to install. Requires Linux kernel 4.0 or higher. * Build system: * Remove all uses of nested functions; GRUB no longer requires an executable stack. * Fix documentation build with Texinfo >= 5.1. * More robust and documented cross-compiling support. * Partial clang support for some platforms (experimental). * Partial mingw64 x86_64-efi compile support (highly experimental). * Partial mingw32 i386-* (other than already present i386-pc) compile support (highly experimental). * Support for grub-mkpasswd on Windows. * Eliminate the use of AutoGen. This allowed some performance improvements to the build system. * Remove variable length arrays. * OpenBSD compile and tools support (NetBSD and FreeBSD were already supported). * Fix build with FreeType >= 2.5.1. * Make gentpl.py compatible with Python 3. It now requires at least Python 2.6. * modinfo.sh contains build information now. * Added many new tests to improve robustness. * Target is built without libgcc now. Necessary builtins are reimplemented directly. This removes requirement for target-specific runtime on build system. * emu libusb support removed (was broken and unmaintained). * powerpc64le compile support. * Use fixed timestamp when generating GRUB image for reproducible builds. * Verify at build time that modules contain only supported relocations and their structure matches what boot-time module loader expects. * Do not require fonts on powerpc-ieee1275. * Revision control moved to git. New in 2.00: * Appearance: * Official theme for gfxmenu (starfield) * Menu is organised with submenus. * Better default video mode selection using EDID. * New platforms: * Itanium port. * Fuloong2F support (including GRUB as firmware) * Fuloong2E support (except GRUB as firmware) * ARCS (SGI machines) port. * qemu -M mips port. * grub-mount to mount filesystems using GRUB FS drivers and FUSE. * Changed security default so entries are locked by default if any superuser is defined. * New drivers: * EHCI. * AHCI. * ESCC serial. * IEEE1275 serial. * EFI serial. * Network stack for BIOS, IEEE1275, EMU and EFI, including TFTP, HTTP and DNS. * New filesystem, filters and disks formats: * DVH partition map. * Plan9 partition map. * Big-endian mdraid. * Big-endian cpio. * ODC and NEWC cpio. * ExFAT. * Minix3fs. * Big-endian minixfs. * RomFS. * Squash4. * Support non-512B disk blocks. * LUKS and GELI support. * LDM read support (no install yet). * LZOP. * Improved filesystem and disks formats support: * HFS+ label support. * Improved reiserfs support. * multidevice, mirrored and raidz(2,3) ZFS support. * RAID LVM (internal RAIDing) support. * ZFS crypto support. * ZLE, LZ4 and GZIP on ZFS support. * Support ZFS up to 33. * HFS string is now treated like mac-roman and not UTF-8 * HFS mtime support. * Improved AFFS and SFS support. * LZO-compressed btrfs support. * cpio and tar symlinks support. * Better FS detection to reduce false positives. * New boot protocols: * Ability to load another coreboot payload when on coreboot. * Plan9. * Freedos. * Ntldr/bootmgr (to load Windows bootloader). * chainloader --bpb support to patch FAT or NTFS BPB in memory to correct wrong partition offset. * PXE chainloading support. * Darwin 11 (Mac OS X Lion) protocol support. * Boot protocol improvements: * Multiple initrd support. * Basic illumos and xnu autoconfig. * Testing and debugging: * New grub-fstest commands: cat, zfsinfo, testload xnu_uuid * grub-fstest recursive directory compare for quickly checking that a directory is read correctly. * Backtace on crash (if gdb module is loaded, x86 only) * Disk cache statistics gathering. * GDB stub and GDB support script. * "make check" and "make bootcheck" expanded to almost all platforms (except i386-ieee1275, mips-arc, sparc64-ieee1275, ia64-efi and emu) * New `time' command. * Performance: * Lazy scanning to avoid accessing devices which aren't really used. This avoids boot delay due to slow device scanning. * Use CPU cache when accessing video memory. * Search hints to first try the most likely device when searching for a device with given UUID. This avoids slow scanning in most cases. * Internationalisation: * Updated to Unicode 6.0. * $"..." syntax for translation in grub scripting language. This allows easy translation of grub.cfg at runtime. * Translations to many languages included in official distribution. * Scripting: * $grub_cpu and $grub_platform variables for conditioning grub.cfg on platform at runtime. * $feature_* variables to condition scripts on available features. * Use of ids to identify menu entries. * all_video module which is empty but depends on all video modules thus allowing easy loading of all of them. * Installation: * grub-mknetdir script for easy creation of netbootable GRUB directory. * Itanium and mips support in grub-mkrescue. * grub-install support for all platforms except emu. * PreP partition install support. * No files conflict between flavours (except grub-mkrescue for ppc). This allows easy install of GRUB for several platforms. * grub-mkstandalone script for easy creating of image including all modules for platforms with generous limit on image size. * program-transform-name now functions according to usual conventions. Use --grubdir and --bootdir to get old behaviour. * ADLER32 and CRC64 support (for XZ and hashsum). * ofconsole renamed to console * Experimental support for compiling with Apple toolchain. * grub-mkdevicemap removed. Now all devices are detected on invocation of any grub utility. New in 1.99: * Keyboard layouts support. * New `lsapm' command (i386-pc only). * Parser for GRUB Legacy configuration files. * Support RAID on virtio devices. * Remove deprecated `root' command. * New `euro.pf2' font which supports most European languages. * Avoid opening the same device twice on Open Firmware platforms. * Extend `vbeinfo' and `vbetest' commands to non-VBE graphics, as `videoinfo' and `videotest'. * New `lsefisystab', `lssal', and `lsefimmap' commands on EFI platforms. * Support explicit user claim that a device is BIOS-visible. Devices listed in device.map will be assumed to be readable using only BIOS facilities, rather than anything more complex such as LVM or RAID. * New bash-completion script for GRUB utilities. * Use ACPI to shut down if possible. * New `lsacpi' command. * Btrfs support. * New `--boot-directory' option to `grub-install', `grub-reboot', and `grub-set-default', with clearer semantics than the previous `--root-directory' option. * Rename CD-ROM device to "cd" on BIOS platforms. * Transparent decompression filters. * Simpler PXE image generation. New `grub-mknetdir' utility to generate netboot directory trees. * New relocator. Allows for more kernel support and more straightforward loader writing. * Handle USB pendrives exposed as floppies. * New Automake-based build system. * Add `sendkey' command (i386-pc only). * ZFS support. * Support 1.x versions of mdadm metadata. * Fix corruption when reading Reiserfs directory entries. * Bidirectional text and diacritics support. * Skip LVM snapshots. * MIPS Yeeloong firmware port. * Change grub-mkdevicemap to emit /dev/disk/by-id/ names where possible on GNU/Linux. * Add `grub-mkconfig' support for Xen with Linux. * Add `grub-mkconfig' support for initrd images on Fedora 13. * Support >3GiB and <16MiB RAM in i386-qemu. * Add support for Cirrus 5446 and Bochs video cards. * Load more appropriate video drivers automatically in `grub-mkconfig'. * USB improvements, including hotplugging/hotunplugging, hub support, and USB serial support. * AMD Geode CS5536 support. * Extensive updates to the Texinfo documentation. * Handle symbolic links under /dev/mapper on GNU/Linux. * Handle installation across multiple partition table types. * Add `cmostest' command (i386/x86_64 only). * Add support for DM-RAID disk devices on GNU/Linux. * Remove `grub-mkisofs'. `grub-mkrescue' now uses GNU xorriso to build CD images. * `grub-mkrescue' support for EFI, coreboot, and QEMU platforms. * Unify `grub-mkimage', `grub-setup', and `grub-install' source code across platforms. * Fix VGA (as opposed to VBE) video driver, formerly a terminal driver. * Add menu hotkey support. * Add support for the nilfs2 filesystem. * `grub-probe' and `grub-mkconfig' support for NetBSD. * Support setting a background image in `grub-mkconfig'. * Support multiple terminals in `grub-mkconfig'. * Regexp support. * MIPS multiboot2 support. * Multiboot2 tag support. * sunpc partition table support. * Add a number of new language features to GRUB script: `for', `while', `until', `elif', function parameters, `break', `continue', `shift', multi-line quoted strings, positional parameters with `setparams', `return', filename wildcard expansion, and `!'. * Support nested partition tables. GRUB now prefers to name partitions in the form `(hd0,msdos1,bsd1)' rather than `(hd0,1,a)'. * Speed up consecutive hostdisk operations on the same device. * Compile parts of `grub-emu' as modules. New in 1.98 - 2010-03-06: * Multiboot on EFI support. * Graphical menu support. * MIPS support. * Saved default menu entry support, with new utilities `grub-reboot' and `grub-set-default'. * Unit testing framework. * Support for multiple terminals. * Encrypted password support, with a new utility `grub-mkpasswd-pbkdf2'. * `grub-mkfloppy' removed; use `grub-mkrescue' to create floppy images. * Add grub-probe support for GNU/Hurd. * Add support for gettext. New in 1.97: * Add support for loading XNU (MacOS X kernel). * ACPI override support. * Integrated gptsync. * Password protection support. * Partition manipulation tool. * Add `keystatus' command. * Unicode fonts are now used by default. * Add `hdparm' command. * Add support for getting the current date and time from CMOS as variables. * Add `drivemap' command. * Add support for RAID levels 4,6 and 10. * update-grub is replaced by grub-mkconfig. * When booting from PXE, PXE can be used to load files. * High resolution timer support. * Image loaders now support IO buffering. * Add `crc' command. * Add Cygwin support. * Add x86_64 EFI support. * Use LZMA compression instead of LZO. * Support for saving the environment from and loading the environment from a file. * Allow the UUID to be used as device name. * The `search' command can use UUIDs now. * Add support for IEEE 1275 on i386. * Create partmap.lst and use it to automatically load partition map modules. * grub-mkconfig supports os-prober to add operating systems to the boot menu. * The ATA driver supports devices bigger than 2 TiB. * Add support for the UDF, AFS and EXT4 filesystems. * The ISO9660 filesystem supports the Joliet extension * Add support for loading kernels of FreeBSD, NetBSD and OpenBSD. * Add new command `sleep'. * Support for direct access to AT keyboards. * New utility `grub-fstest'. New in 1.96 - 2008-02-03: * The license term is changed to GNU General Public License Version 3. * grub-emu is made optional. Now you have to use `--enable-grub-emu' to enable it. * Add Multiboot2 support. * grub-emu can access the host filesystem now. * Add support for the NTFS, cpio/tar and Reiserfs filesystems. * Add support for ATA/ATAPI. * Add update-grub script to generate grub.cfg. * Add grub-mkrescue script to generate floppy or ElTorito images (i386-pc only). * Add support for background images in gfxterm (background_image command). * Add support for detection of 64-bit support in CPU (cpuid command). * GPT is now enabled in i386-pc target. * Add grub-install for EFI. * Ported to the following new platforms: Efika, coreboot (a.k.a. LinuxBIOS), OLPC XO. * Add support for colored menu (menu_color_normal and menu_color_highlight variables). * Fix support for loading Linux zImages (such as memtest86). New in 1.95 - 2006-10-15: * Number partitions from 1 instead of 0. For instance, the first partition of "hd0" is now "hd0,1" but not "hd0,0". * grub-probefs is renamed to grub-probe, and supports printing a guessed OS device name and a GRUB drive name. * RAID and LVM support is added. * New command, echo. * The disk API is changed to support 64-bit addressing. * A TGA loader is added for the video API. New in 1.94 - 2006-06-04: * Fix several serious bugs in HFS+. * Add experimental EFI support. Chainloading and Linux loading are supported at the moment. * Add a new command "blocklist" to show a block list. * Use --with-platform to specify a boot environment. For now, efi, ieee1275 and pc are supported. * Use the filename "kernel.elf" instead of "grubof" on ieee1275. * Install GRUB into pkglibdir instead of pkgdatadir. * Support environmental variables. You can export variables by the command "export". * Remove the commands "default" and "timeout". They are now variables. * Add the commands "source" and "." to include a file. * Implement experimental Video API and a new terminal "gfxterm" based on the Video API. New in 1.93 - 2006-03-10: * Add support for the HFS+ wrapper. * Major improvements to scripting support. * Menu entries are now scriptable. New in 1.92 - 2005-12-25: * Add support for GPT partition table format. * Add a new command "play" to play an audio file on PC. * Add support for Linux/ADFS partition table format. * Add support for BASH-like scripting. * Add support for Apple HFS+ filesystems. New in 1.91 - 2005-10-15: * Add support for LZO version 2. * Support completion in the entry editor. * Add VBE support. * New commands, "search", "vbetest" and "vbeinfo". * The option BOOT_IMAGE is passed to Linux. * Add support for automatic decompression for gzip. * Add support for terminfo and serial. * Add support for x86_64. * GRUB itself is a Multiboot-compliant kernel. * Add new filesystems: XFS, SFS, and AFFS. New in 1.90 - 2005-08-07: * Rename the project name PUPA to GRUB. Now this version is the developmental version of GRUB officially. * The GRUB emulator ``grub-emu'' is added. * Add support for newworld Mac. This should work with other PowerPC-based machines as well, if they use IEEE 1275 (Open Firmware). * Too many changes to describe. Look at ChangeLog for more details. New in 0.7: * Problems in cross-compiling PUPA are fixed. * Use -mrtd and -mregparm=3 to reduce the generated code sizes. This means that any missing prototypes could be fatal. Also, you must take care when writing assembly code. See the comments at the beginning of startup.S, for more details. * New utility, ``pupa-setup''. This sets up PUPA to make it bootable from a real disk. * New commands, "prefix", "insmod", "rmmod" and "lsmod" are added into the rescue mode to manipulate PUPA modules. * Linux support is added. Initrd is not support yet. * Reduce the size of a core image significantly by compressing a large part of the core image and decompressing itself at boot time. The currently used algorithm is LZO (more precisely, LZO1X-999). So you have to install LZO to build PUPA. See <http://www.oberhumer.com/opensource/lzo/>, for more information. New in 0.6 - 2002-12-27, Yoshinori K. Okuji: * The chainloader and the FAT filesystem are modularized. * The structure of the source tree is a bit changed. * Support for building loadable modules is added. * Some generic parts of pupa-mkimage are segregated. * Some documentation files are added, according to the GNU Coding Standards. PK��\�+�!!READMEnu�[���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. 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' PK��\���vvTHANKSnu�[���GRUB 2 would not be what it is today without the invaluable help of everybody who was kind enough to spend time testing it and reporting bugs. The following people made especially gracious contributions of their time and energy in helping to track down bugs, add new features, and generally assist in the GRUB 2 maintainership process: Andrey Shuvikov <mr_hyro@yahoo.com> Bibo Mao <bibo.mao@intel.com> David Miller <davem@davemloft.net> Guillem Jover <guillem@hadrons.org> Harley D. Eades III <hde@foobar-qux.org> Hitoshi Ozeki <h-ozeki@ck2.so-net.ne.jp> Hollis Blanchard <hollis@penguinppc.org> Jeroen Dekkers <jeroen@dekkers.cx> Johan Rydberg <jrydberg@gnu.org> Marco Gerards <marco@gnu.org> Michael Guntsche <mike@it-loops.com> NIIBE Yutaka <gniibe@m17n.org> Omniflux <omniflux@omniflux.com> Robert Bihlmeyer <robbe@orcus.priv.at> Roger Leigh <rleigh@whinlatter.ukfsn.org> Ruslan Nikolaev <nruslan@mail.com> Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk> Tomas Ebenlendr <ebik@ucw.cz> Tristan Gingold <tristan.gingold@bull.net> Tsuneyoshi Yasuo <tuneyoshi@naic.co.jp> Vesa Jaaskelainen <chaac@nic.fi> Vincent Guffens <guffens@inma.ucl.ac.be> Vincent Pelletier <subdino2004@yahoo.fr> Vladimir Serbinenko <phcoder@gmail.com> Also, we thank the projects GNU Automake and LZMA. Some code was stolen from them. This project was supported by Information-technology Promotion Agency, Japan. PK��\ ��>>TODOnu�[��� Before working on improving GRUB, it's very important that you make contact with the core GRUB developers. Things herein might be slightly out of date or otherwise not easy to understand at first glance. So write to <grub-devel@gnu.org> first. For bug tracking, refer to: http://savannah.gnu.org/bugs/?group=grub PK��\6ʁ�;@;@font_char_metrics.pngnu�[����PNG IHDRh�Ҩ*sBIT|d� pHYstt�fxtEXtSoftwarewww.inkscape.org��< IDATx��w�$Uշ��C�9 9�"I�##"�� YA�* �HaH��0$P�9g�4����اgj�Vu�����s�y֪uoU�T�ջN�̌D"�H���=�D"�H�t"�H�)I@'�D��t"�H�)I@'�D��t"�H�)I@'�D��t"�H�)I@'�D��t"�H�)I@'�D���@����4��ܨpn��7��3$�ک6{M�Lΐ�p�rHZ�W�j2��$��_1��:Ǖ�.I@ ��,8�x8�s�� �X��mF!i=IWH���&�ïa��ni��N��ifA|���3�D/0�J$*�,�*�h�c�����1��M�w�x��Ht�$��1�VV�n5��r�? ���|�x� ���P���v%-�L�if��0���#���\mfo�2˅*kKz5�����Q���{��~:���Ձ%�'���͔��8���*�3{���Ձ�{���d� ��_X���^2�u��-fv��u���쉈KOt3K�T��,Zpn�p�k�c�g�������|<l� u� �6md�C��2�}3���H80]���s�������|!���,�q`T8�20���L��g�p|����-ʬ������G�U3e�¸�&G�� � |��I�2�r��L�MC?Kg�=���^e���(pW8�x�n ���u��i�|Wu m�'��/�o1P@�6�cG�r�e��3�x��Ǧ%'�K�t �FCH�2P`o�?8s�p� `�pl�P���rۇc��90m�$�S(;6S�#�9�ˁ�±��gw70"�X;So&��ZW��'|7�e��]�9V&�?��ϮgN u�ɔ���6�+ׇ���~N[�{i�8Y@�S��[ ����� < �9s�!��˕m*������2s�|D��E�3����=(����2���dL��d�;%�� �|,w�1�5�ԝ ���9v7pI��t�[���ce�@�c �v��_�X% �ےzh�����8�3�Ζ3��%�סf��̞�:I��g�_7�K2���u�sUn>-i3{+{ �!W���T�ưp>3�P8�z��`%�!�UI�u�f�?�?��%`�p,k=�P8?M8w~�3{W�=�s���#��;�]*��[��]�C5�G$=���wν�gy�jÒ��N0�_�NOߤ�Ƹ�-3�0W�&�fcX �p!>��x8��4��z� �ψ��K�q��ſ7q������ �z�j��)Bf��?7&}v�E����#��f��+�^a�L*��"W4���W�y�I����+�]6����[��lO3kXw iQ\�v���������M�m��3��63�@x�y_P̳��,��g�/C�}GrT�\� i��I[�*�b^���:� f��>W�F�1���[C���ey��Ϙ�gk`�6������O/Ć�{�mg(3P(^|N�$u�����:1X3{��&��5L��D��Β��ÓÁO�J�f���S�h�+�l<pZx�n0������.�tn�-��uh}ތ�(�,韸z䳸�<�^�8\�A�&3K*��>��~$i�xI���i� ����W��%]�?g�f�|*��c(�>Ŷ��/nur��;��q�ڸd�OHzhp#�=5�K��$efφ8_a���W���f��R��6!�y��"^}~ i`,�&0;.Hif�>��g�y�'��lf�G���#���t���3յ��-��0�V��g�3�a,'I�-���o���^e1�ư@��S�/�Q+����ʾLvT�(�?�5�p�K�c��}y���� ic��J��M�.�'h��D"1��'�+`3����$�4�N+$m�1�_�=����CqS�7��Ãi���s� Í�p����C��fS\0���V�I3��p�q�r�bf���=�Dk�:1�x�_�p S���H:1�x��[&�'}IRq$���p>3�Y�`��u�鶼'�n�tbX`fOH�48<��?wyN$��d�6H��)�|3���9�$��tb�Ra݉�� x�̖�wT�D9i�01l0����z���=�FI�+����m�͓;.I{'$�:��Z����"�����K�Q�����N7�dr����P%<�Sp�ܥ|����$����3��ϱ���%�#��eăWM5$�V�p��ݻ���:`ݐ%I�����˕o�0�/��m�=�O�$+��p�x��{��f<�}}�?��xt���r����.� i;`F3;�Q@Ҵx��0�S��4�`[I��7��2������ޏ�ET��:1�0�K���=�!��7;S^M{-�p�I(�r�p}&���]�L���Jm.<����G��1a�>SfL�g�y�#�k�3�~"͠ÕÈȷ������.�����c�?$鹰�>���elllbfW¤��w�Z����Ņ��fvNA;���8O�pe���-��H�KRs%:�x�Z���y|8w�g��gʗ�pWC���x��Ͷ�d���f�$�VHZU��s�������%��:<sΊ�~����,���-k�-�.�䄷Y����$��y<]ڬ���% ��pc��s�ϑ������v��MǮ�㡌��C3�;����Eǚ1�u��! ��pd���+�tC�`9�,.��g��������4Wo�ϔW,X�[%��Hz;C����$��D7�'�]��������|��d�!����"gO⪼l i�A��v��N$�)�ؐ��m�/�@I�w��!�x�+�M�_�s��ނ�5��6�fv#�z���$���MA�#�E� �&H�hp�P)XRbH�2�܅�O�cf�e��g�^?W�v� 3;$slz�3��zC�3���_�BҬ���f��ܹ9�� fv{���Ȃ�+k�*7��-77�����^���=�+�.���eЉ�IK��;ᱞ|���qM4�-`{`,.���K���7g$�bf��=�� iN3{��q4H�*���*�Gx��,��� �.�Y���l �kc�C��n<;�IL~�M��L�"�Y��f�F��I3�ĐB�8`���"p.�;3�5�o��4���Wm4�ff�u�*���pwo<.��C�C<C͛5�����8��Ǧ4�N��ں�����g�n+cfo��l;��zIӛ������[�&�L�~I���l��Q�IfC����tЉ��(`q3�X ��iv,p����G:�Ԉ�=|IҮ�}��x��f���6h$�<�?��2�G�OЉ!��=��+e�.[�k�k%}X��!u��l���zCЉDb���u�c�����5�Q�� A���4"�����87C�rӷQn���-7]D�i+�/[n�\�k�3 >�kɄ�4�����5sn�\�%��.)7]�rs����F�yr妭�^���l�D}$�|�ɹՁe���Y v���\���(76W�#�k���I��r�nRnLI��%��ȕ[��� ���džh�0[�N����I���%�6,)7O�rk�ʭ�F�Mr�/)�o�Qn�\�)�'}�1����M2���_��Mʍ,)���rkTlo I디;�I�l��箿g鴒�]#���XX�ɟ���~��_X&�����fϑ�2Z;�ڋf;xX#�#f�p�CI�e� %|�E�t��3�_p�������ENe�&i3{���� �8&��2)������\����}��aI&'����x��{���wRq�7_��3{?��U"E��@A��|�x�3� �QAc*��m����Y5�p�� l��͞�O*�>E�Z��3��Ϋ"�^�شx�5#����Nik�="|&77�xX��^�ΨCI���/�W�7�y��f�˶xZ���ߢ'��x�f�� ���1��`�q��^y�,�#e��n3�22�y!��09���t�"iZ3�@�3���Q�@�^mf};W�qd��W�l3���Y��]Ң��fv� �9,�������q�I��Y���e����ؼ� �L��i�6�M��֊������_7�� <�"�=��6^mY2�����ź��+*�̤�~`SIS;$�T����΅�[_�U$1����j~:q�`�$������'��Uya�m�I@O�4n�&��lv&�4I��[�����l��t����M��8E�.I��C�����)��x��Z �b��x��j3�Y���r�xÞ&Q���@jF�z�Ku�$��b$�^Aձ+HZ���uI3�i�bg�u2��p�l�<RkKB���M%3{O�Ì�okTu�X4��ifvE�BE�UI�I�u��,Y�����A/Iz*&�I�,�1�|%�Π �wv����e�'a�x�.NEr��=% �I�U-�Qu���ђ����6!g;��c�f�.R���F���� ��Lz�&��nf��D��kU��x�~cfWU-,i�"������H��N6bd�Iz*��0�'�E��o}E!�S��vOF�)�m/l�ΐ���ܓ��c�$O�>�]O�m.�IA,�&���Bw%���ف{��U1`C3��cJ3\= 3����h�4i]��X�!iyI�2 ��X2Ym���B� N N8�* ��< �:u�I@��|��^3��-�s��/�u�� ��B$m |!��c�Am�7�&iQI�n��!L�$��$��I�q=����+���ǵ��!�TG�4�&�lfm9=���a�є&?��>:y$�+i�� x2�_5�3�_���b���G5�vf���YU�Ix2�N4���?QB����Gaj�$L��=",��vw����{#������"�����*Em��Ɂȫr`�*D����������sg�M9 +P7;��E�$�k@�W����� e;n�Q�Ǣ�]����V1���s^�a4WD����,�#2����� 3OrViMުa���%��D���gO�u���i'.���Ot����W�>�0���=�#��e��~�5��Ul�@�Sm ��c�AE��Yg�^ ��� QL��#����]����0��%}O�Y�5��͕����#����ݛ;&|M�_��T��/"�T�Ξ@�b��3�#۞�4�I���I���D��%mz6c,�PÑ1Q�$͏�<��!�k3(y.�ϊ��3�Te1`㎌�K�B���.)�e�щΓf��5<��FA �f�d���j�gHZ����`�ȡgf��SJ��= <v���W�?���Ό�+l�Q����Z8�t�`��%͠�a.<-Ӡ�s7��}ꕑ�V�٪��/��~��:�"xZ��OK��[��{F���M0y:u gH�.n ެm]�qv*���p����NJZ�T������zM��I�w|y��A��nD������$��$��������ǙW��V ~ߠ��(S�� ���1fvsd��T�$���*�*���8%�a��E����?ɓ�I��Ï�E�_�Hz>�=[��nf�0�Ӏ��r�F�g��=�M"ۺ8<�N�:�]�`�=�X| �K�~�$t&��qZ$����q�˨d��g��qg�����.6��a��1��6T]Y@�46<����4��2�O�U��m���-�2�4XPk�쎺�N�*}N/< [�+�];��k�7��١�u*�I(�\����,bf�uf��C�T�?�����[ުA���퍲'l�Ǹ��gfv T�$z�%̬��7� Y��cfi�i�VkRfB�s��:<���Y}�<�ll���Qu7�k_/r�߮{�a��F��º�ܥ�au<�D�}�o���sm�������8�v��Aׄ��p�����3�O�tVi�)�U��=���}�HC|����Y/�"ݪ�$���̮#�5�_�^l��5�^ ip1=u[q.��'a�R]�6��Í4쐴-p&p3��^l+iT�v��e�<|=��H<KG��"���6-)�C͋�m,>N��MŞ�!:�e���Uo��?*�~%}Y����|aI_�m���#%� 27<����e��2���_���*��} �U�ہ�u_c�uς���z-�<ޝ"?�(�0k��I����c��9��/�?IŁ/��j��[�\K�A�Ò�9%��A-g�5����څv��g-��m�-��5�U�1G�"F��>%�����r��~�d��_67���'����R� eO��vef��Q�����.�³�� ��}�U#-n��cn�����.�[H�'�b*I���,�5z`� ��ͬ,��%}�'��C����>cm�7�w�=]��0�wr۠&I@��e���>I& ����������4��~���;�m��:�^K�lf���]Ф��j�*u-zq�A��r_zJ��~U�lM�@T�$4����YI�I�ۢ�$���H�a��[o����1��⏬�U�=�W��n�1�m���"ʎ�Nj�m,>�۩��7�x�D�S=a��Y���A%&I[H�I�kxơ�s�N�cK��=����/��N�X�<�Z�vjI;^�;�p8Ҧ��� E�UIsHZ�E�?t�M��"� b=ca���"k��#�\.���p����q[OBI��p��3����7�I����7�Ȋ�`lӾ�ƭ����=C�����*�i�5��'���u]1�w����瀺��X���<c�k�h5��_(vT9��חf�5 iZI�O{I#%Ur@��VgGV�`��X���ŭ6jQmXAFp3{��Z.����:��,i��Z�q����Y�o�B�u��X��]*���ff ��t=���XE4���� m�P)b_7��$�cK!&��n=Z,���`�n$��0�%��_�ڢ� �j���kHjw�RH��!��s����X�< �H�aE#����$֓0O_y��8���]۪P�L�< %����m��ߔ��aQI��3����6�H�7%��8��f��n�p��U��J�̈́�B��([�xs����u��m��`Z<����g!�!S�'!�r���>�m��BOB<TC���%�x��0���7W�j�*����[r|(4�j��HZ��3m ��I����햒��!��yw�hIQ�lhj�u��)mT=����Z���7�M�f��N�i������/��̱��A�1�'ҙ�sc;���0��_��1n�]�:�ҵĆ=;���.�r5���b�_wx�8��%t=�7 �Q���I� �2�����g���˒6�p�M�ݪ �Iت��)_�-�[��_l`�.�E#�4��=pc�W\��%L�����O�D��'W��Xx����J�\iF�|f�.�����]j�I`3{�K�wI��FT���b�<6�4S��k�}fVY=%i93�=啤���y�Ȫw������e�UJ2�l@s筷��w�Y�'f�*i�z��]����D�j����-�gl��9��h�ވk��b!�_�l�>���{p��O�uiLE�*�� }��;b݁G���<{$G ��)3玍�� I[�5�"���t�L2 ױǰ���Y�]�Pp�}�,���N�!�Y|���3+����0?�]�cx���=݉H��x�<���|f�13[_W�+p��-l |Z��:�� 97<�ι��uq3��,��̹f9 ��XF����ڨ�0S��O��3+q��;�X�[��|�g�Y�q�{�qMąs'�16�_4���?}A�e�o{���G�*}�t=��%���J4/pph������C���TW��ٟ(w�)c>�*�V.8V�~�s���y�Z,���`�:sJ����u3���c�S�> <f3M�]�IDATfo�{xh�z��&�t=̅?m�4'��s�����;�,Ҫ3�W�8��X3k� �!.��>U�����-�{x�Cl�AY���/FT���ۏՔ�0D<��4�7�[� ��E�8��ߴ��R5 sݯ1�q�g����������g�� a��EB�;Z�Q��m��0%6����$�^ߠ�_�J���k����2�K�����ҘJsf�̈́{ؾ���>8 �̚�!��O�v��w�7�p܀��ל���87�a��z�.�o]�6�D����*��e#�xPaH���}�ٮ@��ڥ˟ጸ�V�r+=|� �p|^\-�u�y 8�L��rW �[��=7���C� X&s�總jc��3h<Y�Ñ?��O��ޗ#����e�q���HO��#����B���,zt��0�v�?�[M��7�ғ��q�}���:��,��������L[pl~`��~��/��Pm��Zn���T��D\�c��JN��i�.\g���I��?�*���놹���z�zJ�7�j0��{�՜�Lү��2ai�C먧VHZf�O��'aX�����n��Z�K��T�~ff��`�(!�҃T����װ8�,>;���f�j����[H���0��xU�4y�ʆ'!��n�� Z����U�� � ���W7�Y���H:;�����셺���t������T��a�<#=F8SZm�bO��^OfIkF�iJIN�9C^��1��q�UUbM�>Gu�m���(�v�(������{�B8X���L�>Y����mT;��M����e���z�Z"Z�q� ����;t #������gz%.�gΔ뉊_��j���/��Ͻ�t�ֶsVh�3��XH�������JG�q��'��vT/~e����|t���I�$}Lҙ���J:8�[O��.���C$�o���.�I� �.����%iaI�z�q엒~��D�S�n,�S�����%�%�QI�IZ"泩���$����_�.�?ލ��L��E�Ib��Y�1�ȪbfgP���)�:� .'a+.���*T�Y(OӵN�8Ωz�b�A.ia�R�r#��o��Hv�q��Вvgr0���?���x���;/>C� �~c���C������-�Wţ��H���,���zL��v���57��0�F��w㑲����Vn��h�O����t3n+�3��1��b�k��A{J���Uo����������o :�I���>~Q��ga�=�t˓0ġ����t��&�=êy iI��C"[R��b~c�:/��7T�S���x`� ���Y�&���M꜈;m̟;��8�؟B�,��4s��ت�c��c�d�] �H����w�5鏸9���ҽ㞄��몊#|�]Wm�;��~�Fu�� �-lҡ�t~&���l��ho4�JD{�v��i�>k����a`�n^W�5��A�:x �.�/�k�U��}�j���|e�|�'IsI�Q�A���g���,���#j�T�˫?��V�%-!�#���4Us��ݖٿ��-�<O�y1�@�O��z=Б[�/�L�`�>Iߕ4f0 �|�1�7$."����c>+�Ɏ �p���}]����쯃m;���[�J����8uO�'k1��g�~i���*d7P���5Ι'w�n�G��Dc=_���3Ƕ�U/��9�1\�ϔ�w}l<e~F���.��O�wJ��l��z\�u=F�R��>k/��?yl�>��7�����A,��b�7��0�}v��X�iČ�}2oE��������B��G$B�{w�3�f�wmx�O�}殣���˰3a���MF��j'X�_q�u��Ix�y�l3=��]bf����y��f�~��~af�K���o3O�J��d�^̹��v�_���__w'��T���Xs�N2���s ��I�G���=�V%-*���������K�X����6��̢�aLQ���1��fv}�z�h�eҸ�9�71mK@���h_�4��\���3��̾��8���0���TU5X�CE>lӋ��}���f�&��:��������N��p��7� +���J~у�"sV��ew/Y,��`+�I�@L;a��w�-Daf��\�ZN�;�5%-^P1`m�@ �&���c�kfKܪ���l�L�+�ۀUp������$�Av�|ư$��}�ɑ�Vm�VJ�og�눊#�7T6��1��g�_�ïx^�F�&��8p���haUm�i�(3��pƞ}?m\�lx���״i�~���?:<��;��b��3V��7 �|P���zz_'�8�>��<�vh�w�A���>��L/'� ��ٽ�)�o\ ��3e,��rm}<\\��2e:&�ñO3Ph=K��y�|���M�XN�u��Ƹ�MŨ`��<x�W�U�p]1�����_��<��ᱯ7������]K�u�x��Yq4l���s)��AQ}upУ�H[s4)#|ahU��Z�D��@V�g��O�6�a���Be�['4�&�cy�-:���3v|�Q��'aA��q-S,�8�*= ,��ٴ*37��>�f��uD\יּ��������a�A�]��W���,U�8j����$�� ����tU�Q0�ʼnS �ʿ|��S��9�zubÊ�����]��m�V�u�ZZ�$���)��w�N���~*����{l}@�'�q��A��h��= |�e�)�[uT���IXBL��gam�� �$�ts%�w�x��g7�OBI3KZ%b��e��T���]��o�z��{]K�S�FTL^��z��(�p'�����z�:�IX����ߚ��{����;2y�)�M�s���q���ۛE^�α}�ƃ�g�Lg\dz%�sn�w��=R��:��ǃin?ެ�l��k�i�Xg�Y$-��-U�l��܁���qO��3<NM^�-������%I3X� ��u�||�o"��O:2�. i?˘fjr<�qO�,����/h�h�T�ӨCO�UqO�[��Q�:�h�����L��w6���v�j�¸�oc��K�C;p=K?����L�wׅ1W63 �R�?��轢ϥT |�O���{t��63;��>��M�/�\ � �,I�N5C3k�۔C�9��G�CJ,?�nk_oU�(����$u�a���g���L3{��BEOBIs�fbf��ϯ�7���Y��93;�̶�o�]��ߟ/J�RҾ��g�$b�����f�!�+|~T$������3�"��%f��*1�M�� ��A�8w@��.\�<������]a� �,f��y��=�:�?���!@��$�U1&o_�b������դw.���UW1L���ػ��b�ӬS\g]ԹY�����ps��X!�����������T'��Ŝ[���4��<��;H</Ϫ�Mb�XI�$I[ᦉ1<������v�1��[vRҀ�1�@N�VX|0�Vt;�h��t�ʼn�6�&�)3{��!�+�I�u�J+�N#O��1n���1��V!O�8�R+���s�V�EtS��F+$-��z��x��1����%<���w-i<.��A6��>���GGêA������:��8��lH��<�a�aű8pN��L�}�rA����y1��M2$:����c \X��(�N\X_�g�苧���l`����g��<fv_HqTD���$m�����9{���*f�����m��ug(s�Ș��;��g�"g� �ʴ*/F��n��~��i_<G�{��x���#�>�|&x ptA��r�[o��H7����Ǵ�e��S�ր(m���eoq-�q��C`���i� &'���1M�;�z�f����`fs��z�D}I��|/I�nԭ�� �������_���K|L�a����V�0���?$c��&�-R����Т1�k���5�f{]� �]$��v� ' ���53����{/n��{�<%�?��'i�2+I[V�q=��#��U"�U�D�>�_ZA~�~����Ym&��'�NWsV$�a��ۋ���C���vc�t�$����>0��� 3[������3�~r�eyF�IM��K5�I���� �xL���j�G��1l(i�nf��'����ҶM��4�����t�" �af��qf�I`n<{�LxV�%]"i<f�[��N�4�I�g�����qs���2��6�;6�J\$?�c$-����I� 3�@{3�ӭE��rj�2��D�I���3�����-����O��33��#�����c[�O }�0U�6����"��B�A.ҭZwr�"ֳ�����A{�M�Hڬ�����2f6�̮5�o�ْ�p;�Q��4p���BL�<�jIg�&@1L���<?���]�1�6y�Ȩ�U��xɒV+:n��p�D]'G�!ii�+nC�T�Cܴk�=y4�)}�����-h�����pk�l�#��eru�.�ݦ�[�c��D_��y��vꀏ��]�����<׳����ӊ��;�mA{G�יo��p=�30Ŀ�L�EA�N�shΛ;>1���x��,W�S�8w$�b��� f�������"��c��➯�X#��|N(�sX�����l_I�/h�"<�ӹ��=8�yG��mL*^�?�=h�p;Ł�N���rǛ�w~O��K`�����ߠ��������9�n����V�s��7��C���wZ_�Uz�y\�-$��o�����i$Mc,�H?ݰ��L���KZ�����羞��moڂ�oW� �5�G���N{*io���>0�g$=�@�G�(��o�E�w� ��_��Y{K�W�۸��m�oD�F��^/87 .���4��IG�q��/���ת����{�I{��?�|{/��>˔��F{�0�m}t�,L�9(��t�sY����f�S1%����I�����3�N���h���������f�x��N:�>GR^��eB�2�(ҭJb��J�RbQ�M��'�¹�$��H�8VR�u �d͐��H�G|�̶�bw�0��/T��S���' ��s�w9O�DE���pW���e��9��0��P%y&�h���|��x�kr��c��i�. �)ɓ�I���HZ�ɯ�1�lk��0QLь�����g���(��'a�$ݿ|7�y�T��H�S4#�'�eߥ�9[�ē�r��@�$Lq�����o�/�V٧.$� ���*�Y|���ēp��vv=�k-U����2��<<nf�wk`�����Xm���I{��C!�Ԣ��]���E�����f�}��Ŧ��U< ƃ���{3��s�!�&�С�D��<p����m��{=lf�u��De�t�o��V��6fU�3��[�B�ﺑ���㩋|N�^��8���3O`:;��1/)6q?3��� <$��ZIgK:D�֒.��'x�%")ҭ��֥��!�llH؟tc,�`8 �V��t��Q�e{��k���'J�����(b��jy ��̮Ͷ#iy``<�ѣx��2ef eV�_��1�G���A}��;��on�:�{C�#p�~FH^nf7��90#��U�3xV�,�~��ǍnE�$lI��U!F�t]��}:5�6<�U���rS�'a���G��4���9p�j<E�5�˔Y�7ƅ�|e�L��B;���l���}��|�ҵt��ͫ����lL�><K��C�4�\kI�K:Zҟ�L��+�Zx���/���ٚfVE8'O�)r�X������)1|�$�NOI��}���� .D�,9�L8h؟ x��)w$�c�guT�����0������Wc�O�fʝ���֝��� ,| �y���,��(`��_U��>c��g��Q��C��٤���J����K[=����,�{��mX�w䲛�ìޝе��6B\n�gH>Φ��84ܸ�mn���1�I�Β��x|�)ol�khվ\`f/d���s�-�[��"�"�x�W��G�v�>yx$?�\;;�v�c��v!>+G� ����%�G�oZ������\�o�Y�㔩8l�yf7����� �l�{z�� W4�)�����ѯ��t1n=qO�����]���U�Fv�*j�?�15��+ԙ�0ƻ�,�{nK��mQ$x$- �l��*�o\��43���}�PxIZْz�'tB@7���?��#~_������l�F��u�{J���Nfr��� �hP���_J9ց��J7��%����e��fu�(�>A����\�ߨ��4y�v��fvy}J@K��.HVw�8����O�;�#$�Ocsrh��xv�"����{��P����w�z����*��b���ֺX�(�v��I�Kb�8FJ-i6I�H�����{F/|9�@v��I�Er6��P��R�|��#p}rC�,���Iϔ�!XwT�+�'�u$��F�Nr�z�����'��%���.sm����U5�Ζz= c� ���U�<�x<e�2Y���M����'�I�ƓO^��$�{OI�/x$N����y��n��`h��#���(�r�%I$�ժB70��������qQ�t�o�A��f���m�����<��!,��w0)/�"ٙ�k���qJ)�7-��XO��40ނˤ��p�ӥp�����/$}�$< ��o����X_�{9So6\ߚyhd2Y��>df�4������?2�C�ohfW�~dÏ�-��E��f���%��s���}�<c�k�G�쾂�i5� ��$찀����n�P{]!�q�K��1a}�"��'��=�$�a���j�.�!y�� ��f��s�fnN��H��X�Re}���< ���̬�3�TD�3��I�oI�ѧ���q��:����-��f�kI_�c�d��r,j�x|�!��i3;U��h�z5�8�9��g���h��q�,W��E�Ɩo�q3;���K�&_*io}�\Wɶw�6k�h`Â�6��K��/l�T�ަ�w\��a�X��Cl_������7�sK�;ב�?\&afGH�,�BI{G���w@&�&��mf痴wns���f�I����h���br��G����Wq���q��W�Y�Ip[�t�2�?�3��~�sK����.�30J�3��)j�\{ n�gJ[���^o�ުM�� w���(n!T�މ%���Q��}�����}�Es���� =K���3\8����]����QY{kઐ��>�@�;�~T��ո`*j�<��b��=�^����1���;���}.؋��Ɯ?�.�@Zh�ۻ�I{�Tho6ܠa4�a#`�L�g(��h�4�N$QHZo89�4< �[��x�3p����{�"�TL��E"�)�w��p<`����p�]�O��8 詘d�}�Iد$OBx6졯���J:1�(y���Iط4�$Von9O�q��N�gϐ�T��-3�/%i��fM�-QRn��r��mRn�\���(�e�ܢ�k���I�s�6���1�����X>.i��|�v��|�UKʭפܖ�r3D�[�E��r+��۠�\�non���<��{�q�S7�([/�����r���˷�(�a�r/��=�F�r�&��˷�(7�I�r�Z�"g�?��0�o1e��'��{���3M�=�+71��-�͖{����M�MAv���GfY"��+�r��fhRn�\��M�-�/gf�]����&�I��H$�>%͠�D�OI:�H$��$��D�OI:�H$��$��D�OI:�H$��$��D�OI:�H$��$��D�OI:�H$��$��D�OI:�H$��$��D�OI:�H$��$��D�OI:�H$��$��D�OI:�H$����R,-�JIEND�B`�PK��\���$�$ grub-dev.htmlnu�[���<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- This developer manual is for GNU GRUB (version 2.03, 17 March 2026). Copyright (C) 1999,2000,2001,2002,2004,2005,2006,2008,2009,2010,2011 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections. --> <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>GNU GRUB Developers Manual 2.03</title> <meta name="description" content="GNU GRUB Developers Manual 2.03"> <meta name="keywords" content="GNU GRUB Developers Manual 2.03"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> <link href="#Top" rel="start" title="Top"> <link href="#Index" rel="index" title="Index"> <link href="#SEC_Contents" rel="contents" title="Table of Contents"> <link href="dir.html#Top" rel="up" title="(dir)"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} blockquote.smallquotation {font-size: smaller} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.lisp {margin-left: 3.2em} div.smalldisplay {margin-left: 3.2em} div.smallexample {margin-left: 3.2em} div.smalllisp {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en"> <h1 class="settitle" align="center">GNU GRUB Developers Manual 2.03</h1> <a name="SEC_Contents"></a> <h2 class="contents-heading">Table of Contents</h2> <div class="contents"> <ul class="no-bullet"> <li><a name="toc-Getting-the-source-code-1" href="#Getting-the-source-code">1 Getting the source code</a></li> <li><a name="toc-Coding-style-1" href="#Coding-style">2 Coding style</a> <ul class="no-bullet"> <li><a name="toc-Naming-Conventions-1" href="#Naming-Conventions">2.1 Naming Conventions</a></li> <li><a name="toc-Functions-1" href="#Functions">2.2 Functions</a></li> <li><a name="toc-Variables-1" href="#Variables">2.3 Variables</a></li> <li><a name="toc-Types-1" href="#Types">2.4 Types</a></li> <li><a name="toc-Macros-1" href="#Macros">2.5 Macros</a></li> <li><a name="toc-Comments-1" href="#Comments">2.6 Comments</a></li> <li><a name="toc-Multi_002dLine-Comments-1" href="#Multi_002dLine-Comments">2.7 Multi-Line Comments</a></li> </ul></li> <li><a name="toc-Finding-your-way-around-1" href="#Finding-your-way-around">3 Finding your way around</a></li> <li><a name="toc-Contributing-changes" href="#Contributing-Changes">4 Contributing changes</a> <ul class="no-bullet"> <li><a name="toc-Getting-started-1" href="#Getting-started">4.1 Getting started</a></li> <li><a name="toc-Typical-Developer-Experience-1" href="#Typical-Developer-Experience">4.2 Typical Developer Experience</a></li> <li><a name="toc-When-you-are-approved-for-write-access-to-project_0027s-files-1" href="#When-you-are-approved-for-write-access-to-project_0027s-files">4.3 When you are approved for write access to project’s files</a></li> </ul></li> <li><a name="toc-Porting-1" href="#Porting">5 Porting</a></li> <li><a name="toc-Error-Handling-1" href="#Error-Handling">6 Error Handling</a></li> <li><a name="toc-Stack-and-heap-size-1" href="#Stack-and-heap-size">7 Stack and heap size</a></li> <li><a name="toc-BIOS-port-memory-map-1" href="#BIOS-port-memory-map">8 BIOS port memory map</a></li> <li><a name="toc-Video-Subsystem-1" href="#Video-Subsystem">9 Video Subsystem</a> <ul class="no-bullet"> <li><a name="toc-Video-API-1" href="#Video-API">9.1 Video API</a> <ul class="no-bullet"> <li><a name="toc-grub_005fvideo_005fsetup" href="#grub_005fvideo_005fsetup">9.1.1 grub_video_setup</a></li> <li><a name="toc-grub_005fvideo_005frestore" href="#grub_005fvideo_005frestore">9.1.2 grub_video_restore</a></li> <li><a name="toc-grub_005fvideo_005fget_005finfo" href="#grub_005fvideo_005fget_005finfo">9.1.3 grub_video_get_info</a></li> <li><a name="toc-grub_005fvideo_005fget_005fblit_005fformat" href="#grub_005fvideo_005fget_005fblit_005fformat">9.1.4 grub_video_get_blit_format</a></li> <li><a name="toc-grub_005fvideo_005fset_005fpalette" href="#grub_005fvideo_005fset_005fpalette">9.1.5 grub_video_set_palette</a></li> <li><a name="toc-grub_005fvideo_005fget_005fpalette" href="#grub_005fvideo_005fget_005fpalette">9.1.6 grub_video_get_palette</a></li> <li><a name="toc-grub_005fvideo_005fset_005farea_005fstatus" href="#grub_005fvideo_005fset_005farea_005fstatus">9.1.7 grub_video_set_area_status</a></li> <li><a name="toc-grub_005fvideo_005fget_005farea_005fstatus" href="#grub_005fvideo_005fget_005farea_005fstatus">9.1.8 grub_video_get_area_status</a></li> <li><a name="toc-grub_005fvideo_005fset_005fviewport" href="#grub_005fvideo_005fset_005fviewport">9.1.9 grub_video_set_viewport</a></li> <li><a name="toc-grub_005fvideo_005fget_005fviewport" href="#grub_005fvideo_005fget_005fviewport">9.1.10 grub_video_get_viewport</a></li> <li><a name="toc-grub_005fvideo_005fset_005fregion" href="#grub_005fvideo_005fset_005fregion">9.1.11 grub_video_set_region</a></li> <li><a name="toc-grub_005fvideo_005fget_005fregion" href="#grub_005fvideo_005fget_005fregion">9.1.12 grub_video_get_region</a></li> <li><a name="toc-grub_005fvideo_005fmap_005fcolor" href="#grub_005fvideo_005fmap_005fcolor">9.1.13 grub_video_map_color</a></li> <li><a name="toc-grub_005fvideo_005fmap_005frgb" href="#grub_005fvideo_005fmap_005frgb">9.1.14 grub_video_map_rgb</a></li> <li><a name="toc-grub_005fvideo_005fmap_005frgba" href="#grub_005fvideo_005fmap_005frgba">9.1.15 grub_video_map_rgba</a></li> <li><a name="toc-grub_005fvideo_005funmap_005fcolor" href="#grub_005fvideo_005funmap_005fcolor">9.1.16 grub_video_unmap_color</a></li> <li><a name="toc-grub_005fvideo_005ffill_005frect" href="#grub_005fvideo_005ffill_005frect">9.1.17 grub_video_fill_rect</a></li> <li><a name="toc-grub_005fvideo_005fblit_005fglyph" href="#grub_005fvideo_005fblit_005fglyph">9.1.18 grub_video_blit_glyph</a></li> <li><a name="toc-grub_005fvideo_005fblit_005fbitmap" href="#grub_005fvideo_005fblit_005fbitmap">9.1.19 grub_video_blit_bitmap</a></li> <li><a name="toc-grub_005fvideo_005fblit_005frender_005ftarget" href="#grub_005fvideo_005fblit_005frender_005ftarget">9.1.20 grub_video_blit_render_target</a></li> <li><a name="toc-grub_005fvideo_005fscroll" href="#grub_005fvideo_005fscroll">9.1.21 grub_video_scroll</a></li> <li><a name="toc-grub_005fvideo_005fswap_005fbuffers" href="#grub_005fvideo_005fswap_005fbuffers">9.1.22 grub_video_swap_buffers</a></li> <li><a name="toc-grub_005fvideo_005fcreate_005frender_005ftarget" href="#grub_005fvideo_005fcreate_005frender_005ftarget">9.1.23 grub_video_create_render_target</a></li> <li><a name="toc-grub_005fvideo_005fdelete_005frender_005ftarget" href="#grub_005fvideo_005fdelete_005frender_005ftarget">9.1.24 grub_video_delete_render_target</a></li> <li><a name="toc-grub_005fvideo_005fset_005factive_005frender_005ftarget" href="#grub_005fvideo_005fset_005factive_005frender_005ftarget">9.1.25 grub_video_set_active_render_target</a></li> <li><a name="toc-grub_005fvideo_005fget_005factive_005frender_005ftarget" href="#grub_005fvideo_005fget_005factive_005frender_005ftarget">9.1.26 grub_video_get_active_render_target</a></li> </ul></li> <li><a name="toc-Example-usage-of-Video-API-1" href="#Example-usage-of-Video-API">9.2 Example usage of Video API</a> <ul class="no-bullet"> <li><a name="toc-Example-of-screen-setup" href="#Example-of-screen-setup">9.2.1 Example of screen setup</a></li> <li><a name="toc-Example-of-setting-up-console-viewport" href="#Example-of-setting-up-console-viewport">9.2.2 Example of setting up console viewport</a></li> </ul></li> <li><a name="toc-Bitmap-API-1" href="#Bitmap-API">9.3 Bitmap API</a> <ul class="no-bullet"> <li><a name="toc-grub_005fvideo_005fbitmap_005fcreate" href="#grub_005fvideo_005fbitmap_005fcreate">9.3.1 grub_video_bitmap_create</a></li> <li><a name="toc-grub_005fvideo_005fbitmap_005fdestroy" href="#grub_005fvideo_005fbitmap_005fdestroy">9.3.2 grub_video_bitmap_destroy</a></li> <li><a name="toc-grub_005fvideo_005fbitmap_005fload" href="#grub_005fvideo_005fbitmap_005fload">9.3.3 grub_video_bitmap_load</a></li> <li><a name="toc-grub_005fvideo_005fbitmap_005fget_005fwidth" href="#grub_005fvideo_005fbitmap_005fget_005fwidth">9.3.4 grub_video_bitmap_get_width</a></li> <li><a name="toc-grub_005fvideo_005fbitmap_005fget_005fheight" href="#grub_005fvideo_005fbitmap_005fget_005fheight">9.3.5 grub_video_bitmap_get_height</a></li> <li><a name="toc-grub_005fvideo_005fbitmap_005fget_005fmode_005finfo" href="#grub_005fvideo_005fbitmap_005fget_005fmode_005finfo">9.3.6 grub_video_bitmap_get_mode_info</a></li> <li><a name="toc-grub_005fvideo_005fbitmap_005fget_005fdata" href="#grub_005fvideo_005fbitmap_005fget_005fdata">9.3.7 grub_video_bitmap_get_data</a></li> </ul></li> </ul></li> <li><a name="toc-PFF2-Font-File-Format-1" href="#PFF2-Font-File-Format">10 PFF2 Font File Format</a> <ul class="no-bullet"> <li><a name="toc-Introduction-1" href="#Introduction">10.1 Introduction</a> <ul class="no-bullet"> <li><a name="toc-Goals-of-the-GRUB-Font-Format" href="#Goals-of-the-GRUB-Font-Format">10.1.1 Goals of the GRUB Font Format</a></li> <li><a name="toc-Why-Another-Font-Format_003f" href="#Why-Another-Font-Format_003f">10.1.2 Why Another Font Format?</a></li> </ul></li> <li><a name="toc-File-Structure-1" href="#File-Structure">10.2 File Structure</a> <ul class="no-bullet"> <li><a name="toc-Section-Types" href="#Section-Types">10.2.1 Section Types</a></li> </ul></li> <li><a name="toc-Font-Metrics-1" href="#Font-Metrics">10.3 Font Metrics</a></li> </ul></li> <li><a name="toc-Graphical-Menu-Software-Design-1" href="#Graphical-Menu-Software-Design">11 Graphical Menu Software Design</a> <ul class="no-bullet"> <li><a name="toc-Introduction-2" href="#Introduction_005f2">11.1 Introduction</a></li> <li><a name="toc-Startup-Sequence-1" href="#Startup-Sequence">11.2 Startup Sequence</a></li> <li><a name="toc-GUI-Components-1" href="#GUI-Components">11.3 GUI Components</a></li> <li><a name="toc-Command-Line-Window-1" href="#Command-Line-Window">11.4 Command Line Window</a></li> </ul></li> <li><a name="toc-Lockdown-framework-1" href="#Lockdown-framework">12 Lockdown framework</a></li> <li><a name="toc-Copying-This-Manual-1" href="#Copying-This-Manual">Appendix A Copying This Manual</a> <ul class="no-bullet"> <li><a name="toc-GNU-Free-Documentation-License-1" href="#GNU-Free-Documentation-License">A.1 GNU Free Documentation License</a> <ul class="no-bullet"> <li><a name="toc-ADDENDUM_003a-How-to-use-this-License-for-your-documents" href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents">A.1.1 ADDENDUM: How to use this License for your documents</a></li> </ul></li> </ul></li> <li><a name="toc-Index-1" href="#Index">Index</a></li> </ul> </div> <a name="Top"></a> <div class="header"> <p> Next: <a href="#Getting-the-source-code" accesskey="n" rel="next">Getting the source code</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GNU-GRUB-developer-manual"></a> <h1 class="top">GNU GRUB developer manual</h1> <p>This is the developer documentation of GNU GRUB, the GRand Unified Bootloader, a flexible and powerful boot loader program for a wide range of architectures. </p> <p>This edition documents version 2.03. </p> <p>This developer manual is for GNU GRUB (version 2.03, 17 March 2026). </p> <p>Copyright © 1999,2000,2001,2002,2004,2005,2006,2008,2009,2010,2011 Free Software Foundation, Inc. </p> <blockquote> <p>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections. </p></blockquote> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Getting-the-source-code" accesskey="1">Getting the source code</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Coding-style" accesskey="2">Coding style</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Finding-your-way-around" accesskey="3">Finding your way around</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Contributing-Changes" accesskey="4">Contributing Changes</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Porting" accesskey="5">Porting</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Error-Handling" accesskey="6">Error Handling</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Stack-and-heap-size" accesskey="7">Stack and heap size</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#BIOS-port-memory-map" accesskey="8">BIOS port memory map</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Video-Subsystem" accesskey="9">Video Subsystem</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#PFF2-Font-File-Format">PFF2 Font File Format</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Graphical-Menu-Software-Design">Graphical Menu Software Design</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Lockdown-framework">Lockdown framework</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Copying-This-Manual">Copying This Manual</a>:</td><td> </td><td align="left" valign="top">Copying This Manual </td></tr> <tr><td align="left" valign="top">• <a href="#Index">Index</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Getting-the-source-code"></a> <div class="header"> <p> Next: <a href="#Coding-style" accesskey="n" rel="next">Coding style</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Getting-the-source-code-1"></a> <h2 class="chapter">1 Getting the source code</h2> <p>GRUB is maintained using the <a href="GIT revision control system">GIT revision control system</a>. To fetch: </p> <div class="example"> <pre class="example">git clone git://git.sv.gnu.org/grub.git </pre></div> <p>Web access is available under </p><div class="example"> <pre class="example">http://git.savannah.gnu.org/cgit/grub.git/ </pre></div> <p>The branches available are: </p> <dl compact="compact"> <dt>‘<samp>master</samp>’</dt> <dd><p>Main development branch. </p></dd> <dt>‘<samp>grub-legacy</samp>’</dt> <dd><p>GRUB 0.97 codebase. Kept for reference and legal reasons </p></dd> <dt>‘<samp>multiboot</samp>’</dt> <dd><p>Multiboot specfication </p></dd> <dt>‘<samp>multiboot2</samp>’</dt> <dd><p>Multiboot2 specfication </p></dd> <dt>‘<samp>developer branches</samp>’</dt> <dd><p>Prefixed with developer name. Every developer of a team manages his own branches. Developer branches do not need changelog entries. </p></dd> </dl> <p>Once you have used <kbd>git clone</kbd> to fetch an initial copy of a branch, you can use <kbd>git pull</kbd> to keep it up to date. If you have modified your local version, you may need to resolve conflicts when pulling. </p> <hr> <a name="Coding-style"></a> <div class="header"> <p> Next: <a href="#Finding-your-way-around" accesskey="n" rel="next">Finding your way around</a>, Previous: <a href="#Getting-the-source-code" accesskey="p" rel="prev">Getting the source code</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Coding-style-1"></a> <h2 class="chapter">2 Coding style</h2> <p>Basically we follow the <a href="http://www.gnu.org/prep/standards_toc.html">GNU Coding Standards</a>. We define additional conventions for GRUB here. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Naming-Conventions" accesskey="1">Naming Conventions</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Functions" accesskey="2">Functions</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Variables" accesskey="3">Variables</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Types" accesskey="4">Types</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Macros" accesskey="5">Macros</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Comments" accesskey="6">Comments</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Multi_002dLine-Comments" accesskey="7">Multi-Line Comments</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Naming-Conventions"></a> <div class="header"> <p> Next: <a href="#Functions" accesskey="n" rel="next">Functions</a>, Up: <a href="#Coding-style" accesskey="u" rel="up">Coding style</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Naming-Conventions-1"></a> <h3 class="section">2.1 Naming Conventions</h3> <p>All global symbols (i.e. functions, variables, types, and macros) must have the prefix grub_ or GRUB_. The all capital form is used only by macros. </p> <hr> <a name="Functions"></a> <div class="header"> <p> Next: <a href="#Variables" accesskey="n" rel="next">Variables</a>, Previous: <a href="#Naming-Conventions" accesskey="p" rel="prev">Naming Conventions</a>, Up: <a href="#Coding-style" accesskey="u" rel="up">Coding style</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Functions-1"></a> <h3 class="section">2.2 Functions</h3> <p>If a function is global, its name must be prefixed with grub_ and must consist of only small letters. If the function belongs to a specific function module, the name must also be prefixed with the module name. For example, if a function is for file systems, its name is prefixed with grub_fs_. If a function is for FAT file system but not for all file systems, its name is prefixed with grub_fs_fat_. The hierarchy is noted this way. </p> <p>After a prefix, a function name must start with a verb (such as get or is). It must not be a noun. Some kind of abbreviation is permitted, as long as it wouldn’t make code less readable (e.g. init). </p> <p>If a function is local, its name may not start with any prefix. It must start with a verb. </p> <hr> <a name="Variables"></a> <div class="header"> <p> Next: <a href="#Types" accesskey="n" rel="next">Types</a>, Previous: <a href="#Functions" accesskey="p" rel="prev">Functions</a>, Up: <a href="#Coding-style" accesskey="u" rel="up">Coding style</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Variables-1"></a> <h3 class="section">2.3 Variables</h3> <p>The rule is mostly the same as functions, as noted above. If a variable is global, its name must be prefixed with grub_ and must consist of only small letters. If the variable belongs to a specific function module, the name must also be prefixed with the module name. For example, if a function is for dynamic loading, its name is prefixed with grub_dl_. If a variable is for ELF but not for all dynamic loading systems, its name is prefixed with grub_dl_elf_. </p> <p>After a prefix, a variable name must start with a noun or an adjective (such as name or long) and it should end with a noun. Some kind of abbreviation is permitted, as long as it wouldn’t make code less readable (e.g. i18n). </p> <p>If a variable is global in the scope of a single file (i.e. it is declared with static), its name may not start with any prefix. It must start with a noun or an adjective. </p> <p>If a variable is local, you may choose any shorter name, as long as it wouldn’t make code less readable (e.g. i). </p> <hr> <a name="Types"></a> <div class="header"> <p> Next: <a href="#Macros" accesskey="n" rel="next">Macros</a>, Previous: <a href="#Variables" accesskey="p" rel="prev">Variables</a>, Up: <a href="#Coding-style" accesskey="u" rel="up">Coding style</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Types-1"></a> <h3 class="section">2.4 Types</h3> <p>The name of a type must be prefixed with grub_ and must consist of only small letters. If the type belongs to a specific function module, the name must also be prefixed with the module name. For example, if a type is for OS loaders, its name is prefixed with grub_loader_. If a type is for Multiboot but not for all OS loaders, its name is prefixed with grub_loader_linux_. </p> <p>The name must be suffixed with _t, to emphasize the fact that it is a type but not a variable or a function. </p> <hr> <a name="Macros"></a> <div class="header"> <p> Next: <a href="#Comments" accesskey="n" rel="next">Comments</a>, Previous: <a href="#Types" accesskey="p" rel="prev">Types</a>, Up: <a href="#Coding-style" accesskey="u" rel="up">Coding style</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Macros-1"></a> <h3 class="section">2.5 Macros</h3> <p>If a macro is global, its name must be prefixed with GRUB_ and must consist of only large letters. Other rules are the same as functions or variables, depending on whether a macro is used like a function or a variable. </p> <hr> <a name="Comments"></a> <div class="header"> <p> Next: <a href="#Multi_002dLine-Comments" accesskey="n" rel="next">Multi-Line Comments</a>, Previous: <a href="#Macros" accesskey="p" rel="prev">Macros</a>, Up: <a href="#Coding-style" accesskey="u" rel="up">Coding style</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Comments-1"></a> <h3 class="section">2.6 Comments</h3> <p>All comments shall be C-style comments, of the form ‘<samp>/* … */</samp>’. </p> <p>Comments shall be placed only on a line by themselves. They shall not be placed together with code, variable declarations, or other non-comment entities. A comment should be placed immediately preceding the entity it describes. </p> <p>Acceptable: </p><div class="example"> <pre class="example">/* The page # that is the front buffer. */ int displayed_page; /* The page # that is the back buffer. */ int render_page; </pre></div> <p>Unacceptable: </p><div class="example"> <pre class="example">int displayed_page; /* The page # that is the front buffer. */ int render_page; /* The page # that is the back buffer. */ </pre></div> <hr> <a name="Multi_002dLine-Comments"></a> <div class="header"> <p> Previous: <a href="#Comments" accesskey="p" rel="prev">Comments</a>, Up: <a href="#Coding-style" accesskey="u" rel="up">Coding style</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Multi_002dLine-Comments-1"></a> <h3 class="section">2.7 Multi-Line Comments</h3> <p>Comments spanning multiple lines shall be formatted with all lines after the first aligned with the first line. </p> <p>Asterisk characters should not be repeated a the start of each subsequent line. </p> <p>Acceptable: </p><div class="example"> <pre class="example">/* This is a comment which spans multiple lines. It is long. */ </pre></div> <p>Unacceptable: </p><div class="example"> <pre class="example">/* * This is a comment * which spans multiple lines. * It is long. */ </pre></div> <p>The opening ‘<samp>/*</samp>’ and closing ‘<samp>*/</samp>’ should be placed together on a line with text. </p> <hr> <a name="Finding-your-way-around"></a> <div class="header"> <p> Next: <a href="#Contributing-Changes" accesskey="n" rel="next">Contributing Changes</a>, Previous: <a href="#Coding-style" accesskey="p" rel="prev">Coding style</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Finding-your-way-around-1"></a> <h2 class="chapter">3 Finding your way around</h2> <p>Here is a brief map of the GRUB code base. </p> <p>GRUB uses Autoconf and Automake, with most of the Automake input generated by a Python script. The top-level build rules are in <samp>configure.ac</samp>, <samp>grub-core/Makefile.core.def</samp>, and <samp>Makefile.util.def</samp>. Each block in a <samp>*.def</samp> file represents a build target, and specifies the source files used to build it on various platforms. The <samp>*.def</samp> files are processed into Automake input by <samp>gentpl.py</samp> (which you only need to look at if you are extending the build system). If you are adding a new module which follows an existing pattern, such as a new command or a new filesystem implementation, it is usually easiest to grep <samp>grub-core/Makefile.core.def</samp> and <samp>Makefile.util.def</samp> for an existing example of that pattern to find out where it should be added. </p> <p>In general, code that may be run at boot time is in a subdirectory of <samp>grub-core</samp>, while code that is only run from within a full operating system is in a subdirectory of the top level. </p> <p>Low-level boot code, such as the MBR implementation on PC BIOS systems, is in the <samp>grub-core/boot/</samp> directory. </p> <p>The GRUB kernel is in <samp>grub-core/kern/</samp>. This contains core facilities such as the device, disk, and file frameworks, environment variable handling, list processing, and so on. The kernel should contain enough to get up to a rescue prompt. Header files for kernel facilities, among others, are in <samp>include/</samp>. </p> <p>Terminal implementations are in <samp>grub-core/term/</samp>. </p> <p>Disk access code is spread across <samp>grub-core/disk/</samp> (for accessing the disk devices themselves), <samp>grub-core/partmap/</samp> (for interpreting partition table data), and <samp>grub-core/fs/</samp> (for accessing filesystems). Note that, with the odd specialised exception, GRUB only contains code to <em>read</em> from filesystems and tries to avoid containing any code to <em>write</em> to filesystems; this lets us confidently assure users that GRUB cannot be responsible for filesystem corruption. </p> <p>PCI and USB bus handling is in <samp>grub-core/bus/</samp>. </p> <p>Video handling code is in <samp>grub-core/video/</samp>. The graphical menu system uses this heavily, but is in a separate directory, <samp>grub-core/gfxmenu/</samp>. </p> <p>Most commands are implemented by files in <samp>grub-core/commands/</samp>, with the following exceptions: </p> <ul> <li> A few core commands live in <samp>grub-core/kern/corecmd.c</samp>. </li><li> Commands related to normal mode live under <samp>grub-core/normal/</samp>. </li><li> Commands that load and boot kernels live under <samp>grub-core/loader/</samp>. </li><li> The ‘<samp>loopback</samp>’ command is really a disk device, and so lives in <samp>grub-core/disk/loopback.c</samp>. </li><li> The ‘<samp>gettext</samp>’ command lives under <samp>grub-core/gettext/</samp>. </li><li> The ‘<samp>loadfont</samp>’ and ‘<samp>lsfonts</samp>’ commands live under <samp>grub-core/font/</samp>. </li><li> The ‘<samp>serial</samp>’, ‘<samp>terminfo</samp>’, and ‘<samp>background_image</samp>’ commands live under <samp>grub-core/term/</samp>. </li><li> The ‘<samp>efiemu_*</samp>’ commands live under <samp>grub-core/efiemu/</samp>. </li><li> OS-dependent code should be under <samp>grub-core/osdep/</samp> </li><li> Utility programs meant to be run from a full operating system (except OS-dependent code mentioned previously) are in <samp>util/</samp>. </li></ul> <p>There are a few other special-purpose exceptions; grep for them if they matter to you. </p> <hr> <a name="Contributing-Changes"></a> <div class="header"> <p> Next: <a href="#Porting" accesskey="n" rel="next">Porting</a>, Previous: <a href="#Finding-your-way-around" accesskey="p" rel="prev">Finding your way around</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Contributing-changes"></a> <h2 class="chapter">4 Contributing changes</h2> <p>Contributing changes to GRUB 2 is welcomed activity. However we have a bit of control what kind of changes will be accepted to GRUB 2. Therefore it is important to discuss your changes on grub-devel mailing list (see MailingLists). On this page there are some basic details on the development process and activities. </p> <p>First of all you should come up with the idea yourself what you want to contribute. If you do not have that beforehand you are advised to study this manual and try GRUB 2 out to see what you think is missing from there. </p> <p>Here are additional pointers: </p><ul> <li> <a href="https://savannah.gnu.org/task/?group=grub GRUB's Task Tracker">https://savannah.gnu.org/task/?group=grub GRUB's Task Tracker</a> </li><li> <a href="https://savannah.gnu.org/bugs/?group=grub GRUB's Bug Tracker">https://savannah.gnu.org/bugs/?group=grub GRUB's Bug Tracker</a> </li></ul> <p>If you intended to make changes to GRUB Legacy (<=0.97) those are not accepted anymore. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Getting-started" accesskey="1">Getting started</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Typical-Developer-Experience" accesskey="2">Typical Developer Experience</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#When-you-are-approved-for-write-access-to-project_0027s-files" accesskey="3">When you are approved for write access to project's files</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Getting-started"></a> <div class="header"> <p> Next: <a href="#Typical-Developer-Experience" accesskey="n" rel="next">Typical Developer Experience</a>, Up: <a href="#Contributing-Changes" accesskey="u" rel="up">Contributing Changes</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Getting-started-1"></a> <h3 class="section">4.1 Getting started</h3> <ul> <li> Always use latest GRUB 2 source code. So get that first. <p>For developers it is recommended always to use the newest development version of GRUB 2. If development takes a long period of time, please remember to keep in sync with newest developments regularly so it is much easier to integrate your change in the future. GRUB 2 is being developed in a GIT repository. </p> <p>Please check Savannah’s GRUB project page for details how to get newest git: <a href="https://savannah.gnu.org/git/?group=grub">GRUB 2 git Repository</a> </p> </li><li> Compile it and try it out. <p>It is always good idea to first see that things work somehow and after that to start to implement new features or develop fixes to bugs. </p> </li><li> Study the code. <p>There are sometimes odd ways to do things in GRUB 2 code base. This is mainly related to limited environment where GRUB 2 is being executed. You usually do not need to understand it all so it is better to only try to look at places that relates to your work. Please do not hesitate to ask for help if there is something that you do not understand. </p> </li><li> Develop a new feature. <p>Now that you know what to do and how it should work in GRUB 2 code base, please be free to develop it. If you have not so far announced your idea on grub-devel mailing list, please do it now. This is to make sure you are not wasting your time working on the solution that will not be integrated to GRUB 2 code base. </p> <p>You might want to study our coding style before starting development so you do not need to change much of the code when your patch is being reviewed. (see <a href="#Coding-style">Coding style</a>) </p> <p>For every accepted patch there has to exist a ChangeLog entry. Our ChangeLog consist of changes within source code and are not describing about what the change logically does. Please see examples from previous entries. </p> <p>Also remember that GRUB 2 is licensed under GPLv3 license and that usually means that you are not allowed to copy pieces of code from other projects. Even if the source project’s license would be compatible with GPLv3, please discuss it beforehand on grub-devel mailing list. </p> </li><li> Test your change. <p>Test that your change works properly. Try it out a couple of times, preferably on different systems, and try to find problems with it. </p> </li><li> Publish your change. <p>When you are happy with your change, first make sure it is compilable with latest development version of GRUB 2. After that please send a patch to grub-devel for review. Please describe in your email why you made the change, what it changes and so on. Please be prepared to receive even discouraging comments about your patch. There is usually at least something that needs to be improved in every patch. </p> <p>Please use unified diff to make your patch (good match of arguments for diff is ‘<samp>-pruN</samp>’). </p> </li><li> Respond to received feedback. <p>If you are asked to modify your patch, please do that and resubmit it for review. If your change is large you are required to submit a copyright agreement to FSF. Please keep in mind that if you are asked to submit for copyright agreement, process can take some time and is mandatory in order to get your changes integrated. </p> <p>If you are not on grub-devel to respond to questions, most likely your patch will not be accepted. Also if problems arise from your changes later on, it would be preferable that you also fix the problem. So stay around for a while. </p> </li><li> Your patch is accepted. <p>Good job! Your patch will now be integrated into GRUB 2 mainline, and if it didn’t break anything it will be publicly available in the next release. </p> <p>Now you are welcome to do further improvements :) </p></li></ul> <hr> <a name="Typical-Developer-Experience"></a> <div class="header"> <p> Next: <a href="#When-you-are-approved-for-write-access-to-project_0027s-files" accesskey="n" rel="next">When you are approved for write access to project's files</a>, Previous: <a href="#Getting-started" accesskey="p" rel="prev">Getting started</a>, Up: <a href="#Contributing-Changes" accesskey="u" rel="up">Contributing Changes</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Typical-Developer-Experience-1"></a> <h3 class="section">4.2 Typical Developer Experience</h3> <p>The typical experience for a developer in this project is the following: </p> <ol> <li> You find yourself wanting to do something (e.g. fixing a bug). </li><li> You show some result in the mailing list or the IRC. </li><li> You are getting to be known to other developers. </li><li> You accumulate significant amount of contribution, so copyright assignment is processed. </li><li> You are free to check in your changes on your own, legally speaking. </li></ol> <p>At this point, it is rather annoying that you ought to ask somebody else every change to be checked in. For efficiency, it is far better, if you can commit it yourself. Therefore, our policy is to give you the write permission to our official repository, once you have shown your skill and will, and the FSF clerks have dealt with your copyright assignment. </p> <hr> <a name="When-you-are-approved-for-write-access-to-project_0027s-files"></a> <div class="header"> <p> Previous: <a href="#Typical-Developer-Experience" accesskey="p" rel="prev">Typical Developer Experience</a>, Up: <a href="#Contributing-Changes" accesskey="u" rel="up">Contributing Changes</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="When-you-are-approved-for-write-access-to-project_0027s-files-1"></a> <h3 class="section">4.3 When you are approved for write access to project’s files</h3> <p>As you might know, GRUB is hosted on <a href="https://savannah.gnu.org/projects/grub Savannah">https://savannah.gnu.org/projects/grub Savannah</a>, thus the membership is managed by Savannah. This means that, if you want to be a member of this project: </p> <ol> <li> You need to create your own account on Savannah. </li><li> You can submit “Request for Inclusion” from “My Groups” on Savannah. </li></ol> <p>Then, one of the admins can approve your request, and you will be a member. If you don’t want to use the Savannah interface to submit a request, you can simply notify the admins by email or something else, alternatively. But you still need to create an account beforehand. </p> <p>NOTE: we sometimes receive a “Request for Inclusion” from an unknown person. In this case, the request would be just discarded, since it is too dangerous to allow a stranger to be a member, which automatically gives him a commit right to the repository, both for a legal reason and for a technical reason. </p> <p>If your intention is to just get started, please do not submit a inclusion request. Instead, please subscribe to the mailing list, and communicate first (e.g. sending a patch, asking a question, commenting on another message...). </p> <hr> <a name="Porting"></a> <div class="header"> <p> Next: <a href="#Error-Handling" accesskey="n" rel="next">Error Handling</a>, Previous: <a href="#Contributing-Changes" accesskey="p" rel="prev">Contributing Changes</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Porting-1"></a> <h2 class="chapter">5 Porting</h2> <p>GRUB2 is designed to be easily portable accross platforms. But because of the nature of bootloader every new port must be done separately. Here is how I did MIPS (loongson and ARC) and Xen ports. Note than this is more of suggestions, not absolute truth. </p> <p>First of all grab any architecture specifications you can find in public (please avoid NDA). </p> <p>First stage is “Hello world”. I’ve done it outside of GRUB for simplicity. Your task is to have a small program which is loadable as bootloader and clearly shows its presence to you. If you have easily accessible console you can just print a message. If you have a mapped framebuffer you know address of, you can draw a square. If you have a debug facility, just hanging without crashing might be enough. For the first stage you can choose to load the bootloader across the network since format for network image is often easier than for local boot and it skips the need of small intermediary stages and nvram handling. Additionally you can often have a good idea of the needed format by running “file” on any netbootable executable for given platform. </p> <p>This program should probably have 2 parts: an assembler and C one. Assembler one handles BSS cleaning and other needed setup (on some platforms you may need to switch modes or copy the executable to its definitive position). So your code may look like (x86 assembly for illustration purposes) </p> <div class="example"> <pre class="example"> .globl _start _start: movl $_bss_start, %edi movl $_end, %ecx subl %edi, %ecx xorl %eax, %eax cld rep stosb call main </pre></div> <div class="example"> <pre class="example"> static const char msg[] = "Hello, world"; void putchar (int c) { ... } void main (void) { const char *ptr = msg; while (*ptr) putchar (*ptr++); while (1); } </pre></div> <p>Sometimes you need a third file: assembly stubs for ABI-compatibility. </p> <p>Once this file is functional it’s time to move it into GRUB2. The startup assembly file goes to grub-core/kern/$cpu/$platform/startup.S. You should also include grub/symbol.h and replace call to entry point with call to EXT_C(grub_main). The C file goes to grub-core/kern/$cpu/$platform/init.c and its entry point is renamed to void grub_machine_init (void). Keep final infinite loop for now. Stubs file if any goes to grub-core/kern/$cpu/$platform/callwrap.S. Sometimes either $cpu or $platform is dropped if file is used on several cpus respectivelyplatforms. Check those locations if they already have what you’re looking for. </p> <p>Then modify in configure.ac the following parts: </p> <p>CPU names: </p> <div class="example"> <pre class="example">case "$target_cpu" in i[[3456]]86) target_cpu=i386 ;; amd64) target_cpu=x86_64 ;; sparc) target_cpu=sparc64 ;; s390x) target_cpu=s390 ;; ... esac </pre></div> <p>Sometimes CPU have additional architecture names which don’t influence booting. You might want to have some canonical name to avoid having bunch of identical platforms with different names. </p> <p>NOTE: it doesn’t influence compile optimisations which depend solely on chosen compiler and compile options. </p> <div class="example"> <pre class="example">if test "x$with_platform" = x; then case "$target_cpu"-"$target_vendor" in i386-apple) platform=efi ;; i386-*) platform=pc ;; x86_64-apple) platform=efi ;; x86_64-*) platform=pc ;; powerpc-*) platform=ieee1275 ;; ... esac else ... fi </pre></div> <p>This part deals with guessing the platform from CPU and vendor. Sometimes you need to use 32-bit mode for booting even if OS runs in 64-bit one. If so add your platform to: </p> <div class="example"> <pre class="example">case "$target_cpu"-"$platform" in x86_64-efi) ;; x86_64-emu) ;; x86_64-*) target_cpu=i386 ;; powerpc64-ieee1275) target_cpu=powerpc ;; esac </pre></div> <p>Add your platform to the list of supported ones: </p> <div class="example"> <pre class="example">case "$target_cpu"-"$platform" in i386-efi) ;; x86_64-efi) ;; i386-pc) ;; i386-multiboot) ;; i386-coreboot) ;; ... esac </pre></div> <p>If explicit -m32 or -m64 is needed add it to: </p> <div class="example"> <pre class="example">case "$target_cpu" in i386 | powerpc) target_m32=1 ;; x86_64 | sparc64) target_m64=1 ;; esac </pre></div> <p>Finally you need to add a conditional to the following block: </p> <div class="example"> <pre class="example">AM_CONDITIONAL([COND_mips_arc], [test x$target_cpu = xmips -a x$platform = xarc]) AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275]) AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275]) </pre></div> <p>Next stop is gentpl.py. You need to add your platform to the list of supported ones (sorry that this list is duplicated): </p> <div class="example"> <pre class="example">GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275", "x86_64_efi", "mips_loongson", "sparc64_ieee1275", "powerpc_ieee1275", "mips_arc", "ia64_efi", "mips_qemu_mips", "s390_mainframe" ] </pre></div> <p>You may also want already to add new platform to one or several of available groups. In particular we always have a group for each CPU even when only one platform for given CPU is available. </p> <p>Then comes grub-core/Makefile.core.def. In the block “kernel” you’ll need to define ldflags for your platform ($cpu_$platform_ldflags). You also need to declare startup asm file ($cpu_$platform_startup) as well as any other files (e.g. init.c and callwrap.S) (e.g. $cpu_$platform = kern/$cpu/$platform/init.c). At this stage you will also need to add dummy dl.c and cache.S with functions grub_err_t grub_arch_dl_check_header (void *ehdr), grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) (dl.c), grub_uint32_t grub_arch_dl_min_alignment (void), and void grub_arch_sync_caches (void *address, grub_size_t len) (cache.S). They won’t be used for now. </p> <p>You will need to create directory include/$cpu/$platform and a file include/$cpu/types.h. The later folowing this template: </p> <div class="example"> <pre class="example">#ifndef GRUB_TYPES_CPU_HEADER #define GRUB_TYPES_CPU_HEADER 1 /* The size of void *. */ #define GRUB_TARGET_SIZEOF_VOID_P 4 /* The size of long. */ #define GRUB_TARGET_SIZEOF_LONG 4 /* mycpu is big-endian. */ #define GRUB_TARGET_WORDS_BIGENDIAN 1 /* Alternatively: mycpu is little-endian. */ #undef GRUB_TARGET_WORDS_BIGENDIAN #endif /* ! GRUB_TYPES_CPU_HEADER */ </pre></div> <p>You will also need to add a dummy file to datetime and setjmp modules to avoid any of it having no files. It can be just completely empty at this stage. </p> <p>You’ll need to make grub-mkimage.c (util/grub_mkimage.c) aware of the needed format. For most commonly used formats like ELF, PE, aout or raw the support is already present and you’ll need to make it follow the existant code paths for your platform adding adjustments if necessary. When done compile: </p> <div class="example"> <pre class="example">./autogen.sh ./configure --target=$cpu --with-platform=$platform TARGET_CC=.. OBJCOPY=... STRIP=... make > /dev/null </pre></div> <p>And create image </p> <div class="example"> <pre class="example">./grub-mkimage -d grub-core -O $format_id -o test.img </pre></div> <p>And it’s time to test your test.img. </p> <p>If it works next stage is to have heap, console and timer. </p> <p>To have the heap working you need to determine which regions are suitable for heap usage, allocate them from firmware and map (if applicable). Then call grub_mm_init_region (vois *start, grub_size_t s) for every of this region. As a shortcut for early port you can allocate right after _end or have a big static array for heap. If you do you’ll probably need to come back to this later. As for output console you should distinguish between an array of text, terminfo or graphics-based console. Many of real-world examples don’t fit perfectly into any of these categories but one of the models is easier to be used as base. In second and third case you should add your platform to terminfokernel respectively videoinkernel group. A good example of array of text is i386-pc (kern/i386/pc/init.c and term/i386/pc/console.c). Of terminfo is ieee1275 (kern/ieee1275/init.c and term/ieee1275/console.c). Of video is loongson (kern/mips/loongson/init.c). Note that terminfo has to be inited in 2 stages: one before (to get at least rudimentary console as early as possible) and another after the heap (to get full-featured console). For the input there are string of keys, terminfo and direct hardware. For string of keys look at i386-pc (same files), for termino ieee1275 (same files) and for hardware loongson (kern/mips/loongson/init.c and term/at_keyboard.c). </p> <p>For the timer you’ll need to call grub_install_get_time_ms (...) with as sole argument a function returning a grub_uint64_t of a number of milliseconds elapsed since arbitrary point in the past. </p> <p>Once these steps accomplished you can remove the inifinite loop and you should be able to get to the minimal console. Next step is to have module loading working. For this you’ll need to fill kern/$cpu/dl.c and kern/$cpu/cache.S with real handling of relocations and respectively the real sync of I and D caches. Also you’ll need to decide where in the image to store the modules. Usual way is to have it concatenated at the end. In this case you’ll need to modify startup.S to copy modules out of bss to let’s say ALIGN_UP (_end, 8) before cleaning out bss. You’ll probably find useful to add total_module_size field to startup.S. In init.c you need to set grub_modbase to the address where modules can be found. You may need grub_modules_get_end () to avoid declaring the space occupied by modules as usable for heap. You can test modules with: </p> <div class="example"> <pre class="example">./grub-mkimage -d grub-core -O $format_id -o test.img hello </pre></div> <p>and then running “hello” in the shell. </p> <p>Once this works, you should think of implementing disk access. Look around disk/ for examples. </p> <p>Then, very importantly, you probably need to implement the actual loader (examples available in loader/) </p> <p>Last step to have minimally usable port is to add support to grub-install to put GRUB in a place where firmware or platform will pick it up. </p> <p>Next steps are: filling datetime.c, setjmp.S, network (net/drivers), video (video/), halt (lib/), reboot (lib/). </p> <p>Please add your platform to Platform limitations and Supported kernels chapter in user documentation and mention any steps you skipped which result in reduced features or performance. Here is the quick checklist of features. Some of them are less important than others and skipping them is completely ok, just needs to be mentioned in user documentation. </p> <p>Checklist: </p><ul> <li> Is heap big enough? </li><li> Which charset is supported by console? </li><li> Does platform have disk driver? </li><li> Do you have network card support? </li><li> Are you able to retrieve datetime (with date)? </li><li> Are you able to set datetime (with date)? </li><li> Is serial supported? </li><li> Do you have direct disk support? </li><li> Do you have direct keyboard support? </li><li> Do you have USB support? </li><li> Do you support loading through network? </li><li> Do you support loading from disk? </li><li> Do you support chainloading? </li><li> Do you support network chainloading? </li><li> Does cpuid command supports checking all CPU features that the user might want conditionalise on (64-bit mode, hypervisor,...) </li><li> Do you support hints? How reliable are they? </li><li> Does platform have ACPI? If so do “acpi” and “lsacpi” modules work? </li><li> Do any of platform-specific operations mentioned in the relevant section of user manual makes sense on your platform? </li><li> Does your platform support PCI? If so is there an appropriate driver for GRUB? </li><li> Do you support badram? </li></ul> <hr> <a name="Error-Handling"></a> <div class="header"> <p> Next: <a href="#Stack-and-heap-size" accesskey="n" rel="next">Stack and heap size</a>, Previous: <a href="#Porting" accesskey="p" rel="prev">Porting</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Error-Handling-1"></a> <h2 class="chapter">6 Error Handling</h2> <p>Error handling in GRUB 2 is based on exception handling model. As C language doesn’t directly support exceptions, exception handling behavior is emulated in software. </p> <p>When exception is raised, function must return to calling function. If calling function does not provide handling of the exception it must return back to its calling function and so on, until exception is handled. If exception is not handled before prompt is displayed, error message will be shown to user. </p> <p>Exception information is stored on <code>grub_errno</code> global variable. If <code>grub_errno</code> variable contains value <code>GRUB_ERR_NONE</code>, there is no active exception and application can continue normal processing. When <code>grub_errno</code> has other value, it is required that application code either handles this error or returns instantly to caller. If function is with return type <code>grub_err_t</code> is about to return <code>GRUB_ERR_NONE</code>, it should not set <code>grub_errno</code> to that value. Only set <code>grub_errno</code> in cases where there is error situation. </p> <p>Simple exception forwarder. </p><div class="example"> <pre class="example">grub_err_t forwarding_example (void) { /* Call function that might cause exception. */ foobar (); /* No special exception handler, just forward possible exceptions. */ if (grub_errno != GRUB_ERR_NONE) { return grub_errno; } /* All is OK, do more processing. */ /* Return OK signal, to caller. */ return GRUB_ERR_NONE; } </pre></div> <p>Error reporting has two components, the actual error code (of type <code>grub_err_t</code>) and textual message that will be displayed to user. List of valid error codes is listed in header file <samp>include/grub/err.h</samp>. Textual error message can contain any textual data. At time of writing, error message can contain up to 256 characters (including terminating NUL). To ease error reporting there is a helper function <code>grub_error</code> that allows easier formatting of error messages and should be used instead of writing directly to global variables. </p> <p>Example of error reporting. </p><div class="example"> <pre class="example">grub_err_t failing_example () { return grub_error (GRUB_ERR_FILE_NOT_FOUND, "Failed to read %s, tried %d times.", "test.txt", 10); } </pre></div> <p>If there is a special reason that error code does not need to be taken account, <code>grub_errno</code> can be zeroed back to <code>GRUB_ERR_NONE</code>. In cases like this all previous error codes should have been handled correctly. This makes sure that there are no unhandled exceptions. </p> <p>Example of zeroing <code>grub_errno</code>. </p><div class="example"> <pre class="example">grub_err_t probe_example () { /* Try to probe device type 1. */ probe_for_device (); if (grub_errno == GRUB_ERR_NONE) { /* Device type 1 was found on system. */ register_device (); return GRUB_ERR_NONE; } /* Zero out error code. */ grub_errno = GRUB_ERR_NONE; /* No device type 1 found, try to probe device type 2. */ probe_for_device2 (); if (grub_errno == GRUB_ERR_NONE) { /* Device type 2 was found on system. */ register_device2 (); return GRUB_ERR_NONE; } /* Zero out error code. */ grub_errno = GRUB_ERR_NONE; /* Return custom error message. */ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No device type 1 or 2 found."); } </pre></div> <p>Some times there is a need to continue processing even if there is a error state in application. In situations like this, there is a needed to save old error state and then call other functions that might fail. To aid in this, there is a error stack implemented. Error state can be pushed to error stack by calling function <code>grub_error_push ()</code>. When processing has been completed, <code>grub_error_pop ()</code> can be used to pop error state from stack. Error stack contains predefined amount of error stack items. Error stack is protected for overflow and marks these situations so overflow error does not get unseen. If there is no space available to store error message, it is simply discarded and overflow will be marked as happened. When overflow happens, it most likely will corrupt error stack consistency as for pushed error there is no matching pop, but overflow message will be shown to inform user about the situation. Overflow message will be shown at time when prompt is about to be drawn. </p> <p>Example usage of error stack. </p><div class="example"> <pre class="example">/* Save possible old error message. */ grub_error_push (); /* Do your stuff here. */ call_possibly_failing_function (); if (grub_errno != GRUB_ERR_NONE) { /* Inform rest of the code that there is error (grub_errno is set). There is no pop here as we want both error states to be displayed. */ return; } /* Restore old error state by popping previous item from stack. */ grub_error_pop (); </pre></div> <hr> <a name="Stack-and-heap-size"></a> <div class="header"> <p> Next: <a href="#BIOS-port-memory-map" accesskey="n" rel="next">BIOS port memory map</a>, Previous: <a href="#Error-Handling" accesskey="p" rel="prev">Error Handling</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Stack-and-heap-size-1"></a> <h2 class="chapter">7 Stack and heap size</h2> <p>On emu stack and heap are just normal host OS stack and heap. Stack is typically 8 MiB although it’s OS-dependent. </p> <p>On i386-pc, i386-coreboot, i386-qemu and i386-multiboot the stack is 60KiB. All available space between 1MiB and 4GiB marks is part of heap. </p> <p>On *-xen stack is 4MiB. If compiled for x86-64 with GCC 4.4 or later adressable space is unlimited. When compiled for x86-64 with older GCC version adressable space is limited to 2GiB. When compiling for i386 adressable space is limited to 4GiB. All adressable pages except the ones for stack, GRUB binary, special pages and page table are in the heap. </p> <p>On *-efi GRUB uses same stack as EFI. If compiled for x86-64 with GCC 4.4 or later adressable space is unlimited. When compiled for x86-64 with older GCC version adressable space is limited to 2GiB. For all other platforms adressable space is limited to 4GiB. GRUB allocates pages from EFI for its heap, at most 1.6 GiB. </p> <p>On i386-ieee1275 and powerpc-ieee1275 GRUB uses same stack as IEEE1275. </p> <p>On i386-ieee1275, GRUB allocates at most 32MiB for its heap. On powerpc-ieee1275, GRUB allocates up to 1GiB. </p> <p>On sparc64-ieee1275 stack is 256KiB and heap is 2MiB. </p> <p>On mips(el)-qemu_mips and mipsel-loongson stack is 2MiB (everything below GRUB image) and everything above GRUB image (from 2MiB + kernel size) until 256MiB is part of heap. </p> <p>On mips-arc stack is 2MiB (everything below GRUB image) and everything above GRUB image(from 2MiB + kernel size) until 128MiB is part of heap. </p> <p>On mipsel-arc stack is 2MiB (everything below GRUB image which is not part of ARC) and everything above GRUB image (from 7MiB + kernel size) until 256MiB is part of heap. </p> <p>On arm-uboot stack is 256KiB and heap is 2MiB. </p> <p>In short: </p> <table> <thead><tr><th width="15%">Platform</th><th width="25%">Stack</th><th width="50%">Heap</th></tr></thead> <tr><td width="15%">emu</td><td width="25%">8 MiB</td><td width="50%">?</td></tr> <tr><td width="15%">i386-pc</td><td width="25%">60 KiB</td><td width="50%">< 4 GiB</td></tr> <tr><td width="15%">i386-coreboot</td><td width="25%">60 KiB</td><td width="50%">< 4 GiB</td></tr> <tr><td width="15%">i386-multiboot</td><td width="25%">60 KiB</td><td width="50%">< 4 GiB</td></tr> <tr><td width="15%">i386-qemu</td><td width="25%">60 KiB</td><td width="50%">< 4 GiB</td></tr> <tr><td width="15%">*-efi</td><td width="25%">?</td><td width="50%">< 1.6 GiB</td></tr> <tr><td width="15%">i386-ieee1275</td><td width="25%">?</td><td width="50%">< 32 MiB</td></tr> <tr><td width="15%">powerpc-ieee1275</td><td width="25%">?</td><td width="50%">< 1 GiB</td></tr> <tr><td width="15%">sparc64-ieee1275</td><td width="25%">256KiB</td><td width="50%">2 MiB</td></tr> <tr><td width="15%">arm-uboot</td><td width="25%">256KiB</td><td width="50%">2 MiB</td></tr> <tr><td width="15%">mips(el)-qemu_mips</td><td width="25%">2MiB</td><td width="50%">253 MiB</td></tr> <tr><td width="15%">mipsel-loongson</td><td width="25%">2MiB</td><td width="50%">253 MiB</td></tr> <tr><td width="15%">mips-arc</td><td width="25%">2MiB</td><td width="50%">125 MiB</td></tr> <tr><td width="15%">mipsel-arc</td><td width="25%">2MiB</td><td width="50%">248 MiB</td></tr> <tr><td width="15%">x86_64-xen (GCC >= 4.4)</td><td width="25%">4MiB</td><td width="50%">unlimited</td></tr> <tr><td width="15%">x86_64-xen (GCC < 4.4)</td><td width="25%">4MiB</td><td width="50%">< 2GiB</td></tr> <tr><td width="15%">i386-xen</td><td width="25%">4MiB</td><td width="50%">< 4GiB</td></tr> </table> <hr> <a name="BIOS-port-memory-map"></a> <div class="header"> <p> Next: <a href="#Video-Subsystem" accesskey="n" rel="next">Video Subsystem</a>, Previous: <a href="#Stack-and-heap-size" accesskey="p" rel="prev">Stack and heap size</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="BIOS-port-memory-map-1"></a> <h2 class="chapter">8 BIOS port memory map</h2> <table> <thead><tr><th width="15%">Start</th><th width="25%">End</th><th width="50%">Usage</th></tr></thead> <tr><td width="15%">0</td><td width="25%">0x1000 - 1</td><td width="50%">BIOS and real mode interrupts</td></tr> <tr><td width="15%">0x07BE</td><td width="25%">0x07FF</td><td width="50%">Partition table passed to another boot loader</td></tr> <tr><td width="15%">?</td><td width="25%">0x2000 - 1</td><td width="50%">Real mode stack</td></tr> <tr><td width="15%">0x7C00</td><td width="25%">0x7D00 - 1</td><td width="50%">Boot sector</td></tr> <tr><td width="15%">0x8000</td><td width="25%">?</td><td width="50%">GRUB kernel</td></tr> <tr><td width="15%">0x68000</td><td width="25%">0x71000 - 1</td><td width="50%">Disk buffer</td></tr> <tr><td width="15%">?</td><td width="25%">0x80000 - 1</td><td width="50%">Protected mode stack</td></tr> <tr><td width="15%">?</td><td width="25%">0xA0000 - 1</td><td width="50%">Extended BIOS Data Area</td></tr> <tr><td width="15%">0xA0000</td><td width="25%">0xC0000 - 1</td><td width="50%">Video RAM</td></tr> <tr><td width="15%">0xC0000</td><td width="25%">0x100000 - 1</td><td width="50%">BIOS</td></tr> <tr><td width="15%">0x100000</td><td width="25%">?</td><td width="50%">Heap and module code</td></tr> </table> <hr> <a name="Video-Subsystem"></a> <div class="header"> <p> Next: <a href="#PFF2-Font-File-Format" accesskey="n" rel="next">PFF2 Font File Format</a>, Previous: <a href="#BIOS-port-memory-map" accesskey="p" rel="prev">BIOS port memory map</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Video-Subsystem-1"></a> <h2 class="chapter">9 Video Subsystem</h2> <p>This document contains specification for Video Subsystem for GRUB2. Currently only the usage interface is described in this document. Internal structure of how video drivers are registering and how video driver manager works are not included here. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Video-API" accesskey="1">Video API</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Example-usage-of-Video-API" accesskey="2">Example usage of Video API</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Bitmap-API" accesskey="3">Bitmap API</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Video-API"></a> <div class="header"> <p> Next: <a href="#Example-usage-of-Video-API" accesskey="n" rel="next">Example usage of Video API</a>, Up: <a href="#Video-Subsystem" accesskey="u" rel="up">Video Subsystem</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Video-API-1"></a> <h3 class="section">9.1 Video API</h3> <a name="grub_005fvideo_005fsetup"></a> <h4 class="subsection">9.1.1 grub_video_setup</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_setup (unsigned int width, unsigned int height, unsigned int mode_type); </pre></div> </li><li> Description: <p>Driver will use information provided to it to select best possible video mode and switch to it. Supported values for <code>mode_type</code> are <code>GRUB_VIDEO_MODE_TYPE_INDEX_COLOR</code> for index color modes, <code>GRUB_VIDEO_MODE_TYPE_RGB</code> for direct RGB color modes and <code>GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED</code> for double buffering. When requesting RGB mode, highest bits per pixel mode will be selected. When requesting Index color mode, mode with highest number of colors will be selected. If all parameters are specified as zero, video adapter will try to figure out best possible mode and initialize it, platform specific differences are allowed here. If there is no mode matching request, error X will be returned. If there are no problems, function returns <code>GRUB_ERR_NONE</code>. </p> <p>This function also performs following task upon succesful mode switch. Active rendering target is changed to screen and viewport is maximized to allow whole screen to be used when performing graphics operations. In RGB modes, emulated palette gets 16 entries containing default values for VGA palette, other colors are defined as black. When switching to Indexed Color mode, driver may set default VGA palette to screen if the video card allows the operation. </p> </li></ul> <a name="grub_005fvideo_005frestore"></a> <h4 class="subsection">9.1.2 grub_video_restore</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_restore (void); </pre></div> </li><li> Description: <p>Video subsystem will deinitialize activated video driver to restore old state of video device. This can be used to switch back to text mode. </p></li></ul> <a name="grub_005fvideo_005fget_005finfo"></a> <h4 class="subsection">9.1.3 grub_video_get_info</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info); </pre></div> <div class="example"> <pre class="example">struct grub_video_mode_info { /* Width of the screen. */ unsigned int width; /* Height of the screen. */ unsigned int height; /* Mode type bitmask. Contains information like is it Index color or RGB mode. */ unsigned int mode_type; /* Bits per pixel. */ unsigned int bpp; /* Bytes per pixel. */ unsigned int bytes_per_pixel; /* Pitch of one scanline. How many bytes there are for scanline. */ unsigned int pitch; /* In index color mode, number of colors. In RGB mode this is 256. */ unsigned int number_of_colors; /* Optimization hint how binary data is coded. */ enum grub_video_blit_format blit_format; /* How many bits are reserved for red color. */ unsigned int red_mask_size; /* What is location of red color bits. In Index Color mode, this is 0. */ unsigned int red_field_pos; /* How many bits are reserved for green color. */ unsigned int green_mask_size; /* What is location of green color bits. In Index Color mode, this is 0. */ unsigned int green_field_pos; /* How many bits are reserved for blue color. */ unsigned int blue_mask_size; /* What is location of blue color bits. In Index Color mode, this is 0. */ unsigned int blue_field_pos; /* How many bits are reserved in color. */ unsigned int reserved_mask_size; /* What is location of reserved color bits. In Index Color mode, this is 0. */ unsigned int reserved_field_pos; }; </pre></div> </li><li> Description: <p>Software developer can use this function to query properties of active rendering taget. Information provided here can be used by other parts of GRUB, like image loaders to convert loaded images to correct screen format to allow more optimized blitters to be used. If there there is no configured video driver with active screen, error <code>GRUB_ERR_BAD_DEVICE</code> is returned, otherwise <code>mode_info</code> is filled with valid information and <code>GRUB_ERR_NONE</code> is returned. </p></li></ul> <a name="grub_005fvideo_005fget_005fblit_005fformat"></a> <h4 class="subsection">9.1.4 grub_video_get_blit_format</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info); </pre></div> <div class="example"> <pre class="example">enum grub_video_blit_format { /* Follow exactly field & mask information. */ GRUB_VIDEO_BLIT_FORMAT_RGBA, /* Make optimization assumption. */ GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, /* Follow exactly field & mask information. */ GRUB_VIDEO_BLIT_FORMAT_RGB, /* Make optimization assumption. */ GRUB_VIDEO_BLIT_FORMAT_R8G8B8, /* When needed, decode color or just use value as is. */ GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR }; </pre></div> </li><li> Description: <p>Used to query how data could be optimized to suit specified video mode. Returns exact video format type, or a generic one if there is no definition for the type. For generic formats, use <code>grub_video_get_info</code> to query video color coding settings. </p></li></ul> <a name="grub_005fvideo_005fset_005fpalette"></a> <h4 class="subsection">9.1.5 grub_video_set_palette</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_set_palette (unsigned int start, unsigned int count, struct grub_video_palette_data *palette_data); </pre></div> <div class="example"> <pre class="example">struct grub_video_palette_data { grub_uint8_t r; /* Red color value (0-255). */ grub_uint8_t g; /* Green color value (0-255). */ grub_uint8_t b; /* Blue color value (0-255). */ grub_uint8_t a; /* Reserved bits value (0-255). */ }; </pre></div> </li><li> Description: <p>Used to setup indexed color palettes. If mode is RGB mode, colors will be set to emulated palette data. In Indexed Color modes, palettes will be set to hardware. Color values will be converted to suit requirements of the video mode. <code>start</code> will tell what hardware color index (or emulated color index) will be set to according information in first indice of <code>palette_data</code>, after that both hardware color index and <code>palette_data</code> index will be incremented until <code>count</code> number of colors have been set. </p></li></ul> <a name="grub_005fvideo_005fget_005fpalette"></a> <h4 class="subsection">9.1.6 grub_video_get_palette</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_get_palette (unsigned int start, unsigned int count, struct grub_video_palette_data *palette_data); </pre></div> <div class="example"> <pre class="example">struct grub_video_palette_data { grub_uint8_t r; /* Red color value (0-255). */ grub_uint8_t g; /* Green color value (0-255). */ grub_uint8_t b; /* Blue color value (0-255). */ grub_uint8_t a; /* Reserved bits value (0-255). */ }; </pre></div> </li><li> Description: <p>Used to query indexed color palettes. If mode is RGB mode, colors will be copied from emulated palette data. In Indexed Color modes, palettes will be read from hardware. Color values will be converted to suit structure format. <code>start</code> will tell what hardware color index (or emulated color index) will be used as a source for first indice of <code>palette_data</code>, after that both hardware color index and <code>palette_data</code> index will be incremented until <code>count</code> number of colors have been read. </p></li></ul> <a name="grub_005fvideo_005fset_005farea_005fstatus"></a> <h4 class="subsection">9.1.7 grub_video_set_area_status</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_set_area_status (grub_video_area_status_t area_status); </pre></div> <div class="example"> <pre class="example">enum grub_video_area_status_t { GRUB_VIDEO_AREA_DISABLED, GRUB_VIDEO_AREA_ENABLED }; </pre></div> </li><li> Description: <p>Used to set area drawing mode for redrawing the specified region. Draw commands are performed in the intersection of the viewport and the region called area. Coordinates remain related to the viewport. If draw commands try to draw over the area, they are clipped. Set status to DISABLED if you need to draw everything. Set status to ENABLED and region to the desired rectangle to redraw everything inside the region leaving everything else intact. Should be used for redrawing of active elements. </p></li></ul> <a name="grub_005fvideo_005fget_005farea_005fstatus"></a> <h4 class="subsection">9.1.8 grub_video_get_area_status</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_r grub_video_get_area_status (grub_video_area_status_t *area_status); </pre></div> </li><li> Description: Used to query the area status. </li></ul> <a name="grub_005fvideo_005fset_005fviewport"></a> <h4 class="subsection">9.1.9 grub_video_set_viewport</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_set_viewport (unsigned int x, unsigned int y, unsigned int width, unsigned int height); </pre></div> </li><li> Description: <p>Used to specify viewport where draw commands are performed. When viewport is set, all draw commands coordinates relate to those specified by <code>x</code> and <code>y</code>. If draw commands try to draw over viewport, they are clipped. If developer requests larger than possible viewport, width and height will be clamped to fit screen. If <code>x</code> and <code>y</code> are out of bounds, all functions drawing to screen will not be displayed. In order to maximize viewport, use <code>grub_video_get_info</code> to query actual screen dimensions and provide that information to this function. </p></li></ul> <a name="grub_005fvideo_005fget_005fviewport"></a> <h4 class="subsection">9.1.10 grub_video_get_viewport</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_get_viewport (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); </pre></div> </li><li> Description: <p>Used to query current viewport dimensions. Software developer can use this to choose best way to render contents of the viewport. </p></li></ul> <a name="grub_005fvideo_005fset_005fregion"></a> <h4 class="subsection">9.1.11 grub_video_set_region</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_set_region (unsigned int x, unsigned int y, unsigned int width, unsigned int height); </pre></div> </li><li> Description: <p>Used to specify the region of the screen which should be redrawn. Use absolute values. When the region is set and area status is ENABLE all draw commands will be performed inside the interseption of region and viewport named area. If draw commands try to draw over viewport, they are clipped. If developer requests larger than possible region, width and height will be clamped to fit screen. Should be used for redrawing of active elements. </p></li></ul> <a name="grub_005fvideo_005fget_005fregion"></a> <h4 class="subsection">9.1.12 grub_video_get_region</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_get_region (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height); </pre></div> </li><li> Description: <p>Used to query current region dimensions. </p></li></ul> <a name="grub_005fvideo_005fmap_005fcolor"></a> <h4 class="subsection">9.1.13 grub_video_map_color</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_video_color_t grub_video_map_color (grub_uint32_t color_name); </pre></div> </li><li> Description: <p>Map color can be used to support color themes in GRUB. There will be collection of color names that can be used to query actual screen mapped color data. Examples could be <code>GRUB_COLOR_CONSOLE_BACKGROUND</code>, <code>GRUB_COLOR_CONSOLE_TEXT</code>. The actual color defines are not specified at this point. </p></li></ul> <a name="grub_005fvideo_005fmap_005frgb"></a> <h4 class="subsection">9.1.14 grub_video_map_rgb</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_video_color_t grub_video_map_rgb (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue); </pre></div> </li><li> Description: <p>Map RGB values to compatible screen color data. Values are expected to be in range 0-255 and in RGB modes they will be converted to screen color data. In index color modes, index color palette will be searched for specified color and then index is returned. </p></li></ul> <a name="grub_005fvideo_005fmap_005frgba"></a> <h4 class="subsection">9.1.15 grub_video_map_rgba</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_video_color_t grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue, grub_uint8_t alpha); </pre></div> </li><li> Description: <p>Map RGBA values to compatible screen color data. Values are expected to be in range 0-255. In RGBA modes they will be converted to screen color data. In index color modes, index color palette will be searched for best matching color and its index is returned. </p></li></ul> <a name="grub_005fvideo_005funmap_005fcolor"></a> <h4 class="subsection">9.1.16 grub_video_unmap_color</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red, grub_uint8_t *green, grub_uint8_t *blue, grub_uint8_t *alpha); </pre></div> </li><li> Description: <p>Unmap color value from <code>color</code> to color channels in <code>red</code>, <code>green</code>, <code>blue</code> and <code>alpha</code>. Values will be in range 0-255. Active rendering target will be used for color domain. In case alpha information is not available in rendering target, it is assumed to be opaque (having value 255). </p></li></ul> <a name="grub_005fvideo_005ffill_005frect"></a> <h4 class="subsection">9.1.17 grub_video_fill_rect</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_fill_rect (grub_video_color_t color, int x, int y, unsigned int width, unsigned int height); </pre></div> </li><li> Description: <p>Fill specified area limited by given coordinates within specified viewport. Negative coordinates are accepted in order to allow easy moving of rectangle within viewport. If coordinates are negative, area of the rectangle will be shrinken to follow size limits of the viewport. </p> <p>Software developer should use either <code>grub_video_map_color</code>, <code>grub_video_map_rgb</code> or <code>grub_video_map_rgba</code> to map requested color to <code>color</code> parameter. </p></li></ul> <a name="grub_005fvideo_005fblit_005fglyph"></a> <h4 class="subsection">9.1.18 grub_video_blit_glyph</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_blit_glyph (struct grub_font_glyph *glyph, grub_video_color_t color, int x, int y); </pre></div> <div class="example"> <pre class="example">struct grub_font_glyph { /* TBD. */ }; </pre></div> </li><li> Description: <p>Used to blit glyph to viewport in specified coodinates. If glyph is at edge of viewport, pixels outside of viewport will be clipped out. Software developer should use either <code>grub_video_map_rgb</code> or <code>grub_video_map_rgba</code> to map requested color to <code>color</code> parameter. </p></li></ul> <a name="grub_005fvideo_005fblit_005fbitmap"></a> <h4 class="subsection">9.1.19 grub_video_blit_bitmap</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap, enum grub_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); </pre></div> <div class="example"> <pre class="example">struct grub_video_bitmap { /* TBD. */ }; enum grub_video_blit_operators { GRUB_VIDEO_BLIT_REPLACE, GRUB_VIDEO_BLIT_BLEND }; </pre></div> </li><li> Description: <p>Used to blit bitmap to viewport in specified coordinates. If part of bitmap is outside of viewport region, it will be clipped out. Offsets affect bitmap position where data will be copied from. Negative values for both viewport coordinates and bitmap offset coordinates are allowed. If data is looked out of bounds of bitmap, color value will be assumed to be transparent. If viewport coordinates are negative, area of the blitted rectangle will be shrinken to follow size limits of the viewport and bitmap. Blitting operator <code>oper</code> specifies should source pixel replace data in screen or blend with pixel alpha value. </p> <p>Software developer should use <code>grub_video_bitmap_create</code> or <code>grub_video_bitmap_load</code> to create or load bitmap data. </p></li></ul> <a name="grub_005fvideo_005fblit_005frender_005ftarget"></a> <h4 class="subsection">9.1.20 grub_video_blit_render_target</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_blit_render_target (struct grub_video_render_target *source, enum grub_video_blit_operators oper, int x, int y, int offset_x, int offset_y, unsigned int width, unsigned int height); </pre></div> <div class="example"> <pre class="example">struct grub_video_render_target { /* This is private data for video driver. Should not be accessed from elsewhere directly. */ }; enum grub_video_blit_operators { GRUB_VIDEO_BLIT_REPLACE, GRUB_VIDEO_BLIT_BLEND }; </pre></div> </li><li> Description: <p>Used to blit source render target to viewport in specified coordinates. If part of source render target is outside of viewport region, it will be clipped out. If blitting operator is specified and source contains alpha values, resulting pixel color components will be calculated using formula ((src_color * src_alpha) + (dst_color * (255 - src_alpha)) / 255, if target buffer has alpha, it will be set to src_alpha. Offsets affect render target position where data will be copied from. If data is looked out of bounds of render target, color value will be assumed to be transparent. Blitting operator <code>oper</code> specifies should source pixel replace data in screen or blend with pixel alpha value. </p></li></ul> <a name="grub_005fvideo_005fscroll"></a> <h4 class="subsection">9.1.21 grub_video_scroll</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_scroll (grub_video_color_t color, int dx, int dy); </pre></div> </li><li> Description: <p>Used to scroll viewport to specified direction. New areas are filled with specified color. This function is used when screen is scroller up in video terminal. </p></li></ul> <a name="grub_005fvideo_005fswap_005fbuffers"></a> <h4 class="subsection">9.1.22 grub_video_swap_buffers</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_swap_buffers (void); </pre></div> </li><li> Description: <p>If double buffering is enabled, this swaps frontbuffer and backbuffer, in order to show values drawn to back buffer. Video driver is free to choose how this operation is techincally done. </p></li></ul> <a name="grub_005fvideo_005fcreate_005frender_005ftarget"></a> <h4 class="subsection">9.1.23 grub_video_create_render_target</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_create_render_target (struct grub_video_render_target **result, unsigned int width, unsigned int height, unsigned int mode_type); </pre></div> <div class="example"> <pre class="example">struct grub_video_render_target { /* This is private data for video driver. Should not be accessed from elsewhere directly. */ }; </pre></div> </li><li> Description: <p>Driver will use information provided to it to create best fitting render target. <code>mode_type</code> will be used to guide on selecting what features are wanted for render target. Supported values for <code>mode_type</code> are <code>GRUB_VIDEO_MODE_TYPE_INDEX_COLOR</code> for index color modes, <code>GRUB_VIDEO_MODE_TYPE_RGB</code> for direct RGB color modes and <code>GRUB_VIDEO_MODE_TYPE_ALPHA</code> for alpha component. </p></li></ul> <a name="grub_005fvideo_005fdelete_005frender_005ftarget"></a> <h4 class="subsection">9.1.24 grub_video_delete_render_target</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_delete_render_target (struct grub_video_render_target *target); </pre></div> </li><li> Description: <p>Used to delete previously created render target. If <code>target</code> contains <code>NULL</code> pointer, nothing will be done. If render target is correctly destroyed, GRUB_ERR_NONE is returned. </p></li></ul> <a name="grub_005fvideo_005fset_005factive_005frender_005ftarget"></a> <h4 class="subsection">9.1.25 grub_video_set_active_render_target</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_set_active_render_target (struct grub_video_render_target *target); </pre></div> </li><li> Description: <p>Sets active render target. If this comand is successful all drawing commands will be done to specified <code>target</code>. There is also special values for target, <code>GRUB_VIDEO_RENDER_TARGET_DISPLAY</code> used to reference screen’s front buffer, <code>GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER</code> used to reference screen’s front buffer (alias for <code>GRUB_VIDEO_RENDER_TARGET_DISPLAY</code>) and <code>GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER</code> used to reference back buffer (if double buffering is enabled). If render target is correclty switched GRUB_ERR_NONE is returned. In no any event shall there be non drawable active render target. </p> </li></ul> <a name="grub_005fvideo_005fget_005factive_005frender_005ftarget"></a> <h4 class="subsection">9.1.26 grub_video_get_active_render_target</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); </pre></div> </li><li> Description: <p>Returns currently active render target. It returns value in <code>target</code> that can be subsequently issued back to <code>grub_video_set_active_render_target</code>. </p></li></ul> <hr> <a name="Example-usage-of-Video-API"></a> <div class="header"> <p> Next: <a href="#Bitmap-API" accesskey="n" rel="next">Bitmap API</a>, Previous: <a href="#Video-API" accesskey="p" rel="prev">Video API</a>, Up: <a href="#Video-Subsystem" accesskey="u" rel="up">Video Subsystem</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Example-usage-of-Video-API-1"></a> <h3 class="section">9.2 Example usage of Video API</h3> <a name="Example-of-screen-setup"></a> <h4 class="subsection">9.2.1 Example of screen setup</h4> <div class="example"> <pre class="example">grub_err_t rc; /* Try to initialize video mode 1024 x 768 with direct RGB. */ rc = grub_video_setup (1024, 768, GRUB_VIDEO_MODE_TYPE_RGB); if (rc != GRUB_ERR_NONE) { /* Fall back to standard VGA Index Color mode. */ rc = grub_video_setup (640, 480, GRUB_VIDEO_MODE_TYPE_INDEX); if (rc != GRUB_ERR_NONE) { /* Handle error. */ } } </pre></div> <a name="Example-of-setting-up-console-viewport"></a> <h4 class="subsection">9.2.2 Example of setting up console viewport</h4> <div class="example"> <pre class="example">grub_uint32_t x, y, width, height; grub_video_color_t color; struct grub_font_glyph glyph; grub_err_t rc; /* Query existing viewport. */ grub_video_get_viewport (&x, &y, &width, &height); /* Fill background. */ color = grub_video_map_color (GRUB_COLOR_BACKGROUND); grub_video_fill_rect (color, 0, 0, width, height); /* Setup console viewport. */ grub_video_set_viewport (x + 10, y + 10, width - 20, height - 20); grub_video_get_viewport (&x, &y, &width, &height); color = grub_video_map_color (GRUB_COLOR_CONSOLE_BACKGROUND); grub_video_fill_rect (color, 0, 0, width, height); /* Draw text to viewport. */ color = grub_video_map_color (GRUB_COLOR_CONSOLE_TEXT); grub_font_get_glyph ('X', &glyph); grub_video_blit_glyph (&glyph, color, 0, 0); </pre></div> <hr> <a name="Bitmap-API"></a> <div class="header"> <p> Previous: <a href="#Example-usage-of-Video-API" accesskey="p" rel="prev">Example usage of Video API</a>, Up: <a href="#Video-Subsystem" accesskey="u" rel="up">Video Subsystem</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Bitmap-API-1"></a> <h3 class="section">9.3 Bitmap API</h3> <a name="grub_005fvideo_005fbitmap_005fcreate"></a> <h4 class="subsection">9.3.1 grub_video_bitmap_create</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap, unsigned int width, unsigned int height, enum grub_video_blit_format blit_format) </pre></div> </li><li> Description: <p>Creates a new bitmap with given dimensions and blitting format. Allocated bitmap data can then be modified freely and finally blitted with <code>grub_video_blit_bitmap</code> to rendering target. </p></li></ul> <a name="grub_005fvideo_005fbitmap_005fdestroy"></a> <h4 class="subsection">9.3.2 grub_video_bitmap_destroy</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_bitmap_destroy (struct grub_video_bitmap *bitmap); </pre></div> </li><li> Description: <p>When bitmap is no longer needed, it can be freed from memory using this command. <code>bitmap</code> is previously allocated bitmap with <code>grub_video_bitmap_create</code> or loaded with <code>grub_video_bitmap_load</code>. </p></li></ul> <a name="grub_005fvideo_005fbitmap_005fload"></a> <h4 class="subsection">9.3.3 grub_video_bitmap_load</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">grub_err_t grub_video_bitmap_load (struct grub_video_bitmap **bitmap, const char *filename); </pre></div> </li><li> Description: <p>Tries to load given bitmap (<code>filename</code>) using registered bitmap loaders. In case bitmap format is not recognized or supported error <code>GRUB_ERR_BAD_FILE_TYPE</code> is returned. </p></li></ul> <a name="grub_005fvideo_005fbitmap_005fget_005fwidth"></a> <h4 class="subsection">9.3.4 grub_video_bitmap_get_width</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">unsigned int grub_video_bitmap_get_width (struct grub_video_bitmap *bitmap); </pre></div> </li><li> Description: <p>Returns bitmap width. </p></li></ul> <a name="grub_005fvideo_005fbitmap_005fget_005fheight"></a> <h4 class="subsection">9.3.5 grub_video_bitmap_get_height</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">unsigned int grub_video_bitmap_get_height (struct grub_video_bitmap *bitmap); </pre></div> </li><li> Description: <p>Return bitmap height. </p></li></ul> <a name="grub_005fvideo_005fbitmap_005fget_005fmode_005finfo"></a> <h4 class="subsection">9.3.6 grub_video_bitmap_get_mode_info</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">void grub_video_bitmap_get_mode_info (struct grub_video_bitmap *bitmap, struct grub_video_mode_info *mode_info); </pre></div> </li><li> Description: <p>Returns bitmap format details in form of <code>grub_video_mode_info</code>. </p></li></ul> <a name="grub_005fvideo_005fbitmap_005fget_005fdata"></a> <h4 class="subsection">9.3.7 grub_video_bitmap_get_data</h4> <ul> <li> Prototype: <div class="example"> <pre class="example">void *grub_video_bitmap_get_data (struct grub_video_bitmap *bitmap); </pre></div> </li><li> Description: <p>Return pointer to bitmap data. Contents of the pointed data can be freely modified. There is no extra protection against going off the bounds so you have to be carefull how to access the data. </p></li></ul> <hr> <a name="PFF2-Font-File-Format"></a> <div class="header"> <p> Next: <a href="#Graphical-Menu-Software-Design" accesskey="n" rel="next">Graphical Menu Software Design</a>, Previous: <a href="#Video-Subsystem" accesskey="p" rel="prev">Video Subsystem</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="PFF2-Font-File-Format-1"></a> <h2 class="chapter">10 PFF2 Font File Format</h2> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Introduction" accesskey="1">Introduction</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#File-Structure" accesskey="2">File Structure</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Font-Metrics" accesskey="3">Font Metrics</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Introduction"></a> <div class="header"> <p> Next: <a href="#File-Structure" accesskey="n" rel="next">File Structure</a>, Up: <a href="#PFF2-Font-File-Format" accesskey="u" rel="up">PFF2 Font File Format</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Introduction-1"></a> <h3 class="section">10.1 Introduction</h3> <p>The goal of this format is to provide a bitmap font format that is simple to use, compact, and cleanly supports Unicode. </p> <a name="Goals-of-the-GRUB-Font-Format"></a> <h4 class="subsection">10.1.1 Goals of the GRUB Font Format</h4> <ul> <li> Simple to read and use. Since GRUB will only be reading the font files, we are more concerned with making the code to read the font simple than we are with writing the font. </li><li> Compact storage. The fonts will generally be stored in a small boot partition where GRUB is located, and this may be on a removable storage device such as a CD or USB flash drive where space is more limited than it is on most hard drives. </li><li> Unicode. GRUB should not have to deal with multiple character encodings. The font should always use Unicode character codes for simple internationalization. </li></ul> <a name="Why-Another-Font-Format_003f"></a> <h4 class="subsection">10.1.2 Why Another Font Format?</h4> <p>There are many existing bitmap font formats that GRUB could use. However, there are aspects of these formats that may make them less than suitable for use in GRUB at this time: </p> <dl compact="compact"> <dt>‘<samp>BDF</samp>’</dt> <dd><p>Inefficient storage; uses ASCII to describe properties and hexadecimal numbers in ASCII for the bitmap rows. </p></dd> <dt>‘<samp>PCF</samp>’</dt> <dd><p>Many format variations such as byte order and bitmap padding (rows padded to byte, word, etc.) would result in more complex code to handle the font format. </p></dd> </dl> <hr> <a name="File-Structure"></a> <div class="header"> <p> Next: <a href="#Font-Metrics" accesskey="n" rel="next">Font Metrics</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#PFF2-Font-File-Format" accesskey="u" rel="up">PFF2 Font File Format</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="File-Structure-1"></a> <h3 class="section">10.2 File Structure</h3> <p>A file <strong>section</strong> consists of a 4-byte name, a 32-bit big-endian length (not including the name or length), and then <var>length</var> more section-type-specific bytes. </p> <p>The standard file extension for PFF2 font files is <samp>.pf2</samp>. </p> <a name="Section-Types"></a> <h4 class="subsection">10.2.1 Section Types</h4> <dl compact="compact"> <dt>‘<samp>FILE</samp>’</dt> <dd><p><strong>File type ID</strong> (ASCII string). This must be the first section in the file. It has length 4 and the contents are the four bytes of the ASCII string ‘<samp>PFF2</samp>’. </p> </dd> <dt>‘<samp>NAME</samp>’</dt> <dd><p><strong>Font name</strong> (ASCII string). This is the full font name including family, weight, style, and point size. For instance, "Helvetica Bold Italic 14". </p> </dd> <dt>‘<samp>FAMI</samp>’</dt> <dd><p><strong>Font family name</strong> (ASCII string). For instance, "Helvetica". This should be included so that intelligent font substitution can take place. </p> </dd> <dt>‘<samp>WEIG</samp>’</dt> <dd><p><strong>Font weight</strong> (ASCII string). Valid values are ‘<samp>bold</samp>’ and ‘<samp>normal</samp>’. This should be included so that intelligent font substitution can take place. </p> </dd> <dt>‘<samp>SLAN</samp>’</dt> <dd><p><strong>Font slant</strong> (ASCII string). Valid values are ‘<samp>italic</samp>’ and ‘<samp>normal</samp>’. This should be included so that intelligent font substitution can take place. </p> </dd> <dt>‘<samp>PTSZ</samp>’</dt> <dd><p><strong>Font point size</strong> (uint16be). </p> </dd> <dt>‘<samp>MAXW</samp>’</dt> <dd><p><strong>Maximum character width in pixels</strong> (uint16be). </p> </dd> <dt>‘<samp>MAXH</samp>’</dt> <dd><p><strong>Maximum character height in pixels</strong> (uint16be). </p> </dd> <dt>‘<samp>ASCE</samp>’</dt> <dd><p><strong>Ascent in pixels</strong> (uint16be). See <a href="#Font-Metrics">Font Metrics</a>, for details. </p> </dd> <dt>‘<samp>DESC</samp>’</dt> <dd><p><strong>Descent in pixels</strong> (uint16be). See <a href="#Font-Metrics">Font Metrics</a>, for details. </p> </dd> <dt>‘<samp>CHIX</samp>’</dt> <dd><p><strong>Character index.</strong> The character index begins with a 32-bit big-endian unsigned integer indicating the total size of the section, not including this size value. For each character, there is an instance of the following entry structure: </p> <ul> <li> <strong>Unicode code point.</strong> (32-bit big-endian integer.) </li><li> <strong>Storage flags.</strong> (byte.) <ul> <li> Bits 2..0: <p>If equal to 000 binary, then the character data is stored uncompressed beginning at the offset indicated by the character’s <strong>offset</strong> value. </p> <p>If equal to 001 binary, then the character data is stored within a compressed character definition block that begins at the offset within the file indicated by the character’s <strong>offset</strong> value. </p></li></ul> </li><li> <strong>Offset.</strong> (32-bit big-endian integer.) <p>A marker that indicates the remainder of the file is data accessed via the character index (CHIX) section. When reading this font file, the rest of the file can be ignored when scanning the sections. The length should be set to -1 (0xFFFFFFFF). </p> <p>Supported data structures: </p> <p>Character definition Each character definition consists of: </p> <ul> <li> <strong>Width.</strong> Width of the bitmap in pixels. The bitmap’s extents represent the glyph’s bounding box. <code>uint16be</code>. </li><li> <strong>Height.</strong> Height of the bitmap in pixels. The bitmap’s extents represent the glyph’s bounding box. <code>uint16be</code>. </li><li> <strong>X offset.</strong> The number of pixels to shift the bitmap by horizontally before drawing the character. <code>int16be</code>. </li><li> <strong>Y offset.</strong> The number of pixels to shift the bitmap by vertically before drawing the character. <code>int16be</code>. </li><li> <strong>Device width.</strong> The number of pixels to advance horizontally from this character’s origin to the origin of the next character. <code>int16be</code>. </li><li> <strong>Bitmap data.</strong> This is encoded as a string of bits. It is organized as a row-major, top-down, left-to-right bitmap. The most significant bit of each byte is taken to be the leftmost or uppermost bit in the byte. For the sake of compact storage, rows are not padded to byte boundaries (i.e., a single byte may contain bits belonging to multiple rows). The last byte of the bitmap <strong>is</strong> padded with zero bits in the bits positions to the right of the last used bit if the bitmap data does not fill the last byte. <p>The length of the <strong>bitmap data</strong> field is (<var>width</var> * <var>height</var> + 7) / 8 using integer arithmetic, which is equivalent to ceil(<var>width</var> * <var>height</var> / 8) using real number arithmetic. </p> <p>It remains to be determined whether bitmap fonts usually make all glyph bitmaps the same height, or if smaller glyphs are stored with bitmaps having a lesser height. In the latter case, the baseline would have to be used to calculate the location the bitmap should be anchored at on screen. </p></li></ul> </li></ul> </dd> </dl> <hr> <a name="Font-Metrics"></a> <div class="header"> <p> Previous: <a href="#File-Structure" accesskey="p" rel="prev">File Structure</a>, Up: <a href="#PFF2-Font-File-Format" accesskey="u" rel="up">PFF2 Font File Format</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Font-Metrics-1"></a> <h3 class="section">10.3 Font Metrics</h3> <ul> <li> Ascent. The distance from the baseline to the top of most characters. Note that in some cases characters may extend above the ascent. </li><li> Descent. The distance from the baseline to the bottom of most characters. Note that in some cases characters may extend below the descent. </li><li> Leading. The amount of space, in pixels, to leave between the descent of one line of text and the ascent of the next line. This metrics is not specified in the current file format; instead, the font rendering engine calculates a reasonable leading value based on the other font metrics. </li><li> Horizonal leading. The amount of space, in pixels, to leave horizontally between the left and right edges of two adjacent glyphs. The <strong>device width</strong> field determines the effective leading value that is used to render the font. </li></ul> <img src="font_char_metrics.png" alt="font_char_metrics"> <p>An illustration of how the various font metrics apply to characters. </p> <hr> <a name="Graphical-Menu-Software-Design"></a> <div class="header"> <p> Next: <a href="#Lockdown-framework" accesskey="n" rel="next">Lockdown framework</a>, Previous: <a href="#PFF2-Font-File-Format" accesskey="p" rel="prev">PFF2 Font File Format</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Graphical-Menu-Software-Design-1"></a> <h2 class="chapter">11 Graphical Menu Software Design</h2> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Introduction_005f2" accesskey="1">Introduction_2</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Startup-Sequence" accesskey="2">Startup Sequence</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#GUI-Components" accesskey="3">GUI Components</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Command-Line-Window" accesskey="4">Command Line Window</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Introduction_005f2"></a> <div class="header"> <p> Next: <a href="#Startup-Sequence" accesskey="n" rel="next">Startup Sequence</a>, Up: <a href="#Graphical-Menu-Software-Design" accesskey="u" rel="up">Graphical Menu Software Design</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Introduction-2"></a> <h3 class="section">11.1 Introduction</h3> <p>The ‘<samp>gfxmenu</samp>’ module provides a graphical menu interface for GRUB 2. It functions as an alternative to the menu interface provided by the ‘<samp>normal</samp>’ module, which uses the grub terminal interface to display a menu on a character-oriented terminal. </p> <p>The graphical menu uses the GRUB video API, which is currently for the VESA BIOS extensions (VBE) 2.0+. This is supported on the i386-pc platform. However, the graphical menu itself does not depend on using VBE, so if another GRUB video driver were implemented, the ‘<samp>gfxmenu</samp>’ graphical menu would work on the new video driver as well. </p> <hr> <a name="Startup-Sequence"></a> <div class="header"> <p> Next: <a href="#GUI-Components" accesskey="n" rel="next">GUI Components</a>, Previous: <a href="#Introduction_005f2" accesskey="p" rel="prev">Introduction_2</a>, Up: <a href="#Graphical-Menu-Software-Design" accesskey="u" rel="up">Graphical Menu Software Design</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Startup-Sequence-1"></a> <h3 class="section">11.2 Startup Sequence</h3> <ul> <li> grub_enter_normal_mode [normal/main.c] </li><li> grub_normal_execute [normal/main.c] </li><li> read_config_file [normal/main.c] </li><li> (When <samp>gfxmenu.mod</samp> is loaded with <code>insmod</code>, it will call <code>grub_menu_viewer_register()</code> to register itself.) </li><li> GRUB_MOD_INIT (gfxmenu) [gfxmenu/gfxmenu.c] </li><li> grub_menu_viewer_register [kern/menu_viewer.c] </li><li> grub_menu_viewer_show_menu [kern/menu_viewer.c] </li><li> get_current_menu_viewer() [kern/menu_viewer.c] </li><li> show_menu() [gfxmenu/gfxmenu.c] </li><li> grub_gfxmenu_model_new [gfxmenu/model.c] </li><li> grub_gfxmenu_view_new [gfxmenu/view.c] </li><li> set_graphics_mode [gfxmenu/view.c] </li><li> grub_gfxmenu_view_load_theme [gfxmenu/theme_loader.c] </li></ul> <hr> <a name="GUI-Components"></a> <div class="header"> <p> Next: <a href="#Command-Line-Window" accesskey="n" rel="next">Command Line Window</a>, Previous: <a href="#Startup-Sequence" accesskey="p" rel="prev">Startup Sequence</a>, Up: <a href="#Graphical-Menu-Software-Design" accesskey="u" rel="up">Graphical Menu Software Design</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GUI-Components-1"></a> <h3 class="section">11.3 GUI Components</h3> <p>The graphical menu implements a GUI component system that supports a container-based layout system. Components can be added to containers, and containers (which are a type of component) can then be added to other containers, to form a tree of components. Currently, the root component of this tree is a ‘<samp>canvas</samp>’ component, which allows manual layout of its child components. </p> <p>Components (non-container): </p> <ul> <li> label </li><li> image </li><li> progress_bar </li><li> circular_progress </li><li> list (currently hard coded to be a boot menu list) </li></ul> <p>Containers: </p> <ul> <li> canvas </li><li> hbox </li><li> vbox </li></ul> <p>The GUI component instances are created by the theme loader in <samp>gfxmenu/theme_loader.c</samp> when a theme is loaded. Theme files specify statements such as ‘<samp>+vbox{ +label { text="Hello" } +label{ text="World" } }</samp>’ to add components to the component tree root. By nesting the component creation statements in the theme file, the instantiated components are nested the same way. </p> <p>When a component is added to a container, that new child is considered <strong>owned</strong> by the container. Great care should be taken if the caller retains a reference to the child component, since it will be destroyed if its parent container is destroyed. A better choice instead of storing a pointer to the child component is to use the component ID to find the desired component. Component IDs do not have to be unique (it is often useful to have multiple components with an ID of "__timeout__", for instance). </p> <p>In order to access and use components in the component tree, there are two functions (defined in <samp>gfxmenu/gui_util.c</samp>) that are particularly useful: </p> <ul> <li> <code>grub_gui_find_by_id (root, id, callback, userdata)</code>: <p>This function ecursively traverses the component tree rooted at <var>root</var>, and for every component that has an ID equal to <var>id</var>, calls the function pointed to by <var>callback</var> with the matching component and the void pointer <var>userdata</var> as arguments. The callback function can do whatever is desired to use the component passed in. </p> </li><li> <code>grub_gui_iterate_recursively (root, callback, userdata)</code>: <p>This function calls the function pointed to by <var>callback</var> for every component that is a descendant of <var>root</var> in the component tree. When the callback function is called, the component and the void pointer <var>userdata</var> as arguments. The callback function can do whatever is desired to use the component passed in. </p></li></ul> <hr> <a name="Command-Line-Window"></a> <div class="header"> <p> Previous: <a href="#GUI-Components" accesskey="p" rel="prev">GUI Components</a>, Up: <a href="#Graphical-Menu-Software-Design" accesskey="u" rel="up">Graphical Menu Software Design</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Command-Line-Window-1"></a> <h3 class="section">11.4 Command Line Window</h3> <p>The terminal window used to provide command line access within the graphical menu is managed by <samp>gfxmenu/view.c</samp>. The ‘<samp>gfxterm</samp>’ terminal is used, and it has been modified to allow rendering to an offscreen render target to allow it to be composed into the double buffering system that the graphical menu view uses. This is bad for performance, however, so it would probably be a good idea to make it possible to temporarily disable double buffering as long as the terminal window is visible. There are still unresolved problems that occur when commands are executed from the terminal window that change the graphics mode. It’s possible that making <code>grub_video_restore()</code> return to the graphics mode that was in use before <code>grub_video_setup()</code> was called might fix some of the problems. </p> <hr> <a name="Lockdown-framework"></a> <div class="header"> <p> Next: <a href="#Copying-This-Manual" accesskey="n" rel="next">Copying This Manual</a>, Previous: <a href="#Graphical-Menu-Software-Design" accesskey="p" rel="prev">Graphical Menu Software Design</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Lockdown-framework-1"></a> <h2 class="chapter">12 Lockdown framework</h2> <p>The GRUB can be locked down, which is a restricted mode where some operations are not allowed. For instance, some commands cannot be used when the GRUB is locked down. </p> <p>The function <code>grub_lockdown()</code> is used to lockdown GRUB and the function <code>grub_is_lockdown()</code> function can be used to check whether lockdown is enabled or not. When enabled, the function returns ‘<samp>GRUB_LOCKDOWN_ENABLED</samp>’ and ‘<samp>GRUB_LOCKDOWN_DISABLED</samp>’ when is not enabled. </p> <p>The following functions can be used to register the commands that can only be used when lockdown is disabled: </p> <ul> <li> <code>grub_cmd_lockdown()</code> registers command which should not run when the GRUB is in lockdown mode. </li><li> <code>grub_cmd_lockdown()</code> registers extended command which should not run when the GRUB is in lockdown mode. </li></ul> <hr> <a name="Copying-This-Manual"></a> <div class="header"> <p> Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Lockdown-framework" accesskey="p" rel="prev">Lockdown framework</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Copying-This-Manual-1"></a> <h2 class="appendix">Appendix A Copying This Manual</h2> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#GNU-Free-Documentation-License" accesskey="1">GNU Free Documentation License</a>:</td><td> </td><td align="left" valign="top">License for copying this manual. </td></tr> </table> <hr> <a name="GNU-Free-Documentation-License"></a> <div class="header"> <p> Up: <a href="#Copying-This-Manual" accesskey="u" rel="up">Copying This Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GNU-Free-Documentation-License-1"></a> <h3 class="appendixsec">A.1 GNU Free Documentation License</h3> <a name="index-FDL_002c-GNU-Free-Documentation-License"></a> <div align="center">Version 1.2, November 2002 </div> <div class="display"> <pre class="display">Copyright © 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. </pre></div> <ol start="0"> <li> PREAMBLE <p>The purpose of this License is to make a manual, textbook, or other functional and useful document <em>free</em> in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. </p> <p>This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. </p> <p>We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. </p> </li><li> APPLICABILITY AND DEFINITIONS <p>This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. </p> <p>A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. </p> <p>A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. </p> <p>The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. </p> <p>The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. </p> <p>A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”. </p> <p>Examples of suitable formats for Transparent copies include plain <small>ASCII</small> without markup, Texinfo input format, LaTeX input format, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available <acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>, PostScript or <acronym>PDF</acronym> designed for human modification. Examples of transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and <acronym>JPG</acronym>. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, <acronym>SGML</acronym> or <acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools are not generally available, and the machine-generated <acronym>HTML</acronym>, PostScript or <acronym>PDF</acronym> produced by some word processors for output purposes only. </p> <p>The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text. </p> <p>A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition. </p> <p>The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. </p> </li><li> VERBATIM COPYING <p>You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. </p> <p>You may also lend copies, under the same conditions stated above, and you may publicly display copies. </p> </li><li> COPYING IN QUANTITY <p>If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. </p> <p>If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. </p> <p>If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. </p> <p>It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. </p> </li><li> MODIFICATIONS <p>You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: </p> <ol type="A" start="1"> <li> Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. </li><li> List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. </li><li> State on the Title page the name of the publisher of the Modified Version, as the publisher. </li><li> Preserve all the copyright notices of the Document. </li><li> Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. </li><li> Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. </li><li> Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice. </li><li> Include an unaltered copy of this License. </li><li> Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. </li><li> Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. </li><li> For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. </li><li> Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. </li><li> Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version. </li><li> Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section. </li><li> Preserve any Warranty Disclaimers. </li></ol> <p>If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles. </p> <p>You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. </p> <p>You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. </p> <p>The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. </p> </li><li> COMBINING DOCUMENTS <p>You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. </p> <p>The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. </p> <p>In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.” </p> </li><li> COLLECTIONS OF DOCUMENTS <p>You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. </p> <p>You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. </p> </li><li> AGGREGATION WITH INDEPENDENT WORKS <p>A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. </p> <p>If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. </p> </li><li> TRANSLATION <p>Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. </p> <p>If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. </p> </li><li> TERMINATION <p>You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. </p> </li><li> FUTURE REVISIONS OF THIS LICENSE <p>The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See <a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>. </p> <p>Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. </p></li></ol> <a name="ADDENDUM_003a-How-to-use-this-License-for-your-documents"></a> <h4 class="appendixsubsec">A.1.1 ADDENDUM: How to use this License for your documents</h4> <p>To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: </p> <div class="smallexample"> <pre class="smallexample"> Copyright (C) <var>year</var> <var>your name</var>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. </pre></div> <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this: </p> <div class="smallexample"> <pre class="smallexample"> with the Invariant Sections being <var>list their titles</var>, with the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts being <var>list</var>. </pre></div> <p>If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. </p> <p>If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. </p> <hr> <a name="Index"></a> <div class="header"> <p> Previous: <a href="#Copying-This-Manual" accesskey="p" rel="prev">Copying This Manual</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Index-1"></a> <h2 class="unnumbered">Index</h2> <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a> </td></tr></table> <table class="index-cp" border="0"> <tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-F">F</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-FDL_002c-GNU-Free-Documentation-License">FDL, GNU Free Documentation License</a>:</td><td> </td><td valign="top"><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></td></tr> <tr><td colspan="4"> <hr></td></tr> </table> <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a> </td></tr></table> <hr> </body> </html> PK��\�P�,D,D grub.htmlnu�[���<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- This manual is for GNU GRUB (version 2.03, 17 March 2026). Copyright (C) 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections. --> <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>GNU GRUB Manual 2.03</title> <meta name="description" content="GNU GRUB Manual 2.03"> <meta name="keywords" content="GNU GRUB Manual 2.03"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> <link href="#Top" rel="start" title="Top"> <link href="#Index" rel="index" title="Index"> <link href="#SEC_Contents" rel="contents" title="Table of Contents"> <link href="dir.html#Top" rel="up" title="(dir)"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} blockquote.smallquotation {font-size: smaller} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.lisp {margin-left: 3.2em} div.smalldisplay {margin-left: 3.2em} div.smallexample {margin-left: 3.2em} div.smalllisp {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en"> <h1 class="settitle" align="center">GNU GRUB Manual 2.03</h1> <a name="SEC_Contents"></a> <h2 class="contents-heading">Table of Contents</h2> <div class="contents"> <ul class="no-bullet"> <li><a name="toc-Introduction-to-GRUB" href="#Introduction">1 Introduction to GRUB</a> <ul class="no-bullet"> <li><a name="toc-Overview-1" href="#Overview">1.1 Overview</a></li> <li><a name="toc-History-of-GRUB" href="#History">1.2 History of GRUB</a></li> <li><a name="toc-Differences-from-previous-versions" href="#Changes-from-GRUB-Legacy">1.3 Differences from previous versions</a></li> <li><a name="toc-GRUB-features" href="#Features">1.4 GRUB features</a></li> <li><a name="toc-The-role-of-a-boot-loader" href="#Role-of-a-boot-loader">1.5 The role of a boot loader</a></li> </ul></li> <li><a name="toc-Naming-convention-1" href="#Naming-convention">2 Naming convention</a></li> <li><a name="toc-OS_002dspecific-notes-about-grub-tools-1" href="#OS_002dspecific-notes-about-grub-tools">3 OS-specific notes about grub tools</a></li> <li><a name="toc-Installation-1" href="#Installation">4 Installation</a> <ul class="no-bullet"> <li><a name="toc-Installing-GRUB-using-grub2_002dinstall-1" href="#Installing-GRUB-using-grub2_002dinstall">4.1 Installing GRUB using grub2-install</a></li> <li><a name="toc-Making-a-GRUB-bootable-CD_002dROM-1" href="#Making-a-GRUB-bootable-CD_002dROM">4.2 Making a GRUB bootable CD-ROM</a></li> <li><a name="toc-The-map-between-BIOS-drives-and-OS-devices" href="#Device-map">4.3 The map between BIOS drives and OS devices</a></li> <li><a name="toc-BIOS-installation-1" href="#BIOS-installation">4.4 BIOS installation</a></li> </ul></li> <li><a name="toc-Booting-1" href="#Booting">5 Booting</a> <ul class="no-bullet"> <li><a name="toc-How-to-boot-operating-systems" href="#General-boot-methods">5.1 How to boot operating systems</a> <ul class="no-bullet"> <li><a name="toc-How-to-boot-an-OS-directly-with-GRUB" href="#Loading-an-operating-system-directly">5.1.1 How to boot an OS directly with GRUB</a></li> <li><a name="toc-Chain_002dloading-an-OS" href="#Chain_002dloading">5.1.2 Chain-loading an OS</a></li> </ul></li> <li><a name="toc-Loopback-booting-1" href="#Loopback-booting">5.2 Loopback booting</a></li> <li><a name="toc-Some-caveats-on-OS_002dspecific-issues" href="#OS_002dspecific-notes">5.3 Some caveats on OS-specific issues</a> <ul class="no-bullet"> <li><a name="toc-GNU_002fHurd-1" href="#GNU_002fHurd">5.3.1 GNU/Hurd</a></li> <li><a name="toc-GNU_002fLinux-1" href="#GNU_002fLinux">5.3.2 GNU/Linux</a></li> <li><a name="toc-NetBSD-1" href="#NetBSD">5.3.3 NetBSD</a></li> <li><a name="toc-DOS_002fWindows-1" href="#DOS_002fWindows">5.3.4 DOS/Windows</a></li> </ul></li> </ul></li> <li><a name="toc-Writing-your-own-configuration-file" href="#Configuration">6 Writing your own configuration file</a> <ul class="no-bullet"> <li><a name="toc-Simple-configuration-handling" href="#Simple-configuration">6.1 Simple configuration handling</a></li> <li><a name="toc-Root-Identifcation-Heuristics-1" href="#Root-Identifcation-Heuristics">6.2 Root Identifcation Heuristics</a></li> <li><a name="toc-Writing-full-configuration-files-directly" href="#Shell_002dlike-scripting">6.3 Writing full configuration files directly</a></li> <li><a name="toc-Multi_002dboot-manual-config-1" href="#Multi_002dboot-manual-config">6.4 Multi-boot manual config</a></li> <li><a name="toc-Embedding-a-configuration-file-into-GRUB" href="#Embedded-configuration">6.5 Embedding a configuration file into GRUB</a></li> </ul></li> <li><a name="toc-Theme-file-format-1" href="#Theme-file-format">7 Theme file format</a> <ul class="no-bullet"> <li><a name="toc-Introduction-1" href="#Introduction-1">7.1 Introduction</a></li> <li><a name="toc-Theme-Elements" href="#Theme-Elements">7.2 Theme Elements</a> <ul class="no-bullet"> <li><a name="toc-Colors" href="#Colors">7.2.1 Colors</a></li> <li><a name="toc-Fonts" href="#Fonts">7.2.2 Fonts</a></li> <li><a name="toc-Progress-Bar" href="#Progress-Bar">7.2.3 Progress Bar</a></li> <li><a name="toc-Circular-Progress-Indicator" href="#Circular-Progress-Indicator">7.2.4 Circular Progress Indicator</a></li> <li><a name="toc-Labels" href="#Labels">7.2.5 Labels</a></li> <li><a name="toc-Boot-Menu" href="#Boot-Menu">7.2.6 Boot Menu</a></li> <li><a name="toc-Styled-Boxes" href="#Styled-Boxes">7.2.7 Styled Boxes</a></li> <li><a name="toc-Creating-Styled-Box-Images" href="#Creating-Styled-Box-Images">7.2.8 Creating Styled Box Images</a></li> </ul></li> <li><a name="toc-Theme-File-Manual" href="#Theme-File-Manual">7.3 Theme File Manual</a> <ul class="no-bullet"> <li><a name="toc-Global-Properties" href="#Global-Properties">7.3.1 Global Properties</a></li> <li><a name="toc-Format" href="#Format">7.3.2 Format</a></li> <li><a name="toc-Global-Property-List" href="#Global-Property-List">7.3.3 Global Property List</a></li> <li><a name="toc-Component-Construction" href="#Component-Construction">7.3.4 Component Construction</a></li> <li><a name="toc-Component-List" href="#Component-List">7.3.5 Component List</a></li> <li><a name="toc-Common-properties" href="#Common-properties">7.3.6 Common properties</a></li> </ul></li> </ul></li> <li><a name="toc-Booting-GRUB-from-the-network" href="#Network">8 Booting GRUB from the network</a></li> <li><a name="toc-Using-GRUB-via-a-serial-line" href="#Serial-terminal">9 Using GRUB via a serial line</a></li> <li><a name="toc-Using-GRUB-with-vendor-power_002don-keys" href="#Vendor-power_002don-keys">10 Using GRUB with vendor power-on keys</a></li> <li><a name="toc-GRUB-image-files" href="#Images">11 GRUB image files</a></li> <li><a name="toc-Core-image-size-limitation-1" href="#Core-image-size-limitation">12 Core image size limitation</a></li> <li><a name="toc-Filesystem-syntax-and-semantics" href="#Filesystem">13 Filesystem syntax and semantics</a> <ul class="no-bullet"> <li><a name="toc-How-to-specify-devices" href="#Device-syntax">13.1 How to specify devices</a></li> <li><a name="toc-How-to-specify-files" href="#File-name-syntax">13.2 How to specify files</a></li> <li><a name="toc-How-to-specify-block-lists" href="#Block-list-syntax">13.3 How to specify block lists</a></li> </ul></li> <li><a name="toc-GRUB_0027s-user-interface" href="#Interface">14 GRUB’s user interface</a> <ul class="no-bullet"> <li><a name="toc-The-flexible-command_002dline-interface" href="#Command_002dline-interface">14.1 The flexible command-line interface</a></li> <li><a name="toc-The-simple-menu-interface" href="#Menu-interface">14.2 The simple menu interface</a></li> <li><a name="toc-Editing-a-menu-entry" href="#Menu-entry-editor">14.3 Editing a menu entry</a></li> </ul></li> <li><a name="toc-GRUB-environment-variables" href="#Environment">15 GRUB environment variables</a> <ul class="no-bullet"> <li><a name="toc-Special-environment-variables-1" href="#Special-environment-variables">15.1 Special environment variables</a> <ul class="no-bullet"> <li><a name="toc-biosnum-1" href="#biosnum">15.1.1 biosnum</a></li> <li><a name="toc-check_005fappended_005fsignatures-1" href="#check_005fappended_005fsignatures">15.1.2 check_appended_signatures</a></li> <li><a name="toc-check_005fsignatures-1" href="#check_005fsignatures">15.1.3 check_signatures</a></li> <li><a name="toc-chosen-1" href="#chosen">15.1.4 chosen</a></li> <li><a name="toc-cmdpath-1" href="#cmdpath">15.1.5 cmdpath</a></li> <li><a name="toc-color_005fhighlight-1" href="#color_005fhighlight">15.1.6 color_highlight</a></li> <li><a name="toc-color_005fnormal-1" href="#color_005fnormal">15.1.7 color_normal</a></li> <li><a name="toc-config_005fdirectory-1" href="#config_005fdirectory">15.1.8 config_directory</a></li> <li><a name="toc-config_005ffile-1" href="#config_005ffile">15.1.9 config_file</a></li> <li><a name="toc-debug-1" href="#debug">15.1.10 debug</a></li> <li><a name="toc-default-1" href="#default">15.1.11 default</a></li> <li><a name="toc-fallback-1" href="#fallback">15.1.12 fallback</a></li> <li><a name="toc-gfxmode-1" href="#gfxmode">15.1.13 gfxmode</a></li> <li><a name="toc-gfxpayload-1" href="#gfxpayload">15.1.14 gfxpayload</a></li> <li><a name="toc-gfxterm_005ffont-1" href="#gfxterm_005ffont">15.1.15 gfxterm_font</a></li> <li><a name="toc-grub_005fcpu-1" href="#grub_005fcpu">15.1.16 grub_cpu</a></li> <li><a name="toc-grub_005fplatform-1" href="#grub_005fplatform">15.1.17 grub_platform</a></li> <li><a name="toc-icondir-1" href="#icondir">15.1.18 icondir</a></li> <li><a name="toc-lang-1" href="#lang">15.1.19 lang</a></li> <li><a name="toc-locale_005fdir-1" href="#locale_005fdir">15.1.20 locale_dir</a></li> <li><a name="toc-menu_005fcolor_005fhighlight-1" href="#menu_005fcolor_005fhighlight">15.1.21 menu_color_highlight</a></li> <li><a name="toc-menu_005fcolor_005fnormal-1" href="#menu_005fcolor_005fnormal">15.1.22 menu_color_normal</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fboot_005ffile-1" href="#net_005f_003cinterface_003e_005fboot_005ffile">15.1.23 net_<var><interface></var>_boot_file</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fdhcp_005fserver_005fname-1" href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname">15.1.24 net_<var><interface></var>_dhcp_server_name</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fdomain-1" href="#net_005f_003cinterface_003e_005fdomain">15.1.25 net_<var><interface></var>_domain</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fextensionspath-1" href="#net_005f_003cinterface_003e_005fextensionspath">15.1.26 net_<var><interface></var>_extensionspath</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fhostname-1" href="#net_005f_003cinterface_003e_005fhostname">15.1.27 net_<var><interface></var>_hostname</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fip-1" href="#net_005f_003cinterface_003e_005fip">15.1.28 net_<var><interface></var>_ip</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fmac-1" href="#net_005f_003cinterface_003e_005fmac">15.1.29 net_<var><interface></var>_mac</a></li> <li><a name="toc-net_005f_003cinterface_003e_005fnext_005fserver-1" href="#net_005f_003cinterface_003e_005fnext_005fserver">15.1.30 net_<var><interface></var>_next_server</a></li> <li><a name="toc-net_005f_003cinterface_003e_005frootpath-1" href="#net_005f_003cinterface_003e_005frootpath">15.1.31 net_<var><interface></var>_rootpath</a></li> <li><a name="toc-net_005fdefault_005finterface-1" href="#net_005fdefault_005finterface">15.1.32 net_default_interface</a></li> <li><a name="toc-net_005fdefault_005fip-1" href="#net_005fdefault_005fip">15.1.33 net_default_ip</a></li> <li><a name="toc-net_005fdefault_005fmac-1" href="#net_005fdefault_005fmac">15.1.34 net_default_mac</a></li> <li><a name="toc-net_005fdefault_005fserver-1" href="#net_005fdefault_005fserver">15.1.35 net_default_server</a></li> <li><a name="toc-pager-1" href="#pager">15.1.36 pager</a></li> <li><a name="toc-prefix-1" href="#prefix">15.1.37 prefix</a></li> <li><a name="toc-pxe_005fblksize-1" href="#pxe_005fblksize">15.1.38 pxe_blksize</a></li> <li><a name="toc-pxe_005fdefault_005fgateway-1" href="#pxe_005fdefault_005fgateway">15.1.39 pxe_default_gateway</a></li> <li><a name="toc-pxe_005fdefault_005fserver-1" href="#pxe_005fdefault_005fserver">15.1.40 pxe_default_server</a></li> <li><a name="toc-root-1" href="#root">15.1.41 root</a></li> <li><a name="toc-superusers-1" href="#superusers">15.1.42 superusers</a></li> <li><a name="toc-theme-1" href="#theme">15.1.43 theme</a></li> <li><a name="toc-timeout-1" href="#timeout">15.1.44 timeout</a></li> <li><a name="toc-timeout_005fstyle-1" href="#timeout_005fstyle">15.1.45 timeout_style</a></li> </ul></li> <li><a name="toc-The-GRUB-environment-block" href="#Environment-block">15.2 The GRUB environment block</a></li> </ul></li> <li><a name="toc-The-list-of-available-commands" href="#Commands">16 The list of available commands</a> <ul class="no-bullet"> <li><a name="toc-The-list-of-commands-for-the-menu-only" href="#Menu_002dspecific-commands">16.1 The list of commands for the menu only</a> <ul class="no-bullet"> <li><a name="toc-menuentry-1" href="#menuentry">16.1.1 menuentry</a></li> <li><a name="toc-submenu-1" href="#submenu">16.1.2 submenu</a></li> </ul></li> <li><a name="toc-The-list-of-general-commands" href="#General-commands">16.2 The list of general commands</a> <ul class="no-bullet"> <li><a name="toc-serial-1" href="#serial">16.2.1 serial</a></li> <li><a name="toc-terminal_005finput-1" href="#terminal_005finput">16.2.2 terminal_input</a></li> <li><a name="toc-terminal_005foutput-1" href="#terminal_005foutput">16.2.3 terminal_output</a></li> <li><a name="toc-terminfo-1" href="#terminfo">16.2.4 terminfo</a></li> </ul></li> <li><a name="toc-The-list-of-command_002dline-and-menu-entry-commands" href="#Command_002dline-and-menu-entry-commands">16.3 The list of command-line and menu entry commands</a> <ul class="no-bullet"> <li><a name="toc-_005b-1" href="#g_t_005b">16.3.1 [</a></li> <li><a name="toc-acpi-1" href="#acpi">16.3.2 acpi</a></li> <li><a name="toc-authenticate-1" href="#authenticate">16.3.3 authenticate</a></li> <li><a name="toc-background_005fcolor-1" href="#background_005fcolor">16.3.4 background_color</a></li> <li><a name="toc-background_005fimage-1" href="#background_005fimage">16.3.5 background_image</a></li> <li><a name="toc-badram-1" href="#badram">16.3.6 badram</a></li> <li><a name="toc-blocklist-1" href="#blocklist">16.3.7 blocklist</a></li> <li><a name="toc-boot-1" href="#boot">16.3.8 boot</a></li> <li><a name="toc-cat-1" href="#cat">16.3.9 cat</a></li> <li><a name="toc-chainloader-1" href="#chainloader">16.3.10 chainloader</a></li> <li><a name="toc-clear-1" href="#clear">16.3.11 clear</a></li> <li><a name="toc-cmosclean-1" href="#cmosclean">16.3.12 cmosclean</a></li> <li><a name="toc-cmosdump-1" href="#cmosdump">16.3.13 cmosdump</a></li> <li><a name="toc-cmostest-1" href="#cmostest">16.3.14 cmostest</a></li> <li><a name="toc-cmp-1" href="#cmp">16.3.15 cmp</a></li> <li><a name="toc-configfile-1" href="#configfile">16.3.16 configfile</a></li> <li><a name="toc-cpuid-1" href="#cpuid">16.3.17 cpuid</a></li> <li><a name="toc-crc-1" href="#crc">16.3.18 crc</a></li> <li><a name="toc-cryptomount-1" href="#cryptomount">16.3.19 cryptomount</a></li> <li><a name="toc-cutmem-1" href="#cutmem">16.3.20 cutmem</a></li> <li><a name="toc-date-1" href="#date">16.3.21 date</a></li> <li><a name="toc-devicetree-1" href="#devicetree">16.3.22 devicetree</a></li> <li><a name="toc-distrust-1" href="#distrust">16.3.23 distrust</a></li> <li><a name="toc-distrust_005fcertificate-1" href="#distrust_005fcertificate">16.3.24 distrust_certificate</a></li> <li><a name="toc-drivemap-1" href="#drivemap">16.3.25 drivemap</a></li> <li><a name="toc-echo-1" href="#echo">16.3.26 echo</a></li> <li><a name="toc-eval-1" href="#eval">16.3.27 eval</a></li> <li><a name="toc-export-1" href="#export">16.3.28 export</a></li> <li><a name="toc-false-1" href="#false">16.3.29 false</a></li> <li><a name="toc-gettext-1" href="#gettext">16.3.30 gettext</a></li> <li><a name="toc-gptsync-1" href="#gptsync">16.3.31 gptsync</a></li> <li><a name="toc-halt-1" href="#halt">16.3.32 halt</a></li> <li><a name="toc-hashsum-1" href="#hashsum">16.3.33 hashsum</a></li> <li><a name="toc-help-1" href="#help">16.3.34 help</a></li> <li><a name="toc-initrd-1" href="#initrd">16.3.35 initrd</a></li> <li><a name="toc-initrd16-1" href="#initrd16">16.3.36 initrd16</a></li> <li><a name="toc-insmod-1" href="#insmod">16.3.37 insmod</a></li> <li><a name="toc-keystatus-1" href="#keystatus">16.3.38 keystatus</a></li> <li><a name="toc-linux-1" href="#linux">16.3.39 linux</a></li> <li><a name="toc-linux16-1" href="#linux16">16.3.40 linux16</a></li> <li><a name="toc-list_005fcertificates-1" href="#list_005fcertificates">16.3.41 list_certificates</a></li> <li><a name="toc-list_005fenv-1" href="#list_005fenv">16.3.42 list_env</a></li> <li><a name="toc-list_005ftrusted-1" href="#list_005ftrusted">16.3.43 list_trusted</a></li> <li><a name="toc-load_005fenv-1" href="#load_005fenv">16.3.44 load_env</a></li> <li><a name="toc-loadfont-1" href="#loadfont">16.3.45 loadfont</a></li> <li><a name="toc-loopback-1" href="#loopback">16.3.46 loopback</a></li> <li><a name="toc-ls-1" href="#ls">16.3.47 ls</a></li> <li><a name="toc-lsfonts-1" href="#lsfonts">16.3.48 lsfonts</a></li> <li><a name="toc-lsmod-1" href="#lsmod">16.3.49 lsmod</a></li> <li><a name="toc-md5sum-1" href="#md5sum">16.3.50 md5sum</a></li> <li><a name="toc-module-1" href="#module">16.3.51 module</a></li> <li><a name="toc-multiboot-1" href="#multiboot">16.3.52 multiboot</a></li> <li><a name="toc-nativedisk-1" href="#nativedisk">16.3.53 nativedisk</a></li> <li><a name="toc-normal-1" href="#normal">16.3.54 normal</a></li> <li><a name="toc-normal_005fexit-1" href="#normal_005fexit">16.3.55 normal_exit</a></li> <li><a name="toc-parttool-1" href="#parttool">16.3.56 parttool</a></li> <li><a name="toc-password-1" href="#password">16.3.57 password</a></li> <li><a name="toc-password_005fpbkdf2-1" href="#password_005fpbkdf2">16.3.58 password_pbkdf2</a></li> <li><a name="toc-play-1" href="#play">16.3.59 play</a></li> <li><a name="toc-probe-1" href="#probe">16.3.60 probe</a></li> <li><a name="toc-pxe_005funload-1" href="#pxe_005funload">16.3.61 pxe_unload</a></li> <li><a name="toc-read-1" href="#read">16.3.62 read</a></li> <li><a name="toc-reboot-1" href="#reboot">16.3.63 reboot</a></li> <li><a name="toc-regexp-1" href="#regexp">16.3.64 regexp</a></li> <li><a name="toc-rmmod-1" href="#rmmod">16.3.65 rmmod</a></li> <li><a name="toc-save_005fenv-1" href="#save_005fenv">16.3.66 save_env</a></li> <li><a name="toc-search-1" href="#search">16.3.67 search</a></li> <li><a name="toc-sendkey-1" href="#sendkey">16.3.68 sendkey</a></li> <li><a name="toc-set-1" href="#set">16.3.69 set</a></li> <li><a name="toc-sha1sum-1" href="#sha1sum">16.3.70 sha1sum</a></li> <li><a name="toc-sha256sum-1" href="#sha256sum">16.3.71 sha256sum</a></li> <li><a name="toc-sha512sum-1" href="#sha512sum">16.3.72 sha512sum</a></li> <li><a name="toc-sleep-1" href="#sleep">16.3.73 sleep</a></li> <li><a name="toc-source-1" href="#source">16.3.74 source</a></li> <li><a name="toc-test-1" href="#test">16.3.75 test</a></li> <li><a name="toc-true-1" href="#true">16.3.76 true</a></li> <li><a name="toc-trust-1" href="#trust">16.3.77 trust</a></li> <li><a name="toc-trust_005fcertificate-1" href="#trust_005fcertificate">16.3.78 trust_certificate</a></li> <li><a name="toc-unset-1" href="#unset">16.3.79 unset</a></li> <li><a name="toc-uppermem-1" href="#uppermem">16.3.80 uppermem</a></li> <li><a name="toc-verify_005fappended-1" href="#verify_005fappended">16.3.81 verify_appended</a></li> <li><a name="toc-verify_005fdetached-1" href="#verify_005fdetached">16.3.82 verify_detached</a></li> <li><a name="toc-videoinfo-1" href="#videoinfo">16.3.83 videoinfo</a></li> <li><a name="toc-xen_005fhypervisor-1" href="#xen_005fhypervisor">16.3.84 xen_hypervisor</a></li> <li><a name="toc-xen_005fmodule-1" href="#xen_005fmodule">16.3.85 xen_module</a></li> </ul></li> <li><a name="toc-The-list-of-networking-commands" href="#Networking-commands">16.4 The list of networking commands</a> <ul class="no-bullet"> <li><a name="toc-net_005fadd_005faddr-1" href="#net_005fadd_005faddr">16.4.1 net_add_addr</a></li> <li><a name="toc-net_005fadd_005fdns-1" href="#net_005fadd_005fdns">16.4.2 net_add_dns</a></li> <li><a name="toc-net_005fadd_005froute-1" href="#net_005fadd_005froute">16.4.3 net_add_route</a></li> <li><a name="toc-net_005fbootp-1" href="#net_005fbootp">16.4.4 net_bootp</a></li> <li><a name="toc-net_005fbootp6-1" href="#net_005fbootp6">16.4.5 net_bootp6</a></li> <li><a name="toc-net_005fdel_005faddr-1" href="#net_005fdel_005faddr">16.4.6 net_del_addr</a></li> <li><a name="toc-net_005fdel_005fdns-1" href="#net_005fdel_005fdns">16.4.7 net_del_dns</a></li> <li><a name="toc-net_005fdel_005froute-1" href="#net_005fdel_005froute">16.4.8 net_del_route</a></li> <li><a name="toc-net_005fget_005fdhcp_005foption-1" href="#net_005fget_005fdhcp_005foption">16.4.9 net_get_dhcp_option</a></li> <li><a name="toc-net_005fipv6_005fautoconf-1" href="#net_005fipv6_005fautoconf">16.4.10 net_ipv6_autoconf</a></li> <li><a name="toc-net_005fls_005faddr-1" href="#net_005fls_005faddr">16.4.11 net_ls_addr</a></li> <li><a name="toc-net_005fls_005fcards-1" href="#net_005fls_005fcards">16.4.12 net_ls_cards</a></li> <li><a name="toc-net_005fls_005fdns-1" href="#net_005fls_005fdns">16.4.13 net_ls_dns</a></li> <li><a name="toc-net_005fls_005froutes-1" href="#net_005fls_005froutes">16.4.14 net_ls_routes</a></li> <li><a name="toc-net_005fnslookup-1" href="#net_005fnslookup">16.4.15 net_nslookup</a></li> </ul></li> </ul></li> <li><a name="toc-Internationalisation-1" href="#Internationalisation">17 Internationalisation</a> <ul class="no-bullet"> <li><a name="toc-Charset" href="#Charset">17.1 Charset</a></li> <li><a name="toc-Filesystems" href="#Filesystems">17.2 Filesystems</a></li> <li><a name="toc-Output-terminal" href="#Output-terminal">17.3 Output terminal</a></li> <li><a name="toc-Input-terminal" href="#Input-terminal">17.4 Input terminal</a></li> <li><a name="toc-Gettext" href="#Gettext">17.5 Gettext</a></li> <li><a name="toc-Regexp" href="#Regexp">17.6 Regexp</a></li> <li><a name="toc-Other" href="#Other">17.7 Other</a></li> </ul></li> <li><a name="toc-Security-1" href="#Security">18 Security</a> <ul class="no-bullet"> <li><a name="toc-Authentication-and-authorisation-in-GRUB" href="#Authentication-and-authorisation">18.1 Authentication and authorisation in GRUB</a></li> <li><a name="toc-Using-GPG_002dstyle-digital-signatures-in-GRUB" href="#Using-GPG_002dstyle-digital-signatures">18.2 Using GPG-style digital signatures in GRUB</a></li> <li><a name="toc-Using-appended-signatures-in-GRUB" href="#Using-appended-signatures">18.3 Using appended signatures in GRUB</a></li> <li><a name="toc-Signing-GRUB-itself-1" href="#Signing-GRUB-itself">18.4 Signing GRUB itself</a></li> <li><a name="toc-Signing-GRUB-for-UEFI-secure-boot" href="#Signing-GRUB-for-UEFI-secure-boot">18.5 Signing GRUB for UEFI secure boot</a></li> <li><a name="toc-Signing-GRUB-with-an-appended-signature" href="#Signing-GRUB-with-an-appended-signature">18.6 Signing GRUB with an appended signature</a></li> <li><a name="toc-Embedded-information-for-generation-number-based-revocation" href="#Secure-Boot-Advanced-Targeting">18.7 Embedded information for generation number based revocation</a></li> <li><a name="toc-Lockdown-when-booting-on-a-secure-setup" href="#Lockdown">18.8 Lockdown when booting on a secure setup</a></li> </ul></li> <li><a name="toc-Platform-limitations-1" href="#Platform-limitations">19 Platform limitations</a></li> <li><a name="toc-Outline" href="#Platform_002dspecific-operations">20 Outline</a></li> <li><a name="toc-Supported-boot-targets" href="#Supported-kernels">21 Supported boot targets</a> <ul class="no-bullet"> <li><a name="toc-Boot-tests" href="#Boot-tests">21.1 Boot tests</a></li> </ul></li> <li><a name="toc-Error-messages-produced-by-GRUB" href="#Troubleshooting">22 Error messages produced by GRUB</a> <ul class="no-bullet"> <li><a name="toc-GRUB-only-offers-a-rescue-shell-1" href="#GRUB-only-offers-a-rescue-shell">22.1 GRUB only offers a rescue shell</a></li> </ul></li> <li><a name="toc-Invoking-grub2_002dinstall-1" href="#Invoking-grub2_002dinstall">23 Invoking grub2-install</a></li> <li><a name="toc-Invoking-grub2_002dmkconfig-1" href="#Invoking-grub2_002dmkconfig">24 Invoking grub2-mkconfig</a></li> <li><a name="toc-Invoking-grub2_002dmkpasswd_002dpbkdf2-1" href="#Invoking-grub2_002dmkpasswd_002dpbkdf2">25 Invoking grub2-mkpasswd-pbkdf2</a></li> <li><a name="toc-Invoking-grub2_002dmkrelpath-1" href="#Invoking-grub2_002dmkrelpath">26 Invoking grub2-mkrelpath</a></li> <li><a name="toc-Invoking-grub2_002dmkrescue-1" href="#Invoking-grub2_002dmkrescue">27 Invoking grub2-mkrescue</a></li> <li><a name="toc-Invoking-grub2_002dmount-1" href="#Invoking-grub2_002dmount">28 Invoking grub2-mount</a></li> <li><a name="toc-Invoking-grub2_002dprobe-1" href="#Invoking-grub2_002dprobe">29 Invoking grub2-probe</a></li> <li><a name="toc-Invoking-grub2_002dscript_002dcheck-1" href="#Invoking-grub2_002dscript_002dcheck">30 Invoking grub2-script-check</a></li> <li><a name="toc-How-to-obtain-and-build-GRUB" href="#Obtaining-and-Building-GRUB">Appendix A How to obtain and build GRUB</a></li> <li><a name="toc-Reporting-bugs-1" href="#Reporting-bugs">Appendix B Reporting bugs</a></li> <li><a name="toc-Where-GRUB-will-go" href="#Future">Appendix C Where GRUB will go</a></li> <li><a name="toc-Copying-This-Manual-1" href="#Copying-This-Manual">Appendix D Copying This Manual</a> <ul class="no-bullet"> <li><a name="toc-GNU-Free-Documentation-License-1" href="#GNU-Free-Documentation-License">D.1 GNU Free Documentation License</a> <ul class="no-bullet"> <li><a name="toc-ADDENDUM_003a-How-to-use-this-License-for-your-documents" href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents">D.1.1 ADDENDUM: How to use this License for your documents</a></li> </ul></li> </ul></li> <li><a name="toc-Index-1" href="#Index">Index</a></li> </ul> </div> <a name="Top"></a> <div class="header"> <p> Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GNU-GRUB-manual"></a> <h1 class="top">GNU GRUB manual</h1> <p>This is the documentation of GNU GRUB, the GRand Unified Bootloader, a flexible and powerful boot loader program for a wide range of architectures. </p> <p>This edition documents version 2.03. </p> <p>This manual is for GNU GRUB (version 2.03, 17 March 2026). </p> <p>Copyright © 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. </p> <blockquote> <p>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections. </p></blockquote> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Introduction" accesskey="1">Introduction</a>:</td><td> </td><td align="left" valign="top">Capturing the spirit of GRUB </td></tr> <tr><td align="left" valign="top">• <a href="#Naming-convention" accesskey="2">Naming convention</a>:</td><td> </td><td align="left" valign="top">Names of your drives in GRUB </td></tr> <tr><td align="left" valign="top">• <a href="#OS_002dspecific-notes-about-grub-tools" accesskey="3">OS-specific notes about grub tools</a>:</td><td> </td><td align="left" valign="top"> Some notes about OS-specific behaviour of GRUB tools </td></tr> <tr><td align="left" valign="top">• <a href="#Installation" accesskey="4">Installation</a>:</td><td> </td><td align="left" valign="top">Installing GRUB on your drive </td></tr> <tr><td align="left" valign="top">• <a href="#Booting" accesskey="5">Booting</a>:</td><td> </td><td align="left" valign="top">How to boot different operating systems </td></tr> <tr><td align="left" valign="top">• <a href="#Configuration" accesskey="6">Configuration</a>:</td><td> </td><td align="left" valign="top">Writing your own configuration file </td></tr> <tr><td align="left" valign="top">• <a href="#Theme-file-format" accesskey="7">Theme file format</a>:</td><td> </td><td align="left" valign="top">Format of GRUB theme files </td></tr> <tr><td align="left" valign="top">• <a href="#Network" accesskey="8">Network</a>:</td><td> </td><td align="left" valign="top">Downloading OS images from a network </td></tr> <tr><td align="left" valign="top">• <a href="#Serial-terminal" accesskey="9">Serial terminal</a>:</td><td> </td><td align="left" valign="top">Using GRUB via a serial line </td></tr> <tr><td align="left" valign="top">• <a href="#Vendor-power_002don-keys">Vendor power-on keys</a>:</td><td> </td><td align="left" valign="top">Changing GRUB behaviour on vendor power-on keys </td></tr> <tr><td align="left" valign="top">• <a href="#Images">Images</a>:</td><td> </td><td align="left" valign="top">GRUB image files </td></tr> <tr><td align="left" valign="top">• <a href="#Core-image-size-limitation">Core image size limitation</a>:</td><td> </td><td align="left" valign="top">GRUB image files size limitations </td></tr> <tr><td align="left" valign="top">• <a href="#Filesystem">Filesystem</a>:</td><td> </td><td align="left" valign="top">Filesystem syntax and semantics </td></tr> <tr><td align="left" valign="top">• <a href="#Interface">Interface</a>:</td><td> </td><td align="left" valign="top">The menu and the command-line </td></tr> <tr><td align="left" valign="top">• <a href="#Environment">Environment</a>:</td><td> </td><td align="left" valign="top">GRUB environment variables </td></tr> <tr><td align="left" valign="top">• <a href="#Commands">Commands</a>:</td><td> </td><td align="left" valign="top">The list of available builtin commands </td></tr> <tr><td align="left" valign="top">• <a href="#Internationalisation">Internationalisation</a>:</td><td> </td><td align="left" valign="top">Topics relating to language support </td></tr> <tr><td align="left" valign="top">• <a href="#Security">Security</a>:</td><td> </td><td align="left" valign="top">Authentication, authorisation, and signatures </td></tr> <tr><td align="left" valign="top">• <a href="#Platform-limitations">Platform limitations</a>:</td><td> </td><td align="left" valign="top">The list of platform-specific limitations </td></tr> <tr><td align="left" valign="top">• <a href="#Platform_002dspecific-operations">Platform-specific operations</a>:</td><td> </td><td align="left" valign="top">Platform-specific operations </td></tr> <tr><td align="left" valign="top">• <a href="#Supported-kernels">Supported kernels</a>:</td><td> </td><td align="left" valign="top">The list of supported kernels </td></tr> <tr><td align="left" valign="top">• <a href="#Troubleshooting">Troubleshooting</a>:</td><td> </td><td align="left" valign="top">Error messages produced by GRUB </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>:</td><td> </td><td align="left" valign="top">How to use the GRUB installer </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dmkconfig">Invoking grub2-mkconfig</a>:</td><td> </td><td align="left" valign="top">Generate a GRUB configuration file </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>:</td><td> </td><td align="left" valign="top"> Generate GRUB password hashes </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dmkrelpath">Invoking grub2-mkrelpath</a>:</td><td> </td><td align="left" valign="top">Make system path relative to its root </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dmkrescue">Invoking grub2-mkrescue</a>:</td><td> </td><td align="left" valign="top">Make a GRUB rescue image </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dmount">Invoking grub2-mount</a>:</td><td> </td><td align="left" valign="top">Mount a file system using GRUB </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dprobe">Invoking grub2-probe</a>:</td><td> </td><td align="left" valign="top">Probe device information for GRUB </td></tr> <tr><td align="left" valign="top">• <a href="#Invoking-grub2_002dscript_002dcheck">Invoking grub2-script-check</a>:</td><td> </td><td align="left" valign="top">Check GRUB script file for syntax errors </td></tr> <tr><td align="left" valign="top">• <a href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>:</td><td> </td><td align="left" valign="top">How to obtain and build GRUB </td></tr> <tr><td align="left" valign="top">• <a href="#Reporting-bugs">Reporting bugs</a>:</td><td> </td><td align="left" valign="top">Where you should send a bug report </td></tr> <tr><td align="left" valign="top">• <a href="#Future">Future</a>:</td><td> </td><td align="left" valign="top">Some future plans on GRUB </td></tr> <tr><td align="left" valign="top">• <a href="#Copying-This-Manual">Copying This Manual</a>:</td><td> </td><td align="left" valign="top">Copying This Manual </td></tr> <tr><td align="left" valign="top">• <a href="#Index">Index</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Introduction"></a> <div class="header"> <p> Next: <a href="#Naming-convention" accesskey="n" rel="next">Naming convention</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Introduction-to-GRUB"></a> <h2 class="chapter">1 Introduction to GRUB</h2> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Overview" accesskey="1">Overview</a>:</td><td> </td><td align="left" valign="top">What exactly GRUB is and how to use it </td></tr> <tr><td align="left" valign="top">• <a href="#History" accesskey="2">History</a>:</td><td> </td><td align="left" valign="top">From maggot to house fly </td></tr> <tr><td align="left" valign="top">• <a href="#Changes-from-GRUB-Legacy" accesskey="3">Changes from GRUB Legacy</a>:</td><td> </td><td align="left" valign="top">Differences from previous versions </td></tr> <tr><td align="left" valign="top">• <a href="#Features" accesskey="4">Features</a>:</td><td> </td><td align="left" valign="top">GRUB features </td></tr> <tr><td align="left" valign="top">• <a href="#Role-of-a-boot-loader" accesskey="5">Role of a boot loader</a>:</td><td> </td><td align="left" valign="top">The role of a boot loader </td></tr> </table> <hr> <a name="Overview"></a> <div class="header"> <p> Next: <a href="#History" accesskey="n" rel="next">History</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Overview-1"></a> <h3 class="section">1.1 Overview</h3> <p>Briefly, a <em>boot loader</em> is the first software program that runs when a computer starts. It is responsible for loading and transferring control to an operating system <em>kernel</em> software (such as Linux or GNU Mach). The kernel, in turn, initializes the rest of the operating system (e.g. a GNU system). </p> <p>GNU GRUB is a very powerful boot loader, which can load a wide variety of free operating systems, as well as proprietary operating systems with chain-loading<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>. GRUB is designed to address the complexity of booting a personal computer; both the program and this manual are tightly bound to that computer platform, although porting to other platforms may be addressed in the future. </p> <p>One of the important features in GRUB is flexibility; GRUB understands filesystems and kernel executable formats, so you can load an arbitrary operating system the way you like, without recording the physical position of your kernel on the disk. Thus you can load the kernel just by specifying its file name and the drive and partition where the kernel resides. </p> <p>When booting with GRUB, you can use either a command-line interface (see <a href="#Command_002dline-interface">Command-line interface</a>), or a menu interface (see <a href="#Menu-interface">Menu interface</a>). Using the command-line interface, you type the drive specification and file name of the kernel manually. In the menu interface, you just select an OS using the arrow keys. The menu is based on a configuration file which you prepare beforehand (see <a href="#Configuration">Configuration</a>). While in the menu, you can switch to the command-line mode, and vice-versa. You can even edit menu entries before using them. </p> <p>In the following chapters, you will learn how to specify a drive, a partition, and a file name (see <a href="#Naming-convention">Naming convention</a>) to GRUB, how to install GRUB on your drive (see <a href="#Installation">Installation</a>), and how to boot your OSes (see <a href="#Booting">Booting</a>), step by step. </p> <hr> <a name="History"></a> <div class="header"> <p> Next: <a href="#Changes-from-GRUB-Legacy" accesskey="n" rel="next">Changes from GRUB Legacy</a>, Previous: <a href="#Overview" accesskey="p" rel="prev">Overview</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="History-of-GRUB"></a> <h3 class="section">1.2 History of GRUB</h3> <p>GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU Hurd with the University of Utah’s Mach 4 microkernel (now known as GNU Mach). Erich and Brian Ford designed the Multiboot Specification (see <a href="http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Top">Motivation</a> in <cite>The Multiboot Specification</cite>), because they were determined not to add to the large number of mutually-incompatible PC boot methods. </p> <p>Erich then began modifying the FreeBSD boot loader so that it would understand Multiboot. He soon realized that it would be a lot easier to write his own boot loader from scratch than to keep working on the FreeBSD boot loader, and so GRUB was born. </p> <p>Erich added many features to GRUB, but other priorities prevented him from keeping up with the demands of its quickly-expanding user base. In 1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an official GNU package, and opened its development by making the latest sources available via anonymous CVS. See <a href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>, for more information. </p> <p>Over the next few years, GRUB was extended to meet many needs, but it quickly became clear that its design was not keeping up with the extensions being made to it, and we reached the point where it was very difficult to make any further changes without breaking existing features. Around 2002, Yoshinori K. Okuji started work on PUPA (Preliminary Universal Programming Architecture for GNU GRUB), aiming to rewrite the core of GRUB to make it cleaner, safer, more robust, and more powerful. PUPA was eventually renamed to GRUB 2, and the original version of GRUB was renamed to GRUB Legacy. Small amounts of maintenance continued to be done on GRUB Legacy, but the last release (0.97) was made in 2005 and at the time of writing it seems unlikely that there will be another. </p> <p>By around 2007, GNU/Linux distributions started to use GRUB 2 to limited extents, and by the end of 2009 multiple major distributions were installing it by default. </p> <hr> <a name="Changes-from-GRUB-Legacy"></a> <div class="header"> <p> Next: <a href="#Features" accesskey="n" rel="next">Features</a>, Previous: <a href="#History" accesskey="p" rel="prev">History</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Differences-from-previous-versions"></a> <h3 class="section">1.3 Differences from previous versions</h3> <p>GRUB 2 is a rewrite of GRUB (see <a href="#History">History</a>), although it shares many characteristics with the previous version, now known as GRUB Legacy. Users of GRUB Legacy may need some guidance to find their way around this new version. </p> <ul> <li> The configuration file has a new name (<samp>grub.cfg</samp> rather than <samp>menu.lst</samp> or <samp>grub.conf</samp>), new syntax (see <a href="#Configuration">Configuration</a>) and many new commands (see <a href="#Commands">Commands</a>). Configuration cannot be copied over directly, although most GRUB Legacy users should not find the syntax too surprising. </li><li> <samp>grub.cfg</samp> is typically automatically generated by <code>grub2-mkconfig</code> (see <a href="#Simple-configuration">Simple configuration</a>). This makes it easier to handle versioned kernel upgrades. </li><li> Partition numbers in GRUB device names now start at 1, not 0 (see <a href="#Naming-convention">Naming convention</a>). </li><li> The configuration file is now written in something closer to a full scripting language: variables, conditionals, and loops are available. </li><li> A small amount of persistent storage is available across reboots, using the <code>save_env</code> and <code>load_env</code> commands in GRUB and the <code>grub2-editenv</code> utility. This is not available in all configurations (see <a href="#Environment-block">Environment block</a>). </li><li> GRUB 2 has more reliable ways to find its own files and those of target kernels on multiple-disk systems, and has commands (see <a href="#search">search</a>) to find devices using file system labels or Universally Unique Identifiers (UUIDs). </li><li> GRUB 2 is available for several other types of system in addition to the PC BIOS systems supported by GRUB Legacy: PC EFI, PC coreboot, PowerPC, SPARC, and MIPS Lemote Yeeloong are all supported. </li><li> Many more file systems are supported, including but not limited to ext4, HFS+, and NTFS. </li><li> GRUB 2 can read files directly from LVM and RAID devices. </li><li> A graphical terminal and a graphical menu system are available. </li><li> GRUB 2’s interface can be translated, including menu entry names. </li><li> The image files (see <a href="#Images">Images</a>) that make up GRUB have been reorganised; Stage 1, Stage 1.5, and Stage 2 are no more. </li><li> GRUB 2 puts many facilities in dynamically loaded modules, allowing the core image to be smaller, and allowing the core image to be built in more flexible ways. </li></ul> <hr> <a name="Features"></a> <div class="header"> <p> Next: <a href="#Role-of-a-boot-loader" accesskey="n" rel="next">Role of a boot loader</a>, Previous: <a href="#Changes-from-GRUB-Legacy" accesskey="p" rel="prev">Changes from GRUB Legacy</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GRUB-features"></a> <h3 class="section">1.4 GRUB features</h3> <p>The primary requirement for GRUB is that it be compliant with the <em>Multiboot Specification</em>, which is described in <a href="http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Top">Motivation</a> in <cite>The Multiboot Specification</cite>. </p> <p>The other goals, listed in approximate order of importance, are: </p> <ul> <li> Basic functions must be straightforward for end-users. </li><li> Rich functionality to support kernel experts and designers. </li><li> Backward compatibility for booting FreeBSD, NetBSD, OpenBSD, and Linux. Proprietary kernels (such as DOS, Windows NT, and OS/2) are supported via a chain-loading function. </li></ul> <p>Except for specific compatibility modes (chain-loading and the Linux <em>piggyback</em> format), all kernels will be started in much the same state as in the Multiboot Specification. Only kernels loaded at 1 megabyte or above are presently supported. Any attempt to load below that boundary will simply result in immediate failure and an error message reporting the problem. </p> <p>In addition to the requirements above, GRUB has the following features (note that the Multiboot Specification doesn’t require all the features that GRUB supports): </p> <dl compact="compact"> <dt>Recognize multiple executable formats</dt> <dd><p>Support many of the <em>a.out</em> variants plus <em>ELF</em>. Symbol tables are also loaded. </p> </dd> <dt>Support non-Multiboot kernels</dt> <dd><p>Support many of the various free 32-bit kernels that lack Multiboot compliance (primarily FreeBSD, NetBSD<a name="DOCF2" href="#FOOT2"><sup>2</sup></a>, OpenBSD, and Linux). Chain-loading of other boot loaders is also supported. </p> </dd> <dt>Load multiples modules</dt> <dd><p>Fully support the Multiboot feature of loading multiple modules. </p> </dd> <dt>Load a configuration file</dt> <dd><p>Support a human-readable text configuration file with preset boot commands. You can also load another configuration file dynamically and embed a preset configuration file in a GRUB image file. The list of commands (see <a href="#Commands">Commands</a>) are a superset of those supported on the command-line. An example configuration file is provided in <a href="#Configuration">Configuration</a>. </p> </dd> <dt>Provide a menu interface</dt> <dd><p>A menu interface listing preset boot commands, with a programmable timeout, is available. There is no fixed limit on the number of boot entries, and the current implementation has space for several hundred. </p> </dd> <dt>Have a flexible command-line interface</dt> <dd><p>A fairly flexible command-line interface, accessible from the menu, is available to edit any preset commands, or write a new boot command set from scratch. If no configuration file is present, GRUB drops to the command-line. </p> <p>The list of commands (see <a href="#Commands">Commands</a>) are a subset of those supported for configuration files. Editing commands closely resembles the Bash command-line (see <a href="features.html#Command-Line-Editing">Command Line Editing</a> in <cite>Bash Features</cite>), with <tt class="key">TAB</tt>-completion of commands, devices, partitions, and files in a directory depending on context. </p> </dd> <dt>Support multiple filesystem types</dt> <dd><p>Support multiple filesystem types transparently, plus a useful explicit blocklist notation. The currently supported filesystem types are <em>Amiga Fast FileSystem (AFFS)</em>, <em>AtheOS fs</em>, <em>BeFS</em>, <em>BtrFS</em> (including raid0, raid1, raid10, gzip and lzo), <em>cpio</em> (little- and big-endian bin, odc and newc variants), <em>Linux ext2/ext3/ext4</em>, <em>DOS FAT12/FAT16/FAT32</em>, <em>exFAT</em>, <em>F2FS</em>, <em>HFS</em>, <em>HFS+</em>, <em>ISO9660</em> (including Joliet, Rock-ridge and multi-chunk files), <em>JFS</em>, <em>Minix fs</em> (versions 1, 2 and 3), <em>nilfs2</em>, <em>NTFS</em> (including compression), <em>ReiserFS</em>, <em>ROMFS</em>, <em>Amiga Smart FileSystem (SFS)</em>, <em>Squash4</em>, <em>tar</em>, <em>UDF</em>, <em>BSD UFS/UFS2</em>, <em>XFS</em>, and <em>ZFS</em> (including lzjb, gzip, zle, mirror, stripe, raidz1/2/3 and encryption in AES-CCM and AES-GCM). See <a href="#Filesystem">Filesystem</a>, for more information. </p> </dd> <dt>Support automatic decompression</dt> <dd><p>Can decompress files which were compressed by <code>gzip</code> or <code>xz</code><a name="DOCF3" href="#FOOT3"><sup>3</sup></a>. This function is both automatic and transparent to the user (i.e. all functions operate upon the uncompressed contents of the specified files). This greatly reduces a file size and loading time, a particularly great benefit for floppies.<a name="DOCF4" href="#FOOT4"><sup>4</sup></a> </p> <p>It is conceivable that some kernel modules should be loaded in a compressed state, so a different module-loading command can be specified to avoid uncompressing the modules. </p> </dd> <dt>Access data on any installed device</dt> <dd><p>Support reading data from any or all floppies or hard disk(s) recognized by the BIOS, independent of the setting of the root device. </p> </dd> <dt>Be independent of drive geometry translations</dt> <dd><p>Unlike many other boot loaders, GRUB makes the particular drive translation irrelevant. A drive installed and running with one translation may be converted to another translation without any adverse effects or changes in GRUB’s configuration. </p> </dd> <dt>Detect all installed <small>RAM</small></dt> <dd><p>GRUB can generally find all the installed <small>RAM</small> on a PC-compatible machine. It uses an advanced BIOS query technique for finding all memory regions. As described on the Multiboot Specification (see <a href="http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Top">Motivation</a> in <cite>The Multiboot Specification</cite>), not all kernels make use of this information, but GRUB provides it for those who do. </p> </dd> <dt>Support Logical Block Address mode</dt> <dd><p>In traditional disk calls (called <em>CHS mode</em>), there is a geometry translation problem, that is, the BIOS cannot access over 1024 cylinders, so the accessible space is limited to at least 508 MB and to at most 8GB. GRUB can’t universally solve this problem, as there is no standard interface used in all machines. However, several newer machines have the new interface, Logical Block Address (<em>LBA</em>) mode. GRUB automatically detects if LBA mode is available and uses it if available. In LBA mode, GRUB can access the entire disk. </p> </dd> <dt>Support network booting</dt> <dd><p>GRUB is basically a disk-based boot loader but also has network support. You can load OS images from a network by using the <em>TFTP</em> protocol. </p> </dd> <dt>Support remote terminals</dt> <dd><p>To support computers with no console, GRUB provides remote terminal support, so that you can control GRUB from a remote host. Only serial terminal support is implemented at the moment. </p></dd> </dl> <hr> <a name="Role-of-a-boot-loader"></a> <div class="header"> <p> Previous: <a href="#Features" accesskey="p" rel="prev">Features</a>, Up: <a href="#Introduction" accesskey="u" rel="up">Introduction</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-role-of-a-boot-loader"></a> <h3 class="section">1.5 The role of a boot loader</h3> <p>The following is a quotation from Gordon Matzigkeit, a GRUB fanatic: </p> <blockquote> <p>Some people like to acknowledge both the operating system and kernel when they talk about their computers, so they might say they use “GNU/Linux” or “GNU/Hurd”. Other people seem to think that the kernel is the most important part of the system, so they like to call their GNU operating systems “Linux systems.” </p> <p>I, personally, believe that this is a grave injustice, because the <em>boot loader</em> is the most important software of all. I used to refer to the above systems as either “LILO”<a name="DOCF5" href="#FOOT5"><sup>5</sup></a> or “GRUB” systems. </p> <p>Unfortunately, nobody ever understood what I was talking about; now I just use the word “GNU” as a pseudonym for GRUB. </p> <p>So, if you ever hear people talking about their alleged “GNU” systems, remember that they are actually paying homage to the best boot loader around… GRUB! </p></blockquote> <p>We, the GRUB maintainers, do not (usually) encourage Gordon’s level of fanaticism, but it helps to remember that boot loaders deserve recognition. We hope that you enjoy using GNU GRUB as much as we did writing it. </p> <hr> <a name="Naming-convention"></a> <div class="header"> <p> Next: <a href="#OS_002dspecific-notes-about-grub-tools" accesskey="n" rel="next">OS-specific notes about grub tools</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Naming-convention-1"></a> <h2 class="chapter">2 Naming convention</h2> <p>The device syntax used in GRUB is a wee bit different from what you may have seen before in your operating system(s), and you need to know it so that you can specify a drive/partition. </p> <p>Look at the following examples and explanations: </p> <div class="example"> <pre class="example">(fd0) </pre></div> <p>First of all, GRUB requires that the device name be enclosed with ‘<samp>(</samp>’ and ‘<samp>)</samp>’. The ‘<samp>fd</samp>’ part means that it is a floppy disk. The number ‘<samp>0</samp>’ is the drive number, which is counted from <em>zero</em>. This expression means that GRUB will use the whole floppy disk. </p> <div class="example"> <pre class="example">(hd0,msdos2) </pre></div> <p>Here, ‘<samp>hd</samp>’ means it is a hard disk drive. The first integer ‘<samp>0</samp>’ indicates the drive number, that is, the first hard disk, the string ‘<samp>msdos</samp>’ indicates the partition scheme, while the second integer, ‘<samp>2</samp>’, indicates the partition number (or the <small>PC</small> slice number in the BSD terminology). The partition numbers are counted from <em>one</em>, not from zero (as was the case in previous versions of GRUB). This expression means the second partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk. </p> <div class="example"> <pre class="example">(hd0,msdos5) </pre></div> <p>This specifies the first <em>extended partition</em> of the first hard disk drive. Note that the partition numbers for extended partitions are counted from ‘<samp>5</samp>’, regardless of the actual number of primary partitions on your hard disk. </p> <div class="example"> <pre class="example">(hd1,msdos1,bsd1) </pre></div> <p>This means the BSD ‘<samp>a</samp>’ partition on first <small>PC</small> slice number of the second hard disk. </p> <p>Of course, to actually access the disks or partitions with GRUB, you need to use the device specification in a command, like ‘<samp>set root=(fd0)</samp>’ or ‘<samp>parttool (hd0,msdos3) hidden-</samp>’. To help you find out which number specifies a partition you want, the GRUB command-line (see <a href="#Command_002dline-interface">Command-line interface</a>) options have argument completion. This means that, for example, you only need to type </p> <div class="example"> <pre class="example">set root=( </pre></div> <p>followed by a <tt class="key">TAB</tt>, and GRUB will display the list of drives, partitions, or file names. So it should be quite easy to determine the name of your target partition, even with minimal knowledge of the syntax. </p> <p>Note that GRUB does <em>not</em> distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS. </p> <p>Now the question is, how to specify a file? Again, consider an example: </p> <div class="example"> <pre class="example">(hd0,msdos1)/vmlinuz </pre></div> <p>This specifies the file named ‘<samp>vmlinuz</samp>’, found on the first partition of the first hard disk drive. Note that the argument completion works with file names, too. </p> <p>That was easy, admit it. Now read the next chapter, to find out how to actually install GRUB on your drive. </p> <hr> <a name="OS_002dspecific-notes-about-grub-tools"></a> <div class="header"> <p> Next: <a href="#Installation" accesskey="n" rel="next">Installation</a>, Previous: <a href="#Naming-convention" accesskey="p" rel="prev">Naming convention</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="OS_002dspecific-notes-about-grub-tools-1"></a> <h2 class="chapter">3 OS-specific notes about grub tools</h2> <p>On OS which have device nodes similar to Unix-like OS GRUB tools use the OS name. E.g. for GNU/Linux: </p> <div class="example"> <pre class="example"># <kbd>grub2-install /dev/sda</kbd> </pre></div> <p>On AROS we use another syntax. For volumes: </p> <div class="example"> <pre class="example">//:<volume name> </pre></div> <p>E.g. </p> <div class="example"> <pre class="example">//:DH0 </pre></div> <p>For disks we use syntax: </p><div class="example"> <pre class="example">//:<driver name>/unit/flags </pre></div> <p>E.g. </p> <div class="example"> <pre class="example"># <kbd>grub2-install //:ata.device/0/0</kbd> </pre></div> <p>On Windows we use UNC path. For volumes it’s typically </p> <div class="example"> <pre class="example">\\?\Volume{<GUID>} \\?\<drive letter>: </pre></div> <p>E.g. </p> <div class="example"> <pre class="example">\\?\Volume{17f34d50-cf64-4b02-800e-51d79c3aa2ff} \\?\C: </pre></div> <p>For disks it’s </p> <div class="example"> <pre class="example">\\?\PhysicalDrive<number> </pre></div> <p>E.g. </p> <div class="example"> <pre class="example"># <kbd>grub2-install \\?\PhysicalDrive0</kbd> </pre></div> <p>Beware that you may need to further escape the backslashes depending on your shell. </p> <p>When compiled with cygwin support then cygwin drive names are automatically when needed. E.g. </p> <div class="example"> <pre class="example"># <kbd>grub2-install /dev/sda</kbd> </pre></div> <hr> <a name="Installation"></a> <div class="header"> <p> Next: <a href="#Booting" accesskey="n" rel="next">Booting</a>, Previous: <a href="#OS_002dspecific-notes-about-grub-tools" accesskey="p" rel="prev">OS-specific notes about grub tools</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Installation-1"></a> <h2 class="chapter">4 Installation</h2> <p>In order to install GRUB as your boot loader, you need to first install the GRUB system and utilities under your UNIX-like operating system (see <a href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>). You can do this either from the source tarball, or as a package for your OS. </p> <p>After you have done that, you need to install the boot loader on a drive (floppy or hard disk) by using the utility <code>grub2-install</code> (see <a href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>) on a UNIX-like OS. </p> <p>GRUB comes with boot images, which are normally put in the directory <samp>/usr/lib/grub/<cpu>-<platform></samp> (for BIOS-based machines <samp>/usr/lib/grub/i386-pc</samp>). Hereafter, the directory where GRUB images are initially placed (normally <samp>/usr/lib/grub/<cpu>-<platform></samp>) will be called the <em>image directory</em>, and the directory where the boot loader needs to find them (usually <samp>/boot</samp>) will be called the <em>boot directory</em>. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Installing-GRUB-using-grub2_002dinstall" accesskey="1">Installing GRUB using grub2-install</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Making-a-GRUB-bootable-CD_002dROM" accesskey="2">Making a GRUB bootable CD-ROM</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Device-map" accesskey="3">Device map</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#BIOS-installation" accesskey="4">BIOS installation</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Installing-GRUB-using-grub2_002dinstall"></a> <div class="header"> <p> Next: <a href="#Making-a-GRUB-bootable-CD_002dROM" accesskey="n" rel="next">Making a GRUB bootable CD-ROM</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Installing-GRUB-using-grub2_002dinstall-1"></a> <h3 class="section">4.1 Installing GRUB using grub2-install</h3> <p>For information on where GRUB should be installed on PC BIOS platforms, see <a href="#BIOS-installation">BIOS installation</a>. </p> <p>In order to install GRUB under a UNIX-like OS (such as <small>GNU</small>), invoke the program <code>grub2-install</code> (see <a href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>) as the superuser (<em>root</em>). </p> <p>The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The argument has to be either a device file (like ‘<samp>/dev/hda</samp>’). For example, under Linux the following will install GRUB into the MBR of the first IDE disk: </p> <div class="example"> <pre class="example"># <kbd>grub2-install /dev/sda</kbd> </pre></div> <p>Likewise, under GNU/Hurd, this has the same effect: </p> <div class="example"> <pre class="example"># <kbd>grub2-install /dev/hd0</kbd> </pre></div> <p>But all the above examples assume that GRUB should put images under the <samp>/boot</samp> directory. If you want GRUB to put images under a directory other than <samp>/boot</samp>, you need to specify the option <samp>--boot-directory</samp>. The typical usage is that you create a GRUB boot floppy with a filesystem. Here is an example: </p> <div class="example"> <pre class="example"># <kbd>mke2fs /dev/fd0</kbd> # <kbd>mount -t ext2 /dev/fd0 /mnt</kbd> # <kbd>mkdir /mnt/boot</kbd> # <kbd>grub2-install --boot-directory=/mnt/boot /dev/fd0</kbd> # <kbd>umount /mnt</kbd> </pre></div> <p>Some BIOSes have a bug of exposing the first partition of a USB drive as a floppy instead of exposing the USB drive as a hard disk (they call it “USB-FDD” boot). In such cases, you need to install like this: </p> <div class="example"> <pre class="example"># <kbd>losetup /dev/loop0 /dev/sdb1</kbd> # <kbd>mount /dev/loop0 /mnt/usb</kbd> # <kbd>grub2-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0</kbd> </pre></div> <p>This install doesn’t conflict with standard install as long as they are in separate directories. </p> <p>On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at <samp>/boot/efi</samp> then you don’t need any special arguments: </p> <div class="example"> <pre class="example"># <kbd>grub2-install</kbd> </pre></div> <p>Otherwise you need to specify where your EFI System partition is mounted: </p> <div class="example"> <pre class="example"># <kbd>grub2-install --efi-directory=/mnt/efi</kbd> </pre></div> <p>For removable installs you have to use <samp>--removable</samp> and specify both <samp>--boot-directory</samp> and <samp>--efi-directory</samp>: </p> <div class="example"> <pre class="example"># <kbd>grub2-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable</kbd> </pre></div> <hr> <a name="Making-a-GRUB-bootable-CD_002dROM"></a> <div class="header"> <p> Next: <a href="#Device-map" accesskey="n" rel="next">Device map</a>, Previous: <a href="#Installing-GRUB-using-grub2_002dinstall" accesskey="p" rel="prev">Installing GRUB using grub2-install</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Making-a-GRUB-bootable-CD_002dROM-1"></a> <h3 class="section">4.2 Making a GRUB bootable CD-ROM</h3> <p>GRUB supports the <em>no emulation mode</em> in the El Torito specification<a name="DOCF6" href="#FOOT6"><sup>6</sup></a>. This means that you can use the whole CD-ROM from GRUB and you don’t have to make a floppy or hard disk image file, which can cause compatibility problems. </p> <p>For booting from a CD-ROM, GRUB uses a special image called <samp>cdboot.img</samp>, which is concatenated with <samp>core.img</samp>. The <samp>core.img</samp> used for this should be built with at least the ‘<samp>iso9660</samp>’ and ‘<samp>biosdisk</samp>’ modules. Your bootable CD-ROM will usually also need to include a configuration file <samp>grub.cfg</samp> and some other GRUB modules. </p> <p>To make a simple generic GRUB rescue CD, you can use the <code>grub2-mkrescue</code> program (see <a href="#Invoking-grub2_002dmkrescue">Invoking grub2-mkrescue</a>): </p> <div class="example"> <pre class="example">$ <kbd>grub2-mkrescue -o grub.iso</kbd> </pre></div> <p>You will often need to include other files in your image. To do this, first make a top directory for the bootable image, say, ‘<samp>iso</samp>’: </p> <div class="example"> <pre class="example">$ <kbd>mkdir iso</kbd> </pre></div> <p>Make a directory for GRUB: </p> <div class="example"> <pre class="example">$ <kbd>mkdir -p iso/boot/grub</kbd> </pre></div> <p>If desired, make the config file <samp>grub.cfg</samp> under <samp>iso/boot/grub</samp> (see <a href="#Configuration">Configuration</a>), and copy any files and directories for the disc to the directory <samp>iso/</samp>. </p> <p>Finally, make the image: </p> <div class="example"> <pre class="example">$ <kbd>grub2-mkrescue -o grub.iso iso</kbd> </pre></div> <p>This produces a file named <samp>grub.iso</samp>, which then can be burned into a CD (or a DVD), or written to a USB mass storage device. </p> <p>The root device will be set up appropriately on entering your <samp>grub.cfg</samp> configuration file, so you can refer to file names on the CD without needing to use an explicit device name. This makes it easier to produce rescue images that will work on both optical drives and USB mass storage devices. </p> <hr> <a name="Device-map"></a> <div class="header"> <p> Next: <a href="#BIOS-installation" accesskey="n" rel="next">BIOS installation</a>, Previous: <a href="#Making-a-GRUB-bootable-CD_002dROM" accesskey="p" rel="prev">Making a GRUB bootable CD-ROM</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-map-between-BIOS-drives-and-OS-devices"></a> <h3 class="section">4.3 The map between BIOS drives and OS devices</h3> <p>If the device map file exists, the GRUB utilities (<code>grub2-probe</code>, etc.) read it to map BIOS drives to OS devices. This file consists of lines like this: </p> <div class="example"> <pre class="example">(<var>device</var>) <var>file</var> </pre></div> <p><var>device</var> is a drive specified in the GRUB syntax (see <a href="#Device-syntax">Device syntax</a>), and <var>file</var> is an OS file, which is normally a device file. </p> <p>Historically, the device map file was used because GRUB device names had to be used in the configuration file, and they were derived from BIOS drive numbers. The map between BIOS drives and OS devices cannot always be guessed correctly: for example, GRUB will get the order wrong if you exchange the boot sequence between IDE and SCSI in your BIOS. </p> <p>Unfortunately, even OS device names are not always stable. Modern versions of the Linux kernel may probe drives in a different order from boot to boot, and the prefix (<samp>/dev/hd*</samp> versus <samp>/dev/sd*</samp>) may change depending on the driver subsystem in use. As a result, the device map file required frequent editing on some systems. </p> <p>GRUB avoids this problem nowadays by using UUIDs or file system labels when generating <samp>grub.cfg</samp>, and we advise that you do the same for any custom menu entries you write. If the device map file does not exist, then the GRUB utilities will assume a temporary device map on the fly. This is often good enough, particularly in the common case of single-disk systems. </p> <p>However, the device map file is not entirely obsolete yet, and it is used for overriding when current environment is different from the one on boot. Most common case is if you use a partition or logical volume as a disk for virtual machine. You can put any comments in the file if needed, as the GRUB utilities assume that a line is just a comment if the first character is ‘<samp>#</samp>’. </p> <hr> <a name="BIOS-installation"></a> <div class="header"> <p> Previous: <a href="#Device-map" accesskey="p" rel="prev">Device map</a>, Up: <a href="#Installation" accesskey="u" rel="up">Installation</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="BIOS-installation-1"></a> <h3 class="section">4.4 BIOS installation</h3> <a name="MBR"></a> <h3 class="heading">MBR</h3> <p>The partition table format traditionally used on PC BIOS platforms is called the Master Boot Record (MBR) format; this is the format that allows up to four primary partitions and additional logical partitions. With this partition table format, there are two ways to install GRUB: it can be embedded in the area between the MBR and the first partition (called by various names, such as the "boot track", "MBR gap", or "embedding area", and which is usually at least 31 KiB), or the core image can be installed in a file system and a list of the blocks that make it up can be stored in the first sector of that partition. </p> <p>Each of these has different problems. There is no way to reserve space in the embedding area with complete safety, and some proprietary software is known to use it to make it difficult for users to work around licensing restrictions; and systems are sometimes partitioned without leaving enough space before the first partition. On the other hand, installing to a filesystem means that GRUB is vulnerable to its blocks being moved around by filesystem features such as tail packing, or even by aggressive fsck implementations, so this approach is quite fragile; and this approach can only be used if the <samp>/boot</samp> filesystem is on the same disk that the BIOS boots from, so that GRUB does not have to rely on guessing BIOS drive numbers. </p> <p>The GRUB development team generally recommends embedding GRUB before the first partition, unless you have special requirements. You must ensure that the first partition starts at least 31 KiB (63 sectors) from the start of the disk; on modern disks, it is often a performance advantage to align partitions on larger boundaries anyway, so the first partition might start 1 MiB from the start of the disk. </p> <a name="GPT"></a> <h3 class="heading">GPT</h3> <p>Some newer systems use the GUID Partition Table (GPT) format. This was specified as part of the Extensible Firmware Interface (EFI), but it can also be used on BIOS platforms if system software supports it; for example, GRUB and GNU/Linux can be used in this configuration. With this format, it is possible to reserve a whole partition for GRUB, called the BIOS Boot Partition. GRUB can then be embedded into that partition without the risk of being overwritten by other software and without being contained in a filesystem which might move its blocks around. </p> <p>When creating a BIOS Boot Partition on a GPT system, you should make sure that it is at least 31 KiB in size. (GPT-formatted disks are not usually particularly small, so we recommend that you make it larger than the bare minimum, such as 1 MiB, to allow plenty of room for growth.) You must also make sure that it has the proper partition type. Using GNU Parted, you can set this using a command such as the following: </p> <div class="example"> <pre class="example"># <kbd>parted /dev/<var>disk</var> set <var>partition-number</var> bios_grub on</kbd> </pre></div> <p>If you are using gdisk, set the partition type to ‘<samp>0xEF02</samp>’. With partitioning programs that require setting the GUID directly, it should be ‘<samp>21686148-6449-6e6f-744e656564454649</samp>’. </p> <p><strong>Caution:</strong> Be very careful which partition you select! When GRUB finds a BIOS Boot Partition during installation, it will automatically overwrite part of it. Make sure that the partition does not contain any other data. </p> <hr> <a name="Booting"></a> <div class="header"> <p> Next: <a href="#Configuration" accesskey="n" rel="next">Configuration</a>, Previous: <a href="#Installation" accesskey="p" rel="prev">Installation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Booting-1"></a> <h2 class="chapter">5 Booting</h2> <p>GRUB can load Multiboot-compliant kernels in a consistent way, but for some free operating systems you need to use some OS-specific magic. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#General-boot-methods" accesskey="1">General boot methods</a>:</td><td> </td><td align="left" valign="top">How to boot OSes with GRUB generally </td></tr> <tr><td align="left" valign="top">• <a href="#Loopback-booting" accesskey="2">Loopback booting</a>:</td><td> </td><td align="left" valign="top">Notes on booting from loopbacks </td></tr> <tr><td align="left" valign="top">• <a href="#OS_002dspecific-notes" accesskey="3">OS-specific notes</a>:</td><td> </td><td align="left" valign="top">Notes on some operating systems </td></tr> </table> <hr> <a name="General-boot-methods"></a> <div class="header"> <p> Next: <a href="#Loopback-booting" accesskey="n" rel="next">Loopback booting</a>, Up: <a href="#Booting" accesskey="u" rel="up">Booting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="How-to-boot-operating-systems"></a> <h3 class="section">5.1 How to boot operating systems</h3> <p>GRUB has two distinct boot methods. One of the two is to load an operating system directly, and the other is to chain-load another boot loader which then will load an operating system actually. Generally speaking, the former is more desirable, because you don’t need to install or maintain other boot loaders and GRUB is flexible enough to load an operating system from an arbitrary disk/partition. However, the latter is sometimes required, since GRUB doesn’t support all the existing operating systems natively. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Loading-an-operating-system-directly" accesskey="1">Loading an operating system directly</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Chain_002dloading" accesskey="2">Chain-loading</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Loading-an-operating-system-directly"></a> <div class="header"> <p> Next: <a href="#Chain_002dloading" accesskey="n" rel="next">Chain-loading</a>, Up: <a href="#General-boot-methods" accesskey="u" rel="up">General boot methods</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="How-to-boot-an-OS-directly-with-GRUB"></a> <h4 class="subsection">5.1.1 How to boot an OS directly with GRUB</h4> <p>Multiboot (see <a href="http://www.gnu.org/software/grub/manual/multiboot/multiboot.html#Top">Motivation</a> in <cite>The Multiboot Specification</cite>) is the native format supported by GRUB. For the sake of convenience, there is also support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to boot other operating systems, you will have to chain-load them (see <a href="#Chain_002dloading">Chain-loading</a>). </p> <p>FIXME: this section is incomplete. </p> <ol> <li> Run the command <code>boot</code> (see <a href="#boot">boot</a>). </li></ol> <p>However, DOS and Windows have some deficiencies, so you might have to use more complicated instructions. See <a href="#DOS_002fWindows">DOS/Windows</a>, for more information. </p> <hr> <a name="Chain_002dloading"></a> <div class="header"> <p> Previous: <a href="#Loading-an-operating-system-directly" accesskey="p" rel="prev">Loading an operating system directly</a>, Up: <a href="#General-boot-methods" accesskey="u" rel="up">General boot methods</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Chain_002dloading-an-OS"></a> <h4 class="subsection">5.1.2 Chain-loading an OS</h4> <p>Operating systems that do not support Multiboot and do not have specific support in GRUB (specific support is available for Linux, FreeBSD, NetBSD and OpenBSD) must be chain-loaded, which involves loading another boot loader and jumping to it in real mode. </p> <p>The <code>chainloader</code> command (see <a href="#chainloader">chainloader</a>) is used to set this up. It is normally also necessary to load some GRUB modules and set the appropriate root device. Putting this together, we get something like this, for a Windows system on the first partition of the first hard disk: </p> <pre class="verbatim">menuentry "Windows" { insmod chain insmod ntfs set root=(hd0,1) chainloader +1 } </pre> <p>On systems with multiple hard disks, an additional workaround may be required. See <a href="#DOS_002fWindows">DOS/Windows</a>. </p> <p>Chain-loading is only supported on PC BIOS and EFI platforms. </p> <hr> <a name="Loopback-booting"></a> <div class="header"> <p> Next: <a href="#OS_002dspecific-notes" accesskey="n" rel="next">OS-specific notes</a>, Previous: <a href="#General-boot-methods" accesskey="p" rel="prev">General boot methods</a>, Up: <a href="#Booting" accesskey="u" rel="up">Booting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Loopback-booting-1"></a> <h3 class="section">5.2 Loopback booting</h3> <p>GRUB is able to read from an image (be it one of CD or HDD) stored on any of its accessible storages (refer to see <a href="#loopback">loopback</a> command). However the OS itself should be able to find its root. This usually involves running a userspace program running before the real root is discovered. This is achieved by GRUB loading a specially made small image and passing it as ramdisk to the kernel. This is achieved by commands <code>kfreebsd_module</code>, <code>knetbsd_module_elf</code>, <code>kopenbsd_ramdisk</code>, <code>initrd</code> (see <a href="#initrd">initrd</a>), <code>initrd16</code> (see <a href="#initrd">initrd</a>), <code>multiboot_module</code>, <code>multiboot2_module</code> or <code>xnu_ramdisk</code> depending on the loader. Note that for knetbsd the image must be put inside miniroot.kmod and the whole miniroot.kmod has to be loaded. In kopenbsd payload this is disabled by default. Aditionally behaviour of initial ramdisk depends on command line options. Several distributors provide the image for this purpose or it’s integrated in their standard ramdisk and activated by special option. Consult your kernel and distribution manual for more details. Other loaders like appleloader, chainloader (BIOS, EFI, coreboot), freedos, ntldr and plan9 provide no possibility of loading initial ramdisk and as far as author is aware the payloads in question don’t support either initial ramdisk or discovering loopback boot in other way and as such not bootable this way. Please consider alternative boot methods like copying all files from the image to actual partition. Consult your OS documentation for more details </p> <hr> <a name="OS_002dspecific-notes"></a> <div class="header"> <p> Previous: <a href="#Loopback-booting" accesskey="p" rel="prev">Loopback booting</a>, Up: <a href="#Booting" accesskey="u" rel="up">Booting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Some-caveats-on-OS_002dspecific-issues"></a> <h3 class="section">5.3 Some caveats on OS-specific issues</h3> <p>Here, we describe some caveats on several operating systems. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#GNU_002fHurd" accesskey="1">GNU/Hurd</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#GNU_002fLinux" accesskey="2">GNU/Linux</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#NetBSD" accesskey="3">NetBSD</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#DOS_002fWindows" accesskey="4">DOS/Windows</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="GNU_002fHurd"></a> <div class="header"> <p> Next: <a href="#GNU_002fLinux" accesskey="n" rel="next">GNU/Linux</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">OS-specific notes</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GNU_002fHurd-1"></a> <h4 class="subsection">5.3.1 GNU/Hurd</h4> <p>Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is nothing special about it. But do not forget that you have to specify a root partition to the kernel. </p> <ol> <li> Set GRUB’s root device to the same drive as GNU/Hurd’s. The command <code>search --set=root --file /boot/gnumach.gz</code> or similar may help you (see <a href="#search">search</a>). </li><li> Load the kernel and the modules, like this: <div class="example"> <pre class="example">grub> <kbd>multiboot /boot/gnumach.gz root=device:hd0s1</kbd> grub> <kbd>module /hurd/ext2fs.static ext2fs --readonly \ --multiboot-command-line='${kernel-command-line}' \ --host-priv-port='${host-port}' \ --device-master-port='${device-port}' \ --exec-server-task='${exec-task}' -T typed '${root}' \ '$(task-create)' '$(task-resume)'</kbd> grub> <kbd>module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'</kbd> </pre></div> </li><li> Finally, run the command <code>boot</code> (see <a href="#boot">boot</a>). </li></ol> <hr> <a name="GNU_002fLinux"></a> <div class="header"> <p> Next: <a href="#NetBSD" accesskey="n" rel="next">NetBSD</a>, Previous: <a href="#GNU_002fHurd" accesskey="p" rel="prev">GNU/Hurd</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">OS-specific notes</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GNU_002fLinux-1"></a> <h4 class="subsection">5.3.2 GNU/Linux</h4> <p>It is relatively easy to boot GNU/Linux from GRUB, because it somewhat resembles to boot a Multiboot-compliant OS. </p> <ol> <li> Set GRUB’s root device to the same drive as GNU/Linux’s. The command <code>search --set=root --file /vmlinuz</code> or similar may help you (see <a href="#search">search</a>). </li><li> Load the kernel using the command <code>linux</code> (see <a href="#linux">linux</a>): <div class="example"> <pre class="example">grub> <kbd>linux /vmlinuz root=/dev/sda1</kbd> </pre></div> <p>If you need to specify some kernel parameters, just append them to the command. For example, to set <samp>acpi</samp> to ‘<samp>off</samp>’, do this: </p> <div class="example"> <pre class="example">grub> <kbd>linux /vmlinuz root=/dev/sda1 acpi=off</kbd> </pre></div> <p>See the documentation in the Linux source tree for complete information on the available options. </p> <p>With <code>linux</code> GRUB uses 32-bit protocol. Some BIOS services like APM or EDD aren’t available with this protocol. In this case you need to use <code>linux16</code> </p> <div class="example"> <pre class="example">grub> <kbd>linux16 /vmlinuz root=/dev/sda1 acpi=off</kbd> </pre></div> </li><li> If you use an initrd, execute the command <code>initrd</code> (see <a href="#initrd">initrd</a>) after <code>linux</code>: <div class="example"> <pre class="example">grub> <kbd>initrd /initrd</kbd> </pre></div> <p>If you used <code>linux16</code> you need to use <code>initrd16</code>: </p> <div class="example"> <pre class="example">grub> <kbd>initrd16 /initrd</kbd> </pre></div> </li><li> Finally, run the command <code>boot</code> (see <a href="#boot">boot</a>). </li></ol> <p><strong>Caution:</strong> If you use an initrd and specify the ‘<samp>mem=</samp>’ option to the kernel to let it use less than actual memory size, you will also have to specify the same memory size to GRUB. To let GRUB know the size, run the command <code>uppermem</code> <em>before</em> loading the kernel. See <a href="#uppermem">uppermem</a>, for more information. </p> <hr> <a name="NetBSD"></a> <div class="header"> <p> Next: <a href="#DOS_002fWindows" accesskey="n" rel="next">DOS/Windows</a>, Previous: <a href="#GNU_002fLinux" accesskey="p" rel="prev">GNU/Linux</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">OS-specific notes</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="NetBSD-1"></a> <h4 class="subsection">5.3.3 NetBSD</h4> <p>Booting a NetBSD kernel from GRUB is also relatively easy: first set GRUB’s root device, then load the kernel and the modules, and finally run <code>boot</code>. </p> <ol> <li> Set GRUB’s root device to the partition holding the NetBSD root file system. For a disk with a NetBSD disk label, this is usually the first partition (a:). In that case, and assuming that the partition is on the first hard disk, set GRUB’s root device as follows: <div class="example"> <pre class="example">grub> <kbd>insmod part_bsd</kbd> grub> <kbd>set root=(hd0,netbsd1)</kbd> </pre></div> <p>For a disk with a GUID Partition Table (GPT), and assuming that the NetBSD root partition is the third GPT partition, do this: </p> <div class="example"> <pre class="example">grub> <kbd>insmod part_gpt</kbd> grub> <kbd>set root=(hd0,gpt3)</kbd> </pre></div> </li><li> Load the kernel using the command <code>knetbsd</code>: <div class="example"> <pre class="example">grub> <kbd>knetbsd /netbsd</kbd> </pre></div> <p>Various options may be given to <code>knetbsd</code>. These options are, for the most part, the same as in the NetBSD boot loader. For instance, to boot the system in single-user mode and with verbose messages, do this: </p> <div class="example"> <pre class="example">grub> <kbd>knetbsd /netbsd -s -v</kbd> </pre></div> </li><li> If needed, load kernel modules with the command <code>knetbsd_module_elf</code>. A typical example is the module for the root file system: <div class="example"> <pre class="example">grub> <kbd>knetbsd_module_elf /stand/amd64/6.0/modules/ffs/ffs.kmod</kbd> </pre></div> </li><li> Finally, run the command <code>boot</code> (see <a href="#boot">boot</a>). </li></ol> <hr> <a name="DOS_002fWindows"></a> <div class="header"> <p> Previous: <a href="#NetBSD" accesskey="p" rel="prev">NetBSD</a>, Up: <a href="#OS_002dspecific-notes" accesskey="u" rel="up">OS-specific notes</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="DOS_002fWindows-1"></a> <h4 class="subsection">5.3.4 DOS/Windows</h4> <p>GRUB cannot boot DOS or Windows directly, so you must chain-load them (see <a href="#Chain_002dloading">Chain-loading</a>). However, their boot loaders have some critical deficiencies, so it may not work to just chain-load them. To overcome the problems, GRUB provides you with two helper functions. </p> <p>If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command <code>drivemap</code> (see <a href="#drivemap">drivemap</a>), like this: </p> <div class="example"> <pre class="example">drivemap -s (hd0) (hd1) </pre></div> <p>This performs a <em>virtual</em> swap between your first and second hard drive. </p> <p><strong>Caution:</strong> This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won’t work. </p> <p>Another problem arises if you installed more than one set of DOS/Windows onto one disk, because they could be confused if there are more than one primary partitions for DOS/Windows. Certainly you should avoid doing this, but there is a solution if you do want to do so. Use the partition hiding/unhiding technique. </p> <p>If GRUB <em>hides</em> a DOS (or Windows) partition (see <a href="#parttool">parttool</a>), DOS (or Windows) will ignore the partition. If GRUB <em>unhides</em> a DOS (or Windows) partition, DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition, do the following: </p> <div class="example"> <pre class="example">parttool (hd0,1) hidden- parttool (hd0,2) hidden+ set root=(hd0,1) chainloader +1 parttool <tt>${root}</tt> boot+ boot </pre></div> <hr> <a name="Configuration"></a> <div class="header"> <p> Next: <a href="#Theme-file-format" accesskey="n" rel="next">Theme file format</a>, Previous: <a href="#Booting" accesskey="p" rel="prev">Booting</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Writing-your-own-configuration-file"></a> <h2 class="chapter">6 Writing your own configuration file</h2> <p>GRUB is configured using <samp>grub.cfg</samp>, usually located under <samp>/boot/grub</samp>. This file is quite flexible, but most users will not need to write the whole thing by hand. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Simple-configuration" accesskey="1">Simple configuration</a>:</td><td> </td><td align="left" valign="top">Recommended for most users </td></tr> <tr><td align="left" valign="top">• <a href="#Root-Identifcation-Heuristics" accesskey="2">Root Identifcation Heuristics</a>:</td><td> </td><td align="left" valign="top">Summary on how the root file system is identified. </td></tr> <tr><td align="left" valign="top">• <a href="#Shell_002dlike-scripting" accesskey="3">Shell-like scripting</a>:</td><td> </td><td align="left" valign="top">For power users and developers </td></tr> <tr><td align="left" valign="top">• <a href="#Multi_002dboot-manual-config" accesskey="4">Multi-boot manual config</a>:</td><td> </td><td align="left" valign="top">For non-standard multi-OS scenarios </td></tr> <tr><td align="left" valign="top">• <a href="#Embedded-configuration" accesskey="5">Embedded configuration</a>:</td><td> </td><td align="left" valign="top">Embedding a configuration file into GRUB </td></tr> </table> <hr> <a name="Simple-configuration"></a> <div class="header"> <p> Next: <a href="#Root-Identifcation-Heuristics" accesskey="n" rel="next">Root Identifcation Heuristics</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Simple-configuration-handling"></a> <h3 class="section">6.1 Simple configuration handling</h3> <p>The program <code>grub2-mkconfig</code> (see <a href="#Invoking-grub2_002dmkconfig">Invoking grub2-mkconfig</a>) generates <samp>grub.cfg</samp> files suitable for most cases. It is suitable for use when upgrading a distribution, and will discover available kernels and attempt to generate menu entries for them. </p> <p><code>grub2-mkconfig</code> does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing <samp>/etc/grub.d/40_custom</samp> or creating <samp>/boot/grub2/custom.cfg</samp>, changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in <samp>/etc/grub.d/</samp>. This may be improved in the future. In the meantime, those who feel that it would be easier to write <samp>grub.cfg</samp> directly are encouraged to do so (see <a href="#Booting">Booting</a>, and <a href="#Shell_002dlike-scripting">Shell-like scripting</a>), and to disable any system provided by their distribution to automatically run <code>grub2-mkconfig</code>. </p> <p>The file <samp>/etc/default/grub</samp> controls the operation of <code>grub2-mkconfig</code>. It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ‘<samp>KEY=value</samp>’ lines, but if the value contains spaces or other special characters then it must be quoted. For example: </p> <div class="example"> <pre class="example">GRUB_TERMINAL_INPUT="console serial" </pre></div> <p>Valid keys in <samp>/etc/default/grub</samp> are as follows: </p> <dl compact="compact"> <dt>‘<samp>GRUB_DEFAULT</samp>’</dt> <dd><p>The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string ‘<samp>saved</samp>’. Using the id may be useful if you want to set a menu entry as the default even though there may be a variable number of entries before it. </p> <p>For example, if you have: </p> <pre class="verbatim">menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux { ... } </pre> <p>then you can make this the default using: </p> <div class="example"> <pre class="example">GRUB_DEFAULT=example-gnu-linux </pre></div> <p>Previously it was documented the way to use entry title. While this still works it’s not recommended since titles often contain unstable device names and may be translated </p> <p>If you set this to ‘<samp>saved</samp>’, then the default menu entry will be that saved by ‘<samp>GRUB_SAVEDEFAULT</samp>’ or <code>grub2-set-default</code>. This relies on the environment block, which may not be available in all situations (see <a href="#Environment-block">Environment block</a>). </p> <p>The default is ‘<samp>0</samp>’. </p> </dd> <dt>‘<samp>GRUB_SAVEDEFAULT</samp>’</dt> <dd><p>If this option is set to ‘<samp>true</samp>’, then, when an entry is selected, save it as a new default entry for use by future runs of GRUB. This is only useful if ‘<samp>GRUB_DEFAULT=saved</samp>’; it is a separate option because ‘<samp>GRUB_DEFAULT=saved</samp>’ is useful without this option, in conjunction with <code>grub2-set-default</code>. Unset by default. This option relies on the environment block, which may not be available in all situations (see <a href="#Environment-block">Environment block</a>). </p> </dd> <dt>‘<samp>GRUB_TIMEOUT</samp>’</dt> <dd><p>Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is ‘<samp>5</samp>’. Set to ‘<samp>0</samp>’ to boot immediately without displaying the menu, or to ‘<samp>-1</samp>’ to wait indefinitely. </p> <p>If ‘<samp>GRUB_TIMEOUT_STYLE</samp>’ is set to ‘<samp>countdown</samp>’ or ‘<samp>hidden</samp>’, the timeout is instead counted before the menu is displayed. </p> </dd> <dt>‘<samp>GRUB_TIMEOUT_STYLE</samp>’</dt> <dd><p>If this option is unset or set to ‘<samp>menu</samp>’, then GRUB will display the menu and then wait for the timeout set by ‘<samp>GRUB_TIMEOUT</samp>’ to expire before booting the default entry. Pressing a key interrupts the timeout. </p> <p>If this option is set to ‘<samp>countdown</samp>’ or ‘<samp>hidden</samp>’, then, before displaying the menu, GRUB will wait for the timeout set by ‘<samp>GRUB_TIMEOUT</samp>’ to expire. If <tt class="key">ESC</tt> is pressed during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the ‘<samp>countdown</samp>’ case, it will show a one-line indication of the remaining time. </p> </dd> <dt>‘<samp>GRUB_DEFAULT_BUTTON</samp>’</dt> <dt>‘<samp>GRUB_TIMEOUT_BUTTON</samp>’</dt> <dt>‘<samp>GRUB_TIMEOUT_STYLE_BUTTON</samp>’</dt> <dt>‘<samp>GRUB_BUTTON_CMOS_ADDRESS</samp>’</dt> <dd><p>Variants of the corresponding variables without the ‘<samp>_BUTTON</samp>’ suffix, used to support vendor-specific power buttons. See <a href="#Vendor-power_002don-keys">Vendor power-on keys</a>. </p> </dd> <dt>‘<samp>GRUB_DISTRIBUTOR</samp>’</dt> <dd><p>Set by distributors of GRUB to their identifying name. This is used to generate more informative menu entry titles. </p> </dd> <dt>‘<samp>GRUB_TERMINAL_INPUT</samp>’</dt> <dd><p>Select the terminal input device. You may select multiple devices here, separated by spaces. </p> <p>Valid terminal input names depend on the platform, but may include ‘<samp>console</samp>’ (native platform console), ‘<samp>serial</samp>’ (serial terminal), ‘<samp>serial_<port></samp>’ (serial terminal with explicit port selection), ‘<samp>at_keyboard</samp>’ (PC AT keyboard), or ‘<samp>usb_keyboard</samp>’ (USB keyboard using the HID Boot Protocol, for cases where the firmware does not handle this). </p> <p>The default is to use the platform’s native terminal input. </p> </dd> <dt>‘<samp>GRUB_TERMINAL_OUTPUT</samp>’</dt> <dd><p>Select the terminal output device. You may select multiple devices here, separated by spaces. </p> <p>Valid terminal output names depend on the platform, but may include ‘<samp>console</samp>’ (native platform console), ‘<samp>serial</samp>’ (serial terminal), ‘<samp>serial_<port></samp>’ (serial terminal with explicit port selection), ‘<samp>gfxterm</samp>’ (graphics-mode output), ‘<samp>vga_text</samp>’ (VGA text output), ‘<samp>mda_text</samp>’ (MDA text output), ‘<samp>morse</samp>’ (Morse-coding using system beeper) or ‘<samp>spkmodem</samp>’ (simple data protocol using system speaker). </p> <p>‘<samp>spkmodem</samp>’ is useful when no serial port is available. Connect the output of sending system (where GRUB is running) to line-in of receiving system (usually developer machine). On receiving system compile ‘<samp>spkmodem-recv</samp>’ from ‘<samp>util/spkmodem-recv.c</samp>’ and run: </p> <div class="example"> <pre class="example">parecord --channels=1 --rate=48000 --format=s16le | ./spkmodem-recv </pre></div> <p>The default is to use the platform’s native terminal output. </p> </dd> <dt>‘<samp>GRUB_TERMINAL</samp>’</dt> <dd><p>If this option is set, it overrides both ‘<samp>GRUB_TERMINAL_INPUT</samp>’ and ‘<samp>GRUB_TERMINAL_OUTPUT</samp>’ to the same value. </p> </dd> <dt>‘<samp>GRUB_SERIAL_COMMAND</samp>’</dt> <dd><p>A command to configure the serial port when using the serial console. See <a href="#serial">serial</a>. Defaults to ‘<samp>serial</samp>’. </p> </dd> <dt>‘<samp>GRUB_CMDLINE_LINUX</samp>’</dt> <dd><p>Command-line arguments to add to menu entries for the Linux kernel. </p> </dd> <dt>‘<samp>GRUB_CMDLINE_LINUX_DEFAULT</samp>’</dt> <dd><p>Unless ‘<samp>GRUB_DISABLE_RECOVERY</samp>’ is set to ‘<samp>true</samp>’, two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the default menu entry, after those listed in ‘<samp>GRUB_CMDLINE_LINUX</samp>’. </p> </dd> <dt>‘<samp>GRUB_CMDLINE_NETBSD</samp>’</dt> <dt>‘<samp>GRUB_CMDLINE_NETBSD_DEFAULT</samp>’</dt> <dd><p>As ‘<samp>GRUB_CMDLINE_LINUX</samp>’ and ‘<samp>GRUB_CMDLINE_LINUX_DEFAULT</samp>’, but for NetBSD. </p> </dd> <dt>‘<samp>GRUB_CMDLINE_GNUMACH</samp>’</dt> <dd><p>As ‘<samp>GRUB_CMDLINE_LINUX</samp>’, but for GNU Mach. </p> </dd> <dt>‘<samp>GRUB_CMDLINE_XEN</samp>’</dt> <dt>‘<samp>GRUB_CMDLINE_XEN_DEFAULT</samp>’</dt> <dd><p>The values of these options are passed to Xen hypervisor Xen menu entries, for all respectively normal entries. </p> </dd> <dt>‘<samp>GRUB_CMDLINE_LINUX_XEN_REPLACE</samp>’</dt> <dt>‘<samp>GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT</samp>’</dt> <dd><p>The values of these options replace the values of ‘<samp>GRUB_CMDLINE_LINUX</samp>’ and ‘<samp>GRUB_CMDLINE_LINUX_DEFAULT</samp>’ for Linux and Xen menu entries. </p> </dd> <dt>‘<samp>GRUB_EARLY_INITRD_LINUX_CUSTOM</samp>’</dt> <dt>‘<samp>GRUB_EARLY_INITRD_LINUX_STOCK</samp>’</dt> <dd><p>List of space-separated early initrd images to be loaded from ‘<samp>/boot</samp>’. This is for loading things like CPU microcode, firmware, ACPI tables, crypto keys, and so on. These early images will be loaded in the order declared, and all will be loaded before the actual functional initrd image. </p> <p>‘<samp>GRUB_EARLY_INITRD_LINUX_STOCK</samp>’ is for your distribution to declare images that are provided by the distribution. It should not be modified without understanding the consequences. They will be loaded first. </p> <p>‘<samp>GRUB_EARLY_INITRD_LINUX_CUSTOM</samp>’ is for your custom created images. </p> <p>The default stock images are as follows, though they may be overridden by your distribution: </p><div class="example"> <pre class="example">intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio </pre></div> </dd> <dt>‘<samp>GRUB_DISABLE_LINUX_UUID</samp>’</dt> <dd><p>Normally, <code>grub2-mkconfig</code> will generate menu entries that use universally-unique identifiers (UUIDs) to identify the root filesystem to the Linux kernel, using a ‘<samp>root=UUID=...</samp>’ kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to ‘<samp>true</samp>’. </p> </dd> <dt>‘<samp>GRUB_DISABLE_LINUX_PARTUUID</samp>’</dt> <dd><p>If <code>grub-mkconfig</code> cannot identify the root filesystem via its universally-unique indentifier (UUID), <code>grub-mkconfig</code> can use the UUID of the partition containing the filesystem to identify the root filesystem to the Linux kernel via a ‘<samp>root=PARTUUID=...</samp>’ kernel parameter. This is not as reliable as using the filesystem UUID, but is more reliable than using the Linux device names. When ‘<samp>GRUB_DISABLE_LINUX_PARTUUID</samp>’ is set to ‘<samp>false</samp>’, the Linux kernel version must be 2.6.37 (3.10 for systems using the MSDOS partition scheme) or newer. This option defaults to ‘<samp>true</samp>’. To enable the use of partition UUIDs, set this option to ‘<samp>false</samp>’. </p> </dd> <dt>‘<samp>GRUB_DISABLE_RECOVERY</samp>’</dt> <dd><p>If this option is set to ‘<samp>true</samp>’, disable the generation of recovery mode menu entries. </p> </dd> <dt>‘<samp>GRUB_DISABLE_UUID</samp>’</dt> <dd><p>Normally, <code>grub2-mkconfig</code> will generate menu entries that use universally-unique identifiers (UUIDs) to identify various filesystems to search for files. This is usually more reliable, but in some cases it may not be appropriate. To disable this use of UUIDs, set this option to ‘<samp>true</samp>’. </p> </dd> <dt>‘<samp>GRUB_VIDEO_BACKEND</samp>’</dt> <dd><p>If graphical video support is required, either because the ‘<samp>gfxterm</samp>’ graphical terminal is in use or because ‘<samp>GRUB_GFXPAYLOAD_LINUX</samp>’ is set, then <code>grub2-mkconfig</code> will normally load all available GRUB video drivers and use the one most appropriate for your hardware. If you need to override this for some reason, then you can set this option. </p> <p>After <code>grub2-install</code> has been run, the available video drivers are listed in <samp>/boot/grub2/video.lst</samp>. </p> </dd> <dt>‘<samp>GRUB_GFXMODE</samp>’</dt> <dd><p>Set the resolution used on the ‘<samp>gfxterm</samp>’ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ‘<samp>auto</samp>’, which tries to select a preferred resolution. See <a href="#gfxmode">gfxmode</a>. </p> </dd> <dt>‘<samp>GRUB_BACKGROUND</samp>’</dt> <dd><p>Set a background image for use with the ‘<samp>gfxterm</samp>’ graphical terminal. The value of this option must be a file readable by GRUB at boot time, and it must end with <samp>.png</samp>, <samp>.tga</samp>, <samp>.jpg</samp>, or <samp>.jpeg</samp>. The image will be scaled if necessary to fit the screen. </p> </dd> <dt>‘<samp>GRUB_THEME</samp>’</dt> <dd><p>Set a theme for use with the ‘<samp>gfxterm</samp>’ graphical terminal. </p> </dd> <dt>‘<samp>GRUB_GFXPAYLOAD_LINUX</samp>’</dt> <dd><p>Set to ‘<samp>text</samp>’ to force the Linux kernel to boot in normal text mode, ‘<samp>keep</samp>’ to preserve the graphics mode set using ‘<samp>GRUB_GFXMODE</samp>’, ‘<samp><var>width</var>x<var>height</var></samp>’[‘<samp>x<var>depth</var></samp>’] to set a particular graphics mode, or a sequence of these separated by commas or semicolons to try several modes in sequence. See <a href="#gfxpayload">gfxpayload</a>. </p> <p>Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this option to ‘<samp>text</samp>’ and GRUB will tell Linux to boot in normal text mode. </p> </dd> <dt>‘<samp>GRUB_DISABLE_OS_PROBER</samp>’</dt> <dd><p>Normally, <code>grub2-mkconfig</code> will try to use the external <code>os-prober</code> program, if installed, to discover other operating systems installed on the same system and generate appropriate menu entries for them. Set this option to ‘<samp>true</samp>’ to disable this. </p> </dd> <dt>‘<samp>GRUB_OS_PROBER_SKIP_LIST</samp>’</dt> <dd><p>List of space-separated FS UUIDs of filesystems to be ignored from os-prober output. For efi chainloaders it’s <UUID>@<EFI FILE> </p> </dd> <dt>‘<samp>GRUB_DISABLE_SUBMENU</samp>’</dt> <dd><p>Normally, <code>grub2-mkconfig</code> will generate top level menu entry for the kernel with highest version number and put all other found kernels or alternative menu entries for recovery mode in submenu. For entries returned by <code>os-prober</code> first entry will be put on top level and all others in submenu. If this option is set to ‘<samp>y</samp>’, flat menu with all entries on top level will be generated instead. Changing this option will require changing existing values of ‘<samp>GRUB_DEFAULT</samp>’, ‘<samp>fallback</samp>’ (see <a href="#fallback">fallback</a>) and ‘<samp>default</samp>’ (see <a href="#default">default</a>) environment variables as well as saved default entry using <code>grub2-set-default</code> and value used with <code>grub2-reboot</code>. </p> </dd> <dt>‘<samp>GRUB_ENABLE_CRYPTODISK</samp>’</dt> <dd><p>If set to ‘<samp>y</samp>’, <code>grub2-mkconfig</code> and <code>grub2-install</code> will check for encrypted disks and generate additional commands needed to access them during boot. Note that in this case unattended boot is not possible because GRUB will wait for passphrase to unlock encrypted container. </p> </dd> <dt>‘<samp>GRUB_INIT_TUNE</samp>’</dt> <dd><p>Play a tune on the speaker when GRUB starts. This is particularly useful for users unable to see the screen. The value of this option is passed directly to <a href="#play">play</a>. </p> </dd> <dt>‘<samp>GRUB_BADRAM</samp>’</dt> <dd><p>If this option is set, GRUB will issue a <a href="#badram">badram</a> command to filter out specified regions of RAM. </p> </dd> <dt>‘<samp>GRUB_PRELOAD_MODULES</samp>’</dt> <dd><p>This option may be set to a list of GRUB module names separated by spaces. Each module will be loaded as early as possible, at the start of <samp>grub.cfg</samp>. </p> </dd> </dl> <p>The following options are still accepted for compatibility with existing configurations, but have better replacements: </p> <dl compact="compact"> <dt>‘<samp>GRUB_HIDDEN_TIMEOUT</samp>’</dt> <dd><p>Wait this many seconds before displaying the menu. If <tt class="key">ESC</tt> is pressed during that time, display the menu and wait for input according to ‘<samp>GRUB_TIMEOUT</samp>’. If a hotkey associated with a menu entry is pressed, boot the associated menu entry immediately. If the timeout expires before either of these happens, display the menu for the number of seconds specified in ‘<samp>GRUB_TIMEOUT</samp>’ before booting the default entry. </p> <p>If you set ‘<samp>GRUB_HIDDEN_TIMEOUT</samp>’, you should also set ‘<samp>GRUB_TIMEOUT=0</samp>’ so that the menu is not displayed at all unless <tt class="key">ESC</tt> is pressed. </p> <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp>GRUB_TIMEOUT_STYLE=countdown</samp>’ or ‘<samp>GRUB_TIMEOUT_STYLE=hidden</samp>’. </p> </dd> <dt>‘<samp>GRUB_HIDDEN_TIMEOUT_QUIET</samp>’</dt> <dd><p>In conjunction with ‘<samp>GRUB_HIDDEN_TIMEOUT</samp>’, set this to ‘<samp>true</samp>’ to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu. </p> <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp>GRUB_TIMEOUT_STYLE=countdown</samp>’. </p> </dd> <dt>‘<samp>GRUB_HIDDEN_TIMEOUT_BUTTON</samp>’</dt> <dd><p>Variant of ‘<samp>GRUB_HIDDEN_TIMEOUT</samp>’, used to support vendor-specific power buttons. See <a href="#Vendor-power_002don-keys">Vendor power-on keys</a>. </p> <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp>GRUB_TIMEOUT_STYLE=countdown</samp>’ or ‘<samp>GRUB_TIMEOUT_STYLE=hidden</samp>’. </p> </dd> </dl> <p>For more detailed customisation of <code>grub2-mkconfig</code>’s output, you may edit the scripts in <samp>/etc/grub.d</samp> directly. <samp>/etc/grub.d/40_custom</samp> is particularly useful for adding entire custom menu entries; simply type the menu entries you want to add at the end of that file, making sure to leave at least the first two lines intact. </p> <hr> <a name="Root-Identifcation-Heuristics"></a> <div class="header"> <p> Next: <a href="#Shell_002dlike-scripting" accesskey="n" rel="next">Shell-like scripting</a>, Previous: <a href="#Simple-configuration" accesskey="p" rel="prev">Simple configuration</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Root-Identifcation-Heuristics-1"></a> <h3 class="section">6.2 Root Identifcation Heuristics</h3> <p>If the target operating system uses the Linux kernel, <code>grub-mkconfig</code> attempts to identify the root file system via a heuristic algoirthm. This algorithm selects the identification method of the root file system by considering three factors. The first is if an initrd for the target operating system is also present. The second is ‘<samp>GRUB_DISABLE_LINUX_UUID</samp>’ and if set to ‘<samp>true</samp>’, prevents <code>grub-mkconfig</code> from identifying the root file system by its UUID. The third is ‘<samp>GRUB_DISABLE_LINUX_PARTUUID</samp>’ and if set to ‘<samp>true</samp>’, prevents <code>grub-mkconfig</code> from identifying the root file system via the UUID of its enclosing partition. If the variables are assigned any other value, that value is considered equivalent to ‘<samp>false</samp>’. The variables are also considered to be set to ‘<samp>false</samp>’ if they are not set. </p> <p>When booting, the Linux kernel will delegate the task of mounting the root filesystem to the initrd. Most initrd images determine the root file system by checking the Linux kernel’s command-line for the ‘<samp>root</samp>’ key and use its value as the identification method of the root file system. To improve the reliability of booting, most initrd images also allow the root file system to be identified by its UUID. Because of this behavior, the <code>grub-mkconfig</code> command will set ‘<samp>root</samp>’ to ‘<samp>root=UUID=...</samp>’ to provide the initrd with the filesystem UUID of the root file system. </p> <p>If no initrd is detected or ‘<samp>GRUB_DISABLE_LINUX_UUID</samp>’ is set to ‘<samp>true</samp>’ then <code>grub-command</code> will identify the root filesystem by setting the kernel command-line variable ‘<samp>root</samp>’ to ‘<samp>root=PARTUUID=...</samp>’ unless ‘<samp>GRUB_DISABLE_LINUX_PARTUUID</samp>’ is also set to ‘<samp>true</samp>’. If ‘<samp>GRUB_DISABLE_LINUX_PARTUUID</samp>’ is also set to ‘<samp>true</samp>’, <code>grub-command</code> will identify by its Linux device name. </p> <p>The following table summarizes the behavior of the <code>grub-mkconfig</code> command. </p> <table> <thead><tr><th>Initrd detected</th><th>GRUB_DISABLE_LINUX_PARTUUID Set To</th><th>GRUB_DISABLE_LINUX_UUID Set To</th><th>Linux Root ID Method</th></tr></thead> <tr><td>false</td><td>false</td><td>false</td><td>part UUID</td></tr> <tr><td>false</td><td>false</td><td>true</td><td>part UUID</td></tr> <tr><td>false</td><td>true</td><td>false</td><td>dev name</td></tr> <tr><td>false</td><td>true</td><td>true</td><td>dev name</td></tr> <tr><td>true</td><td>false</td><td>false</td><td>fs UUID</td></tr> <tr><td>true</td><td>false</td><td>true</td><td>part UUID</td></tr> <tr><td>true</td><td>true</td><td>false</td><td>fs UUID</td></tr> <tr><td>true</td><td>true</td><td>true</td><td>dev name</td></tr> </table> <p>Remember, ‘<samp>GRUB_DISABLE_LINUX_PARTUUID</samp>’ and ‘<samp>GRUB_DISABLE_LINUX_UUID</samp>’ are also considered to be set to ‘<samp>false</samp>’ when they are unset. </p> <hr> <a name="Shell_002dlike-scripting"></a> <div class="header"> <p> Next: <a href="#Multi_002dboot-manual-config" accesskey="n" rel="next">Multi-boot manual config</a>, Previous: <a href="#Root-Identifcation-Heuristics" accesskey="p" rel="prev">Root Identifcation Heuristics</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Writing-full-configuration-files-directly"></a> <h3 class="section">6.3 Writing full configuration files directly</h3> <p><samp>grub.cfg</samp> is written in GRUB’s built-in scripting language, which has a syntax quite similar to that of GNU Bash and other Bourne shell derivatives. </p> <a name="Words"></a> <h3 class="heading">Words</h3> <p>A <em>word</em> is a sequence of characters considered as a single unit by GRUB. Words are separated by <em>metacharacters</em>, which are the following plus space, tab, and newline: </p> <div class="example"> <pre class="example">{ } | & $ ; < > </pre></div> <p>Quoting may be used to include metacharacters in words; see below. </p> <a name="Reserved-words"></a> <h3 class="heading">Reserved words</h3> <p>Reserved words have a special meaning to GRUB. The following words are recognised as reserved when unquoted and either the first word of a simple command or the third word of a <code>for</code> command: </p> <div class="example"> <pre class="example">! [[ ]] { } case do done elif else esac fi for function if in menuentry select then time until while </pre></div> <p>Not all of these reserved words have a useful purpose yet; some are reserved for future expansion. </p> <a name="Quoting"></a> <h3 class="heading">Quoting</h3> <p>Quoting is used to remove the special meaning of certain characters or words. It can be used to treat metacharacters as part of a word, to prevent reserved words from being recognised as such, and to prevent variable expansion. </p> <p>There are three quoting mechanisms: the escape character, single quotes, and double quotes. </p> <p>A non-quoted backslash (\) is the <em>escape character</em>. It preserves the literal value of the next character that follows, with the exception of newline. </p> <p>Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. </p> <p>Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of ‘<samp>$</samp>’ and ‘<samp>\</samp>’. The ‘<samp>$</samp>’ character retains its special meaning within double quotes. The backslash retains its special meaning only when followed by one of the following characters: ‘<samp>$</samp>’, ‘<samp>"</samp>’, ‘<samp>\</samp>’, or newline. A backslash-newline pair is treated as a line continuation (that is, it is removed from the input stream and effectively ignored<a name="DOCF7" href="#FOOT7"><sup>7</sup></a>). A double quote may be quoted within double quotes by preceding it with a backslash. </p> <a name="Variable-expansion"></a> <h3 class="heading">Variable expansion</h3> <p>The ‘<samp>$</samp>’ character introduces variable expansion. The variable name to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name. </p> <p>Normal variable names begin with an alphabetic character, followed by zero or more alphanumeric characters. These names refer to entries in the GRUB environment (see <a href="#Environment">Environment</a>). </p> <p>Positional variable names consist of one or more digits. They represent parameters passed to function calls, with ‘<samp>$1</samp>’ representing the first parameter, and so on. </p> <p>The special variable name ‘<samp>?</samp>’ expands to the exit status of the most recently executed command. When positional variable names are active, other special variable names ‘<samp>@</samp>’, ‘<samp>*</samp>’ and ‘<samp>#</samp>’ are defined and they expand to all positional parameters with necessary quoting, positional parameters without any quoting, and positional parameter count respectively. </p> <a name="Comments"></a> <h3 class="heading">Comments</h3> <p>A word beginning with ‘<samp>#</samp>’ causes that word and all remaining characters on that line to be ignored. </p> <a name="Simple-commands"></a> <h3 class="heading">Simple commands</h3> <p>A <em>simple command</em> is a sequence of words separated by spaces or tabs and terminated by a semicolon or a newline. The first word specifies the command to be executed. The remaining words are passed as arguments to the invoked command. </p> <p>The return value of a simple command is its exit status. If the reserved word <code>!</code> precedes the command, then the return value is instead the logical negation of the command’s exit status. </p> <a name="Compound-commands"></a> <h3 class="heading">Compound commands</h3> <p>A <em>compound command</em> is one of the following: </p> <dl compact="compact"> <dt>for <var>name</var> in <var>word</var> …; do <var>list</var>; done</dt> <dd><p>The list of words following <code>in</code> is expanded, generating a list of items. The variable <var>name</var> is set to each element of this list in turn, and <var>list</var> is executed each time. The return value is the exit status of the last command that executes. If the expansion of the items following <code>in</code> results in an empty list, no commands are executed, and the return status is 0. </p> </dd> <dt>if <var>list</var>; then <var>list</var>; [elif <var>list</var>; then <var>list</var>;] … [else <var>list</var>;] fi</dt> <dd><p>The <code>if</code> <var>list</var> is executed. If its exit status is zero, the <code>then</code> <var>list</var> is executed. Otherwise, each <code>elif</code> <var>list</var> is executed in turn, and if its exit status is zero, the corresponding <code>then</code> <var>list</var> is executed and the command completes. Otherwise, the <code>else</code> <var>list</var> is executed, if present. The exit status is the exit status of the last command executed, or zero if no condition tested true. </p> </dd> <dt>while <var>cond</var>; do <var>list</var>; done</dt> <dt>until <var>cond</var>; do <var>list</var>; done</dt> <dd><p>The <code>while</code> command continuously executes the <code>do</code> <var>list</var> as long as the last command in <var>cond</var> returns an exit status of zero. The <code>until</code> command is identical to the <code>while</code> command, except that the test is negated; the <code>do</code> <var>list</var> is executed as long as the last command in <var>cond</var> returns a non-zero exit status. The exit status of the <code>while</code> and <code>until</code> commands is the exit status of the last <code>do</code> <var>list</var> command executed, or zero if none was executed. </p> </dd> <dt>function <var>name</var> { <var>command</var>; … }</dt> <dd><p>This defines a function named <var>name</var>. The <em>body</em> of the function is the list of commands within braces, each of which must be terminated with a semicolon or a newline. This list of commands will be executed whenever <var>name</var> is specified as the name of a simple command. Function definitions do not affect the exit status in <code>$?</code>. When executed, the exit status of a function is the exit status of the last command executed in the body. </p> </dd> <dt>menuentry <var>title</var> [<samp>--class=class</samp> …] [<samp>--users=users</samp>] [<samp>--unrestricted</samp>] [<samp>--hotkey=key</samp>] [<samp>--id=id</samp>] { <var>command</var>; … }</dt> <dd><p>See <a href="#menuentry">menuentry</a>. </p></dd> </dl> <a name="Built_002din-Commands"></a> <h3 class="heading">Built-in Commands</h3> <p>Some built-in commands are also provided by GRUB script to help script writers perform actions that are otherwise not possible. For example, these include commands to jump out of a loop without fully completing it, etc. </p> <dl compact="compact"> <dt>break [<code>n</code>]</dt> <dd><p>Exit from within a <code>for</code>, <code>while</code>, or <code>until</code> loop. If <code>n</code> is specified, break <code>n</code> levels. <code>n</code> must be greater than or equal to 1. If <code>n</code> is greater than the number of enclosing loops, all enclosing loops are exited. The return value is 0 unless <code>n</code> is not greater than or equal to 1. </p> </dd> <dt>continue [<code>n</code>]</dt> <dd><p>Resume the next iteration of the enclosing <code>for</code>, <code>while</code> or <code>until</code> loop. If <code>n</code> is specified, resume at the <code>n</code>th enclosing loop. <code>n</code> must be greater than or equal to 1. If <code>n</code> is greater than the number of enclosing loops, the last enclosing loop (the <em>top-level</em> loop) is resumed. The return value is 0 unless <code>n</code> is not greater than or equal to 1. </p> </dd> <dt>return [<code>n</code>]</dt> <dd><p>Causes a function to exit with the return value specified by <code>n</code>. If <code>n</code> is omitted, the return status is that of the last command executed in the function body. If used outside a function the return status is false. </p> </dd> <dt>setparams [<code>arg</code>] …</dt> <dd><p>Replace positional parameters starting with <code>$1</code> with arguments to <code>setparams</code>. </p> </dd> <dt>shift [<code>n</code>]</dt> <dd><p>The positional parameters from <code>n</code>+1 … are renamed to <code>$1</code>…. Parameters represented by the numbers <code>$#</code> down to <code>$#</code>-<code>n</code>+1 are unset. <code>n</code> must be a non-negative number less than or equal to <code>$#</code>. If <code>n</code> is 0, no parameters are changed. If <code>n</code> is not given, it is assumed to be 1. If <code>n</code> is greater than <code>$#</code>, the positional parameters are not changed. The return status is greater than zero if <code>n</code> is greater than <code>$#</code> or less than zero; otherwise 0. </p> </dd> </dl> <hr> <a name="Multi_002dboot-manual-config"></a> <div class="header"> <p> Next: <a href="#Embedded-configuration" accesskey="n" rel="next">Embedded configuration</a>, Previous: <a href="#Shell_002dlike-scripting" accesskey="p" rel="prev">Shell-like scripting</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Multi_002dboot-manual-config-1"></a> <h3 class="section">6.4 Multi-boot manual config</h3> <p>Currently autogenerating config files for multi-boot environments depends on os-prober and has several shortcomings. While fixing it is scheduled for the next release, meanwhile you can make use of the power of GRUB syntax and do it yourself. A possible configuration is detailed here, feel free to adjust to your needs. </p> <p>First create a separate GRUB partition, big enough to hold GRUB. Some of the following entries show how to load OS installer images from this same partition, for that you obviously need to make the partition large enough to hold those images as well. Mount this partition on/mnt/boot and disable GRUB in all OSes and manually install self-compiled latest GRUB with: </p> <p><code>grub2-install --boot-directory=/mnt/boot /dev/sda</code> </p> <p>In all the OSes install GRUB tools but disable installing GRUB in bootsector, so you’ll have menu.lst and grub.cfg available for use. Also disable os-prober use by setting: </p> <p><code>GRUB_DISABLE_OS_PROBER=true</code> </p> <p>in /etc/default/grub </p> <p>Then write a grub.cfg (/mnt/boot/grub2/grub.cfg): </p> <div class="example"> <pre class="example"> menuentry "OS using grub2" { insmod xfs search --set=root --label OS1 --hint hd0,msdos8 configfile /boot/grub2/grub.cfg } menuentry "OS using grub2-legacy" { insmod ext2 search --set=root --label OS2 --hint hd0,msdos6 legacy_configfile /boot/grub2/menu.lst } menuentry "Windows XP" { insmod ntfs search --set=root --label WINDOWS_XP --hint hd0,msdos1 ntldr /ntldr } menuentry "Windows 7" { insmod ntfs search --set=root --label WINDOWS_7 --hint hd0,msdos2 ntldr /bootmgr } menuentry "FreeBSD" { insmod zfs search --set=root --label freepool --hint hd0,msdos7 kfreebsd /freebsd@/boot/kernel/kernel kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd set kFreeBSD.hw.psm.synaptics_support=1 } menuentry "experimental GRUB" { search --set=root --label GRUB --hint hd0,msdos5 multiboot /experimental/grub/i386-pc/core.img } menuentry "Fedora 16 installer" { search --set=root --label GRUB --hint hd0,msdos5 linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800 initrd /fedora/initrd.img } menuentry "Fedora rawhide installer" { search --set=root --label GRUB --hint hd0,msdos5 linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800 initrd /fedora/initrd.img } menuentry "Debian sid installer" { search --set=root --label GRUB --hint hd0,msdos5 linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz } </pre></div> <p>Notes: </p><ul> <li> Argument to search after –label is FS LABEL. You can also use UUIDs with –fs-uuid UUID instead of –label LABEL. You could also use direct <code>root=hd0,msdosX</code> but this is not recommended due to device name instability. </li></ul> <hr> <a name="Embedded-configuration"></a> <div class="header"> <p> Previous: <a href="#Multi_002dboot-manual-config" accesskey="p" rel="prev">Multi-boot manual config</a>, Up: <a href="#Configuration" accesskey="u" rel="up">Configuration</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Embedding-a-configuration-file-into-GRUB"></a> <h3 class="section">6.5 Embedding a configuration file into GRUB</h3> <p>GRUB supports embedding a configuration file directly into the core image, so that it is loaded before entering normal mode. This is useful, for example, when it is not straightforward to find the real configuration file, or when you need to debug problems with loading that file. <code>grub2-install</code> uses this feature when it is not using BIOS disk functions or when installing to a different disk from the one containing <samp>/boot/grub</samp>, in which case it needs to use the <code>search</code> command (see <a href="#search">search</a>) to find <samp>/boot/grub</samp>. </p> <p>To embed a configuration file, use the <samp>-c</samp> option to <code>grub2-mkimage</code>. The file is copied into the core image, so it may reside anywhere on the file system, and may be removed after running <code>grub2-mkimage</code>. </p> <p>After the embedded configuration file (if any) is executed, GRUB will load the ‘<samp>normal</samp>’ module (see <a href="#normal">normal</a>), which will then read the real configuration file from <samp>$prefix/grub.cfg</samp>. By this point, the <code>root</code> variable will also have been set to the root device name. For example, <code>prefix</code> might be set to ‘<samp>(hd0,1)/boot/grub</samp>’, and <code>root</code> might be set to ‘<samp>hd0,1</samp>’. Thus, in most cases, the embedded configuration file only needs to set the <code>prefix</code> and <code>root</code> variables, and then drop through to GRUB’s normal processing. A typical example of this might look like this: </p> <div class="example"> <pre class="example">search.fs_uuid 01234567-89ab-cdef-0123-456789abcdef root set prefix=($root)/boot/grub </pre></div> <p>(The ‘<samp>search_fs_uuid</samp>’ module must be included in the core image for this example to work.) </p> <p>In more complex cases, it may be useful to read other configuration files directly from the embedded configuration file. This allows such things as reading files not called <samp>grub.cfg</samp>, or reading files from a directory other than that where GRUB’s loadable modules are installed. To do this, include the ‘<samp>configfile</samp>’ and ‘<samp>normal</samp>’ modules in the core image, and embed a configuration file that uses the <code>configfile</code> command to load another file. The following example of this also requires the <code>echo</code>, <code>search_label</code>, and <code>test</code> modules to be included in the core image: </p> <div class="example"> <pre class="example">search.fs_label grub root if [ -e /boot/grub2/example/test1.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub2/example/test1.cfg else if [ -e /boot/grub2/example/test2.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub2/example/test2.cfg else echo "Could not find an example configuration file!" fi fi </pre></div> <p>The embedded configuration file may not contain menu entries directly, but may only read them from elsewhere using <code>configfile</code>. </p> <hr> <a name="Theme-file-format"></a> <div class="header"> <p> Next: <a href="#Network" accesskey="n" rel="next">Network</a>, Previous: <a href="#Configuration" accesskey="p" rel="prev">Configuration</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Theme-file-format-1"></a> <h2 class="chapter">7 Theme file format</h2> <a name="Introduction-1"></a> <h3 class="section">7.1 Introduction</h3> <p>The GRUB graphical menu supports themes that can customize the layout and appearance of the GRUB boot menu. The theme is configured through a plain text file that specifies the layout of the various GUI components (including the boot menu, timeout progress bar, and text messages) as well as the appearance using colors, fonts, and images. Example is available in docs/example_theme.txt </p> <a name="Theme-Elements"></a> <h3 class="section">7.2 Theme Elements</h3> <a name="Colors"></a> <h4 class="subsection">7.2.1 Colors</h4> <p>Colors can be specified in several ways: </p> <ul> <li> HTML-style “#RRGGBB” or “#RGB” format, where *R*, *G*, and *B* are hexadecimal digits (e.g., “#8899FF”) </li><li> as comma-separated decimal RGB values (e.g., “128, 128, 255”) </li><li> with “SVG 1.0 color names” (e.g., “cornflowerblue”) which must be specified in lowercase. </li></ul> <a name="Fonts"></a> <h4 class="subsection">7.2.2 Fonts</h4> <p>The fonts GRUB uses “PFF2 font format” bitmap fonts. Fonts are specified with full font names. Currently there is no provision for a preference list of fonts, or deriving one font from another. Fonts are loaded with the “loadfont” command in GRUB (<a href="#loadfont">loadfont</a>). To see the list of loaded fonts, execute the “lsfonts” command (<a href="#lsfonts">lsfonts</a>). If there are too many fonts to fit on screen, do “set pager=1” before executing “lsfonts”. </p> <a name="Progress-Bar"></a> <h4 class="subsection">7.2.3 Progress Bar</h4> <div class="float"><a name="Pixmap_002dstyled-progress-bar"></a> <div class="float-caption"><p><strong>Figure 7.1 </strong></p></div></div> <div class="float"><a name="Plain-progress-bar_002c-drawn-with-solid-color_002e"></a> <div class="float-caption"><p><strong>Figure 7.2 </strong></p></div></div> <p>Progress bars are used to display the remaining time before GRUB boots the default menu entry. To create a progress bar that will display the remaining time before automatic boot, simply create a “progress_bar” component with the id “__timeout__”. This indicates to GRUB that the progress bar should be updated as time passes, and it should be made invisible if the countdown to automatic boot is interrupted by the user. </p> <p>Progress bars may optionally have text displayed on them. This text is controlled by variable “text” which contains a printf template with the only argument %d is the number of seconds remaining. Additionally special values “@TIMEOUT_NOTIFICATION_SHORT@”, “@TIMEOUT_NOTIFICATION_MIDDLE@”, “@TIMEOUT_NOTIFICATION_LONG@” are replaced with standard and translated templates. </p> <a name="Circular-Progress-Indicator"></a> <h4 class="subsection">7.2.4 Circular Progress Indicator</h4> <p>The circular progress indicator functions similarly to the progress bar. When given an id of “__timeout__”, GRUB updates the circular progress indicator’s value to indicate the time remaining. For the circular progress indicator, there are two images used to render it: the *center* image, and the *tick* image. The center image is rendered in the center of the component, while the tick image is used to render each mark along the circumference of the indicator. </p> <a name="Labels"></a> <h4 class="subsection">7.2.5 Labels</h4> <p>Text labels can be placed on the boot screen. The font, color, and horizontal alignment can be specified for labels. If a label is given the id “__timeout__”, then the “text” property for that label is also updated with a message informing the user of the number of seconds remaining until automatic boot. This is useful in case you want the text displayed somewhere else instead of directly on the progress bar. </p> <a name="Boot-Menu"></a> <h4 class="subsection">7.2.6 Boot Menu</h4> <p>The boot menu where GRUB displays the menu entries from the “grub.cfg” file. It is a list of items, where each item has a title and an optional icon. The icon is selected based on the *classes* specified for the menu entry. If there is a PNG file named “myclass.png” in the “grub/themes/icons” directory, it will be displayed for items which have the class *myclass*. The boot menu can be customized in several ways, such as the font and color used for the menu entry title, and by specifying styled boxes for the menu itself and for the selected item highlight. </p> <a name="Styled-Boxes"></a> <h4 class="subsection">7.2.7 Styled Boxes</h4> <p>One of the most important features for customizing the layout is the use of *styled boxes*. A styled box is composed of 9 rectangular (and potentially empty) regions, which are used to seamlessly draw the styled box on screen: </p> <table> <tr><td width="30%">Northwest (nw)</td><td width="30%">North (n)</td><td width="30%">Northeast (ne)</td></tr> <tr><td width="30%">West (w)</td><td width="30%">Center (c)</td><td width="30%">East (e)</td></tr> <tr><td width="30%">Southwest (sw)</td><td width="30%">South (s)</td><td width="30%">Southeast (se)</td></tr> </table> <p>To support any size of box on screen, the center slice and the slices for the top, bottom, and sides are all scaled to the correct size for the component on screen, using the following rules: </p> <ol> <li> The edge slices (north, south, east, and west) are scaled in the direction of the edge they are adjacent to. For instance, the west slice is scaled vertically. </li><li> The corner slices (northwest, northeast, southeast, and southwest) are not scaled. </li><li> The center slice is scaled to fill the remaining space in the middle. </li></ol> <p>As an example of how an image might be sliced up, consider the styled box used for a terminal view. </p> <div class="float"><a name="An-example-of-the-slices-_0028in-red_0029-used-for-a-terminal-window_002e-This-drawing-was-created-and-sliced-in-Inkscape_005f_002c-as-the-next-section-explains_002e"></a> <div class="float-caption"><p><strong>Figure 7.3 </strong></p></div></div> <a name="Creating-Styled-Box-Images"></a> <h4 class="subsection">7.2.8 Creating Styled Box Images</h4> <p>The Inkscape_ scalable vector graphics editor is a very useful tool for creating styled box images. One process that works well for slicing a drawing into the necessary image slices is: </p> <ol> <li> Create or open the drawing you’d like use. </li><li> Create a new layer on the top of the layer stack. Make it visible. Select this layer as the current layer. </li><li> Draw 9 rectangles on your drawing where you’d like the slices to be. Clear the fill option, and set the stroke to 1 pixel wide solid stroke. The corners of the slices must meet precisely; if it is off by a single pixel, it will probably be evident when the styled box is rendered in the GRUB menu. You should probably go to File | Document Properties | Grids and enable a grid or create a guide (click on one of the rulers next to the drawing and drag over the drawing; release the mouse button to place the guide) to help place the rectangles precisely. </li><li> Right click on the center slice rectangle and choose Object Properties. Change the "Id" to “slice_c“ and click Set. Repeat this for the remaining 8 rectangles, giving them Id values of “slice_n“, “slice_ne“, “slice_e“, and so on according to the location. </li><li> Save the drawing. </li><li> Select all the slice rectangles. With the slice layer selected, you can simply press Ctrl+A to select all rectangles. The status bar should indicate that 9 rectangles are selected. </li><li> Click the layer hide icon for the slice layer in the layer palette. The rectangles will remain selected, even though they are hidden. </li><li> Choose File | Export Bitmap and check the *Batch export 9 selected objects* box. Make sure that *Hide all except selected* is unchecked. click *Export*. This will create PNG files in the same directory as the drawing, named after the slices. These can now be used for a styled box in a GRUB theme. </li></ol> <a name="Theme-File-Manual"></a> <h3 class="section">7.3 Theme File Manual</h3> <p>The theme file is a plain text file. Lines that begin with “#“ are ignored and considered comments. (Note: This may not be the case if the previous line ended where a value was expected.) </p> <p>The theme file contains two types of statements: </p><ol> <li> Global properties. </li><li> Component construction. </li></ol> <a name="Global-Properties"></a> <h4 class="subsection">7.3.1 Global Properties</h4> <a name="Format"></a> <h4 class="subsection">7.3.2 Format</h4> <p>Global properties are specified with the simple format: </p><ul> <li> name1: value1 </li><li> name2: "value which may contain spaces" </li><li> name3: #88F </li></ul> <p>In this example, name3 is assigned a color value. </p> <a name="Global-Property-List"></a> <h4 class="subsection">7.3.3 Global Property List</h4> <table> <tr><td width="30%">title-text</td><td width="60%">Specifies the text to display at the top center of the screen as a title.</td></tr> <tr><td width="30%">title-font</td><td width="60%">Defines the font used for the title message at the top of the screen.</td></tr> <tr><td width="30%">title-color</td><td width="60%">Defines the color of the title message.</td></tr> <tr><td width="30%">message-font</td><td width="60%">Currently unused. Left for backward compatibility.</td></tr> <tr><td width="30%">message-color</td><td width="60%">Currently unused. Left for backward compatibility.</td></tr> <tr><td width="30%">message-bg-color</td><td width="60%">Currently unused. Left for backward compatibility.</td></tr> <tr><td width="30%">desktop-image</td><td width="60%">Specifies the image to use as the background. It will be scaled to fit the screen size or proportionally scaled depending on the scale method.</td></tr> <tr><td width="30%">desktop-image-scale-method</td><td width="60%">Specifies the scaling method for the *desktop-image*. Options are “stretch“, “crop“, “padding“, “fitwidth“, “fitheight“. “stretch“ for fitting the screen size. Otherwise it is proportional scaling of a part of *desktop-image* to the part of the screen. “crop“ part of the *desktop-image* will be proportionally scaled to fit the screen sizes. “padding“ the entire *desktop-image* will be contained on the screen. “fitwidth“ for fitting the *desktop-image*’s width with screen width. “fitheight“ for fitting the *desktop-image*’s height with the screen height. Default is “stretch“.</td></tr> <tr><td width="30%">desktop-image-h-align</td><td width="60%">Specifies the horizontal alignment of the *desktop-image* if *desktop-image-scale-method* isn’t equeal to “stretch“. Options are “left“, “center“, “right“. Default is “center“.</td></tr> <tr><td width="30%">desktop-image-v-align</td><td width="60%">Specifies the vertical alignment of the *desktop-image* if *desktop-image-scale-method* isn’t equeal to “stretch“. Options are “top“, “center“, “bottom“. Default is “center“.</td></tr> <tr><td width="30%">desktop-color</td><td width="60%">Specifies the color for the background if *desktop-image* is not specified.</td></tr> <tr><td width="30%">terminal-box</td><td width="60%">Specifies the file name pattern for the styled box slices used for the command line terminal window. For example, “terminal-box: terminal_*.png“ will use the images “terminal_c.png“ as the center area, “terminal_n.png“ as the north (top) edge, “terminal_nw.png“ as the northwest (upper left) corner, and so on. If the image for any slice is not found, it will simply be left empty.</td></tr> <tr><td width="30%">terminal-border</td><td width="60%">Specifies the border width of the terminal window.</td></tr> <tr><td width="30%">terminal-left</td><td width="60%">Specifies the left coordinate of the terminal window.</td></tr> <tr><td width="30%">terminal-top</td><td width="60%">Specifies the top coordinate of the terminal window.</td></tr> <tr><td width="30%">terminal-width</td><td width="60%">Specifies the width of the terminal window.</td></tr> <tr><td width="30%">terminal-height</td><td width="60%">Specifies the height of the terminal window.</td></tr> </table> <a name="Component-Construction"></a> <h4 class="subsection">7.3.4 Component Construction</h4> <p>Greater customizability comes is provided by components. A tree of components forms the user interface. *Containers* are components that can contain other components, and there is always a single root component which is an instance of a *canvas* container. </p> <p>Components are created in the theme file by prefixing the type of component with a ’+’ sign: </p> <p><code> + label { text="GRUB" font="aqui 11" color="#8FF" } </code> </p> <p>properties of a component are specified as "name = value" (whitespace surrounding tokens is optional and is ignored) where *value* may be: </p><ul> <li> a single word (e.g., “align = center“, “color = #FF8080“), </li><li> a quoted string (e.g., “text = "Hello, World!"“), or </li><li> a tuple (e.g., “preferred_size = (120, 80)“). </li></ul> <a name="Component-List"></a> <h4 class="subsection">7.3.5 Component List</h4> <p>The following is a list of the components and the properties they support. </p> <ul> <li> label A label displays a line of text. <p>Properties: </p><table> <tr><td width="20%">id</td><td width="70%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry.</td></tr> <tr><td width="20%">text</td><td width="70%">The text to display. If “id“ is set to “__timeout__“ and no “text“ property is set then the amount of seconds will be shown. If set to “@KEYMAP_SHORT@“, “@KEYMAP_MIDDLE@“ or “@KEYMAP_LONG@“ then predefined hotkey information will be shown.</td></tr> <tr><td width="20%">font</td><td width="70%">The font to use for text display.</td></tr> <tr><td width="20%">color</td><td width="70%">The color of the text.</td></tr> <tr><td width="20%">align</td><td width="70%">The horizontal alignment of the text within the component. Options are “left“, “center“ and “right“.</td></tr> <tr><td width="20%">visible</td><td width="70%">Set to “false“ to hide the label.</td></tr> </table> </li><li> image A component that displays an image. The image is scaled to fit the component. <p>Properties: </p> <table> <tr><td width="20%">file</td><td width="70%">The full path to the image file to load.</td></tr> </table> </li><li> progress_bar Displays a horizontally oriented progress bar. It can be rendered using simple solid filled rectangles, or using a pair of pixmap styled boxes. <p>Properties: </p> <table> <tr><td width="20%">id</td><td width="70%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry.</td></tr> <tr><td width="20%">fg_color</td><td width="70%">The foreground color for plain solid color rendering.</td></tr> <tr><td width="20%">bg_color</td><td width="70%">The background color for plain solid color rendering.</td></tr> <tr><td width="20%">border_color</td><td width="70%">The border color for plain solid color rendering.</td></tr> <tr><td width="20%">text_color</td><td width="70%">The text color.</td></tr> <tr><td width="20%">bar_style</td><td width="70%">The styled box specification for the frame of the progress bar. Example: “progress_frame_*.png“ If the value is equal to “highlight_style“ then no styled boxes will be shown.</td></tr> <tr><td width="20%">highlight_style</td><td width="70%">The styled box specification for the highlighted region of the progress bar. This box will be used to paint just the highlighted region of the bar, and will be increased in size as the bar nears completion. Example: “progress_hl_*.png“. If the value is equal to “bar_style“ then no styled boxes will be shown.</td></tr> <tr><td width="20%">highlight_overlay</td><td width="70%">If this option is set to “true“ then the highlight box side slices (every slice except the center slice) will overlay the frame box side slices. And the center slice of the highlight box can move all the way (from top to bottom), being drawn on the center slice of the frame box. That way we can make a progress bar with round-shaped edges so there won’t be a free space from the highlight to the frame in top and bottom scrollbar positions. Default is “false“.</td></tr> <tr><td width="20%">font</td><td width="70%">The font to use for progress bar.</td></tr> <tr><td width="20%">text</td><td width="70%">The text to display on the progress bar. If the progress bar’s ID is set to “__timeout__“ and the value of this property is set to “@TIMEOUT_NOTIFICATION_SHORT@“, “@TIMEOUT_NOTIFICATION_MIDDLE@“ or “@TIMEOUT_NOTIFICATION_LONG@“, then GRUB will update this property with an informative message as the timeout approaches.</td></tr> </table> </li><li> circular_progress Displays a circular progress indicator. The appearance of this component is determined by two images: the *center* image and the *tick* image. The center image is generally larger and will be drawn in the center of the component. Around the circumference of a circle within the component, the tick image will be drawn a certain number of times, depending on the properties of the component. <p>Properties: </p> <table> <tr><td width="30%">id</td><td width="60%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry.</td></tr> <tr><td width="30%">center_bitmap</td><td width="60%">The file name of the image to draw in the center of the component.</td></tr> <tr><td width="30%">tick_bitmap</td><td width="60%">The file name of the image to draw for the tick marks.</td></tr> <tr><td width="30%">num_ticks</td><td width="60%">The number of ticks that make up a full circle.</td></tr> <tr><td width="30%">ticks_disappear</td><td width="60%">Boolean value indicating whether tick marks should progressively appear, or progressively disappear as *value* approaches *end*. Specify “true“ or “false“. Default is “false“.</td></tr> <tr><td width="30%">start_angle</td><td width="60%">The position of the first tick mark to appear or disappear. Measured in "parrots", 1 "parrot" = 1 / 256 of the full circle. Use values “xxx deg“ or “xxx \xc2\xb0“ to set the angle in degrees.</td></tr> </table> </li><li> boot_menu Displays the GRUB boot menu. It allows selecting items and executing them. <p>Properties: </p> <table> <tr><td width="40%">item_font</td><td width="50%">The font to use for the menu item titles.</td></tr> <tr><td width="40%">selected_item_font</td><td width="50%">The font to use for the selected menu item, or “inherit“ (the default) to use “item_font“ for the selected menu item as well.</td></tr> <tr><td width="40%">item_color</td><td width="50%">The color to use for the menu item titles.</td></tr> <tr><td width="40%">selected_item_color</td><td width="50%">The color to use for the selected menu item, or “inherit“ (the default) to use “item_color“ for the selected menu item as well.</td></tr> <tr><td width="40%">icon_width</td><td width="50%">The width of menu item icons. Icons are scaled to the specified size.</td></tr> <tr><td width="40%">icon_height</td><td width="50%">The height of menu item icons.</td></tr> <tr><td width="40%">item_height</td><td width="50%">The height of each menu item in pixels.</td></tr> <tr><td width="40%">item_padding</td><td width="50%">The amount of space in pixels to leave on each side of the menu item contents.</td></tr> <tr><td width="40%">item_icon_space</td><td width="50%">The space between an item’s icon and the title text, in pixels.</td></tr> <tr><td width="40%">item_spacing</td><td width="50%">The amount of space to leave between menu items, in pixels.</td></tr> <tr><td width="40%">menu_pixmap_style</td><td width="50%">The image file pattern for the menu frame styled box. Example: “menu_*.png“ (this will use images such as “menu_c.png“, “menu_w.png“, ‘menu_nw.png“, etc.)</td></tr> <tr><td width="40%">item_pixmap_style</td><td width="50%">The image file pattern for the item styled box.</td></tr> <tr><td width="40%">selected_item_pixmap_style</td><td width="50%">The image file pattern for the selected item highlight styled box.</td></tr> <tr><td width="40%">scrollbar</td><td width="50%">Boolean value indicating whether the scroll bar should be drawn if the frame and thumb styled boxes are configured.</td></tr> <tr><td width="40%">scrollbar_frame</td><td width="50%">The image file pattern for the entire scroll bar. Example: “scrollbar_*.png“</td></tr> <tr><td width="40%">scrollbar_thumb</td><td width="50%">The image file pattern for the scroll bar thumb (the part of the scroll bar that moves as scrolling occurs). Example: “scrollbar_thumb_*.png“</td></tr> <tr><td width="40%">scrollbar_thumb_overlay</td><td width="50%">If this option is set to “true“ then the scrollbar thumb side slices (every slice except the center slice) will overlay the scrollbar frame side slices. And the center slice of the scrollbar_thumb can move all the way (from top to bottom), being drawn on the center slice of the scrollbar frame. That way we can make a scrollbar with round-shaped edges so there won’t be a free space from the thumb to the frame in top and bottom scrollbar positions. Default is “false“.</td></tr> <tr><td width="40%">scrollbar_slice</td><td width="50%">The menu frame styled box’s slice in which the scrollbar will be drawn. Possible values are “west“, “center“, “east“ (default). “west“ - the scrollbar will be drawn in the west slice (right-aligned). “east“ - the scrollbar will be drawn in the east slice (left-aligned). “center“ - the scrollbar will be drawn in the center slice. Note: in case of “center“ slice: a) If the scrollbar should be drawn then boot menu entry’s width is decreased by the scrollbar’s width and the scrollbar is drawn at the right side of the center slice. b) If the scrollbar won’t be drawn then the boot menu entry’s width is the width of the center slice. c) We don’t necessary need the menu pixmap box to display the scrollbar.</td></tr> <tr><td width="40%">scrollbar_left_pad</td><td width="50%">The left scrollbar padding in pixels. Unused if “scrollbar_slice“ is “west“.</td></tr> <tr><td width="40%">scrollbar_right_pad</td><td width="50%">The right scrollbar padding in pixels. Unused if “scrollbar_slice“ is “east“.</td></tr> <tr><td width="40%">scrollbar_top_pad</td><td width="50%">The top scrollbar padding in pixels.</td></tr> <tr><td width="40%">scrollbar_bottom_pad</td><td width="50%">The bottom scrollbar padding in pixels.</td></tr> <tr><td width="40%">visible</td><td width="50%">Set to “false“ to hide the boot menu.</td></tr> </table> </li><li> canvas Canvas is a container that allows manual placement of components within it. It does not alter the positions of its child components. It assigns all child components their preferred sizes. </li><li> hbox The *hbox* container lays out its children from left to right, giving each one its preferred width. The height of each child is set to the maximum of the preferred heights of all children. </li><li> vbox The *vbox* container lays out its children from top to bottom, giving each one its preferred height. The width of each child is set to the maximum of the preferred widths of all children. </li></ul> <a name="Common-properties"></a> <h4 class="subsection">7.3.6 Common properties</h4> <p>The following properties are supported by all components: </p><dl compact="compact"> <dt>‘<samp>left</samp>’</dt> <dd><p>The distance from the left border of container to left border of the object in either of three formats: </p><table> <tr><td width="20%">x</td><td width="70%">Value in pixels</td></tr> <tr><td width="20%">p%</td><td width="70%">Percentage</td></tr> <tr><td width="20%">p%+x</td><td width="70%">mixture of both</td></tr> </table> </dd> <dt>‘<samp>top</samp>’</dt> <dd><p>The distance from the left border of container to left border of the object in same format. </p></dd> <dt>‘<samp>width</samp>’</dt> <dd><p>The width of object in same format. </p></dd> <dt>‘<samp>height</samp>’</dt> <dd><p>The height of object in same format. </p></dd> <dt>‘<samp>id</samp>’</dt> <dd><p>The identifier for the component. This can be any arbitrary string. The ID can be used by scripts to refer to various components in the GUI component tree. Currently, there is one special ID value that GRUB recognizes: </p> <table> <tr><td width="20%">“__timeout__“</td><td width="70%">Component with this ID will be updated by GRUB and will indicate time elapsed to an automatical boot of the default entry. Affected components: “label“, “circular_progress“, “progress_bar“.</td></tr> </table> </dd> </dl> <hr> <a name="Network"></a> <div class="header"> <p> Next: <a href="#Serial-terminal" accesskey="n" rel="next">Serial terminal</a>, Previous: <a href="#Theme-file-format" accesskey="p" rel="prev">Theme file format</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Booting-GRUB-from-the-network"></a> <h2 class="chapter">8 Booting GRUB from the network</h2> <p>The following instructions don’t work for *-emu, i386-qemu, i386-coreboot, i386-multiboot, mips_loongson, mips-arc and mips_qemu_mips </p> <p>To generate a netbootable directory, run: </p> <div class="example"> <pre class="example">grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/<platform> </pre></div> <p>E.g. for i386-pc: </p> <div class="example"> <pre class="example">grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i386-pc </pre></div> <p>Then follow instructions printed out by grub2-mknetdir on configuring your DHCP server. </p> <p>The grub.cfg file is placed in the same directory as the path output by grub-mknetdir hereafter referred to as FWPATH. GRUB will search for its configuration files in order using the following rules where the appended value corresponds to a value on the client machine. </p> <div class="example"> <pre class="example">‘<samp>(FWPATH)</samp>’/grub.cfg-‘<samp>(UUID OF NIC)</samp>’ ‘<samp>(FWPATH)</samp>’/grub.cfg-‘<samp>(MAC ADDRESS OF NIC)</samp>’ ‘<samp>(FWPATH)</samp>’/grub.cfg-‘<samp>(IPv4 OR IPv6 ADDRESS)</samp>’ ‘<samp>(FWPATH)</samp>’/grub.cfg </pre></div> <p>The client will only attempt to look up an IPv6 address config once, however, it will try the IPv4 multiple times. The concrete example below shows what would happen under the IPv4 case. </p> <div class="example"> <pre class="example">UUID: 7726a678-7fc0-4853-a4f6-c85ac36a120a MAC: 52:54:00:ec:33:81 IPV4: 10.0.0.130 (0A000082) </pre></div> <div class="example"> <pre class="example">‘<samp>(FWPATH)</samp>’/grub.cfg-7726a678-7fc0-4853-a4f6-c85ac36a120a ‘<samp>(FWPATH)</samp>’/grub.cfg-52-54-00-ec-33-81 ‘<samp>(FWPATH)</samp>’/grub.cfg-0A000082 ‘<samp>(FWPATH)</samp>’/grub.cfg-0A00008 ‘<samp>(FWPATH)</samp>’/grub.cfg-0A0000 ‘<samp>(FWPATH)</samp>’/grub.cfg-0A000 ‘<samp>(FWPATH)</samp>’/grub.cfg-0A00 ‘<samp>(FWPATH)</samp>’/grub.cfg-0A0 ‘<samp>(FWPATH)</samp>’/grub.cfg-0A ‘<samp>(FWPATH)</samp>’/grub.cfg-0 ‘<samp>(FWPATH)</samp>’/grub.cfg </pre></div> <p>After GRUB has started, files on the TFTP server will be accessible via the ‘<samp>(tftp)</samp>’ device. </p> <p>The server IP address can be controlled by changing the ‘<samp>(tftp)</samp>’ device name to ‘<samp>(tftp,<var>server-ip</var>)</samp>’. Note that this should be changed both in the prefix and in any references to the device name in the configuration file. </p> <p>GRUB provides several environment variables which may be used to inspect or change the behaviour of the PXE device. In the following description <var><interface></var> is placeholder for the name of network interface (platform dependent): </p> <dl compact="compact"> <dt>‘<samp>net_<var><interface></var>_ip</samp>’</dt> <dd><p>The network interface’s IP address. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_mac</samp>’</dt> <dd><p>The network interface’s MAC address. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_hostname</samp>’</dt> <dd><p>The client host name provided by DHCP. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_domain</samp>’</dt> <dd><p>The client domain name provided by DHCP. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_rootpath</samp>’</dt> <dd><p>The path to the client’s root disk provided by DHCP. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_extensionspath</samp>’</dt> <dd><p>The path to additional DHCP vendor extensions provided by DHCP. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_boot_file</samp>’</dt> <dd><p>The boot file name provided by DHCP. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_dhcp_server_name</samp>’</dt> <dd><p>The name of the DHCP server responsible for these boot parameters. Read-only. </p> </dd> <dt>‘<samp>net_<var><interface></var>_next_server</samp>’</dt> <dd><p>The IP address of the next (usually, TFTP) server provided by DHCP. Read-only. </p> </dd> <dt>‘<samp>net_default_interface</samp>’</dt> <dd><p>Initially set to name of network interface that was used to load grub. Read-write, although setting it affects only interpretation of ‘<samp>net_default_ip</samp>’ and ‘<samp>net_default_mac</samp>’ </p> </dd> <dt>‘<samp>net_default_ip</samp>’</dt> <dd><p>The IP address of default interface. Read-only. This is alias for the ‘<samp>net_${net_default_interface}_ip</samp>’. </p> </dd> <dt>‘<samp>net_default_mac</samp>’</dt> <dd><p>The default interface’s MAC address. Read-only. This is alias for the ‘<samp>net_${net_default_interface}_mac</samp>’. </p> </dd> <dt>‘<samp>net_default_server</samp>’</dt> <dd><p>The default server used by network drives (see <a href="#Device-syntax">Device syntax</a>). Read-write, although setting this is only useful before opening a network device. </p> </dd> </dl> <hr> <a name="Serial-terminal"></a> <div class="header"> <p> Next: <a href="#Vendor-power_002don-keys" accesskey="n" rel="next">Vendor power-on keys</a>, Previous: <a href="#Network" accesskey="p" rel="prev">Network</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Using-GRUB-via-a-serial-line"></a> <h2 class="chapter">9 Using GRUB via a serial line</h2> <p>This chapter describes how to use the serial terminal support in GRUB. </p> <p>If you have many computers or computers with no display/keyboard, it could be very useful to control the computers through serial communications. To connect one computer with another via a serial line, you need to prepare a null-modem (cross) serial cable, and you may need to have multiport serial boards, if your computer doesn’t have extra serial ports. In addition, a terminal emulator is also required, such as minicom. Refer to a manual of your operating system, for more information. </p> <p>As for GRUB, the instruction to set up a serial terminal is quite simple. Here is an example: </p> <div class="example"> <pre class="example">grub> <kbd>serial --unit=0 --speed=9600</kbd> grub> <kbd>terminal_input serial; terminal_output serial</kbd> </pre></div> <p>The command <code>serial</code> initializes the serial unit 0 with the speed 9600bps. The serial unit 0 is usually called ‘<samp>COM1</samp>’, so, if you want to use COM2, you must specify ‘<samp>--unit=1</samp>’ instead. This command accepts many other options, so please refer to <a href="#serial">serial</a>, for more details. </p> <p>The commands <code>terminal_input</code> (see <a href="#terminal_005finput">terminal_input</a>) and <code>terminal_output</code> (see <a href="#terminal_005foutput">terminal_output</a>) choose which type of terminal you want to use. In the case above, the terminal will be a serial terminal, but you can also pass <code>console</code> to the command, as ‘<samp>terminal_input serial console</samp>’. In this case, a terminal in which you press any key will be selected as a GRUB terminal. In the example above, note that you need to put both commands on the same command line, as you will lose the ability to type commands on the console after the first command. </p> <p>However, note that GRUB assumes that your terminal emulator is compatible with VT100 by default. This is true for most terminal emulators nowadays, but you should pass the option <samp>--dumb</samp> to the command if your terminal emulator is not VT100-compatible or implements few VT100 escape sequences. If you specify this option then GRUB provides you with an alternative menu interface, because the normal menu requires several fancy features of your terminal. </p> <hr> <a name="Vendor-power_002don-keys"></a> <div class="header"> <p> Next: <a href="#Images" accesskey="n" rel="next">Images</a>, Previous: <a href="#Serial-terminal" accesskey="p" rel="prev">Serial terminal</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Using-GRUB-with-vendor-power_002don-keys"></a> <h2 class="chapter">10 Using GRUB with vendor power-on keys</h2> <p>Some laptop vendors provide an additional power-on button which boots another OS. GRUB supports such buttons with the ‘<samp>GRUB_TIMEOUT_BUTTON</samp>’, ‘<samp>GRUB_TIMEOUT_STYLE_BUTTON</samp>’, ‘<samp>GRUB_DEFAULT_BUTTON</samp>’, and ‘<samp>GRUB_BUTTON_CMOS_ADDRESS</samp>’ variables in default/grub (see <a href="#Simple-configuration">Simple configuration</a>). ‘<samp>GRUB_TIMEOUT_BUTTON</samp>’, ‘<samp>GRUB_TIMEOUT_STYLE_BUTTON</samp>’, and ‘<samp>GRUB_DEFAULT_BUTTON</samp>’ are used instead of the corresponding variables without the ‘<samp>_BUTTON</samp>’ suffix when powered on using the special button. ‘<samp>GRUB_BUTTON_CMOS_ADDRESS</samp>’ is vendor-specific and partially model-specific. Values known to the GRUB team are: </p> <dl compact="compact"> <dt><tt class="key">Dell XPS M1330M</tt></dt> <dd><p>121:3 </p></dd> <dt><tt class="key">Dell XPS M1530</tt></dt> <dd><p>85:3 </p></dd> <dt><tt class="key">Dell Latitude E4300</tt></dt> <dd><p>85:3 </p></dd> <dt><tt class="key">Asus EeePC 1005PE</tt></dt> <dd><p>84:1 (unconfirmed) </p></dd> <dt><tt class="key">LENOVO ThinkPad T410s (2912W1C)</tt></dt> <dd><p>101:3 </p></dd> </dl> <p>To take full advantage of this function, install GRUB into the MBR (see <a href="#Installing-GRUB-using-grub2_002dinstall">Installing GRUB using grub2-install</a>). </p> <p>If you have a laptop which has a similar feature and not in the above list could you figure your address and contribute? To discover the address do the following: </p><ul> <li> boot normally </li><li> <div class="example"> <pre class="example">sudo modprobe nvram sudo cat /dev/nvram | xxd > normal_button.txt </pre></div> </li><li> boot using vendor button </li><li> <div class="example"> <pre class="example">sudo modprobe nvram sudo cat /dev/nvram | xxd > normal_vendor.txt </pre></div> </li></ul> <p>Then compare these text files and find where a bit was toggled. E.g. in case of Dell XPS it was: </p><div class="example"> <pre class="example">byte 0x47: 20 --> 28 </pre></div> <p>It’s a bit number 3 as seen from following table: </p><table> <tr><td width="20%">0</td><td width="20%">01</td></tr> <tr><td width="20%">1</td><td width="20%">02</td></tr> <tr><td width="20%">2</td><td width="20%">04</td></tr> <tr><td width="20%">3</td><td width="20%">08</td></tr> <tr><td width="20%">4</td><td width="20%">10</td></tr> <tr><td width="20%">5</td><td width="20%">20</td></tr> <tr><td width="20%">6</td><td width="20%">40</td></tr> <tr><td width="20%">7</td><td width="20%">80</td></tr> </table> <p>0x47 is decimal 71. Linux nvram implementation cuts first 14 bytes of CMOS. So the real byte address in CMOS is 71+14=85 So complete address is 85:3 </p> <hr> <a name="Images"></a> <div class="header"> <p> Next: <a href="#Core-image-size-limitation" accesskey="n" rel="next">Core image size limitation</a>, Previous: <a href="#Vendor-power_002don-keys" accesskey="p" rel="prev">Vendor power-on keys</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GRUB-image-files"></a> <h2 class="chapter">11 GRUB image files</h2> <p>GRUB consists of several images: a variety of bootstrap images for starting GRUB in various ways, a kernel image, and a set of modules which are combined with the kernel image to form a core image. Here is a short overview of them. </p> <dl compact="compact"> <dt><samp>boot.img</samp></dt> <dd><p>On PC BIOS systems, this image is the first part of GRUB to start. It is written to a master boot record (MBR) or to the boot sector of a partition. Because a PC boot sector is 512 bytes, the size of this image is exactly 512 bytes. </p> <p>The sole function of <samp>boot.img</samp> is to read the first sector of the core image from a local disk and jump to it. Because of the size restriction, <samp>boot.img</samp> cannot understand any file system structure, so <code>grub2-install</code> hardcodes the location of the first sector of the core image into <samp>boot.img</samp> when installing GRUB. </p> </dd> <dt><samp>diskboot.img</samp></dt> <dd><p>This image is used as the first sector of the core image when booting from a hard disk. It reads the rest of the core image into memory and starts the kernel. Since file system handling is not yet available, it encodes the location of the core image using a block list format. </p> </dd> <dt><samp>cdboot.img</samp></dt> <dd><p>This image is used as the first sector of the core image when booting from a CD-ROM drive. It performs a similar function to <samp>diskboot.img</samp>. </p> </dd> <dt><samp>pxeboot.img</samp></dt> <dd><p>This image is used as the start of the core image when booting from the network using PXE. See <a href="#Network">Network</a>. </p> </dd> <dt><samp>lnxboot.img</samp></dt> <dd><p>This image may be placed at the start of the core image in order to make GRUB look enough like a Linux kernel that it can be booted by LILO using an ‘<samp>image=</samp>’ section. </p> </dd> <dt><samp>kernel.img</samp></dt> <dd><p>This image contains GRUB’s basic run-time facilities: frameworks for device and file handling, environment variables, the rescue mode command-line parser, and so on. It is rarely used directly, but is built into all core images. </p> </dd> <dt><samp>core.img</samp></dt> <dd><p>This is the core image of GRUB. It is built dynamically from the kernel image and an arbitrary list of modules by the <code>grub2-mkimage</code> program. Usually, it contains enough modules to access <samp>/boot/grub</samp>, and loads everything else (including menu handling, the ability to load target operating systems, and so on) from the file system at run-time. The modular design allows the core image to be kept small, since the areas of disk where it must be installed are often as small as 32KB. </p> <p>See <a href="#BIOS-installation">BIOS installation</a>, for details on where the core image can be installed on PC systems. </p> </dd> <dt><samp>*.mod</samp></dt> <dd><p>Everything else in GRUB resides in dynamically loadable modules. These are often loaded automatically, or built into the core image if they are essential, but may also be loaded manually using the <code>insmod</code> command (see <a href="#insmod">insmod</a>). </p></dd> </dl> <a name="For-GRUB-Legacy-users"></a> <h3 class="heading">For GRUB Legacy users</h3> <p>GRUB 2 has a different design from GRUB Legacy, and so correspondences with the images it used cannot be exact. Nevertheless, GRUB Legacy users often ask questions in the terms they are familiar with, and so here is a brief guide to how GRUB 2’s images relate to that. </p> <dl compact="compact"> <dt><samp>stage1</samp></dt> <dd><p>Stage 1 from GRUB Legacy was very similar to <samp>boot.img</samp> in GRUB 2, and they serve the same function. </p> </dd> <dt><samp>*_stage1_5</samp></dt> <dd><p>In GRUB Legacy, Stage 1.5’s function was to include enough filesystem code to allow the much larger Stage 2 to be read from an ordinary filesystem. In this respect, its function was similar to <samp>core.img</samp> in GRUB 2. However, <samp>core.img</samp> is much more capable than Stage 1.5 was; since it offers a rescue shell, it is sometimes possible to recover manually in the event that it is unable to load any other modules, for example if partition numbers have changed. <samp>core.img</samp> is built in a more flexible way, allowing GRUB 2 to support reading modules from advanced disk types such as LVM and RAID. </p> <p>GRUB Legacy could run with only Stage 1 and Stage 2 in some limited configurations, while GRUB 2 requires <samp>core.img</samp> and cannot work without it. </p> </dd> <dt><samp>stage2</samp></dt> <dd><p>GRUB 2 has no single Stage 2 image. Instead, it loads modules from <samp>/boot/grub</samp> at run-time. </p> </dd> <dt><samp>stage2_eltorito</samp></dt> <dd><p>In GRUB 2, images for booting from CD-ROM drives are now constructed using <samp>cdboot.img</samp> and <samp>core.img</samp>, making sure that the core image contains the ‘<samp>iso9660</samp>’ module. It is usually best to use the <code>grub2-mkrescue</code> program for this. </p> </dd> <dt><samp>nbgrub</samp></dt> <dd><p>There is as yet no equivalent for <samp>nbgrub</samp> in GRUB 2; it was used by Etherboot and some other network boot loaders. </p> </dd> <dt><samp>pxegrub</samp></dt> <dd><p>In GRUB 2, images for PXE network booting are now constructed using <samp>pxeboot.img</samp> and <samp>core.img</samp>, making sure that the core image contains the ‘<samp>pxe</samp>’ and ‘<samp>pxecmd</samp>’ modules. See <a href="#Network">Network</a>. </p></dd> </dl> <hr> <a name="Core-image-size-limitation"></a> <div class="header"> <p> Next: <a href="#Filesystem" accesskey="n" rel="next">Filesystem</a>, Previous: <a href="#Images" accesskey="p" rel="prev">Images</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Core-image-size-limitation-1"></a> <h2 class="chapter">12 Core image size limitation</h2> <p>Heavily limited platforms: </p><ul> <li> i386-pc (normal and PXE): the core image size (compressed) is limited by 458240 bytes. kernel.img (.text + .data + .bss, uncompressed) is limited by 392704 bytes. module size (uncompressed) + kernel.img (.text + .data, uncompressed) is limited by the size of contiguous chunk at 1M address. </li><li> sparc64-ieee1275: kernel.img (.text + .data + .bss) + modules + 256K (stack) + 2M (heap) is limited by space available at 0x4400. On most platforms it’s just 3 or 4M since ieee1275 maps only so much. </li><li> i386-ieee1275: kernel.img (.text + .data + .bss) + modules is limited by memory available at 0x10000, at most 596K </li></ul> <p>Lightly limited platforms: </p> <ul> <li> *-xen: limited only by adress space and RAM size. </li><li> i386-qemu: kernel.img (.text + .data + .bss) is limited by 392704 bytes. (core.img would be limited by ROM size but it’s unlimited on qemu </li><li> All EFI platforms: limited by contiguous RAM size and possibly firmware bugs </li><li> Coreboot and multiboot. kernel.img (.text + .data + .bss) is limited by 392704 bytes. module size is limited by the size of contiguous chunk at 1M address. </li><li> mipsel-loongson (ELF), mips(el)-qemu_mips (ELF): if uncompressed: kernel.img (.text + .data) + modules is limited by the space from 80200000 forward if compressed: kernel.img (.text + .data, uncompressed) + modules (uncompressed) + (modules + kernel.img (.text + .data)) (compressed) + decompressor is limited by the space from 80200000 forward </li><li> mipsel-loongson (Flash), mips(el)-qemu_mips (Flash): kernel.img (.text + .data) + modules is limited by the space from 80200000 forward core.img (final) is limited by flash size (512K on yeeloong and fulooong) </li><li> mips-arc: if uncompressed: kernel.img (.text + .data) is limited by the space from 8bd00000 forward modules + dummy decompressor is limited by the space from 8bd00000 backward if compressed: kernel.img (.text + .data, uncompressed) is limited by the space from 8bd00000 forward modules (uncompressed) + (modules + kernel.img (.text + .data)) (compressed, aligned to 1M) + 1M (decompressor + scratch space) is limited by the space from 8bd00000 backward </li><li> powerpc-ieee1275: kernel.img (.text + .data + .bss) + modules is limited by space available at 0x200000 </li></ul> <hr> <a name="Filesystem"></a> <div class="header"> <p> Next: <a href="#Interface" accesskey="n" rel="next">Interface</a>, Previous: <a href="#Core-image-size-limitation" accesskey="p" rel="prev">Core image size limitation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Filesystem-syntax-and-semantics"></a> <h2 class="chapter">13 Filesystem syntax and semantics</h2> <p>GRUB uses a special syntax for specifying disk drives which can be accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish between IDE, ESDI, SCSI, or others. You must know yourself which BIOS device is equivalent to which OS device. Normally, that will be clear if you see the files in a device or use the command <code>search</code> (see <a href="#search">search</a>). </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Device-syntax" accesskey="1">Device syntax</a>:</td><td> </td><td align="left" valign="top">How to specify devices </td></tr> <tr><td align="left" valign="top">• <a href="#File-name-syntax" accesskey="2">File name syntax</a>:</td><td> </td><td align="left" valign="top">How to specify files </td></tr> <tr><td align="left" valign="top">• <a href="#Block-list-syntax" accesskey="3">Block list syntax</a>:</td><td> </td><td align="left" valign="top">How to specify block lists </td></tr> </table> <hr> <a name="Device-syntax"></a> <div class="header"> <p> Next: <a href="#File-name-syntax" accesskey="n" rel="next">File name syntax</a>, Up: <a href="#Filesystem" accesskey="u" rel="up">Filesystem</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="How-to-specify-devices"></a> <h3 class="section">13.1 How to specify devices</h3> <p>The device syntax is like this: </p> <div class="example"> <pre class="example"><code>(<var>device</var>[,<var>partmap-name1</var><var>part-num1</var>[,<var>partmap-name2</var><var>part-num2</var>[,...]]])</code> </pre></div> <p>‘<samp>[]</samp>’ means the parameter is optional. <var>device</var> depends on the disk driver in use. BIOS and EFI disks use either ‘<samp>fd</samp>’ or ‘<samp>hd</samp>’ followed by a digit, like ‘<samp>fd0</samp>’, or ‘<samp>cd</samp>’. AHCI, PATA (ata), crypto, USB use the name of driver followed by a number. Memdisk and host are limited to one disk and so it’s refered just by driver name. RAID (md), ofdisk (ieee1275 and nand), LVM (lvm), LDM, virtio (vdsk) and arcdisk (arc) use intrinsic name of disk prefixed by driver name. Additionally just “nand” refers to the disk aliased as “nand”. Conflicts are solved by suffixing a number if necessarry. Commas need to be escaped. Loopback uses whatever name specified to <code>loopback</code> command. Hostdisk uses names specified in device.map as long as it’s of the form [fhc]d[0-9]* or hostdisk/<OS DEVICE>. For crypto and RAID (md) additionally you can use the syntax <driver name>uuid/<uuid>. For LVM additionally you can use the syntax lvmid/<volume-group-uuid>/<volume-uuid>. </p> <div class="example"> <pre class="example">(fd0) (hd0) (cd) (ahci0) (ata0) (crypto0) (usb0) (cryptouuid/123456789abcdef0123456789abcdef0) (mduuid/123456789abcdef0123456789abcdef0) (lvm/system-root) (lvmid/F1ikgD-2RES-306G-il9M-7iwa-4NKW-EbV1NV/eLGuCQ-L4Ka-XUgR-sjtJ-ffch-bajr-fCNfz5) (md/myraid) (md/0) (ieee1275/disk2) (ieee1275//pci@1f\,0/ide@d/disk@2) (nand) (memdisk) (host) (myloop) (hostdisk//dev/sda) </pre></div> <p><var>part-num</var> represents the partition number of <var>device</var>, starting from one. <var>partname</var> is optional but is recommended since disk may have several top-level partmaps. Specifying third and later component you can access to subpartitions. </p> <p>The syntax ‘<samp>(hd0)</samp>’ represents using the entire disk (or the MBR when installing GRUB), while the syntax ‘<samp>(hd0,1)</samp>’ represents using the first partition of the disk (or the boot sector of the partition when installing GRUB). </p> <div class="example"> <pre class="example">(hd0,msdos1) (hd0,msdos1,msdos5) (hd0,msdos1,bsd3) (hd0,netbsd1) (hd0,gpt1) (hd0,1,3) </pre></div> <p>If you enabled the network support, the special drives <code>(<var>protocol</var>[,<var>server</var>])</code> are also available. Supported protocols are ‘<samp>http</samp>’ and ‘<samp>tftp</samp>’. If <var>server</var> is omitted, value of environment variable ‘<samp>net_default_server</samp>’ is used. Before using the network drive, you must initialize the network. See <a href="#Network">Network</a>, for more information. </p> <p>If you boot GRUB from a CD-ROM, ‘<samp>(cd)</samp>’ is available. See <a href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>, for details. </p> <hr> <a name="File-name-syntax"></a> <div class="header"> <p> Next: <a href="#Block-list-syntax" accesskey="n" rel="next">Block list syntax</a>, Previous: <a href="#Device-syntax" accesskey="p" rel="prev">Device syntax</a>, Up: <a href="#Filesystem" accesskey="u" rel="up">Filesystem</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="How-to-specify-files"></a> <h3 class="section">13.2 How to specify files</h3> <p>There are two ways to specify files, by <em>absolute file name</em> and by <em>block list</em>. </p> <p>An absolute file name resembles a Unix absolute file name, using ‘<samp>/</samp>’ for the directory separator (not ‘<samp>\</samp>’ as in DOS). One example is ‘<samp>(hd0,1)/boot/grub2/grub.cfg</samp>’. This means the file <samp>/boot/grub2/grub.cfg</samp> in the first partition of the first hard disk. If you omit the device name in an absolute file name, GRUB uses GRUB’s <em>root device</em> implicitly. So if you set the root device to, say, ‘<samp>(hd1,1)</samp>’ by the command ‘<samp>set root=(hd1,1)</samp>’ (see <a href="#set">set</a>), then <code>/boot/kernel</code> is the same as <code>(hd1,1)/boot/kernel</code>. </p> <p>On ZFS filesystem the first path component must be <var>volume</var>‘<samp>@</samp>’[<var>snapshot</var>]. So ‘<samp>/rootvol@snap-129/boot/grub2/grub.cfg</samp>’ refers to file ‘<samp>/boot/grub2/grub.cfg</samp>’ in snapshot of volume ‘<samp>rootvol</samp>’ with name ‘<samp>snap-129</samp>’. Trailing ‘<samp>@</samp>’ after volume name is mandatory even if snapshot name is omitted. </p> <hr> <a name="Block-list-syntax"></a> <div class="header"> <p> Previous: <a href="#File-name-syntax" accesskey="p" rel="prev">File name syntax</a>, Up: <a href="#Filesystem" accesskey="u" rel="up">Filesystem</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="How-to-specify-block-lists"></a> <h3 class="section">13.3 How to specify block lists</h3> <p>A block list is used for specifying a file that doesn’t appear in the filesystem, like a chainloader. The syntax is <code>[<var>offset</var>]+<var>length</var>[,[<var>offset</var>]+<var>length</var>]…</code>. Here is an example: </p> <div class="example"> <pre class="example"><code>0+100,200+1,300+300</code> </pre></div> <p>This represents that GRUB should read blocks 0 through 99, block 200, and blocks 300 through 599. If you omit an offset, then GRUB assumes the offset is zero. </p> <p>Like the file name syntax (see <a href="#File-name-syntax">File name syntax</a>), if a blocklist does not contain a device name, then GRUB uses GRUB’s <em>root device</em>. So <code>(hd0,2)+1</code> is the same as <code>+1</code> when the root device is ‘<samp>(hd0,2)</samp>’. </p> <hr> <a name="Interface"></a> <div class="header"> <p> Next: <a href="#Environment" accesskey="n" rel="next">Environment</a>, Previous: <a href="#Filesystem" accesskey="p" rel="prev">Filesystem</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GRUB_0027s-user-interface"></a> <h2 class="chapter">14 GRUB’s user interface</h2> <p>GRUB has both a simple menu interface for choosing preset entries from a configuration file, and a highly flexible command-line for performing any desired combination of boot commands. </p> <p>GRUB looks for its configuration file as soon as it is loaded. If one is found, then the full menu interface is activated using whatever entries were found in the file. If you choose the <em>command-line</em> menu option, or if the configuration file was not found, then GRUB drops to the command-line interface. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Command_002dline-interface" accesskey="1">Command-line interface</a>:</td><td> </td><td align="left" valign="top">The flexible command-line interface </td></tr> <tr><td align="left" valign="top">• <a href="#Menu-interface" accesskey="2">Menu interface</a>:</td><td> </td><td align="left" valign="top">The simple menu interface </td></tr> <tr><td align="left" valign="top">• <a href="#Menu-entry-editor" accesskey="3">Menu entry editor</a>:</td><td> </td><td align="left" valign="top">Editing a menu entry </td></tr> </table> <hr> <a name="Command_002dline-interface"></a> <div class="header"> <p> Next: <a href="#Menu-interface" accesskey="n" rel="next">Menu interface</a>, Up: <a href="#Interface" accesskey="u" rel="up">Interface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-flexible-command_002dline-interface"></a> <h3 class="section">14.1 The flexible command-line interface</h3> <p>The command-line interface provides a prompt and after it an editable text area much like a command-line in Unix or DOS. Each command is immediately executed after it is entered<a name="DOCF8" href="#FOOT8"><sup>8</sup></a>. The commands (see <a href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>) are a subset of those available in the configuration file, used with exactly the same syntax. </p> <p>Cursor movement and editing of the text on the line can be done via a subset of the functions available in the Bash shell: </p> <dl compact="compact"> <dt><tt class="key">C-f</tt></dt> <dt><tt class="key">PC right key</tt></dt> <dd><p>Move forward one character. </p> </dd> <dt><tt class="key">C-b</tt></dt> <dt><tt class="key">PC left key</tt></dt> <dd><p>Move back one character. </p> </dd> <dt><tt class="key">C-a</tt></dt> <dt><tt class="key">HOME</tt></dt> <dd><p>Move to the start of the line. </p> </dd> <dt><tt class="key">C-e</tt></dt> <dt><tt class="key">END</tt></dt> <dd><p>Move the the end of the line. </p> </dd> <dt><tt class="key">C-d</tt></dt> <dt><tt class="key">DEL</tt></dt> <dd><p>Delete the character underneath the cursor. </p> </dd> <dt><tt class="key">C-h</tt></dt> <dt><tt class="key">BS</tt></dt> <dd><p>Delete the character to the left of the cursor. </p> </dd> <dt><tt class="key">C-k</tt></dt> <dd><p>Kill the text from the current cursor position to the end of the line. </p> </dd> <dt><tt class="key">C-u</tt></dt> <dd><p>Kill backward from the cursor to the beginning of the line. </p> </dd> <dt><tt class="key">C-y</tt></dt> <dd><p>Yank the killed text back into the buffer at the cursor. </p> </dd> <dt><tt class="key">C-p</tt></dt> <dt><tt class="key">PC up key</tt></dt> <dd><p>Move up through the history list. </p> </dd> <dt><tt class="key">C-n</tt></dt> <dt><tt class="key">PC down key</tt></dt> <dd><p>Move down through the history list. </p></dd> </dl> <p>When typing commands interactively, if the cursor is within or before the first word in the command-line, pressing the <tt class="key">TAB</tt> key (or <tt class="key">C-i</tt>) will display a listing of the available commands, and if the cursor is after the first word, the <kbd><span class="key">TAB</span></kbd> will provide a completion listing of disks, partitions, and file names depending on the context. Note that to obtain a list of drives, one must open a parenthesis, as <code>root (</code>. </p> <p>Note that you cannot use the completion functionality in the TFTP filesystem. This is because TFTP doesn’t support file name listing for the security. </p> <hr> <a name="Menu-interface"></a> <div class="header"> <p> Next: <a href="#Menu-entry-editor" accesskey="n" rel="next">Menu entry editor</a>, Previous: <a href="#Command_002dline-interface" accesskey="p" rel="prev">Command-line interface</a>, Up: <a href="#Interface" accesskey="u" rel="up">Interface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-simple-menu-interface"></a> <h3 class="section">14.2 The simple menu interface</h3> <p>The menu interface is quite easy to use. Its commands are both reasonably intuitive and described on screen. </p> <p>Basically, the menu interface provides a list of <em>boot entries</em> to the user to choose from. Use the arrow keys to select the entry of choice, then press <tt class="key">RET</tt> to run it. An optional timeout is available to boot the default entry (the first one if not set), which is aborted by pressing any key. </p> <p>Commands are available to enter a bare command-line by pressing <tt class="key">c</tt> (which operates exactly like the non-config-file version of GRUB, but allows one to return to the menu if desired by pressing <tt class="key">ESC</tt>) or to edit any of the <em>boot entries</em> by pressing <tt class="key">e</tt>. </p> <p>If you protect the menu interface with a password (see <a href="#Security">Security</a>), all you can do is choose an entry by pressing <tt class="key">RET</tt>, or press <tt class="key">p</tt> to enter the password. </p> <hr> <a name="Menu-entry-editor"></a> <div class="header"> <p> Previous: <a href="#Menu-interface" accesskey="p" rel="prev">Menu interface</a>, Up: <a href="#Interface" accesskey="u" rel="up">Interface</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Editing-a-menu-entry"></a> <h3 class="section">14.3 Editing a menu entry</h3> <p>The menu entry editor looks much like the main menu interface, but the lines in the menu are individual commands in the selected entry instead of entry names. </p> <p>If an <tt class="key">ESC</tt> is pressed in the editor, it aborts all the changes made to the configuration entry and returns to the main menu interface. </p> <p>Each line in the menu entry can be edited freely, and you can add new lines by pressing <tt class="key">RET</tt> at the end of a line. To boot the edited entry, press <tt class="key">Ctrl-x</tt>. </p> <p>Although GRUB unfortunately does not support <em>undo</em>, you can do almost the same thing by just returning to the main menu using <tt class="key">ESC</tt>. </p> <hr> <a name="Environment"></a> <div class="header"> <p> Next: <a href="#Commands" accesskey="n" rel="next">Commands</a>, Previous: <a href="#Interface" accesskey="p" rel="prev">Interface</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GRUB-environment-variables"></a> <h2 class="chapter">15 GRUB environment variables</h2> <p>GRUB supports environment variables which are rather like those offered by all Unix-like systems. Environment variables have a name, which is unique and is usually a short identifier, and a value, which is an arbitrary string of characters. They may be set (see <a href="#set">set</a>), unset (see <a href="#unset">unset</a>), or looked up (see <a href="#Shell_002dlike-scripting">Shell-like scripting</a>) by name. </p> <p>A number of environment variables have special meanings to various parts of GRUB. Others may be used freely in GRUB configuration files. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Special-environment-variables" accesskey="1">Special environment variables</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Environment-block" accesskey="2">Environment block</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Special-environment-variables"></a> <div class="header"> <p> Next: <a href="#Environment-block" accesskey="n" rel="next">Environment block</a>, Up: <a href="#Environment" accesskey="u" rel="up">Environment</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Special-environment-variables-1"></a> <h3 class="section">15.1 Special environment variables</h3> <p>These variables have special meaning to GRUB. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#biosnum" accesskey="1">biosnum</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#check_005fappended_005fsignatures" accesskey="2">check_appended_signatures</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#check_005fsignatures" accesskey="3">check_signatures</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#chosen" accesskey="4">chosen</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#cmdpath" accesskey="5">cmdpath</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#color_005fhighlight" accesskey="6">color_highlight</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#color_005fnormal" accesskey="7">color_normal</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#config_005fdirectory" accesskey="8">config_directory</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#config_005ffile" accesskey="9">config_file</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#debug">debug</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#default">default</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#fallback">fallback</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#gfxmode">gfxmode</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#gfxpayload">gfxpayload</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#gfxterm_005ffont">gfxterm_font</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#grub_005fcpu">grub_cpu</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#grub_005fplatform">grub_platform</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#icondir">icondir</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#lang">lang</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#locale_005fdir">locale_dir</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#menu_005fcolor_005fhighlight">menu_color_highlight</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#menu_005fcolor_005fnormal">menu_color_normal</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fboot_005ffile">net_<var><interface></var>_boot_file</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname">net_<var><interface></var>_dhcp_server_name</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fdomain">net_<var><interface></var>_domain</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fextensionspath">net_<var><interface></var>_extensionspath</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fhostname">net_<var><interface></var>_hostname</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fip">net_<var><interface></var>_ip</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fmac">net_<var><interface></var>_mac</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005fnext_005fserver">net_<var><interface></var>_next_server</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005f_003cinterface_003e_005frootpath">net_<var><interface></var>_rootpath</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fdefault_005finterface">net_default_interface</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fdefault_005fip">net_default_ip</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fdefault_005fmac">net_default_mac</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fdefault_005fserver">net_default_server</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#pager">pager</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#prefix">prefix</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#pxe_005fblksize">pxe_blksize</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#pxe_005fdefault_005fserver">pxe_default_server</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#root">root</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#superusers">superusers</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#theme">theme</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#timeout">timeout</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#timeout_005fstyle">timeout_style</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="biosnum"></a> <div class="header"> <p> Next: <a href="#check_005fappended_005fsignatures" accesskey="n" rel="next">check_appended_signatures</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="biosnum-1"></a> <h4 class="subsection">15.1.1 biosnum</h4> <p>When chain-loading another boot loader (see <a href="#Chain_002dloading">Chain-loading</a>), GRUB may need to know what BIOS drive number corresponds to the root device (see <a href="#root">root</a>) so that it can set up registers properly. If the <var>biosnum</var> variable is set, it overrides GRUB’s own means of guessing this. </p> <p>For an alternative approach which also changes BIOS drive mappings for the chain-loaded system, see <a href="#drivemap">drivemap</a>. </p> <hr> <a name="check_005fappended_005fsignatures"></a> <div class="header"> <p> Next: <a href="#check_005fsignatures" accesskey="n" rel="next">check_signatures</a>, Previous: <a href="#biosnum" accesskey="p" rel="prev">biosnum</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="check_005fappended_005fsignatures-1"></a> <h4 class="subsection">15.1.2 check_appended_signatures</h4> <p>This variable controls whether GRUB enforces appended signature validation on certain loaded files. See <a href="#Using-appended-signatures">Using appended signatures</a>. </p> <hr> <a name="check_005fsignatures"></a> <div class="header"> <p> Next: <a href="#chosen" accesskey="n" rel="next">chosen</a>, Previous: <a href="#check_005fappended_005fsignatures" accesskey="p" rel="prev">check_appended_signatures</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="check_005fsignatures-1"></a> <h4 class="subsection">15.1.3 check_signatures</h4> <p>This variable controls whether GRUB enforces GPG-style digital signature validation on loaded files. See <a href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures</a>. </p> <hr> <a name="chosen"></a> <div class="header"> <p> Next: <a href="#cmdpath" accesskey="n" rel="next">cmdpath</a>, Previous: <a href="#check_005fsignatures" accesskey="p" rel="prev">check_signatures</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="chosen-1"></a> <h4 class="subsection">15.1.4 chosen</h4> <p>When executing a menu entry, GRUB sets the <var>chosen</var> variable to the title of the entry being executed. </p> <p>If the menu entry is in one or more submenus, then <var>chosen</var> is set to the titles of each of the submenus starting from the top level followed by the title of the menu entry itself, separated by ‘<samp>></samp>’. </p> <hr> <a name="cmdpath"></a> <div class="header"> <p> Next: <a href="#color_005fhighlight" accesskey="n" rel="next">color_highlight</a>, Previous: <a href="#chosen" accesskey="p" rel="prev">chosen</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cmdpath-1"></a> <h4 class="subsection">15.1.5 cmdpath</h4> <p>The location from which <samp>core.img</samp> was loaded as an absolute directory name (see <a href="#File-name-syntax">File name syntax</a>). This is set by GRUB at startup based on information returned by platform firmware. Not every platform provides this information and some may return only device without path name. </p> <hr> <a name="color_005fhighlight"></a> <div class="header"> <p> Next: <a href="#color_005fnormal" accesskey="n" rel="next">color_normal</a>, Previous: <a href="#cmdpath" accesskey="p" rel="prev">cmdpath</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="color_005fhighlight-1"></a> <h4 class="subsection">15.1.6 color_highlight</h4> <p>This variable contains the “highlight” foreground and background terminal colors, separated by a slash (‘<samp>/</samp>’). Setting this variable changes those colors. For the available color names, see <a href="#color_005fnormal">color_normal</a>. </p> <p>The default is ‘<samp>black/light-gray</samp>’. </p> <hr> <a name="color_005fnormal"></a> <div class="header"> <p> Next: <a href="#config_005fdirectory" accesskey="n" rel="next">config_directory</a>, Previous: <a href="#color_005fhighlight" accesskey="p" rel="prev">color_highlight</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="color_005fnormal-1"></a> <h4 class="subsection">15.1.7 color_normal</h4> <p>This variable contains the “normal” foreground and background terminal colors, separated by a slash (‘<samp>/</samp>’). Setting this variable changes those colors. Each color must be a name from the following list: </p> <ul> <li> black </li><li> blue </li><li> green </li><li> cyan </li><li> red </li><li> magenta </li><li> brown </li><li> light-gray </li><li> dark-gray </li><li> light-blue </li><li> light-green </li><li> light-cyan </li><li> light-red </li><li> light-magenta </li><li> yellow </li><li> white </li></ul> <p>The default is ‘<samp>light-gray/black</samp>’. </p> <p>The color support support varies from terminal to terminal. </p> <p>‘<samp>morse</samp>’ has no color support at all. </p> <p>‘<samp>mda_text</samp>’ color support is limited to highlighting by black/white reversal. </p> <p>‘<samp>console</samp>’ on ARC, EMU and IEEE1275, ‘<samp>serial_*</samp>’ and ‘<samp>spkmodem</samp>’ are governed by terminfo and support only 8 colors if in modes ‘<samp>vt100-color</samp>’ (default for console on emu), ‘<samp>arc</samp>’ (default for console on ARC), ‘<samp>ieee1275</samp>’ (default for console on IEEE1275). When in mode ‘<samp>vt100</samp>’ then the color support is limited to highlighting by black/white reversal. When in mode ‘<samp>dumb</samp>’ there is no color support. </p> <p>When console supports no colors this setting is ignored. When console supports 8 colors, then the colors from the second half of the previous list are mapped to the matching colors of first half. </p> <p>‘<samp>console</samp>’ on EFI and BIOS and ‘<samp>vga_text</samp>’ support all 16 colors. </p> <p>‘<samp>gfxterm</samp>’ supports all 16 colors and would be theoretically extendable to support whole rgb24 palette but currently there is no compelling reason to go beyond the current 16 colors. </p> <hr> <a name="config_005fdirectory"></a> <div class="header"> <p> Next: <a href="#config_005ffile" accesskey="n" rel="next">config_file</a>, Previous: <a href="#color_005fnormal" accesskey="p" rel="prev">color_normal</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="config_005fdirectory-1"></a> <h4 class="subsection">15.1.8 config_directory</h4> <p>This variable is automatically set by GRUB to the directory part of current configuration file name (see <a href="#config_005ffile">config_file</a>). </p> <hr> <a name="config_005ffile"></a> <div class="header"> <p> Next: <a href="#debug" accesskey="n" rel="next">debug</a>, Previous: <a href="#config_005fdirectory" accesskey="p" rel="prev">config_directory</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="config_005ffile-1"></a> <h4 class="subsection">15.1.9 config_file</h4> <p>This variable is automatically set by GRUB to the name of configuration file that is being processed by commands <code>configfile</code> (see <a href="#configfile">configfile</a>) or <code>normal</code> (see <a href="#normal">normal</a>). It is restored to the previous value when command completes. </p> <hr> <a name="debug"></a> <div class="header"> <p> Next: <a href="#default" accesskey="n" rel="next">default</a>, Previous: <a href="#config_005ffile" accesskey="p" rel="prev">config_file</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="debug-1"></a> <h4 class="subsection">15.1.10 debug</h4> <p>This variable may be set to enable debugging output from various components of GRUB. The value is a list of debug facility names separated by whitespace or ‘<samp>,</samp>’, or ‘<samp>all</samp>’ to enable all available debugging output. The facility names are the first argument to grub_dprintf. Consult source for more details. </p> <hr> <a name="default"></a> <div class="header"> <p> Next: <a href="#fallback" accesskey="n" rel="next">fallback</a>, Previous: <a href="#debug" accesskey="p" rel="prev">debug</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="default-1"></a> <h4 class="subsection">15.1.11 default</h4> <p>If this variable is set, it identifies a menu entry that should be selected by default, possibly after a timeout (see <a href="#timeout">timeout</a>). The entry may be identified by number (starting from 0 at each level of the hierarchy), by title, or by id. </p> <p>For example, if you have: </p> <pre class="verbatim">menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux { ... } </pre> <p>then you can make this the default using: </p> <div class="example"> <pre class="example">default=example-gnu-linux </pre></div> <p>If the entry is in a submenu, then it must be identified using the number, title, or id of each of the submenus starting from the top level, followed by the number, title, or id of the menu entry itself, with each element separated by ‘<samp>></samp>’. For example, take the following menu structure: </p> <div class="example"> <pre class="example">GNU/Hurd --id gnu-hurd Standard Boot --id=gnu-hurd-std Rescue shell --id=gnu-hurd-rescue Other platforms --id=other Minix --id=minix Version 3.4.0 --id=minix-3.4.0 Version 3.3.0 --id=minix-3.3.0 GRUB Invaders --id=grub-invaders </pre></div> <p>The more recent release of Minix would then be identified as ‘<samp>Other platforms>Minix>Version 3.4.0</samp>’, or as ‘<samp>1>0>0</samp>’, or as ‘<samp>other>minix>minix-3.4.0</samp>’. </p> <p>This variable is often set by ‘<samp>GRUB_DEFAULT</samp>’ (see <a href="#Simple-configuration">Simple configuration</a>), <code>grub2-set-default</code>, or <code>grub2-reboot</code>. </p> <hr> <a name="fallback"></a> <div class="header"> <p> Next: <a href="#gfxmode" accesskey="n" rel="next">gfxmode</a>, Previous: <a href="#default" accesskey="p" rel="prev">default</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="fallback-1"></a> <h4 class="subsection">15.1.12 fallback</h4> <p>If this variable is set, it identifies a menu entry that should be selected if the default menu entry fails to boot. Entries are identified in the same way as for ‘<samp>default</samp>’ (see <a href="#default">default</a>). </p> <hr> <a name="gfxmode"></a> <div class="header"> <p> Next: <a href="#gfxpayload" accesskey="n" rel="next">gfxpayload</a>, Previous: <a href="#fallback" accesskey="p" rel="prev">fallback</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="gfxmode-1"></a> <h4 class="subsection">15.1.13 gfxmode</h4> <p>If this variable is set, it sets the resolution used on the ‘<samp>gfxterm</samp>’ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ‘<samp>auto</samp>’, which selects a platform-specific default that should look reasonable. Supported modes can be listed by ‘<samp>videoinfo</samp>’ command in GRUB. </p> <p>The resolution may be specified as a sequence of one or more modes, separated by commas (‘<samp>,</samp>’) or semicolons (‘<samp>;</samp>’); each will be tried in turn until one is found. Each mode should be either ‘<samp>auto</samp>’, ‘<samp><var>width</var>x<var>height</var></samp>’, or ‘<samp><var>width</var>x<var>height</var>x<var>depth</var></samp>’. </p> <hr> <a name="gfxpayload"></a> <div class="header"> <p> Next: <a href="#gfxterm_005ffont" accesskey="n" rel="next">gfxterm_font</a>, Previous: <a href="#gfxmode" accesskey="p" rel="prev">gfxmode</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="gfxpayload-1"></a> <h4 class="subsection">15.1.14 gfxpayload</h4> <p>If this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ‘<samp>vga=</samp>’ boot option (see <a href="#linux">linux</a>). It may be set to ‘<samp>text</samp>’ to force the Linux kernel to boot in normal text mode, ‘<samp>keep</samp>’ to preserve the graphics mode set using ‘<samp>gfxmode</samp>’, or any of the permitted values for ‘<samp>gfxmode</samp>’ to set a particular graphics mode (see <a href="#gfxmode">gfxmode</a>). </p> <p>Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this variable to ‘<samp>text</samp>’ and GRUB will tell Linux to boot in normal text mode. </p> <p>The default is platform-specific. On platforms with a native text mode (such as PC BIOS platforms), the default is ‘<samp>text</samp>’. Otherwise the default may be ‘<samp>auto</samp>’ or a specific video mode. </p> <p>This variable is often set by ‘<samp>GRUB_GFXPAYLOAD_LINUX</samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). </p> <hr> <a name="gfxterm_005ffont"></a> <div class="header"> <p> Next: <a href="#grub_005fcpu" accesskey="n" rel="next">grub_cpu</a>, Previous: <a href="#gfxpayload" accesskey="p" rel="prev">gfxpayload</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="gfxterm_005ffont-1"></a> <h4 class="subsection">15.1.15 gfxterm_font</h4> <p>If this variable is set, it names a font to use for text on the ‘<samp>gfxterm</samp>’ graphical terminal. Otherwise, ‘<samp>gfxterm</samp>’ may use any available font. </p> <hr> <a name="grub_005fcpu"></a> <div class="header"> <p> Next: <a href="#grub_005fplatform" accesskey="n" rel="next">grub_platform</a>, Previous: <a href="#gfxterm_005ffont" accesskey="p" rel="prev">gfxterm_font</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="grub_005fcpu-1"></a> <h4 class="subsection">15.1.16 grub_cpu</h4> <p>In normal mode (see <a href="#normal">normal</a>), GRUB sets the ‘<samp>grub_cpu</samp>’ variable to the CPU type for which GRUB was built (e.g. ‘<samp>i386</samp>’ or ‘<samp>powerpc</samp>’). </p> <hr> <a name="grub_005fplatform"></a> <div class="header"> <p> Next: <a href="#icondir" accesskey="n" rel="next">icondir</a>, Previous: <a href="#grub_005fcpu" accesskey="p" rel="prev">grub_cpu</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="grub_005fplatform-1"></a> <h4 class="subsection">15.1.17 grub_platform</h4> <p>In normal mode (see <a href="#normal">normal</a>), GRUB sets the ‘<samp>grub_platform</samp>’ variable to the platform for which GRUB was built (e.g. ‘<samp>pc</samp>’ or ‘<samp>efi</samp>’). </p> <hr> <a name="icondir"></a> <div class="header"> <p> Next: <a href="#lang" accesskey="n" rel="next">lang</a>, Previous: <a href="#grub_005fplatform" accesskey="p" rel="prev">grub_platform</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="icondir-1"></a> <h4 class="subsection">15.1.18 icondir</h4> <p>If this variable is set, it names a directory in which the GRUB graphical menu should look for icons after looking in the theme’s ‘<samp>icons</samp>’ directory. See <a href="#Theme-file-format">Theme file format</a>. </p> <hr> <a name="lang"></a> <div class="header"> <p> Next: <a href="#locale_005fdir" accesskey="n" rel="next">locale_dir</a>, Previous: <a href="#icondir" accesskey="p" rel="prev">icondir</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="lang-1"></a> <h4 class="subsection">15.1.19 lang</h4> <p>If this variable is set, it names the language code that the <code>gettext</code> command (see <a href="#gettext">gettext</a>) uses to translate strings. For example, French would be named as ‘<samp>fr</samp>’, and Simplified Chinese as ‘<samp>zh_CN</samp>’. </p> <p><code>grub2-mkconfig</code> (see <a href="#Simple-configuration">Simple configuration</a>) will try to set a reasonable default for this variable based on the system locale. </p> <hr> <a name="locale_005fdir"></a> <div class="header"> <p> Next: <a href="#menu_005fcolor_005fhighlight" accesskey="n" rel="next">menu_color_highlight</a>, Previous: <a href="#lang" accesskey="p" rel="prev">lang</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="locale_005fdir-1"></a> <h4 class="subsection">15.1.20 locale_dir</h4> <p>If this variable is set, it names the directory where translation files may be found (see <a href="#gettext">gettext</a>), usually <samp>/boot/grub2/locale</samp>. Otherwise, internationalization is disabled. </p> <p><code>grub2-mkconfig</code> (see <a href="#Simple-configuration">Simple configuration</a>) will set a reasonable default for this variable if internationalization is needed and any translation files are available. </p> <hr> <a name="menu_005fcolor_005fhighlight"></a> <div class="header"> <p> Next: <a href="#menu_005fcolor_005fnormal" accesskey="n" rel="next">menu_color_normal</a>, Previous: <a href="#locale_005fdir" accesskey="p" rel="prev">locale_dir</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="menu_005fcolor_005fhighlight-1"></a> <h4 class="subsection">15.1.21 menu_color_highlight</h4> <p>This variable contains the foreground and background colors to be used for the highlighted menu entry, separated by a slash (‘<samp>/</samp>’). Setting this variable changes those colors. For the available color names, see <a href="#color_005fnormal">color_normal</a>. </p> <p>The default is the value of ‘<samp>color_highlight</samp>’ (see <a href="#color_005fhighlight">color_highlight</a>). </p> <hr> <a name="menu_005fcolor_005fnormal"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fboot_005ffile" accesskey="n" rel="next">net_<var><interface></var>_boot_file</a>, Previous: <a href="#menu_005fcolor_005fhighlight" accesskey="p" rel="prev">menu_color_highlight</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="menu_005fcolor_005fnormal-1"></a> <h4 class="subsection">15.1.22 menu_color_normal</h4> <p>This variable contains the foreground and background colors to be used for non-highlighted menu entries, separated by a slash (‘<samp>/</samp>’). Setting this variable changes those colors. For the available color names, see <a href="#color_005fnormal">color_normal</a>. </p> <p>The default is the value of ‘<samp>color_normal</samp>’ (see <a href="#color_005fnormal">color_normal</a>). </p> <hr> <a name="net_005f_003cinterface_003e_005fboot_005ffile"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname" accesskey="n" rel="next">net_<var><interface></var>_dhcp_server_name</a>, Previous: <a href="#menu_005fcolor_005fnormal" accesskey="p" rel="prev">menu_color_normal</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fboot_005ffile-1"></a> <h4 class="subsection">15.1.23 net_<var><interface></var>_boot_file</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005fdhcp_005fserver_005fname"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fdomain" accesskey="n" rel="next">net_<var><interface></var>_domain</a>, Previous: <a href="#net_005f_003cinterface_003e_005fboot_005ffile" accesskey="p" rel="prev">net_<var><interface></var>_boot_file</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fdhcp_005fserver_005fname-1"></a> <h4 class="subsection">15.1.24 net_<var><interface></var>_dhcp_server_name</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005fdomain"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fextensionspath" accesskey="n" rel="next">net_<var><interface></var>_extensionspath</a>, Previous: <a href="#net_005f_003cinterface_003e_005fdhcp_005fserver_005fname" accesskey="p" rel="prev">net_<var><interface></var>_dhcp_server_name</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fdomain-1"></a> <h4 class="subsection">15.1.25 net_<var><interface></var>_domain</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005fextensionspath"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fhostname" accesskey="n" rel="next">net_<var><interface></var>_hostname</a>, Previous: <a href="#net_005f_003cinterface_003e_005fdomain" accesskey="p" rel="prev">net_<var><interface></var>_domain</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fextensionspath-1"></a> <h4 class="subsection">15.1.26 net_<var><interface></var>_extensionspath</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005fhostname"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fip" accesskey="n" rel="next">net_<var><interface></var>_ip</a>, Previous: <a href="#net_005f_003cinterface_003e_005fextensionspath" accesskey="p" rel="prev">net_<var><interface></var>_extensionspath</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fhostname-1"></a> <h4 class="subsection">15.1.27 net_<var><interface></var>_hostname</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005fip"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fmac" accesskey="n" rel="next">net_<var><interface></var>_mac</a>, Previous: <a href="#net_005f_003cinterface_003e_005fhostname" accesskey="p" rel="prev">net_<var><interface></var>_hostname</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fip-1"></a> <h4 class="subsection">15.1.28 net_<var><interface></var>_ip</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005fmac"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005fnext_005fserver" accesskey="n" rel="next">net_<var><interface></var>_next_server</a>, Previous: <a href="#net_005f_003cinterface_003e_005fip" accesskey="p" rel="prev">net_<var><interface></var>_ip</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fmac-1"></a> <h4 class="subsection">15.1.29 net_<var><interface></var>_mac</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005fnext_005fserver"></a> <div class="header"> <p> Next: <a href="#net_005f_003cinterface_003e_005frootpath" accesskey="n" rel="next">net_<var><interface></var>_rootpath</a>, Previous: <a href="#net_005f_003cinterface_003e_005fmac" accesskey="p" rel="prev">net_<var><interface></var>_mac</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005fnext_005fserver-1"></a> <h4 class="subsection">15.1.30 net_<var><interface></var>_next_server</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005f_003cinterface_003e_005frootpath"></a> <div class="header"> <p> Next: <a href="#net_005fdefault_005finterface" accesskey="n" rel="next">net_default_interface</a>, Previous: <a href="#net_005f_003cinterface_003e_005fnext_005fserver" accesskey="p" rel="prev">net_<var><interface></var>_next_server</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005f_003cinterface_003e_005frootpath-1"></a> <h4 class="subsection">15.1.31 net_<var><interface></var>_rootpath</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005fdefault_005finterface"></a> <div class="header"> <p> Next: <a href="#net_005fdefault_005fip" accesskey="n" rel="next">net_default_ip</a>, Previous: <a href="#net_005f_003cinterface_003e_005frootpath" accesskey="p" rel="prev">net_<var><interface></var>_rootpath</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fdefault_005finterface-1"></a> <h4 class="subsection">15.1.32 net_default_interface</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005fdefault_005fip"></a> <div class="header"> <p> Next: <a href="#net_005fdefault_005fmac" accesskey="n" rel="next">net_default_mac</a>, Previous: <a href="#net_005fdefault_005finterface" accesskey="p" rel="prev">net_default_interface</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fdefault_005fip-1"></a> <h4 class="subsection">15.1.33 net_default_ip</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005fdefault_005fmac"></a> <div class="header"> <p> Next: <a href="#net_005fdefault_005fserver" accesskey="n" rel="next">net_default_server</a>, Previous: <a href="#net_005fdefault_005fip" accesskey="p" rel="prev">net_default_ip</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fdefault_005fmac-1"></a> <h4 class="subsection">15.1.34 net_default_mac</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="net_005fdefault_005fserver"></a> <div class="header"> <p> Next: <a href="#pager" accesskey="n" rel="next">pager</a>, Previous: <a href="#net_005fdefault_005fmac" accesskey="p" rel="prev">net_default_mac</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fdefault_005fserver-1"></a> <h4 class="subsection">15.1.35 net_default_server</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="pager"></a> <div class="header"> <p> Next: <a href="#prefix" accesskey="n" rel="next">prefix</a>, Previous: <a href="#net_005fdefault_005fserver" accesskey="p" rel="prev">net_default_server</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="pager-1"></a> <h4 class="subsection">15.1.36 pager</h4> <p>If set to ‘<samp>1</samp>’, pause output after each screenful and wait for keyboard input. The default is not to pause output. </p> <hr> <a name="prefix"></a> <div class="header"> <p> Next: <a href="#pxe_005fblksize" accesskey="n" rel="next">pxe_blksize</a>, Previous: <a href="#pager" accesskey="p" rel="prev">pager</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="prefix-1"></a> <h4 class="subsection">15.1.37 prefix</h4> <p>The location of the ‘<samp>/boot/grub</samp>’ directory as an absolute file name (see <a href="#File-name-syntax">File name syntax</a>). This is normally set by GRUB at startup based on information provided by <code>grub2-install</code>. GRUB modules are dynamically loaded from this directory, so it must be set correctly in order for many parts of GRUB to work. </p> <hr> <a name="pxe_005fblksize"></a> <div class="header"> <p> Next: <a href="#pxe_005fdefault_005fgateway" accesskey="n" rel="next">pxe_default_gateway</a>, Previous: <a href="#prefix" accesskey="p" rel="prev">prefix</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="pxe_005fblksize-1"></a> <h4 class="subsection">15.1.38 pxe_blksize</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="pxe_005fdefault_005fgateway"></a> <div class="header"> <p> Next: <a href="#pxe_005fdefault_005fserver" accesskey="n" rel="next">pxe_default_server</a>, Previous: <a href="#pxe_005fblksize" accesskey="p" rel="prev">pxe_blksize</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="pxe_005fdefault_005fgateway-1"></a> <h4 class="subsection">15.1.39 pxe_default_gateway</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="pxe_005fdefault_005fserver"></a> <div class="header"> <p> Next: <a href="#root" accesskey="n" rel="next">root</a>, Previous: <a href="#pxe_005fdefault_005fgateway" accesskey="p" rel="prev">pxe_default_gateway</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="pxe_005fdefault_005fserver-1"></a> <h4 class="subsection">15.1.40 pxe_default_server</h4> <p>See <a href="#Network">Network</a>. </p> <hr> <a name="root"></a> <div class="header"> <p> Next: <a href="#superusers" accesskey="n" rel="next">superusers</a>, Previous: <a href="#pxe_005fdefault_005fserver" accesskey="p" rel="prev">pxe_default_server</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="root-1"></a> <h4 class="subsection">15.1.41 root</h4> <p>The root device name (see <a href="#Device-syntax">Device syntax</a>). Any file names that do not specify an explicit device name are read from this device. The default is normally set by GRUB at startup based on the value of ‘<samp>prefix</samp>’ (see <a href="#prefix">prefix</a>). </p> <p>For example, if GRUB was installed to the first partition of the first hard disk, then ‘<samp>prefix</samp>’ might be set to ‘<samp>(hd0,msdos1)/boot/grub</samp>’ and ‘<samp>root</samp>’ to ‘<samp>hd0,msdos1</samp>’. </p> <hr> <a name="superusers"></a> <div class="header"> <p> Next: <a href="#theme" accesskey="n" rel="next">theme</a>, Previous: <a href="#root" accesskey="p" rel="prev">root</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="superusers-1"></a> <h4 class="subsection">15.1.42 superusers</h4> <p>This variable may be set to a list of superuser names to enable authentication support. See <a href="#Security">Security</a>. </p> <hr> <a name="theme"></a> <div class="header"> <p> Next: <a href="#timeout" accesskey="n" rel="next">timeout</a>, Previous: <a href="#superusers" accesskey="p" rel="prev">superusers</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="theme-1"></a> <h4 class="subsection">15.1.43 theme</h4> <p>This variable may be set to a directory containing a GRUB graphical menu theme. See <a href="#Theme-file-format">Theme file format</a>. </p> <p>This variable is often set by ‘<samp>GRUB_THEME</samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). </p> <hr> <a name="timeout"></a> <div class="header"> <p> Next: <a href="#timeout_005fstyle" accesskey="n" rel="next">timeout_style</a>, Previous: <a href="#theme" accesskey="p" rel="prev">theme</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="timeout-1"></a> <h4 class="subsection">15.1.44 timeout</h4> <p>If this variable is set, it specifies the time in seconds to wait for keyboard input before booting the default menu entry. A timeout of ‘<samp>0</samp>’ means to boot the default entry immediately without displaying the menu; a timeout of ‘<samp>-1</samp>’ (or unset) means to wait indefinitely. </p> <p>If ‘<samp>timeout_style</samp>’ (see <a href="#timeout_005fstyle">timeout_style</a>) is set to ‘<samp>countdown</samp>’ or ‘<samp>hidden</samp>’, the timeout is instead counted before the menu is displayed. </p> <p>This variable is often set by ‘<samp>GRUB_TIMEOUT</samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). </p> <hr> <a name="timeout_005fstyle"></a> <div class="header"> <p> Previous: <a href="#timeout" accesskey="p" rel="prev">timeout</a>, Up: <a href="#Special-environment-variables" accesskey="u" rel="up">Special environment variables</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="timeout_005fstyle-1"></a> <h4 class="subsection">15.1.45 timeout_style</h4> <p>This variable may be set to ‘<samp>menu</samp>’, ‘<samp>countdown</samp>’, or ‘<samp>hidden</samp>’ to control the way in which the timeout (see <a href="#timeout">timeout</a>) interacts with displaying the menu. See the documentation of ‘<samp>GRUB_TIMEOUT_STYLE</samp>’ (see <a href="#Simple-configuration">Simple configuration</a>) for details. </p> <hr> <a name="Environment-block"></a> <div class="header"> <p> Previous: <a href="#Special-environment-variables" accesskey="p" rel="prev">Special environment variables</a>, Up: <a href="#Environment" accesskey="u" rel="up">Environment</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-GRUB-environment-block"></a> <h3 class="section">15.2 The GRUB environment block</h3> <p>It is often useful to be able to remember a small amount of information from one boot to the next. For example, you might want to set the default menu entry based on what was selected the last time. GRUB deliberately does not implement support for writing files in order to minimise the possibility of the boot loader being responsible for file system corruption, so a GRUB configuration file cannot just create a file in the ordinary way. However, GRUB provides an “environment block” which can be used to save a small amount of state. </p> <p>The environment block is a preallocated 1024-byte file, which normally lives in <samp>/boot/grub2/grubenv</samp> (although you should not assume this). At boot time, the <code>load_env</code> command (see <a href="#load_005fenv">load_env</a>) loads environment variables from it, and the <code>save_env</code> (see <a href="#save_005fenv">save_env</a>) command saves environment variables to it. From a running system, the <code>grub2-editenv</code> utility can be used to edit the environment block. </p> <p>For safety reasons, this storage is only available when installed on a plain disk (no LVM or RAID), using a non-checksumming filesystem (no ZFS), and using BIOS or EFI functions (no ATA, USB or IEEE1275). </p> <p><code>grub2-mkconfig</code> uses this facility to implement ‘<samp>GRUB_SAVEDEFAULT</samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). </p> <hr> <a name="Commands"></a> <div class="header"> <p> Next: <a href="#Internationalisation" accesskey="n" rel="next">Internationalisation</a>, Previous: <a href="#Environment" accesskey="p" rel="prev">Environment</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-list-of-available-commands"></a> <h2 class="chapter">16 The list of available commands</h2> <p>In this chapter, we list all commands that are available in GRUB. </p> <p>Commands belong to different groups. A few can only be used in the global section of the configuration file (or “menu”); most of them can be entered on the command-line and can be used either anywhere in the menu or specifically in the menu entries. </p> <p>In rescue mode, only the <code>insmod</code> (see <a href="#insmod">insmod</a>), <code>ls</code> (see <a href="#ls">ls</a>), <code>set</code> (see <a href="#set">set</a>), and <code>unset</code> (see <a href="#unset">unset</a>) commands are normally available. If you end up in rescue mode and do not know what to do, then see <a href="#GRUB-only-offers-a-rescue-shell">GRUB only offers a rescue shell</a>. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Menu_002dspecific-commands" accesskey="1">Menu-specific commands</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#General-commands" accesskey="2">General commands</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Command_002dline-and-menu-entry-commands" accesskey="3">Command-line and menu entry commands</a>:</td><td> </td><td align="left" valign="top"> </td></tr> <tr><td align="left" valign="top">• <a href="#Networking-commands" accesskey="4">Networking commands</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="Menu_002dspecific-commands"></a> <div class="header"> <p> Next: <a href="#General-commands" accesskey="n" rel="next">General commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-list-of-commands-for-the-menu-only"></a> <h3 class="section">16.1 The list of commands for the menu only</h3> <p>The semantics used in parsing the configuration file are the following: </p> <ul> <li> The files <em>must</em> be in plain-text format. </li><li> ‘<samp>#</samp>’ at the beginning of a line in a configuration file means it is only a comment. </li><li> Options are separated by spaces. </li><li> All numbers can be either decimal or hexadecimal. A hexadecimal number must be preceded by ‘<samp>0x</samp>’, and is case-insensitive. </li></ul> <p>These commands can only be used in the menu: </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#menuentry" accesskey="1">menuentry</a>:</td><td> </td><td align="left" valign="top">Start a menu entry </td></tr> <tr><td align="left" valign="top">• <a href="#submenu" accesskey="2">submenu</a>:</td><td> </td><td align="left" valign="top">Group menu entries </td></tr> </table> <hr> <a name="menuentry"></a> <div class="header"> <p> Next: <a href="#submenu" accesskey="n" rel="next">submenu</a>, Up: <a href="#Menu_002dspecific-commands" accesskey="u" rel="up">Menu-specific commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="menuentry-1"></a> <h4 class="subsection">16.1.1 menuentry</h4> <dl> <dt><a name="index-menuentry"></a>Command: <strong>menuentry</strong> <em><var>title</var> [<samp>--class=class</samp> …] [<samp>--users=users</samp>] [<samp>--unrestricted</samp>] [<samp>--hotkey=key</samp>] [<samp>--id=id</samp>] [<var>arg</var> …] { <var>command</var>; … }</em></dt> <dd><p>This defines a GRUB menu entry named <var>title</var>. When this entry is selected from the menu, GRUB will set the <var>chosen</var> environment variable to value of <samp>--id</samp> if <samp>--id</samp> is given, execute the list of commands given within braces, and if the last command in the list returned successfully and a kernel was loaded it will execute the <code>boot</code> command. </p> <p>The <samp>--class</samp> option may be used any number of times to group menu entries into classes. Menu themes may display different classes using different styles. </p> <p>The <samp>--users</samp> option grants specific users access to specific menu entries. See <a href="#Security">Security</a>. </p> <p>The <samp>--unrestricted</samp> option grants all users access to specific menu entries. See <a href="#Security">Security</a>. </p> <p>The <samp>--hotkey</samp> option associates a hotkey with a menu entry. <var>key</var> may be a single letter, or one of the aliases ‘<samp>backspace</samp>’, ‘<samp>tab</samp>’, or ‘<samp>delete</samp>’. </p> <p>The <samp>--id</samp> may be used to associate unique identifier with a menu entry. <var>id</var> is string of ASCII aphanumeric characters, underscore and hyphen and should not start with a digit. </p> <p>All other arguments including <var>title</var> are passed as positional parameters when list of commands is executed with <var>title</var> always assigned to <code>$1</code>. </p></dd></dl> <hr> <a name="submenu"></a> <div class="header"> <p> Previous: <a href="#menuentry" accesskey="p" rel="prev">menuentry</a>, Up: <a href="#Menu_002dspecific-commands" accesskey="u" rel="up">Menu-specific commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="submenu-1"></a> <h4 class="subsection">16.1.2 submenu</h4> <dl> <dt><a name="index-submenu"></a>Command: <strong>submenu</strong> <em><var>title</var> [<samp>--class=class</samp> …] [<samp>--users=users</samp>] [<samp>--unrestricted</samp>] [<samp>--hotkey=key</samp>] [<samp>--id=id</samp>] { <var>menu entries</var> … }</em></dt> <dd><p>This defines a submenu. An entry called <var>title</var> will be added to the menu; when that entry is selected, a new menu will be displayed showing all the entries within this submenu. </p> <p>All options are the same as in the <code>menuentry</code> command (see <a href="#menuentry">menuentry</a>). </p></dd></dl> <hr> <a name="General-commands"></a> <div class="header"> <p> Next: <a href="#Command_002dline-and-menu-entry-commands" accesskey="n" rel="next">Command-line and menu entry commands</a>, Previous: <a href="#Menu_002dspecific-commands" accesskey="p" rel="prev">Menu-specific commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-list-of-general-commands"></a> <h3 class="section">16.2 The list of general commands</h3> <p>Commands usable anywhere in the menu and in the command-line. </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#serial" accesskey="1">serial</a>:</td><td> </td><td align="left" valign="top">Set up a serial device </td></tr> <tr><td align="left" valign="top">• <a href="#terminal_005finput" accesskey="2">terminal_input</a>:</td><td> </td><td align="left" valign="top">Manage input terminals </td></tr> <tr><td align="left" valign="top">• <a href="#terminal_005foutput" accesskey="3">terminal_output</a>:</td><td> </td><td align="left" valign="top">Manage output terminals </td></tr> <tr><td align="left" valign="top">• <a href="#terminfo" accesskey="4">terminfo</a>:</td><td> </td><td align="left" valign="top">Define terminal type </td></tr> </table> <hr> <a name="serial"></a> <div class="header"> <p> Next: <a href="#terminal_005finput" accesskey="n" rel="next">terminal_input</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="serial-1"></a> <h4 class="subsection">16.2.1 serial</h4> <dl> <dt><a name="index-serial"></a>Command: <strong>serial</strong> <em>[<samp>--unit=unit</samp>] [<samp>--port=port</samp>] [<samp>--speed=speed</samp>] [<samp>--word=word</samp>] [<samp>--parity=parity</samp>] [<samp>--stop=stop</samp>]</em></dt> <dd><p>Initialize a serial device. <var>unit</var> is a number in the range 0-3 specifying which serial port to use; default is 0, which corresponds to the port often called COM1. <var>port</var> is the I/O port where the UART is to be found; if specified it takes precedence over <var>unit</var>. <var>speed</var> is the transmission speed; default is 9600. <var>word</var> and <var>stop</var> are the number of data bits and stop bits. Data bits must be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data bits and one stop bit. <var>parity</var> is one of ‘<samp>no</samp>’, ‘<samp>odd</samp>’, ‘<samp>even</samp>’ and defaults to ‘<samp>no</samp>’. </p> <p>The serial port is not used as a communication channel unless the <code>terminal_input</code> or <code>terminal_output</code> command is used (see <a href="#terminal_005finput">terminal_input</a>, see <a href="#terminal_005foutput">terminal_output</a>). </p> <p>See also <a href="#Serial-terminal">Serial terminal</a>. </p></dd></dl> <hr> <a name="terminal_005finput"></a> <div class="header"> <p> Next: <a href="#terminal_005foutput" accesskey="n" rel="next">terminal_output</a>, Previous: <a href="#serial" accesskey="p" rel="prev">serial</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="terminal_005finput-1"></a> <h4 class="subsection">16.2.2 terminal_input</h4> <dl> <dt><a name="index-terminal_005finput"></a>Command: <strong>terminal_input</strong> <em>[<samp>--append</samp>|<samp>--remove</samp>] [terminal1] [terminal2] …</em></dt> <dd><p>List or select an input terminal. </p> <p>With no arguments, list the active and available input terminals. </p> <p>With <samp>--append</samp>, add the named terminals to the list of active input terminals; any of these may be used to provide input to GRUB. </p> <p>With <samp>--remove</samp>, remove the named terminals from the active list. </p> <p>With no options but a list of terminal names, make only the listed terminal names active. </p></dd></dl> <hr> <a name="terminal_005foutput"></a> <div class="header"> <p> Next: <a href="#terminfo" accesskey="n" rel="next">terminfo</a>, Previous: <a href="#terminal_005finput" accesskey="p" rel="prev">terminal_input</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="terminal_005foutput-1"></a> <h4 class="subsection">16.2.3 terminal_output</h4> <dl> <dt><a name="index-terminal_005foutput"></a>Command: <strong>terminal_output</strong> <em>[<samp>--append</samp>|<samp>--remove</samp>] [terminal1] [terminal2] …</em></dt> <dd><p>List or select an output terminal. </p> <p>With no arguments, list the active and available output terminals. </p> <p>With <samp>--append</samp>, add the named terminals to the list of active output terminals; all of these will receive output from GRUB. </p> <p>With <samp>--remove</samp>, remove the named terminals from the active list. </p> <p>With no options but a list of terminal names, make only the listed terminal names active. </p></dd></dl> <hr> <a name="terminfo"></a> <div class="header"> <p> Previous: <a href="#terminal_005foutput" accesskey="p" rel="prev">terminal_output</a>, Up: <a href="#General-commands" accesskey="u" rel="up">General commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="terminfo-1"></a> <h4 class="subsection">16.2.4 terminfo</h4> <dl> <dt><a name="index-terminfo"></a>Command: <strong>terminfo</strong> <em>[-a|-u|-v] [term]</em></dt> <dd><p>Define the capabilities of your terminal by giving the name of an entry in the terminfo database, which should correspond roughly to a ‘<samp>TERM</samp>’ environment variable in Unix. </p> <p>The currently available terminal types are ‘<samp>vt100</samp>’, ‘<samp>vt100-color</samp>’, ‘<samp>ieee1275</samp>’, and ‘<samp>dumb</samp>’. If you need other terminal types, please contact us to discuss the best way to include support for these in GRUB. </p> <p>The <samp>-a</samp> (<samp>--ascii</samp>), <samp>-u</samp> (<samp>--utf8</samp>), and <samp>-v</samp> (<samp>--visual-utf8</samp>) options control how non-ASCII text is displayed. <samp>-a</samp> specifies an ASCII-only terminal; <samp>-u</samp> specifies logically-ordered UTF-8; and <samp>-v</samp> specifies "visually-ordered UTF-8" (in other words, arranged such that a terminal emulator without bidirectional text support will display right-to-left text in the proper order; this is not really proper UTF-8, but a workaround). </p> <p>If no option or terminal type is specified, the current terminal type is printed. </p></dd></dl> <hr> <a name="Command_002dline-and-menu-entry-commands"></a> <div class="header"> <p> Next: <a href="#Networking-commands" accesskey="n" rel="next">Networking commands</a>, Previous: <a href="#General-commands" accesskey="p" rel="prev">General commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-list-of-command_002dline-and-menu-entry-commands"></a> <h3 class="section">16.3 The list of command-line and menu entry commands</h3> <p>These commands are usable in the command-line and in menu entries. If you forget a command, you can run the command <code>help</code> (see <a href="#help">help</a>). </p> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#g_t_005b" accesskey="1">[</a>:</td><td> </td><td align="left" valign="top">Check file types and compare values </td></tr> <tr><td align="left" valign="top">• <a href="#acpi" accesskey="2">acpi</a>:</td><td> </td><td align="left" valign="top">Load ACPI tables </td></tr> <tr><td align="left" valign="top">• <a href="#authenticate" accesskey="3">authenticate</a>:</td><td> </td><td align="left" valign="top">Check whether user is in user list </td></tr> <tr><td align="left" valign="top">• <a href="#background_005fcolor" accesskey="4">background_color</a>:</td><td> </td><td align="left" valign="top">Set background color for active terminal </td></tr> <tr><td align="left" valign="top">• <a href="#background_005fimage" accesskey="5">background_image</a>:</td><td> </td><td align="left" valign="top">Load background image for active terminal </td></tr> <tr><td align="left" valign="top">• <a href="#badram" accesskey="6">badram</a>:</td><td> </td><td align="left" valign="top">Filter out bad regions of RAM </td></tr> <tr><td align="left" valign="top">• <a href="#blocklist" accesskey="7">blocklist</a>:</td><td> </td><td align="left" valign="top">Print a block list </td></tr> <tr><td align="left" valign="top">• <a href="#boot" accesskey="8">boot</a>:</td><td> </td><td align="left" valign="top">Start up your operating system </td></tr> <tr><td align="left" valign="top">• <a href="#cat" accesskey="9">cat</a>:</td><td> </td><td align="left" valign="top">Show the contents of a file </td></tr> <tr><td align="left" valign="top">• <a href="#chainloader">chainloader</a>:</td><td> </td><td align="left" valign="top">Chain-load another boot loader </td></tr> <tr><td align="left" valign="top">• <a href="#clear">clear</a>:</td><td> </td><td align="left" valign="top">Clear the screen </td></tr> <tr><td align="left" valign="top">• <a href="#cmosclean">cmosclean</a>:</td><td> </td><td align="left" valign="top">Clear bit in CMOS </td></tr> <tr><td align="left" valign="top">• <a href="#cmosdump">cmosdump</a>:</td><td> </td><td align="left" valign="top">Dump CMOS contents </td></tr> <tr><td align="left" valign="top">• <a href="#cmostest">cmostest</a>:</td><td> </td><td align="left" valign="top">Test bit in CMOS </td></tr> <tr><td align="left" valign="top">• <a href="#cmp">cmp</a>:</td><td> </td><td align="left" valign="top">Compare two files </td></tr> <tr><td align="left" valign="top">• <a href="#configfile">configfile</a>:</td><td> </td><td align="left" valign="top">Load a configuration file </td></tr> <tr><td align="left" valign="top">• <a href="#cpuid">cpuid</a>:</td><td> </td><td align="left" valign="top">Check for CPU features </td></tr> <tr><td align="left" valign="top">• <a href="#crc">crc</a>:</td><td> </td><td align="left" valign="top">Compute or check CRC32 checksums </td></tr> <tr><td align="left" valign="top">• <a href="#cryptomount">cryptomount</a>:</td><td> </td><td align="left" valign="top">Mount a crypto device </td></tr> <tr><td align="left" valign="top">• <a href="#cutmem">cutmem</a>:</td><td> </td><td align="left" valign="top">Remove memory regions </td></tr> <tr><td align="left" valign="top">• <a href="#date">date</a>:</td><td> </td><td align="left" valign="top">Display or set current date and time </td></tr> <tr><td align="left" valign="top">• <a href="#devicetree">devicetree</a>:</td><td> </td><td align="left" valign="top">Load a device tree blob </td></tr> <tr><td align="left" valign="top">• <a href="#distrust">distrust</a>:</td><td> </td><td align="left" valign="top">Remove a pubkey from trusted keys </td></tr> <tr><td align="left" valign="top">• <a href="#distrust_005fcertificate">distrust_certificate</a>:</td><td> </td><td align="left" valign="top">Remove a certificate from the list of trusted certificates </td></tr> <tr><td align="left" valign="top">• <a href="#drivemap">drivemap</a>:</td><td> </td><td align="left" valign="top">Map a drive to another </td></tr> <tr><td align="left" valign="top">• <a href="#echo">echo</a>:</td><td> </td><td align="left" valign="top">Display a line of text </td></tr> <tr><td align="left" valign="top">• <a href="#eval">eval</a>:</td><td> </td><td align="left" valign="top">Evaluate agruments as GRUB commands </td></tr> <tr><td align="left" valign="top">• <a href="#export">export</a>:</td><td> </td><td align="left" valign="top">Export an environment variable </td></tr> <tr><td align="left" valign="top">• <a href="#false">false</a>:</td><td> </td><td align="left" valign="top">Do nothing, unsuccessfully </td></tr> <tr><td align="left" valign="top">• <a href="#gettext">gettext</a>:</td><td> </td><td align="left" valign="top">Translate a string </td></tr> <tr><td align="left" valign="top">• <a href="#gptsync">gptsync</a>:</td><td> </td><td align="left" valign="top">Fill an MBR based on GPT entries </td></tr> <tr><td align="left" valign="top">• <a href="#halt">halt</a>:</td><td> </td><td align="left" valign="top">Shut down your computer </td></tr> <tr><td align="left" valign="top">• <a href="#hashsum">hashsum</a>:</td><td> </td><td align="left" valign="top">Compute or check hash checksum </td></tr> <tr><td align="left" valign="top">• <a href="#help">help</a>:</td><td> </td><td align="left" valign="top">Show help messages </td></tr> <tr><td align="left" valign="top">• <a href="#initrd">initrd</a>:</td><td> </td><td align="left" valign="top">Load a Linux initrd </td></tr> <tr><td align="left" valign="top">• <a href="#initrd16">initrd16</a>:</td><td> </td><td align="left" valign="top">Load a Linux initrd (16-bit mode) </td></tr> <tr><td align="left" valign="top">• <a href="#insmod">insmod</a>:</td><td> </td><td align="left" valign="top">Insert a module </td></tr> <tr><td align="left" valign="top">• <a href="#keystatus">keystatus</a>:</td><td> </td><td align="left" valign="top">Check key modifier status </td></tr> <tr><td align="left" valign="top">• <a href="#linux">linux</a>:</td><td> </td><td align="left" valign="top">Load a Linux kernel </td></tr> <tr><td align="left" valign="top">• <a href="#linux16">linux16</a>:</td><td> </td><td align="left" valign="top">Load a Linux kernel (16-bit mode) </td></tr> <tr><td align="left" valign="top">• <a href="#list_005fcertificates">list_certificates</a>:</td><td> </td><td align="left" valign="top">List trusted certificates </td></tr> <tr><td align="left" valign="top">• <a href="#list_005fenv">list_env</a>:</td><td> </td><td align="left" valign="top">List variables in environment block </td></tr> <tr><td align="left" valign="top">• <a href="#list_005ftrusted">list_trusted</a>:</td><td> </td><td align="left" valign="top">List trusted public keys </td></tr> <tr><td align="left" valign="top">• <a href="#load_005fenv">load_env</a>:</td><td> </td><td align="left" valign="top">Load variables from environment block </td></tr> <tr><td align="left" valign="top">• <a href="#loadfont">loadfont</a>:</td><td> </td><td align="left" valign="top">Load font files </td></tr> <tr><td align="left" valign="top">• <a href="#loopback">loopback</a>:</td><td> </td><td align="left" valign="top">Make a device from a filesystem image </td></tr> <tr><td align="left" valign="top">• <a href="#ls">ls</a>:</td><td> </td><td align="left" valign="top">List devices or files </td></tr> <tr><td align="left" valign="top">• <a href="#lsfonts">lsfonts</a>:</td><td> </td><td align="left" valign="top">List loaded fonts </td></tr> <tr><td align="left" valign="top">• <a href="#lsmod">lsmod</a>:</td><td> </td><td align="left" valign="top">Show loaded modules </td></tr> <tr><td align="left" valign="top">• <a href="#md5sum">md5sum</a>:</td><td> </td><td align="left" valign="top">Compute or check MD5 hash </td></tr> <tr><td align="left" valign="top">• <a href="#module">module</a>:</td><td> </td><td align="left" valign="top">Load module for multiboot kernel </td></tr> <tr><td align="left" valign="top">• <a href="#multiboot">multiboot</a>:</td><td> </td><td align="left" valign="top">Load multiboot compliant kernel </td></tr> <tr><td align="left" valign="top">• <a href="#nativedisk">nativedisk</a>:</td><td> </td><td align="left" valign="top">Switch to native disk drivers </td></tr> <tr><td align="left" valign="top">• <a href="#normal">normal</a>:</td><td> </td><td align="left" valign="top">Enter normal mode </td></tr> <tr><td align="left" valign="top">• <a href="#normal_005fexit">normal_exit</a>:</td><td> </td><td align="left" valign="top">Exit from normal mode </td></tr> <tr><td align="left" valign="top">• <a href="#parttool">parttool</a>:</td><td> </td><td align="left" valign="top">Modify partition table entries </td></tr> <tr><td align="left" valign="top">• <a href="#password">password</a>:</td><td> </td><td align="left" valign="top">Set a clear-text password </td></tr> <tr><td align="left" valign="top">• <a href="#password_005fpbkdf2">password_pbkdf2</a>:</td><td> </td><td align="left" valign="top">Set a hashed password </td></tr> <tr><td align="left" valign="top">• <a href="#play">play</a>:</td><td> </td><td align="left" valign="top">Play a tune </td></tr> <tr><td align="left" valign="top">• <a href="#probe">probe</a>:</td><td> </td><td align="left" valign="top">Retrieve device info </td></tr> <tr><td align="left" valign="top">• <a href="#pxe_005funload">pxe_unload</a>:</td><td> </td><td align="left" valign="top">Unload the PXE environment </td></tr> <tr><td align="left" valign="top">• <a href="#read">read</a>:</td><td> </td><td align="left" valign="top">Read user input </td></tr> <tr><td align="left" valign="top">• <a href="#reboot">reboot</a>:</td><td> </td><td align="left" valign="top">Reboot your computer </td></tr> <tr><td align="left" valign="top">• <a href="#regexp">regexp</a>:</td><td> </td><td align="left" valign="top">Test if regular expression matches string </td></tr> <tr><td align="left" valign="top">• <a href="#rmmod">rmmod</a>:</td><td> </td><td align="left" valign="top">Remove a module </td></tr> <tr><td align="left" valign="top">• <a href="#save_005fenv">save_env</a>:</td><td> </td><td align="left" valign="top">Save variables to environment block </td></tr> <tr><td align="left" valign="top">• <a href="#search">search</a>:</td><td> </td><td align="left" valign="top">Search devices by file, label, or UUID </td></tr> <tr><td align="left" valign="top">• <a href="#sendkey">sendkey</a>:</td><td> </td><td align="left" valign="top">Emulate keystrokes </td></tr> <tr><td align="left" valign="top">• <a href="#set">set</a>:</td><td> </td><td align="left" valign="top">Set an environment variable </td></tr> <tr><td align="left" valign="top">• <a href="#sha1sum">sha1sum</a>:</td><td> </td><td align="left" valign="top">Compute or check SHA1 hash </td></tr> <tr><td align="left" valign="top">• <a href="#sha256sum">sha256sum</a>:</td><td> </td><td align="left" valign="top">Compute or check SHA256 hash </td></tr> <tr><td align="left" valign="top">• <a href="#sha512sum">sha512sum</a>:</td><td> </td><td align="left" valign="top">Compute or check SHA512 hash </td></tr> <tr><td align="left" valign="top">• <a href="#sleep">sleep</a>:</td><td> </td><td align="left" valign="top">Wait for a specified number of seconds </td></tr> <tr><td align="left" valign="top">• <a href="#source">source</a>:</td><td> </td><td align="left" valign="top">Read a configuration file in same context </td></tr> <tr><td align="left" valign="top">• <a href="#test">test</a>:</td><td> </td><td align="left" valign="top">Check file types and compare values </td></tr> <tr><td align="left" valign="top">• <a href="#true">true</a>:</td><td> </td><td align="left" valign="top">Do nothing, successfully </td></tr> <tr><td align="left" valign="top">• <a href="#trust">trust</a>:</td><td> </td><td align="left" valign="top">Add public key to list of trusted keys </td></tr> <tr><td align="left" valign="top">• <a href="#trust_005fcertificate">trust_certificate</a>:</td><td> </td><td align="left" valign="top">Add an x509 certificate to the list of trusted certificates </td></tr> <tr><td align="left" valign="top">• <a href="#unset">unset</a>:</td><td> </td><td align="left" valign="top">Unset an environment variable </td></tr> <tr><td align="left" valign="top">• <a href="#uppermem">uppermem</a>:</td><td> </td><td align="left" valign="top">Set the upper memory size </td></tr> <tr><td align="left" valign="top">• <a href="#verify_005fappended">verify_appended</a>:</td><td> </td><td align="left" valign="top">Verify appended digital signature </td></tr> <tr><td align="left" valign="top">• <a href="#verify_005fdetached">verify_detached</a>:</td><td> </td><td align="left" valign="top">Verify detached digital signature </td></tr> <tr><td align="left" valign="top">• <a href="#videoinfo">videoinfo</a>:</td><td> </td><td align="left" valign="top">List available video modes </td></tr> <tr><td align="left" valign="top">• <a href="#xen_005fhypervisor">xen_hypervisor</a>:</td><td> </td><td align="left" valign="top">Load xen hypervisor binary (only on AArch64) </td></tr> <tr><td align="left" valign="top">• <a href="#xen_005fmodule">xen_module</a>:</td><td> </td><td align="left" valign="top">Load xen modules for xen hypervisor (only on AArch64) </td></tr> </table> <hr> <a name="g_t_005b"></a> <div class="header"> <p> Next: <a href="#acpi" accesskey="n" rel="next">acpi</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="g_t_005b-1"></a> <h4 class="subsection">16.3.1 [</h4> <dl> <dt><a name="index-_005b"></a>Command: <strong><code>[</code></strong> <em>expression <code>]</code></em></dt> <dd><p>Alias for <code>test <var>expression</var></code> (see <a href="#test">test</a>). </p></dd></dl> <hr> <a name="acpi"></a> <div class="header"> <p> Next: <a href="#authenticate" accesskey="n" rel="next">authenticate</a>, Previous: <a href="#g_t_005b" accesskey="p" rel="prev">[</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="acpi-1"></a> <h4 class="subsection">16.3.2 acpi</h4> <dl> <dt><a name="index-acpi"></a>Command: <strong>acpi</strong> <em>[<samp>-1</samp>|<samp>-2</samp>] [<samp>--exclude=table1,…</samp>|<samp>--load-only=table1,…</samp>] [<samp>--oemid=id</samp>] [<samp>--oemtable=table</samp>] [<samp>--oemtablerev=rev</samp>] [<samp>--oemtablecreator=creator</samp>] [<samp>--oemtablecreatorrev=rev</samp>] [<samp>--no-ebda</samp>] filename …</em></dt> <dd><p>Modern BIOS systems normally implement the Advanced Configuration and Power Interface (ACPI), and define various tables that describe the interface between an ACPI-compliant operating system and the firmware. In some cases, the tables provided by default only work well with certain operating systems, and it may be necessary to replace some of them. </p> <p>Normally, this command will replace the Root System Description Pointer (RSDP) in the Extended BIOS Data Area to point to the new tables. If the <samp>--no-ebda</samp> option is used, the new tables will be known only to GRUB, but may be used by GRUB’s EFI emulation. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a href="#Lockdown">Lockdown</a>). Otherwise an attacker can instruct the GRUB to load an SSDT table to overwrite the kernel lockdown configuration and later load and execute unsigned code. </p></dd></dl> <hr> <a name="authenticate"></a> <div class="header"> <p> Next: <a href="#background_005fcolor" accesskey="n" rel="next">background_color</a>, Previous: <a href="#acpi" accesskey="p" rel="prev">acpi</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="authenticate-1"></a> <h4 class="subsection">16.3.3 authenticate</h4> <dl> <dt><a name="index-authenticate"></a>Command: <strong>authenticate</strong> <em>[userlist]</em></dt> <dd><p>Check whether user is in <var>userlist</var> or listed in the value of variable ‘<samp>superusers</samp>’. See see <a href="#superusers">superusers</a> for valid user list format. If ‘<samp>superusers</samp>’ is empty, this command returns true. See <a href="#Security">Security</a>. </p></dd></dl> <hr> <a name="background_005fcolor"></a> <div class="header"> <p> Next: <a href="#background_005fimage" accesskey="n" rel="next">background_image</a>, Previous: <a href="#authenticate" accesskey="p" rel="prev">authenticate</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="background_005fcolor-1"></a> <h4 class="subsection">16.3.4 background_color</h4> <dl> <dt><a name="index-background_005fcolor"></a>Command: <strong>background_color</strong> <em>color</em></dt> <dd><p>Set background color for active terminal. For valid color specifications see see <a href="#Theme-file-format">Colors</a>. Background color can be changed only when using ‘<samp>gfxterm</samp>’ for terminal output. </p> <p>This command sets color of empty areas without text. Text background color is controlled by environment variables <var>color_normal</var>, <var>color_highlight</var>, <var>menu_color_normal</var>, <var>menu_color_highlight</var>. See <a href="#Special-environment-variables">Special environment variables</a>. </p></dd></dl> <hr> <a name="background_005fimage"></a> <div class="header"> <p> Next: <a href="#badram" accesskey="n" rel="next">badram</a>, Previous: <a href="#background_005fcolor" accesskey="p" rel="prev">background_color</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="background_005fimage-1"></a> <h4 class="subsection">16.3.5 background_image</h4> <dl> <dt><a name="index-background_005fimage"></a>Command: <strong>background_image</strong> <em>[[<samp>--mode</samp> ‘<samp>stretch</samp>’|‘<samp>normal</samp>’] file]</em></dt> <dd><p>Load background image for active terminal from <var>file</var>. Image is stretched to fill up entire screen unless option <samp>--mode</samp> ‘<samp>normal</samp>’ is given. Without arguments remove currently loaded background image. Background image can be changed only when using ‘<samp>gfxterm</samp>’ for terminal output. </p> </dd></dl> <hr> <a name="badram"></a> <div class="header"> <p> Next: <a href="#blocklist" accesskey="n" rel="next">blocklist</a>, Previous: <a href="#background_005fimage" accesskey="p" rel="prev">background_image</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="badram-1"></a> <h4 class="subsection">16.3.6 badram</h4> <dl> <dt><a name="index-badram"></a>Command: <strong>badram</strong> <em>addr,mask[,addr,mask...]</em></dt> <dd><p>Filter out bad RAM. </p></dd></dl> <p>This command notifies the memory manager that specified regions of RAM ought to be filtered out (usually, because they’re damaged). This remains in effect after a payload kernel has been loaded by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot kernels in general. </p> <p>Syntax is the same as provided by the <a href="http://www.memtest.org/">Memtest86+ utility</a>: a list of address/mask pairs. Given a page-aligned address and a base address / mask pair, if all the bits of the page-aligned address that are enabled by the mask match with the base address, it means this page is to be filtered. This syntax makes it easy to represent patterns that are often result of memory damage, due to physical distribution of memory cells. </p> <p>The command is similar to <code>cutmem</code> command. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a href="#Lockdown">Lockdown</a>). This prevents removing EFI memory regions to potentially subvert the security mechanisms provided by the UEFI secure boot. </p> <hr> <a name="blocklist"></a> <div class="header"> <p> Next: <a href="#boot" accesskey="n" rel="next">boot</a>, Previous: <a href="#badram" accesskey="p" rel="prev">badram</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="blocklist-1"></a> <h4 class="subsection">16.3.7 blocklist</h4> <dl> <dt><a name="index-blocklist"></a>Command: <strong>blocklist</strong> <em>file</em></dt> <dd><p>Print a block list (see <a href="#Block-list-syntax">Block list syntax</a>) for <var>file</var>. </p></dd></dl> <hr> <a name="boot"></a> <div class="header"> <p> Next: <a href="#cat" accesskey="n" rel="next">cat</a>, Previous: <a href="#blocklist" accesskey="p" rel="prev">blocklist</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="boot-1"></a> <h4 class="subsection">16.3.8 boot</h4> <dl> <dt><a name="index-boot"></a>Command: <strong>boot</strong></dt> <dd><p>Boot the OS or chain-loader which has been loaded. Only necessary if running the fully interactive command-line (it is implicit at the end of a menu entry). </p></dd></dl> <hr> <a name="cat"></a> <div class="header"> <p> Next: <a href="#chainloader" accesskey="n" rel="next">chainloader</a>, Previous: <a href="#boot" accesskey="p" rel="prev">boot</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cat-1"></a> <h4 class="subsection">16.3.9 cat</h4> <dl> <dt><a name="index-cat"></a>Command: <strong>cat</strong> <em>[<samp>--dos</samp>] file</em></dt> <dd><p>Display the contents of the file <var>file</var>. This command may be useful to remind you of your OS’s root partition: </p> <div class="example"> <pre class="example">grub> <kbd>cat /etc/fstab</kbd> </pre></div> <p>If the <samp>--dos</samp> option is used, then carriage return / new line pairs will be displayed as a simple new line. Otherwise, the carriage return will be displayed as a control character (‘<samp><d></samp>’) to make it easier to see when boot problems are caused by a file formatted using DOS-style line endings. </p></dd></dl> <hr> <a name="chainloader"></a> <div class="header"> <p> Next: <a href="#clear" accesskey="n" rel="next">clear</a>, Previous: <a href="#cat" accesskey="p" rel="prev">cat</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="chainloader-1"></a> <h4 class="subsection">16.3.10 chainloader</h4> <dl> <dt><a name="index-chainloader"></a>Command: <strong>chainloader</strong> <em>[<samp>--force</samp>] file</em></dt> <dd><p>Load <var>file</var> as a chain-loader. Like any other file loaded by the filesystem code, it can use the blocklist notation (see <a href="#Block-list-syntax">Block list syntax</a>) to grab the first sector of the current partition with ‘<samp>+1</samp>’. If you specify the option <samp>--force</samp>, then load <var>file</var> forcibly, whether it has a correct signature or not. This is required when you want to load a defective boot loader, such as SCO UnixWare 7.1. </p></dd></dl> <hr> <a name="clear"></a> <div class="header"> <p> Next: <a href="#cmosclean" accesskey="n" rel="next">cmosclean</a>, Previous: <a href="#chainloader" accesskey="p" rel="prev">chainloader</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="clear-1"></a> <h4 class="subsection">16.3.11 clear</h4> <dl> <dt><a name="index-clear"></a>Command: <strong>clear</strong></dt> <dd><p>Clear the screen. </p></dd></dl> <hr> <a name="cmosclean"></a> <div class="header"> <p> Next: <a href="#cmosdump" accesskey="n" rel="next">cmosdump</a>, Previous: <a href="#clear" accesskey="p" rel="prev">clear</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cmosclean-1"></a> <h4 class="subsection">16.3.12 cmosclean</h4> <dl> <dt><a name="index-cmosclean"></a>Command: <strong>cmosclean</strong> <em>byte:bit</em></dt> <dd><p>Clear value of bit in CMOS at location <var>byte</var>:<var>bit</var>. This command is available only on platforms that support CMOS. </p></dd></dl> <hr> <a name="cmosdump"></a> <div class="header"> <p> Next: <a href="#cmostest" accesskey="n" rel="next">cmostest</a>, Previous: <a href="#cmosclean" accesskey="p" rel="prev">cmosclean</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cmosdump-1"></a> <h4 class="subsection">16.3.13 cmosdump</h4> <dl> <dt><a name="index-CMOS"></a>Dump: <strong>CMOS</strong> <em>contents</em></dt> <dd><p>Dump full CMOS contents as hexadecimal values. This command is available only on platforms that support CMOS. </p></dd></dl> <hr> <a name="cmostest"></a> <div class="header"> <p> Next: <a href="#cmp" accesskey="n" rel="next">cmp</a>, Previous: <a href="#cmosdump" accesskey="p" rel="prev">cmosdump</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cmostest-1"></a> <h4 class="subsection">16.3.14 cmostest</h4> <dl> <dt><a name="index-cmostest"></a>Command: <strong>cmostest</strong> <em>byte:bit</em></dt> <dd><p>Test value of bit in CMOS at location <var>byte</var>:<var>bit</var>. Exit status is zero if bit is set, non zero otherwise. This command is available only on platforms that support CMOS. </p></dd></dl> <hr> <a name="cmp"></a> <div class="header"> <p> Next: <a href="#configfile" accesskey="n" rel="next">configfile</a>, Previous: <a href="#cmostest" accesskey="p" rel="prev">cmostest</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cmp-1"></a> <h4 class="subsection">16.3.15 cmp</h4> <dl> <dt><a name="index-cmp"></a>Command: <strong>cmp</strong> <em>file1 file2</em></dt> <dd><p>Compare the file <var>file1</var> with the file <var>file2</var>. If they differ in size, print the sizes like this: </p> <div class="example"> <pre class="example">Differ in size: 0x1234 [foo], 0x4321 [bar] </pre></div> <p>If the sizes are equal but the bytes at an offset differ, then print the bytes like this: </p> <div class="example"> <pre class="example">Differ at the offset 777: 0xbe [foo], 0xef [bar] </pre></div> <p>If they are completely identical, nothing will be printed. </p></dd></dl> <hr> <a name="configfile"></a> <div class="header"> <p> Next: <a href="#cpuid" accesskey="n" rel="next">cpuid</a>, Previous: <a href="#cmp" accesskey="p" rel="prev">cmp</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="configfile-1"></a> <h4 class="subsection">16.3.16 configfile</h4> <dl> <dt><a name="index-configfile"></a>Command: <strong>configfile</strong> <em>file</em></dt> <dd><p>Load <var>file</var> as a configuration file. If <var>file</var> defines any menu entries, then show a menu containing them immediately. Any environment variable changes made by the commands in <var>file</var> will not be preserved after <code>configfile</code> returns. </p></dd></dl> <hr> <a name="cpuid"></a> <div class="header"> <p> Next: <a href="#crc" accesskey="n" rel="next">crc</a>, Previous: <a href="#configfile" accesskey="p" rel="prev">configfile</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cpuid-1"></a> <h4 class="subsection">16.3.17 cpuid</h4> <dl> <dt><a name="index-cpuid"></a>Command: <strong>cpuid</strong> <em>[-l] [-p]</em></dt> <dd><p>Check for CPU features. This command is only available on x86 systems. </p> <p>With the <samp>-l</samp> option, return true if the CPU supports long mode (64-bit). </p> <p>With the <samp>-p</samp> option, return true if the CPU supports Physical Address Extension (PAE). </p> <p>If invoked without options, this command currently behaves as if it had been invoked with <samp>-l</samp>. This may change in the future. </p></dd></dl> <hr> <a name="crc"></a> <div class="header"> <p> Next: <a href="#cryptomount" accesskey="n" rel="next">cryptomount</a>, Previous: <a href="#cpuid" accesskey="p" rel="prev">cpuid</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="crc-1"></a> <h4 class="subsection">16.3.18 crc</h4> <dl> <dt><a name="index-crc"></a>Command: <strong>crc</strong> <em>arg …</em></dt> <dd><p>Alias for <code>hashsum --hash crc32 arg …</code>. See command <code>hashsum</code> (see <a href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> <a name="cryptomount"></a> <div class="header"> <p> Next: <a href="#cutmem" accesskey="n" rel="next">cutmem</a>, Previous: <a href="#crc" accesskey="p" rel="prev">crc</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cryptomount-1"></a> <h4 class="subsection">16.3.19 cryptomount</h4> <dl> <dt><a name="index-cryptomount"></a>Command: <strong>cryptomount</strong> <em>device|<samp>-u</samp> uuid|<samp>-a</samp>|<samp>-b</samp></em></dt> <dd><p>Setup access to encrypted device. If necessary, passphrase is requested interactively. Option <var>device</var> configures specific grub device (see <a href="#Naming-convention">Naming convention</a>); option <samp>-u</samp> <var>uuid</var> configures device with specified <var>uuid</var>; option <samp>-a</samp> configures all detected encrypted devices; option <samp>-b</samp> configures all geli containers that have boot flag set. </p> <p>GRUB suports devices encrypted using LUKS and geli. Note that necessary modules (<var>luks</var> and <var>geli</var>) have to be loaded manually before this command can be used. </p></dd></dl> <hr> <a name="cutmem"></a> <div class="header"> <p> Next: <a href="#date" accesskey="n" rel="next">date</a>, Previous: <a href="#cryptomount" accesskey="p" rel="prev">cryptomount</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="cutmem-1"></a> <h4 class="subsection">16.3.20 cutmem</h4> <dl> <dt><a name="index-cutmem"></a>Command: <strong>cutmem</strong> <em>from[K|M|G] to[K|M|G]</em></dt> <dd><p>Remove any memory regions in specified range. </p></dd></dl> <p>This command notifies the memory manager that specified regions of RAM ought to be filtered out. This remains in effect after a payload kernel has been loaded by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot kernels in general. </p> <p>The command is similar to <code>badram</code> command. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a href="#Lockdown">Lockdown</a>). This prevents removing EFI memory regions to potentially subvert the security mechanisms provided by the UEFI secure boot. </p> <hr> <a name="date"></a> <div class="header"> <p> Next: <a href="#devicetree" accesskey="n" rel="next">devicetree</a>, Previous: <a href="#cutmem" accesskey="p" rel="prev">cutmem</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="date-1"></a> <h4 class="subsection">16.3.21 date</h4> <dl> <dt><a name="index-date"></a>Command: <strong>date</strong> <em>[[year-]month-day] [hour:minute[:second]]</em></dt> <dd><p>With no arguments, print the current date and time. </p> <p>Otherwise, take the current date and time, change any elements specified as arguments, and set the result as the new date and time. For example, ‘date 01-01’ will set the current month and day to January 1, but leave the year, hour, minute, and second unchanged. </p></dd></dl> <hr> <a name="devicetree"></a> <div class="header"> <p> Next: <a href="#distrust" accesskey="n" rel="next">distrust</a>, Previous: <a href="#date" accesskey="p" rel="prev">date</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="devicetree-1"></a> <h4 class="subsection">16.3.22 devicetree</h4> <dl> <dt><a name="index-devicetree"></a>Command: <strong>devicetree</strong> <em>file</em></dt> <dd><p>Load a device tree blob (.dtb) from a filesystem, for later use by a Linux kernel. Does not perform merging with any device tree supplied by firmware, but rather replaces it completely. </p> <p>Note: The command is not allowed when lockdown is enforced (see <a href="#Lockdown">Lockdown</a>). This is done to prevent subverting various security mechanisms. </p></dd></dl> <hr> <a name="distrust"></a> <div class="header"> <p> Next: <a href="#distrust_005fcertificate" accesskey="n" rel="next">distrust_certificate</a>, Previous: <a href="#devicetree" accesskey="p" rel="prev">devicetree</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="distrust-1"></a> <h4 class="subsection">16.3.23 distrust</h4> <dl> <dt><a name="index-distrust"></a>Command: <strong>distrust</strong> <em>pubkey_id</em></dt> <dd><p>Remove public key <var>pubkey_id</var> from GRUB’s keyring of trusted keys. <var>pubkey_id</var> is the last four bytes (eight hexadecimal digits) of the GPG v4 key id, which is also the output of <code>list_trusted</code> (see <a href="#list_005ftrusted">list_trusted</a>). Outside of GRUB, the key id can be obtained using <code>gpg --fingerprint</code>). These keys are used to validate signatures when environment variable <code>check_signatures</code> is set to <code>enforce</code> (see <a href="#check_005fsignatures">check_signatures</a>), and by some invocations of <code>verify_detached</code> (see <a href="#verify_005fdetached">verify_detached</a>). See <a href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures</a>, for more information. </p></dd></dl> <hr> <a name="distrust_005fcertificate"></a> <div class="header"> <p> Next: <a href="#drivemap" accesskey="n" rel="next">drivemap</a>, Previous: <a href="#distrust" accesskey="p" rel="prev">distrust</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="distrust_005fcertificate-1"></a> <h4 class="subsection">16.3.24 distrust_certificate</h4> <dl> <dt><a name="index-distrust_005fcertificate"></a>Command: <strong>distrust_certificate</strong> <em>cert_number</em></dt> <dd><p>Remove the x509 certificate numbered <var>cert_number</var> from GRUB’s keyring of trusted x509 certificates for verifying appended signatures. </p> <p><var>cert_number</var> is the certificate number as listed by <code>list_certificates</code> (see <a href="#list_005fcertificates">list_certificates</a>). </p> <p>These certificates are used to validate appended signatures when environment variable <code>check_appended_signatures</code> is set to <code>enforce</code> (see <a href="#check_005fappended_005fsignatures">check_appended_signatures</a>), and by <code>verify_appended</code> (see <a href="#verify_005fappended">verify_appended</a>). See See <a href="#Using-appended-signatures">Using appended signatures</a> for more information. </p></dd></dl> <hr> <a name="drivemap"></a> <div class="header"> <p> Next: <a href="#echo" accesskey="n" rel="next">echo</a>, Previous: <a href="#distrust_005fcertificate" accesskey="p" rel="prev">distrust_certificate</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="drivemap-1"></a> <h4 class="subsection">16.3.25 drivemap</h4> <dl> <dt><a name="index-drivemap"></a>Command: <strong>drivemap</strong> <em><samp>-l</samp>|<samp>-r</samp>|[<samp>-s</samp>] from_drive to_drive</em></dt> <dd><p>Without options, map the drive <var>from_drive</var> to the drive <var>to_drive</var>. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. For convenience, any partition suffix on the drive is ignored, so you can safely use <tt>${root}</tt> as a drive specification. </p> <p>With the <samp>-s</samp> option, perform the reverse mapping as well, swapping the two drives. </p> <p>With the <samp>-l</samp> option, list the current mappings. </p> <p>With the <samp>-r</samp> option, reset all mappings to the default values. </p> <p>For example: </p> <div class="example"> <pre class="example">drivemap -s (hd0) (hd1) </pre></div> </dd></dl> <hr> <a name="echo"></a> <div class="header"> <p> Next: <a href="#eval" accesskey="n" rel="next">eval</a>, Previous: <a href="#drivemap" accesskey="p" rel="prev">drivemap</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="echo-1"></a> <h4 class="subsection">16.3.26 echo</h4> <dl> <dt><a name="index-echo"></a>Command: <strong>echo</strong> <em>[<samp>-n</samp>] [<samp>-e</samp>] string …</em></dt> <dd><p>Display the requested text and, unless the <samp>-n</samp> option is used, a trailing new line. If there is more than one string, they are separated by spaces in the output. As usual in GRUB commands, variables may be substituted using ‘<samp>${var}</samp>’. </p> <p>The <samp>-e</samp> option enables interpretation of backslash escapes. The following sequences are recognised: </p> <dl compact="compact"> <dt><code>\\</code></dt> <dd><p>backslash </p> </dd> <dt><code>\a</code></dt> <dd><p>alert (BEL) </p> </dd> <dt><code>\c</code></dt> <dd><p>suppress trailing new line </p> </dd> <dt><code>\f</code></dt> <dd><p>form feed </p> </dd> <dt><code>\n</code></dt> <dd><p>new line </p> </dd> <dt><code>\r</code></dt> <dd><p>carriage return </p> </dd> <dt><code>\t</code></dt> <dd><p>horizontal tab </p> </dd> <dt><code>\v</code></dt> <dd><p>vertical tab </p></dd> </dl> <p>When interpreting backslash escapes, backslash followed by any other character will print that character. </p></dd></dl> <hr> <a name="eval"></a> <div class="header"> <p> Next: <a href="#export" accesskey="n" rel="next">export</a>, Previous: <a href="#echo" accesskey="p" rel="prev">echo</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="eval-1"></a> <h4 class="subsection">16.3.27 eval</h4> <dl> <dt><a name="index-eval"></a>Command: <strong>eval</strong> <em>string ...</em></dt> <dd><p>Concatenate arguments together using single space as separator and evaluate result as sequence of GRUB commands. </p></dd></dl> <hr> <a name="export"></a> <div class="header"> <p> Next: <a href="#false" accesskey="n" rel="next">false</a>, Previous: <a href="#eval" accesskey="p" rel="prev">eval</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="export-1"></a> <h4 class="subsection">16.3.28 export</h4> <dl> <dt><a name="index-export"></a>Command: <strong>export</strong> <em>envvar</em></dt> <dd><p>Export the environment variable <var>envvar</var>. Exported variables are visible to subsidiary configuration files loaded using <code>configfile</code>. </p></dd></dl> <hr> <a name="false"></a> <div class="header"> <p> Next: <a href="#gettext" accesskey="n" rel="next">gettext</a>, Previous: <a href="#export" accesskey="p" rel="prev">export</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="false-1"></a> <h4 class="subsection">16.3.29 false</h4> <dl> <dt><a name="index-false"></a>Command: <strong>false</strong></dt> <dd><p>Do nothing, unsuccessfully. This is mainly useful in control constructs such as <code>if</code> and <code>while</code> (see <a href="#Shell_002dlike-scripting">Shell-like scripting</a>). </p></dd></dl> <hr> <a name="gettext"></a> <div class="header"> <p> Next: <a href="#gptsync" accesskey="n" rel="next">gptsync</a>, Previous: <a href="#false" accesskey="p" rel="prev">false</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="gettext-1"></a> <h4 class="subsection">16.3.30 gettext</h4> <dl> <dt><a name="index-gettext"></a>Command: <strong>gettext</strong> <em>string</em></dt> <dd><p>Translate <var>string</var> into the current language. </p> <p>The current language code is stored in the ‘<samp>lang</samp>’ variable in GRUB’s environment (see <a href="#lang">lang</a>). Translation files in MO format are read from ‘<samp>locale_dir</samp>’ (see <a href="#locale_005fdir">locale_dir</a>), usually <samp>/boot/grub2/locale</samp>. </p></dd></dl> <hr> <a name="gptsync"></a> <div class="header"> <p> Next: <a href="#halt" accesskey="n" rel="next">halt</a>, Previous: <a href="#gettext" accesskey="p" rel="prev">gettext</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="gptsync-1"></a> <h4 class="subsection">16.3.31 gptsync</h4> <dl> <dt><a name="index-gptsync"></a>Command: <strong>gptsync</strong> <em>device [partition[+/-[type]]] …</em></dt> <dd><p>Disks using the GUID Partition Table (GPT) also have a legacy Master Boot Record (MBR) partition table for compatibility with the BIOS and with older operating systems. The legacy MBR can only represent a limited subset of GPT partition entries. </p> <p>This command populates the legacy MBR with the specified <var>partition</var> entries on <var>device</var>. Up to three partitions may be used. </p> <p><var>type</var> is an MBR partition type code; prefix with ‘<samp>0x</samp>’ if you want to enter this in hexadecimal. The separator between <var>partition</var> and <var>type</var> may be ‘<samp>+</samp>’ to make the partition active, or ‘<samp>-</samp>’ to make it inactive; only one partition may be active. If both the separator and type are omitted, then the partition will be inactive. </p></dd></dl> <hr> <a name="halt"></a> <div class="header"> <p> Next: <a href="#hashsum" accesskey="n" rel="next">hashsum</a>, Previous: <a href="#gptsync" accesskey="p" rel="prev">gptsync</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="halt-1"></a> <h4 class="subsection">16.3.32 halt</h4> <dl> <dt><a name="index-halt"></a>Command: <strong>halt</strong> <em><samp>--no-apm</samp></em></dt> <dd><p>The command halts the computer. If the <samp>--no-apm</samp> option is specified, no APM BIOS call is performed. Otherwise, the computer is shut down using APM. </p></dd></dl> <hr> <a name="hashsum"></a> <div class="header"> <p> Next: <a href="#help" accesskey="n" rel="next">help</a>, Previous: <a href="#halt" accesskey="p" rel="prev">halt</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="hashsum-1"></a> <h4 class="subsection">16.3.33 hashsum</h4> <dl> <dt><a name="index-hashsum"></a>Command: <strong>hashsum</strong> <em><samp>--hash</samp> hash <samp>--keep-going</samp> <samp>--uncompress</samp> <samp>--check</samp> file [<samp>--prefix</samp> dir]|file …</em></dt> <dd><p>Compute or verify file hashes. Hash type is selected with option <samp>--hash</samp>. Supported hashes are: ‘<samp>adler32</samp>’, ‘<samp>crc64</samp>’, ‘<samp>crc32</samp>’, ‘<samp>crc32rfc1510</samp>’, ‘<samp>crc24rfc2440</samp>’, ‘<samp>md4</samp>’, ‘<samp>md5</samp>’, ‘<samp>ripemd160</samp>’, ‘<samp>sha1</samp>’, ‘<samp>sha224</samp>’, ‘<samp>sha256</samp>’, ‘<samp>sha512</samp>’, ‘<samp>sha384</samp>’, ‘<samp>tiger192</samp>’, ‘<samp>tiger</samp>’, ‘<samp>tiger2</samp>’, ‘<samp>whirlpool</samp>’. Option <samp>--uncompress</samp> uncompresses files before computing hash. </p> <p>When list of files is given, hash of each file is computed and printed, followed by file name, each file on a new line. </p> <p>When option <samp>--check</samp> is given, it points to a file that contains list of <var>hash name</var> pairs in the same format as used by UNIX <code>md5sum</code> command. Option <samp>--prefix</samp> may be used to give directory where files are located. Hash verification stops after the first mismatch was found unless option <samp>--keep-going</samp> was given. The exit code <code>$?</code> is set to 0 if hash verification is successful. If it fails, <code>$?</code> is set to a nonzero value. </p></dd></dl> <hr> <a name="help"></a> <div class="header"> <p> Next: <a href="#initrd" accesskey="n" rel="next">initrd</a>, Previous: <a href="#hashsum" accesskey="p" rel="prev">hashsum</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="help-1"></a> <h4 class="subsection">16.3.34 help</h4> <dl> <dt><a name="index-help"></a>Command: <strong>help</strong> <em>[pattern …]</em></dt> <dd><p>Display helpful information about builtin commands. If you do not specify <var>pattern</var>, this command shows short descriptions of all available commands. </p> <p>If you specify any <var>patterns</var>, it displays longer information about each of the commands whose names begin with those <var>patterns</var>. </p></dd></dl> <hr> <a name="initrd"></a> <div class="header"> <p> Next: <a href="#initrd16" accesskey="n" rel="next">initrd16</a>, Previous: <a href="#help" accesskey="p" rel="prev">help</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="initrd-1"></a> <h4 class="subsection">16.3.35 initrd</h4> <dl> <dt><a name="index-initrd"></a>Command: <strong>initrd</strong> <em>file</em></dt> <dd><p>Load an initial ramdisk for a Linux kernel image, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the <code>linux</code> command (see <a href="#linux">linux</a>) has been run. See also <a href="#GNU_002fLinux">GNU/Linux</a>. </p></dd></dl> <hr> <a name="initrd16"></a> <div class="header"> <p> Next: <a href="#insmod" accesskey="n" rel="next">insmod</a>, Previous: <a href="#initrd" accesskey="p" rel="prev">initrd</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="initrd16-1"></a> <h4 class="subsection">16.3.36 initrd16</h4> <dl> <dt><a name="index-initrd16"></a>Command: <strong>initrd16</strong> <em>file</em></dt> <dd><p>Load an initial ramdisk for a Linux kernel image to be booted in 16-bit mode, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the <code>linux16</code> command (see <a href="#linux16">linux16</a>) has been run. See also <a href="#GNU_002fLinux">GNU/Linux</a>. </p> <p>This command is only available on x86 systems. </p></dd></dl> <hr> <a name="insmod"></a> <div class="header"> <p> Next: <a href="#keystatus" accesskey="n" rel="next">keystatus</a>, Previous: <a href="#initrd16" accesskey="p" rel="prev">initrd16</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="insmod-1"></a> <h4 class="subsection">16.3.37 insmod</h4> <dl> <dt><a name="index-insmod"></a>Command: <strong>insmod</strong> <em>module</em></dt> <dd><p>Insert the dynamic GRUB module called <var>module</var>. </p></dd></dl> <hr> <a name="keystatus"></a> <div class="header"> <p> Next: <a href="#linux" accesskey="n" rel="next">linux</a>, Previous: <a href="#insmod" accesskey="p" rel="prev">insmod</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="keystatus-1"></a> <h4 class="subsection">16.3.38 keystatus</h4> <dl> <dt><a name="index-keystatus"></a>Command: <strong>keystatus</strong> <em>[<samp>--shift</samp>] [<samp>--ctrl</samp>] [<samp>--alt</samp>]</em></dt> <dd><p>Return true if the Shift, Control, or Alt modifier keys are held down, as requested by options. This is useful in scripting, to allow some user control over behaviour without having to wait for a keypress. </p> <p>Checking key modifier status is only supported on some platforms. If invoked without any options, the <code>keystatus</code> command returns true if and only if checking key modifier status is supported. </p></dd></dl> <hr> <a name="linux"></a> <div class="header"> <p> Next: <a href="#linux16" accesskey="n" rel="next">linux16</a>, Previous: <a href="#keystatus" accesskey="p" rel="prev">keystatus</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="linux-1"></a> <h4 class="subsection">16.3.39 linux</h4> <dl> <dt><a name="index-linux"></a>Command: <strong>linux</strong> <em>file …</em></dt> <dd><p>Load a Linux kernel image from <var>file</var>. The rest of the line is passed verbatim as the <em>kernel command-line</em>. Any initrd must be reloaded after using this command (see <a href="#initrd">initrd</a>). </p> <p>On x86 systems, the kernel will be booted using the 32-bit boot protocol. Note that this means that the ‘<samp>vga=</samp>’ boot option will not work; if you want to set a special video mode, you will need to use GRUB commands such as ‘<samp>set gfxpayload=1024x768</samp>’ or ‘<samp>set gfxpayload=keep</samp>’ (to keep the same mode as used in GRUB) instead. GRUB can automatically detect some uses of ‘<samp>vga=</samp>’ and translate them to appropriate settings of ‘<samp>gfxpayload</samp>’. The <code>linux16</code> command (see <a href="#linux16">linux16</a>) avoids this restriction. </p></dd></dl> <hr> <a name="linux16"></a> <div class="header"> <p> Next: <a href="#list_005fcertificates" accesskey="n" rel="next">list_certificates</a>, Previous: <a href="#linux" accesskey="p" rel="prev">linux</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="linux16-1"></a> <h4 class="subsection">16.3.40 linux16</h4> <dl> <dt><a name="index-linux16"></a>Command: <strong>linux16</strong> <em>file …</em></dt> <dd><p>Load a Linux kernel image from <var>file</var> in 16-bit mode. The rest of the line is passed verbatim as the <em>kernel command-line</em>. Any initrd must be reloaded after using this command (see <a href="#initrd16">initrd16</a>). </p> <p>The kernel will be booted using the traditional 16-bit boot protocol. As well as bypassing problems with ‘<samp>vga=</samp>’ described in <a href="#linux">linux</a>, this permits booting some other programs that implement the Linux boot protocol for the sake of convenience. </p> <p>This command is only available on x86 systems. </p></dd></dl> <hr> <a name="list_005fcertificates"></a> <div class="header"> <p> Next: <a href="#list_005fenv" accesskey="n" rel="next">list_env</a>, Previous: <a href="#linux16" accesskey="p" rel="prev">linux16</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="list_005fcertificates-1"></a> <h4 class="subsection">16.3.41 list_certificates</h4> <dl> <dt><a name="index-list_005fcertificates"></a>Command: <strong>list_certificates</strong></dt> <dd><p>List all x509 certificates trusted by GRUB for validating appended signatures. The output is a numbered list of certificates, showing the certificate’s serial number and Common Name. </p> <p>The certificate number can be used as an argument to <code>distrust_certificate</code> (see <a href="#distrust_005fcertificate">distrust_certificate</a>). </p> <p>See See <a href="#Using-appended-signatures">Using appended signatures</a> for more information. </p></dd></dl> <hr> <a name="list_005fenv"></a> <div class="header"> <p> Next: <a href="#list_005ftrusted" accesskey="n" rel="next">list_trusted</a>, Previous: <a href="#list_005fcertificates" accesskey="p" rel="prev">list_certificates</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="list_005fenv-1"></a> <h4 class="subsection">16.3.42 list_env</h4> <dl> <dt><a name="index-list_005fenv"></a>Command: <strong>list_env</strong> <em>[<samp>--file</samp> file]</em></dt> <dd><p>List all variables in the environment block file. See <a href="#Environment-block">Environment block</a>. </p> <p>The <samp>--file</samp> option overrides the default location of the environment block. </p></dd></dl> <hr> <a name="list_005ftrusted"></a> <div class="header"> <p> Next: <a href="#load_005fenv" accesskey="n" rel="next">load_env</a>, Previous: <a href="#list_005fenv" accesskey="p" rel="prev">list_env</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="list_005ftrusted-1"></a> <h4 class="subsection">16.3.43 list_trusted</h4> <dl> <dt><a name="index-list_005ftrusted"></a>Command: <strong>list_trusted</strong></dt> <dd><p>List all public keys trusted by GRUB for validating signatures. The output is in GPG’s v4 key fingerprint format (i.e., the output of <code>gpg --fingerprint</code>). The least significant four bytes (last eight hexadecimal digits) can be used as an argument to <code>distrust</code> (see <a href="#distrust">distrust</a>). See <a href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures</a>, for more information about uses for these keys. </p></dd></dl> <hr> <a name="load_005fenv"></a> <div class="header"> <p> Next: <a href="#loadfont" accesskey="n" rel="next">loadfont</a>, Previous: <a href="#list_005ftrusted" accesskey="p" rel="prev">list_trusted</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="load_005fenv-1"></a> <h4 class="subsection">16.3.44 load_env</h4> <dl> <dt><a name="index-load_005fenv"></a>Command: <strong>load_env</strong> <em>[<samp>--file</samp> file] [<samp>--skip-sig</samp>] [whitelisted_variable_name] …</em></dt> <dd><p>Load all variables from the environment block file into the environment. See <a href="#Environment-block">Environment block</a>. </p> <p>The <samp>--file</samp> option overrides the default location of the environment block. </p> <p>The <samp>--skip-sig</samp> option skips signature checking even when the value of environment variable <code>check_signatures</code> is set to <code>enforce</code> (see <a href="#check_005fsignatures">check_signatures</a>). </p> <p>If one or more variable names are provided as arguments, they are interpreted as a whitelist of variables to load from the environment block file. Variables set in the file but not present in the whitelist are ignored. </p> <p>The <samp>--skip-sig</samp> option should be used with care, and should always be used in concert with a whitelist of acceptable variables whose values should be set. Failure to employ a carefully constructed whitelist could result in reading a malicious value into critical environment variables from the file, such as setting <code>check_signatures=no</code>, modifying <code>prefix</code> to boot from an unexpected location or not at all, etc. </p> <p>When used with care, <samp>--skip-sig</samp> and the whitelist enable an administrator to configure a system to boot only signed configurations, but to allow the user to select from among multiple configurations, and to enable “one-shot” boot attempts and “savedefault” behavior. See <a href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures</a>, for more information. </p> <p>Extra care should be taken when combining this command with appended signatures (see <a href="#Using-appended-signatures">Using appended signatures</a>), as this file is not validated by an appended signature and could set <code>check_appended_signatures=no</code>. </p></dd></dl> <hr> <a name="loadfont"></a> <div class="header"> <p> Next: <a href="#loopback" accesskey="n" rel="next">loopback</a>, Previous: <a href="#load_005fenv" accesskey="p" rel="prev">load_env</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="loadfont-1"></a> <h4 class="subsection">16.3.45 loadfont</h4> <dl> <dt><a name="index-loadfont"></a>Command: <strong>loadfont</strong> <em>file …</em></dt> <dd><p>Load specified font files. Unless absolute pathname is given, <var>file</var> is assumed to be in directory ‘<samp>$prefix/fonts</samp>’ with suffix ‘<samp>.pf2</samp>’ appended. See <a href="#Theme-file-format">Fonts</a>. </p></dd></dl> <hr> <a name="loopback"></a> <div class="header"> <p> Next: <a href="#ls" accesskey="n" rel="next">ls</a>, Previous: <a href="#loadfont" accesskey="p" rel="prev">loadfont</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="loopback-1"></a> <h4 class="subsection">16.3.46 loopback</h4> <dl> <dt><a name="index-loopback"></a>Command: <strong>loopback</strong> <em>[<samp>-d</samp>] device file</em></dt> <dd><p>Make the device named <var>device</var> correspond to the contents of the filesystem image in <var>file</var>. For example: </p> <div class="example"> <pre class="example">loopback loop0 /path/to/image ls (loop0)/ </pre></div> <p>With the <samp>-d</samp> option, delete a device previously created using this command. </p></dd></dl> <hr> <a name="ls"></a> <div class="header"> <p> Next: <a href="#lsfonts" accesskey="n" rel="next">lsfonts</a>, Previous: <a href="#loopback" accesskey="p" rel="prev">loopback</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="ls-1"></a> <h4 class="subsection">16.3.47 ls</h4> <dl> <dt><a name="index-ls"></a>Command: <strong>ls</strong> <em>[arg …]</em></dt> <dd><p>List devices or files. </p> <p>With no arguments, print all devices known to GRUB. </p> <p>If the argument is a device name enclosed in parentheses (see <a href="#Device-syntax">Device syntax</a>), then print the name of the filesystem of that device. </p> <p>If the argument is a directory given as an absolute file name (see <a href="#File-name-syntax">File name syntax</a>), then list the contents of that directory. </p></dd></dl> <hr> <a name="lsfonts"></a> <div class="header"> <p> Next: <a href="#lsmod" accesskey="n" rel="next">lsmod</a>, Previous: <a href="#ls" accesskey="p" rel="prev">ls</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="lsfonts-1"></a> <h4 class="subsection">16.3.48 lsfonts</h4> <dl> <dt><a name="index-lsfonts"></a>Command: <strong>lsfonts</strong></dt> <dd><p>List loaded fonts. </p></dd></dl> <hr> <a name="lsmod"></a> <div class="header"> <p> Next: <a href="#md5sum" accesskey="n" rel="next">md5sum</a>, Previous: <a href="#lsfonts" accesskey="p" rel="prev">lsfonts</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="lsmod-1"></a> <h4 class="subsection">16.3.49 lsmod</h4> <dl> <dt><a name="index-lsmod"></a>Command: <strong>lsmod</strong></dt> <dd><p>Show list of loaded modules. </p></dd></dl> <hr> <a name="md5sum"></a> <div class="header"> <p> Next: <a href="#module" accesskey="n" rel="next">module</a>, Previous: <a href="#lsmod" accesskey="p" rel="prev">lsmod</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="md5sum-1"></a> <h4 class="subsection">16.3.50 md5sum</h4> <dl> <dt><a name="index-md5sum"></a>Command: <strong>md5sum</strong> <em>arg …</em></dt> <dd><p>Alias for <code>hashsum --hash md5 arg …</code>. See command <code>hashsum</code> (see <a href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> <a name="module"></a> <div class="header"> <p> Next: <a href="#multiboot" accesskey="n" rel="next">multiboot</a>, Previous: <a href="#md5sum" accesskey="p" rel="prev">md5sum</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="module-1"></a> <h4 class="subsection">16.3.51 module</h4> <dl> <dt><a name="index-module"></a>Command: <strong>module</strong> <em>[--nounzip] file [arguments]</em></dt> <dd><p>Load a module for multiboot kernel image. The rest of the line is passed verbatim as the module command line. </p></dd></dl> <hr> <a name="multiboot"></a> <div class="header"> <p> Next: <a href="#nativedisk" accesskey="n" rel="next">nativedisk</a>, Previous: <a href="#module" accesskey="p" rel="prev">module</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="multiboot-1"></a> <h4 class="subsection">16.3.52 multiboot</h4> <dl> <dt><a name="index-multiboot"></a>Command: <strong>multiboot</strong> <em>[--quirk-bad-kludge] [--quirk-modules-after-kernel] file …</em></dt> <dd><p>Load a multiboot kernel image from <var>file</var>. The rest of the line is passed verbatim as the <em>kernel command-line</em>. Any module must be reloaded after using this command (see <a href="#module">module</a>). </p> <p>Some kernels have known problems. You need to specify –quirk-* for those. –quirk-bad-kludge is a problem seen in several products that they include loading kludge information with invalid data in ELF file. GRUB prior to 0.97 and some custom builds prefered ELF information while 0.97 and GRUB 2 use kludge. Use this option to ignore kludge. Known affected systems: old Solaris, SkyOS. </p> <p>–quirk-modules-after-kernel is needed for kernels which load at relatively high address e.g. 16MiB mark and can’t cope with modules stuffed between 1MiB mark and beginning of the kernel. Known afftected systems: VMWare. </p></dd></dl> <hr> <a name="nativedisk"></a> <div class="header"> <p> Next: <a href="#normal" accesskey="n" rel="next">normal</a>, Previous: <a href="#multiboot" accesskey="p" rel="prev">multiboot</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="nativedisk-1"></a> <h4 class="subsection">16.3.53 nativedisk</h4> <dl> <dt><a name="index-nativedisk"></a>Command: <strong>nativedisk</strong></dt> <dd><p>Switch from firmware disk drivers to native ones. Really useful only on platforms where both firmware and native disk drives are available. Currently i386-pc, i386-efi, i386-ieee1275 and x86_64-efi. </p></dd></dl> <hr> <a name="normal"></a> <div class="header"> <p> Next: <a href="#normal_005fexit" accesskey="n" rel="next">normal_exit</a>, Previous: <a href="#nativedisk" accesskey="p" rel="prev">nativedisk</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="normal-1"></a> <h4 class="subsection">16.3.54 normal</h4> <dl> <dt><a name="index-normal"></a>Command: <strong>normal</strong> <em>[file]</em></dt> <dd><p>Enter normal mode and display the GRUB menu. </p> <p>In normal mode, commands, filesystem modules, and cryptography modules are automatically loaded, and the full GRUB script parser is available. Other modules may be explicitly loaded using <code>insmod</code> (see <a href="#insmod">insmod</a>). </p> <p>If a <var>file</var> is given, then commands will be read from that file. Otherwise, they will be read from <samp>$prefix/grub.cfg</samp> if it exists. </p> <p><code>normal</code> may be called from within normal mode, creating a nested environment. It is more usual to use <code>configfile</code> (see <a href="#configfile">configfile</a>) for this. </p></dd></dl> <hr> <a name="normal_005fexit"></a> <div class="header"> <p> Next: <a href="#parttool" accesskey="n" rel="next">parttool</a>, Previous: <a href="#normal" accesskey="p" rel="prev">normal</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="normal_005fexit-1"></a> <h4 class="subsection">16.3.55 normal_exit</h4> <dl> <dt><a name="index-normal_005fexit"></a>Command: <strong>normal_exit</strong></dt> <dd><p>Exit normal mode (see <a href="#normal">normal</a>). If this instance of normal mode was not nested within another one, then return to rescue mode. </p></dd></dl> <hr> <a name="parttool"></a> <div class="header"> <p> Next: <a href="#password" accesskey="n" rel="next">password</a>, Previous: <a href="#normal_005fexit" accesskey="p" rel="prev">normal_exit</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="parttool-1"></a> <h4 class="subsection">16.3.56 parttool</h4> <dl> <dt><a name="index-parttool"></a>Command: <strong>parttool</strong> <em>partition commands</em></dt> <dd><p>Make various modifications to partition table entries. </p> <p>Each <var>command</var> is either a boolean option, in which case it must be followed with ‘<samp>+</samp>’ or ‘<samp>-</samp>’ (with no intervening space) to enable or disable that option, or else it takes a value in the form ‘<samp><var>command</var>=<var>value</var></samp>’. </p> <p>Currently, <code>parttool</code> is only useful on DOS partition tables (also known as Master Boot Record, or MBR). On these partition tables, the following commands are available: </p> <dl compact="compact"> <dt>‘<samp>boot</samp>’ (boolean)</dt> <dd><p>When enabled, this makes the selected partition be the active (bootable) partition on its disk, clearing the active flag on all other partitions. This command is limited to <em>primary</em> partitions. </p> </dd> <dt>‘<samp>type</samp>’ (value)</dt> <dd><p>Change the type of an existing partition. The value must be a number in the range 0-0xFF (prefix with ‘<samp>0x</samp>’ to enter it in hexadecimal). </p> </dd> <dt>‘<samp>hidden</samp>’ (boolean)</dt> <dd><p>When enabled, this hides the selected partition by setting the <em>hidden</em> bit in its partition type code; when disabled, unhides the selected partition by clearing this bit. This is useful only when booting DOS or Windows and multiple primary FAT partitions exist in one disk. See also <a href="#DOS_002fWindows">DOS/Windows</a>. </p></dd> </dl> </dd></dl> <hr> <a name="password"></a> <div class="header"> <p> Next: <a href="#password_005fpbkdf2" accesskey="n" rel="next">password_pbkdf2</a>, Previous: <a href="#parttool" accesskey="p" rel="prev">parttool</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="password-1"></a> <h4 class="subsection">16.3.57 password</h4> <dl> <dt><a name="index-password"></a>Command: <strong>password</strong> <em>user clear-password</em></dt> <dd><p>Define a user named <var>user</var> with password <var>clear-password</var>. See <a href="#Security">Security</a>. </p></dd></dl> <hr> <a name="password_005fpbkdf2"></a> <div class="header"> <p> Next: <a href="#play" accesskey="n" rel="next">play</a>, Previous: <a href="#password" accesskey="p" rel="prev">password</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="password_005fpbkdf2-1"></a> <h4 class="subsection">16.3.58 password_pbkdf2</h4> <dl> <dt><a name="index-password_005fpbkdf2"></a>Command: <strong>password_pbkdf2</strong> <em>user hashed-password</em></dt> <dd><p>Define a user named <var>user</var> with password hash <var>hashed-password</var>. Use <code>grub2-mkpasswd-pbkdf2</code> (see <a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>) to generate password hashes. See <a href="#Security">Security</a>. </p></dd></dl> <hr> <a name="play"></a> <div class="header"> <p> Next: <a href="#probe" accesskey="n" rel="next">probe</a>, Previous: <a href="#password_005fpbkdf2" accesskey="p" rel="prev">password_pbkdf2</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="play-1"></a> <h4 class="subsection">16.3.59 play</h4> <dl> <dt><a name="index-play"></a>Command: <strong>play</strong> <em>file | tempo [pitch1 duration1] [pitch2 duration2] …</em></dt> <dd><p>Plays a tune </p> <p>If the argument is a file name (see <a href="#File-name-syntax">File name syntax</a>), play the tune recorded in it. The file format is first the tempo as an unsigned 32bit little-endian number, then pairs of unsigned 16bit little-endian numbers for pitch and duration pairs. </p> <p>If the arguments are a series of numbers, play the inline tune. </p> <p>The tempo is the base for all note durations. 60 gives a 1-second base, 120 gives a half-second base, etc. Pitches are Hz. Set pitch to 0 to produce a rest. </p></dd></dl> <hr> <a name="probe"></a> <div class="header"> <p> Next: <a href="#pxe_005funload" accesskey="n" rel="next">pxe_unload</a>, Previous: <a href="#play" accesskey="p" rel="prev">play</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="probe-1"></a> <h4 class="subsection">16.3.60 probe</h4> <dl> <dt><a name="index-probe"></a>Command: <strong>probe</strong> <em>[<samp>--set</samp> var] <samp>--driver</samp>|<samp>--partmap</samp>|<samp>--fs</samp>|<samp>--fs-uuid</samp>|<samp>--label</samp> device</em></dt> <dd><p>Retrieve device information. If option <samp>--set</samp> is given, assign result to variable <var>var</var>, otherwise print information on the screen. </p></dd></dl> <hr> <a name="pxe_005funload"></a> <div class="header"> <p> Next: <a href="#read" accesskey="n" rel="next">read</a>, Previous: <a href="#probe" accesskey="p" rel="prev">probe</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="pxe_005funload-1"></a> <h4 class="subsection">16.3.61 pxe_unload</h4> <dl> <dt><a name="index-pxe_005funload"></a>Command: <strong>pxe_unload</strong></dt> <dd><p>Unload the PXE environment (see <a href="#Network">Network</a>). </p> <p>This command is only available on PC BIOS systems. </p></dd></dl> <hr> <a name="read"></a> <div class="header"> <p> Next: <a href="#reboot" accesskey="n" rel="next">reboot</a>, Previous: <a href="#pxe_005funload" accesskey="p" rel="prev">pxe_unload</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="read-1"></a> <h4 class="subsection">16.3.62 read</h4> <dl> <dt><a name="index-read"></a>Command: <strong>read</strong> <em>[var]</em></dt> <dd><p>Read a line of input from the user. If an environment variable <var>var</var> is given, set that environment variable to the line of input that was read, with no terminating newline. </p></dd></dl> <hr> <a name="reboot"></a> <div class="header"> <p> Next: <a href="#regexp" accesskey="n" rel="next">regexp</a>, Previous: <a href="#read" accesskey="p" rel="prev">read</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="reboot-1"></a> <h4 class="subsection">16.3.63 reboot</h4> <dl> <dt><a name="index-reboot"></a>Command: <strong>reboot</strong></dt> <dd><p>Reboot the computer. </p></dd></dl> <hr> <a name="regexp"></a> <div class="header"> <p> Next: <a href="#rmmod" accesskey="n" rel="next">rmmod</a>, Previous: <a href="#reboot" accesskey="p" rel="prev">reboot</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="regexp-1"></a> <h4 class="subsection">16.3.64 regexp</h4> <dl> <dt><a name="index-regexp"></a>Command: <strong>regexp</strong> <em>[<samp>--set</samp> [number:]var] regexp string</em></dt> <dd><p>Test if regular expression <var>regexp</var> matches <var>string</var>. Supported regular expressions are POSIX.2 Extended Regular Expressions. If option <samp>--set</samp> is given, store <var>number</var>th matched subexpression in variable <var>var</var>. Subexpressions are numbered in order of their opening parentheses starting from ‘<samp>1</samp>’. <var>number</var> defaults to ‘<samp>1</samp>’. </p></dd></dl> <hr> <a name="rmmod"></a> <div class="header"> <p> Next: <a href="#save_005fenv" accesskey="n" rel="next">save_env</a>, Previous: <a href="#regexp" accesskey="p" rel="prev">regexp</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="rmmod-1"></a> <h4 class="subsection">16.3.65 rmmod</h4> <dl> <dt><a name="index-rmmod"></a>Command: <strong>rmmod</strong> <em>module</em></dt> <dd><p>Remove a loaded <var>module</var>. </p></dd></dl> <hr> <a name="save_005fenv"></a> <div class="header"> <p> Next: <a href="#search" accesskey="n" rel="next">search</a>, Previous: <a href="#rmmod" accesskey="p" rel="prev">rmmod</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="save_005fenv-1"></a> <h4 class="subsection">16.3.66 save_env</h4> <dl> <dt><a name="index-save_005fenv"></a>Command: <strong>save_env</strong> <em>[<samp>--file</samp> file] var …</em></dt> <dd><p>Save the named variables from the environment to the environment block file. See <a href="#Environment-block">Environment block</a>. </p> <p>The <samp>--file</samp> option overrides the default location of the environment block. </p> <p>This command will operate successfully even when environment variable <code>check_signatures</code> is set to <code>enforce</code> (see <a href="#check_005fsignatures">check_signatures</a>), since it writes to disk and does not alter the behavior of GRUB based on any contents of disk that have been read. It is possible to modify a digitally signed environment block file from within GRUB using this command, such that its signature will no longer be valid on subsequent boots. Care should be taken in such advanced configurations to avoid rendering the system unbootable. See <a href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures</a>, for more information. </p></dd></dl> <hr> <a name="search"></a> <div class="header"> <p> Next: <a href="#sendkey" accesskey="n" rel="next">sendkey</a>, Previous: <a href="#save_005fenv" accesskey="p" rel="prev">save_env</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="search-1"></a> <h4 class="subsection">16.3.67 search</h4> <dl> <dt><a name="index-search"></a>Command: <strong>search</strong> <em>[<samp>--file</samp>|<samp>--label</samp>|<samp>--fs-uuid</samp>] [<samp>--set</samp> [var]] [<samp>--no-floppy</samp>] name</em></dt> <dd><p>Search devices by file (<samp>-f</samp>, <samp>--file</samp>), filesystem label (<samp>-l</samp>, <samp>--label</samp>), or filesystem UUID (<samp>-u</samp>, <samp>--fs-uuid</samp>). </p> <p>If the <samp>--set</samp> option is used, the first device found is set as the value of environment variable <var>var</var>. The default variable is ‘<samp>root</samp>’. </p> <p>The <samp>--no-floppy</samp> option prevents searching floppy devices, which can be slow. </p> <p>The ‘<samp>search.file</samp>’, ‘<samp>search.fs_label</samp>’, and ‘<samp>search.fs_uuid</samp>’ commands are aliases for ‘<samp>search --file</samp>’, ‘<samp>search --label</samp>’, and ‘<samp>search --fs-uuid</samp>’ respectively. </p></dd></dl> <hr> <a name="sendkey"></a> <div class="header"> <p> Next: <a href="#set" accesskey="n" rel="next">set</a>, Previous: <a href="#search" accesskey="p" rel="prev">search</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="sendkey-1"></a> <h4 class="subsection">16.3.68 sendkey</h4> <dl> <dt><a name="index-sendkey"></a>Command: <strong>sendkey</strong> <em>[<samp>--num</samp>|<samp>--caps</samp>|<samp>--scroll</samp>|<samp>--insert</samp>|<samp>--pause</samp>|<samp>--left-shift</samp>|<samp>--right-shift</samp>|<samp>--sysrq</samp>|<samp>--numkey</samp>|<samp>--capskey</samp>|<samp>--scrollkey</samp>|<samp>--insertkey</samp>|<samp>--left-alt</samp>|<samp>--right-alt</samp>|<samp>--left-ctrl</samp>|<samp>--right-ctrl</samp> ‘<samp>on</samp>’|‘<samp>off</samp>’]… [<samp>no-led</samp>] keystroke</em></dt> <dd><p>Insert keystrokes into the keyboard buffer when booting. Sometimes an operating system or chainloaded boot loader requires particular keys to be pressed: for example, one might need to press a particular key to enter "safe mode", or when chainloading another boot loader one might send keystrokes to it to navigate its menu. </p> <p>You may provide up to 16 keystrokes (the length of the BIOS keyboard buffer). Keystroke names may be upper-case or lower-case letters, digits, or taken from the following table: </p> <table> <thead><tr><th width="40%">Name</th><th width="50%">Key</th></tr></thead> <tr><td width="40%">escape</td><td width="50%">Escape</td></tr> <tr><td width="40%">exclam</td><td width="50%">!</td></tr> <tr><td width="40%">at</td><td width="50%">@</td></tr> <tr><td width="40%">numbersign</td><td width="50%">#</td></tr> <tr><td width="40%">dollar</td><td width="50%">$</td></tr> <tr><td width="40%">percent</td><td width="50%">%</td></tr> <tr><td width="40%">caret</td><td width="50%">^</td></tr> <tr><td width="40%">ampersand</td><td width="50%">&</td></tr> <tr><td width="40%">asterisk</td><td width="50%">*</td></tr> <tr><td width="40%">parenleft</td><td width="50%">(</td></tr> <tr><td width="40%">parenright</td><td width="50%">)</td></tr> <tr><td width="40%">minus</td><td width="50%">-</td></tr> <tr><td width="40%">underscore</td><td width="50%">_</td></tr> <tr><td width="40%">equal</td><td width="50%">=</td></tr> <tr><td width="40%">plus</td><td width="50%">+</td></tr> <tr><td width="40%">backspace</td><td width="50%">Backspace</td></tr> <tr><td width="40%">tab</td><td width="50%">Tab</td></tr> <tr><td width="40%">bracketleft</td><td width="50%">[</td></tr> <tr><td width="40%">braceleft</td><td width="50%">{</td></tr> <tr><td width="40%">bracketright</td><td width="50%">]</td></tr> <tr><td width="40%">braceright</td><td width="50%">}</td></tr> <tr><td width="40%">enter</td><td width="50%">Enter</td></tr> <tr><td width="40%">control</td><td width="50%">press and release Control</td></tr> <tr><td width="40%">semicolon</td><td width="50%">;</td></tr> <tr><td width="40%">colon</td><td width="50%">:</td></tr> <tr><td width="40%">quote</td><td width="50%">’</td></tr> <tr><td width="40%">doublequote</td><td width="50%">"</td></tr> <tr><td width="40%">backquote</td><td width="50%">‘</td></tr> <tr><td width="40%">tilde</td><td width="50%">~</td></tr> <tr><td width="40%">shift</td><td width="50%">press and release left Shift</td></tr> <tr><td width="40%">backslash</td><td width="50%">\</td></tr> <tr><td width="40%">bar</td><td width="50%">|</td></tr> <tr><td width="40%">comma</td><td width="50%">,</td></tr> <tr><td width="40%">less</td><td width="50%"><</td></tr> <tr><td width="40%">period</td><td width="50%">.</td></tr> <tr><td width="40%">greater</td><td width="50%">></td></tr> <tr><td width="40%">slash</td><td width="50%">/</td></tr> <tr><td width="40%">question</td><td width="50%">?</td></tr> <tr><td width="40%">rshift</td><td width="50%">press and release right Shift</td></tr> <tr><td width="40%">alt</td><td width="50%">press and release Alt</td></tr> <tr><td width="40%">space</td><td width="50%">space bar</td></tr> <tr><td width="40%">capslock</td><td width="50%">Caps Lock</td></tr> <tr><td width="40%">F1</td><td width="50%">F1</td></tr> <tr><td width="40%">F2</td><td width="50%">F2</td></tr> <tr><td width="40%">F3</td><td width="50%">F3</td></tr> <tr><td width="40%">F4</td><td width="50%">F4</td></tr> <tr><td width="40%">F5</td><td width="50%">F5</td></tr> <tr><td width="40%">F6</td><td width="50%">F6</td></tr> <tr><td width="40%">F7</td><td width="50%">F7</td></tr> <tr><td width="40%">F8</td><td width="50%">F8</td></tr> <tr><td width="40%">F9</td><td width="50%">F9</td></tr> <tr><td width="40%">F10</td><td width="50%">F10</td></tr> <tr><td width="40%">F11</td><td width="50%">F11</td></tr> <tr><td width="40%">F12</td><td width="50%">F12</td></tr> <tr><td width="40%">num1</td><td width="50%">1 (numeric keypad)</td></tr> <tr><td width="40%">num2</td><td width="50%">2 (numeric keypad)</td></tr> <tr><td width="40%">num3</td><td width="50%">3 (numeric keypad)</td></tr> <tr><td width="40%">num4</td><td width="50%">4 (numeric keypad)</td></tr> <tr><td width="40%">num5</td><td width="50%">5 (numeric keypad)</td></tr> <tr><td width="40%">num6</td><td width="50%">6 (numeric keypad)</td></tr> <tr><td width="40%">num7</td><td width="50%">7 (numeric keypad)</td></tr> <tr><td width="40%">num8</td><td width="50%">8 (numeric keypad)</td></tr> <tr><td width="40%">num9</td><td width="50%">9 (numeric keypad)</td></tr> <tr><td width="40%">num0</td><td width="50%">0 (numeric keypad)</td></tr> <tr><td width="40%">numperiod</td><td width="50%">. (numeric keypad)</td></tr> <tr><td width="40%">numend</td><td width="50%">End (numeric keypad)</td></tr> <tr><td width="40%">numdown</td><td width="50%">Down (numeric keypad)</td></tr> <tr><td width="40%">numpgdown</td><td width="50%">Page Down (numeric keypad)</td></tr> <tr><td width="40%">numleft</td><td width="50%">Left (numeric keypad)</td></tr> <tr><td width="40%">numcenter</td><td width="50%">5 with Num Lock inactive (numeric keypad)</td></tr> <tr><td width="40%">numright</td><td width="50%">Right (numeric keypad)</td></tr> <tr><td width="40%">numhome</td><td width="50%">Home (numeric keypad)</td></tr> <tr><td width="40%">numup</td><td width="50%">Up (numeric keypad)</td></tr> <tr><td width="40%">numpgup</td><td width="50%">Page Up (numeric keypad)</td></tr> <tr><td width="40%">numinsert</td><td width="50%">Insert (numeric keypad)</td></tr> <tr><td width="40%">numdelete</td><td width="50%">Delete (numeric keypad)</td></tr> <tr><td width="40%">numasterisk</td><td width="50%">* (numeric keypad)</td></tr> <tr><td width="40%">numminus</td><td width="50%">- (numeric keypad)</td></tr> <tr><td width="40%">numplus</td><td width="50%">+ (numeric keypad)</td></tr> <tr><td width="40%">numslash</td><td width="50%">/ (numeric keypad)</td></tr> <tr><td width="40%">numenter</td><td width="50%">Enter (numeric keypad)</td></tr> <tr><td width="40%">delete</td><td width="50%">Delete</td></tr> <tr><td width="40%">insert</td><td width="50%">Insert</td></tr> <tr><td width="40%">home</td><td width="50%">Home</td></tr> <tr><td width="40%">end</td><td width="50%">End</td></tr> <tr><td width="40%">pgdown</td><td width="50%">Page Down</td></tr> <tr><td width="40%">pgup</td><td width="50%">Page Up</td></tr> <tr><td width="40%">down</td><td width="50%">Down</td></tr> <tr><td width="40%">up</td><td width="50%">Up</td></tr> <tr><td width="40%">left</td><td width="50%">Left</td></tr> <tr><td width="40%">right</td><td width="50%">Right</td></tr> </table> <p>As well as keystrokes, the <code>sendkey</code> command takes various options that affect the BIOS keyboard status flags. These options take an ‘<samp>on</samp>’ or ‘<samp>off</samp>’ parameter, specifying that the corresponding status flag be set or unset; omitting the option for a given status flag will leave that flag at its initial state at boot. The <samp>--num</samp>, <samp>--caps</samp>, <samp>--scroll</samp>, and <samp>--insert</samp> options emulate setting the corresponding mode, while the <samp>--numkey</samp>, <samp>--capskey</samp>, <samp>--scrollkey</samp>, and <samp>--insertkey</samp> options emulate pressing and holding the corresponding key. The other status flag options are self-explanatory. </p> <p>If the <samp>--no-led</samp> option is given, the status flag options will have no effect on keyboard LEDs. </p> <p>If the <code>sendkey</code> command is given multiple times, then only the last invocation has any effect. </p> <p>Since <code>sendkey</code> manipulates the BIOS keyboard buffer, it may cause hangs, reboots, or other misbehaviour on some systems. If the operating system or boot loader that runs after GRUB uses its own keyboard driver rather than the BIOS keyboard functions, then <code>sendkey</code> will have no effect. </p> <p>This command is only available on PC BIOS systems. </p></dd></dl> <hr> <a name="set"></a> <div class="header"> <p> Next: <a href="#sha1sum" accesskey="n" rel="next">sha1sum</a>, Previous: <a href="#sendkey" accesskey="p" rel="prev">sendkey</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="set-1"></a> <h4 class="subsection">16.3.69 set</h4> <dl> <dt><a name="index-set"></a>Command: <strong>set</strong> <em>[envvar=value]</em></dt> <dd><p>Set the environment variable <var>envvar</var> to <var>value</var>. If invoked with no arguments, print all environment variables with their values. </p></dd></dl> <hr> <a name="sha1sum"></a> <div class="header"> <p> Next: <a href="#sha256sum" accesskey="n" rel="next">sha256sum</a>, Previous: <a href="#set" accesskey="p" rel="prev">set</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="sha1sum-1"></a> <h4 class="subsection">16.3.70 sha1sum</h4> <dl> <dt><a name="index-sha1sum"></a>Command: <strong>sha1sum</strong> <em>arg …</em></dt> <dd><p>Alias for <code>hashsum --hash sha1 arg …</code>. See command <code>hashsum</code> (see <a href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> <a name="sha256sum"></a> <div class="header"> <p> Next: <a href="#sha512sum" accesskey="n" rel="next">sha512sum</a>, Previous: <a href="#sha1sum" accesskey="p" rel="prev">sha1sum</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="sha256sum-1"></a> <h4 class="subsection">16.3.71 sha256sum</h4> <dl> <dt><a name="index-sha256sum"></a>Command: <strong>sha256sum</strong> <em>arg …</em></dt> <dd><p>Alias for <code>hashsum --hash sha256 arg …</code>. See command <code>hashsum</code> (see <a href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> <a name="sha512sum"></a> <div class="header"> <p> Next: <a href="#sleep" accesskey="n" rel="next">sleep</a>, Previous: <a href="#sha256sum" accesskey="p" rel="prev">sha256sum</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="sha512sum-1"></a> <h4 class="subsection">16.3.72 sha512sum</h4> <dl> <dt><a name="index-sha512sum"></a>Command: <strong>sha512sum</strong> <em>arg …</em></dt> <dd><p>Alias for <code>hashsum --hash sha512 arg …</code>. See command <code>hashsum</code> (see <a href="#hashsum">hashsum</a>) for full description. </p></dd></dl> <hr> <a name="sleep"></a> <div class="header"> <p> Next: <a href="#source" accesskey="n" rel="next">source</a>, Previous: <a href="#sha512sum" accesskey="p" rel="prev">sha512sum</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="sleep-1"></a> <h4 class="subsection">16.3.73 sleep</h4> <dl> <dt><a name="index-sleep"></a>Command: <strong>sleep</strong> <em>[<samp>--verbose</samp>] [<samp>--interruptible</samp>] count</em></dt> <dd><p>Sleep for <var>count</var> seconds. If option <samp>--interruptible</samp> is given, allow <tt class="key">ESC</tt> to interrupt sleep. With <samp>--verbose</samp> show countdown of remaining seconds. Exit code is set to 0 if timeout expired and to 1 if timeout was interrupted by <tt class="key">ESC</tt>. </p></dd></dl> <hr> <a name="source"></a> <div class="header"> <p> Next: <a href="#test" accesskey="n" rel="next">test</a>, Previous: <a href="#sleep" accesskey="p" rel="prev">sleep</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="source-1"></a> <h4 class="subsection">16.3.74 source</h4> <dl> <dt><a name="index-source"></a>Command: <strong>source</strong> <em>file</em></dt> <dd><p>Read <var>file</var> as a configuration file, as if its contents had been incorporated directly into the sourcing file. Unlike <code>configfile</code> (see <a href="#configfile">configfile</a>), this executes the contents of <var>file</var> without changing context: any environment variable changes made by the commands in <var>file</var> will be preserved after <code>source</code> returns, and the menu will not be shown immediately. </p></dd></dl> <hr> <a name="test"></a> <div class="header"> <p> Next: <a href="#true" accesskey="n" rel="next">true</a>, Previous: <a href="#source" accesskey="p" rel="prev">source</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="test-1"></a> <h4 class="subsection">16.3.75 test</h4> <dl> <dt><a name="index-test"></a>Command: <strong>test</strong> <em>expression</em></dt> <dd><p>Evaluate <var>expression</var> and return zero exit status if result is true, non zero status otherwise. </p> <p><var>expression</var> is one of: </p> <dl compact="compact"> <dt><var>string1</var> <code>==</code> <var>string2</var></dt> <dd><p>the strings are equal </p></dd> <dt><var>string1</var> <code>!=</code> <var>string2</var></dt> <dd><p>the strings are not equal </p></dd> <dt><var>string1</var> <code><</code> <var>string2</var></dt> <dd><p><var>string1</var> is lexicographically less than <var>string2</var> </p></dd> <dt><var>string1</var> <code><=</code> <var>string2</var></dt> <dd><p><var>string1</var> is lexicographically less or equal than <var>string2</var> </p></dd> <dt><var>string1</var> <code>></code> <var>string2</var></dt> <dd><p><var>string1</var> is lexicographically greater than <var>string2</var> </p></dd> <dt><var>string1</var> <code>>=</code> <var>string2</var></dt> <dd><p><var>string1</var> is lexicographically greater or equal than <var>string2</var> </p></dd> <dt><var>integer1</var> <code>-eq</code> <var>integer2</var></dt> <dd><p><var>integer1</var> is equal to <var>integer2</var> </p></dd> <dt><var>integer1</var> <code>-ge</code> <var>integer2</var></dt> <dd><p><var>integer1</var> is greater than or equal to <var>integer2</var> </p></dd> <dt><var>integer1</var> <code>-gt</code> <var>integer2</var></dt> <dd><p><var>integer1</var> is greater than <var>integer2</var> </p></dd> <dt><var>integer1</var> <code>-le</code> <var>integer2</var></dt> <dd><p><var>integer1</var> is less than or equal to <var>integer2</var> </p></dd> <dt><var>integer1</var> <code>-lt</code> <var>integer2</var></dt> <dd><p><var>integer1</var> is less than <var>integer2</var> </p></dd> <dt><var>integer1</var> <code>-ne</code> <var>integer2</var></dt> <dd><p><var>integer1</var> is not equal to <var>integer2</var> </p></dd> <dt><var>prefix</var><var>integer1</var> <code>-pgt</code> <var>prefix</var><var>integer2</var></dt> <dd><p><var>integer1</var> is greater than <var>integer2</var> after stripping off common non-numeric <var>prefix</var>. </p></dd> <dt><var>prefix</var><var>integer1</var> <code>-plt</code> <var>prefix</var><var>integer2</var></dt> <dd><p><var>integer1</var> is less than <var>integer2</var> after stripping off common non-numeric <var>prefix</var>. </p></dd> <dt><var>file1</var> <code>-nt</code> <var>file2</var></dt> <dd><p><var>file1</var> is newer than <var>file2</var> (modification time). Optionally numeric <var>bias</var> may be directly appended to <code>-nt</code> in which case it is added to the first file modification time. </p></dd> <dt><var>file1</var> <code>-ot</code> <var>file2</var></dt> <dd><p><var>file1</var> is older than <var>file2</var> (modification time). Optionally numeric <var>bias</var> may be directly appended to <code>-ot</code> in which case it is added to the first file modification time. </p></dd> <dt><code>-d</code> <var>file</var></dt> <dd><p><var>file</var> exists and is a directory </p></dd> <dt><code>-e</code> <var>file</var></dt> <dd><p><var>file</var> exists </p></dd> <dt><code>-f</code> <var>file</var></dt> <dd><p><var>file</var> exists and is not a directory </p></dd> <dt><code>-s</code> <var>file</var></dt> <dd><p><var>file</var> exists and has a size greater than zero </p></dd> <dt><code>-n</code> <var>string</var></dt> <dd><p>the length of <var>string</var> is nonzero </p></dd> <dt><var>string</var></dt> <dd><p><var>string</var> is equivalent to <code>-n <var>string</var></code> </p></dd> <dt><code>-z</code> <var>string</var></dt> <dd><p>the length of <var>string</var> is zero </p></dd> <dt><code>(</code> <var>expression</var> <code>)</code></dt> <dd><p><var>expression</var> is true </p></dd> <dt><code>!</code> <var>expression</var></dt> <dd><p><var>expression</var> is false </p></dd> <dt><var>expression1</var> <code>-a</code> <var>expression2</var></dt> <dd><p>both <var>expression1</var> and <var>expression2</var> are true </p></dd> <dt><var>expression1</var> <var>expression2</var></dt> <dd><p>both <var>expression1</var> and <var>expression2</var> are true. This syntax is not POSIX-compliant and is not recommended. </p></dd> <dt><var>expression1</var> <code>-o</code> <var>expression2</var></dt> <dd><p>either <var>expression1</var> or <var>expression2</var> is true </p></dd> </dl> </dd></dl> <hr> <a name="true"></a> <div class="header"> <p> Next: <a href="#trust" accesskey="n" rel="next">trust</a>, Previous: <a href="#test" accesskey="p" rel="prev">test</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="true-1"></a> <h4 class="subsection">16.3.76 true</h4> <dl> <dt><a name="index-true"></a>Command: <strong>true</strong></dt> <dd><p>Do nothing, successfully. This is mainly useful in control constructs such as <code>if</code> and <code>while</code> (see <a href="#Shell_002dlike-scripting">Shell-like scripting</a>). </p></dd></dl> <hr> <a name="trust"></a> <div class="header"> <p> Next: <a href="#trust_005fcertificate" accesskey="n" rel="next">trust_certificate</a>, Previous: <a href="#true" accesskey="p" rel="prev">true</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="trust-1"></a> <h4 class="subsection">16.3.77 trust</h4> <dl> <dt><a name="index-trust"></a>Command: <strong>trust</strong> <em>[<samp>--skip-sig</samp>] pubkey_file</em></dt> <dd><p>Read public key from <var>pubkey_file</var> and add it to GRUB’s internal list of trusted public keys. These keys are used to validate digital signatures when environment variable <code>check_signatures</code> is set to <code>enforce</code>. Note that if <code>check_signatures</code> is set to <code>enforce</code> when <code>trust</code> executes, then <var>pubkey_file</var> must itself be properly signed. The <samp>--skip-sig</samp> option can be used to disable signature-checking when reading <var>pubkey_file</var> itself. It is expected that <samp>--skip-sig</samp> is useful for testing and manual booting. See <a href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures</a>, for more information. </p></dd></dl> <hr> <a name="trust_005fcertificate"></a> <div class="header"> <p> Next: <a href="#unset" accesskey="n" rel="next">unset</a>, Previous: <a href="#trust" accesskey="p" rel="prev">trust</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="trust_005fcertificate-1"></a> <h4 class="subsection">16.3.78 trust_certificate</h4> <dl> <dt><a name="index-trust_005fcertificate"></a>Command: <strong>trust_certificate</strong> <em>x509_certificate</em></dt> <dd><p>Read an DER-formatted x509 certificate from the file <var>x509_certificate</var> and add it to GRUB’s internal list of trusted x509 certificates. These certificates are used to validate appended signatures when the environment variable <code>check_appended_signatures</code> is set to <code>enforce</code>. </p> <p>Note that if <code>check_appended_signatures</code> is set to <code>enforce</code> when <code>trust_certificate</code> is executed, then <var>x509_certificate</var> must itself bear an appended signature. (It is not sufficient that <var>x509_certificate</var> be signed by a trusted certificate according to the x509 rules: grub does not include support for validating signatures within x509 certificates themselves.) </p> <p>See See <a href="#Using-appended-signatures">Using appended signatures</a> for more information. </p></dd></dl> <hr> <a name="unset"></a> <div class="header"> <p> Next: <a href="#uppermem" accesskey="n" rel="next">uppermem</a>, Previous: <a href="#trust_005fcertificate" accesskey="p" rel="prev">trust_certificate</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="unset-1"></a> <h4 class="subsection">16.3.79 unset</h4> <dl> <dt><a name="index-unset"></a>Command: <strong>unset</strong> <em>envvar</em></dt> <dd><p>Unset the environment variable <var>envvar</var>. </p></dd></dl> <hr> <a name="uppermem"></a> <div class="header"> <p> Next: <a href="#verify_005fappended" accesskey="n" rel="next">verify_appended</a>, Previous: <a href="#unset" accesskey="p" rel="prev">unset</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="uppermem-1"></a> <h4 class="subsection">16.3.80 uppermem</h4> <p>This command is not yet implemented for GRUB 2, although it is planned. </p> <hr> <a name="verify_005fappended"></a> <div class="header"> <p> Next: <a href="#verify_005fdetached" accesskey="n" rel="next">verify_detached</a>, Previous: <a href="#uppermem" accesskey="p" rel="prev">uppermem</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="verify_005fappended-1"></a> <h4 class="subsection">16.3.81 verify_appended</h4> <dl> <dt><a name="index-verify_005fappended"></a>Command: <strong>verify_appended</strong> <em>file</em></dt> <dd><p>Verifies an appended signature on <var>file</var> against the trusted certificates known to GRUB (See see <a href="#list_005fcertificates">list_certificates</a>, see <a href="#trust_005fcertificate">trust_certificate</a>, and see <a href="#distrust_005fcertificate">distrust_certificate</a>). </p> <p>Exit code <code>$?</code> is set to 0 if the signature validates successfully. If validation fails, it is set to a non-zero value. See See <a href="#Using-appended-signatures">Using appended signatures</a>, for more information. </p></dd></dl> <hr> <a name="verify_005fdetached"></a> <div class="header"> <p> Next: <a href="#videoinfo" accesskey="n" rel="next">videoinfo</a>, Previous: <a href="#verify_005fappended" accesskey="p" rel="prev">verify_appended</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="verify_005fdetached-1"></a> <h4 class="subsection">16.3.82 verify_detached</h4> <dl> <dt><a name="index-verify_005fdetached"></a>Command: <strong>verify_detached</strong> <em>[<samp>--skip-sig</samp>] file signature_file [pubkey_file]</em></dt> <dd><p>Verifies a GPG-style detached signature, where the signed file is <var>file</var>, and the signature itself is in file <var>signature_file</var>. Optionally, a specific public key to use can be specified using <var>pubkey_file</var>. When environment variable <code>check_signatures</code> is set to <code>enforce</code>, then <var>pubkey_file</var> must itself be properly signed by an already-trusted key. An unsigned <var>pubkey_file</var> can be loaded by specifying <samp>--skip-sig</samp>. If <var>pubkey_file</var> is omitted, then public keys from GRUB’s trusted keys (see <a href="#list_005ftrusted">list_trusted</a>, see <a href="#trust">trust</a>, and see <a href="#distrust">distrust</a>) are tried. </p> <p>Exit code <code>$?</code> is set to 0 if the signature validates successfully. If validation fails, it is set to a non-zero value. See <a href="#Using-GPG_002dstyle-digital-signatures">Using GPG-style digital signatures</a>, for more information. </p></dd></dl> <hr> <a name="videoinfo"></a> <div class="header"> <p> Next: <a href="#xen_005fhypervisor" accesskey="n" rel="next">xen_hypervisor</a>, Previous: <a href="#verify_005fdetached" accesskey="p" rel="prev">verify_detached</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="videoinfo-1"></a> <h4 class="subsection">16.3.83 videoinfo</h4> <dl> <dt><a name="index-videoinfo"></a>Command: <strong>videoinfo</strong> <em>[[WxH]xD]</em></dt> <dd><p>List available video modes. If resolution is given, show only matching modes. </p></dd></dl> <hr> <a name="xen_005fhypervisor"></a> <div class="header"> <p> Next: <a href="#xen_005fmodule" accesskey="n" rel="next">xen_module</a>, Previous: <a href="#videoinfo" accesskey="p" rel="prev">videoinfo</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="xen_005fhypervisor-1"></a> <h4 class="subsection">16.3.84 xen_hypervisor</h4> <dl> <dt><a name="index-xen_005fhypervisor"></a>Command: <strong>xen_hypervisor</strong> <em>file [arguments] …</em></dt> <dd><p>Load a Xen hypervisor binary from <var>file</var>. The rest of the line is passed verbatim as the <em>kernel command-line</em>. Any other binaries must be reloaded after using this command. This command is only available on AArch64 systems. </p></dd></dl> <hr> <a name="xen_005fmodule"></a> <div class="header"> <p> Previous: <a href="#xen_005fhypervisor" accesskey="p" rel="prev">xen_hypervisor</a>, Up: <a href="#Command_002dline-and-menu-entry-commands" accesskey="u" rel="up">Command-line and menu entry commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="xen_005fmodule-1"></a> <h4 class="subsection">16.3.85 xen_module</h4> <dl> <dt><a name="index-xen_005fmodule"></a>Command: <strong>xen_module</strong> <em>[--nounzip] file [arguments]</em></dt> <dd><p>Load a module for xen hypervisor at the booting process of xen. The rest of the line is passed verbatim as the module command line. Modules should be loaded in the following order: - dom0 kernel image - dom0 ramdisk if present - XSM policy if present This command is only available on AArch64 systems. </p></dd></dl> <hr> <a name="Networking-commands"></a> <div class="header"> <p> Previous: <a href="#Command_002dline-and-menu-entry-commands" accesskey="p" rel="prev">Command-line and menu entry commands</a>, Up: <a href="#Commands" accesskey="u" rel="up">Commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="The-list-of-networking-commands"></a> <h3 class="section">16.4 The list of networking commands</h3> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#net_005fadd_005faddr" accesskey="1">net_add_addr</a>:</td><td> </td><td align="left" valign="top">Add a network address </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fadd_005fdns" accesskey="2">net_add_dns</a>:</td><td> </td><td align="left" valign="top">Add a DNS server </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fadd_005froute" accesskey="3">net_add_route</a>:</td><td> </td><td align="left" valign="top">Add routing entry </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fbootp" accesskey="4">net_bootp</a>:</td><td> </td><td align="left" valign="top">Perform a bootp autoconfiguration </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fbootp6" accesskey="5">net_bootp6</a>:</td><td> </td><td align="left" valign="top">Perform a DHCPv6 autoconfiguration </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fdel_005faddr" accesskey="6">net_del_addr</a>:</td><td> </td><td align="left" valign="top">Remove IP address from interface </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fdel_005fdns" accesskey="7">net_del_dns</a>:</td><td> </td><td align="left" valign="top">Remove a DNS server </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fdel_005froute" accesskey="8">net_del_route</a>:</td><td> </td><td align="left" valign="top">Remove a route entry </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fget_005fdhcp_005foption" accesskey="9">net_get_dhcp_option</a>:</td><td> </td><td align="left" valign="top">Retrieve DHCP options </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a>:</td><td> </td><td align="left" valign="top">Perform IPv6 autoconfiguration </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fls_005faddr">net_ls_addr</a>:</td><td> </td><td align="left" valign="top">List interfaces </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fls_005fcards">net_ls_cards</a>:</td><td> </td><td align="left" valign="top">List network cards </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fls_005fdns">net_ls_dns</a>:</td><td> </td><td align="left" valign="top">List DNS servers </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fls_005froutes">net_ls_routes</a>:</td><td> </td><td align="left" valign="top">List routing entries </td></tr> <tr><td align="left" valign="top">• <a href="#net_005fnslookup">net_nslookup</a>:</td><td> </td><td align="left" valign="top">Perform a DNS lookup </td></tr> </table> <hr> <a name="net_005fadd_005faddr"></a> <div class="header"> <p> Next: <a href="#net_005fadd_005fdns" accesskey="n" rel="next">net_add_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fadd_005faddr-1"></a> <h4 class="subsection">16.4.1 net_add_addr</h4> <dl> <dt><a name="index-net_005fadd_005faddr"></a>Command: <strong>net_add_addr</strong> <em><var>interface</var> <var>card</var> <var>address</var></em></dt> <dd><p>Configure additional network <var>interface</var> with <var>address</var> on a network <var>card</var>. <var>address</var> can be either IP in dotted decimal notation, or symbolic name which is resolved using DNS lookup. If successful, this command also adds local link routing entry to the default subnet of <var>address</var> with name <var>interface</var>‘<samp>:local</samp>’ via <var>interface</var>. </p></dd></dl> <hr> <a name="net_005fadd_005fdns"></a> <div class="header"> <p> Next: <a href="#net_005fadd_005froute" accesskey="n" rel="next">net_add_route</a>, Previous: <a href="#net_005fadd_005faddr" accesskey="p" rel="prev">net_add_addr</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fadd_005fdns-1"></a> <h4 class="subsection">16.4.2 net_add_dns</h4> <dl> <dt><a name="index-net_005fadd_005fdns"></a>Command: <strong>net_add_dns</strong> <em><var>server</var></em></dt> <dd><p>Resolve <var>server</var> IP address and add to the list of DNS servers used during name lookup. </p></dd></dl> <hr> <a name="net_005fadd_005froute"></a> <div class="header"> <p> Next: <a href="#net_005fbootp" accesskey="n" rel="next">net_bootp</a>, Previous: <a href="#net_005fadd_005fdns" accesskey="p" rel="prev">net_add_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fadd_005froute-1"></a> <h4 class="subsection">16.4.3 net_add_route</h4> <dl> <dt><a name="index-net_005fadd_005froute"></a>Command: <strong>net_add_route</strong> <em><var>shortname</var> <var>ip</var>[/<var>prefix</var>] [<var>interface</var> | ‘<samp>gw</samp>’ <var>gateway</var>]</em></dt> <dd><p>Add route to network with address <var>ip</var> as modified by <var>prefix</var> via either local <var>interface</var> or <var>gateway</var>. <var>prefix</var> is optional and defaults to 32 for IPv4 address and 128 for IPv6 address. Route is identified by <var>shortname</var> which can be used to remove it (see <a href="#net_005fdel_005froute">net_del_route</a>). </p></dd></dl> <hr> <a name="net_005fbootp"></a> <div class="header"> <p> Next: <a href="#net_005fbootp6" accesskey="n" rel="next">net_bootp6</a>, Previous: <a href="#net_005fadd_005froute" accesskey="p" rel="prev">net_add_route</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fbootp-1"></a> <h4 class="subsection">16.4.4 net_bootp</h4> <dl> <dt><a name="index-net_005fbootp"></a>Command: <strong>net_bootp</strong> <em>[<var>card</var>]</em></dt> <dd><p>Perform configuration of <var>card</var> using DHCP protocol. If no card name is specified, try to configure all existing cards. If configuration was successful, interface with name <var>card</var>‘<samp>:dhcp</samp>’ and configured address is added to <var>card</var>. Additionally the following DHCP options are recognized and processed: </p> <dl compact="compact"> <dt>‘<samp>1 (Subnet Mask)</samp>’</dt> <dd><p>Used to calculate network local routing entry for interface <var>card</var>‘<samp>:dhcp</samp>’. </p></dd> <dt>‘<samp>3 (Router)</samp>’</dt> <dd><p>Adds default route entry with the name <var>card</var>‘<samp>:dhcp:default</samp>’ via gateway from DHCP option. Note that only option with single route is accepted. </p></dd> <dt>‘<samp>6 (Domain Name Server)</samp>’</dt> <dd><p>Adds all servers from option value to the list of servers used during name resolution. </p></dd> <dt>‘<samp>12 (Host Name)</samp>’</dt> <dd><p>Sets environment variable ‘<samp>net_</samp>’<var><card></var>‘<samp>_dhcp_hostname</samp>’ (see <a href="#net_005f_003cinterface_003e_005fhostname">net_<var><interface></var>_hostname</a>) to the value of option. </p></dd> <dt>‘<samp>15 (Domain Name)</samp>’</dt> <dd><p>Sets environment variable ‘<samp>net_</samp>’<var><card></var>‘<samp>_dhcp_domain</samp>’ (see <a href="#net_005f_003cinterface_003e_005fdomain">net_<var><interface></var>_domain</a>) to the value of option. </p></dd> <dt>‘<samp>17 (Root Path)</samp>’</dt> <dd><p>Sets environment variable ‘<samp>net_</samp>’<var><card></var>‘<samp>_dhcp_rootpath</samp>’ (see <a href="#net_005f_003cinterface_003e_005frootpath">net_<var><interface></var>_rootpath</a>) to the value of option. </p></dd> <dt>‘<samp>18 (Extensions Path)</samp>’</dt> <dd><p>Sets environment variable ‘<samp>net_</samp>’<var><card></var>‘<samp>_dhcp_extensionspath</samp>’ (see <a href="#net_005f_003cinterface_003e_005fextensionspath">net_<var><interface></var>_extensionspath</a>) to the value of option. </p></dd> </dl> </dd></dl> <hr> <a name="net_005fbootp6"></a> <div class="header"> <p> Next: <a href="#net_005fdel_005faddr" accesskey="n" rel="next">net_del_addr</a>, Previous: <a href="#net_005fbootp" accesskey="p" rel="prev">net_bootp</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fbootp6-1"></a> <h4 class="subsection">16.4.5 net_bootp6</h4> <dl> <dt><a name="index-net_005fbootp6"></a>Command: <strong>net_bootp6</strong> <em>[<var>card</var>]</em></dt> <dd><p>Perform configuration of <var>card</var> using DHCPv6 protocol. If no card name is specified, try to configure all existing cards. If configuration was successful, interface with name <var>card</var>‘<samp>:dhcp6</samp>’ and configured address is added to <var>card</var>. </p> <dl compact="compact"> <dt>‘<samp>1 (Domain Name Server)</samp>’</dt> <dd><p>Adds all servers from option value to the list of servers used during name resolution. </p></dd> </dl> </dd></dl> <hr> <a name="net_005fdel_005faddr"></a> <div class="header"> <p> Next: <a href="#net_005fdel_005fdns" accesskey="n" rel="next">net_del_dns</a>, Previous: <a href="#net_005fbootp6" accesskey="p" rel="prev">net_bootp6</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fdel_005faddr-1"></a> <h4 class="subsection">16.4.6 net_del_addr</h4> <dl> <dt><a name="index-net_005fdel_005faddr"></a>Command: <strong>net_del_addr</strong> <em><var>interface</var></em></dt> <dd><p>Remove configured <var>interface</var> with associated address. </p></dd></dl> <hr> <a name="net_005fdel_005fdns"></a> <div class="header"> <p> Next: <a href="#net_005fdel_005froute" accesskey="n" rel="next">net_del_route</a>, Previous: <a href="#net_005fdel_005faddr" accesskey="p" rel="prev">net_del_addr</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fdel_005fdns-1"></a> <h4 class="subsection">16.4.7 net_del_dns</h4> <dl> <dt><a name="index-net_005fdel_005fdns"></a>Command: <strong>net_del_dns</strong> <em><var>address</var></em></dt> <dd><p>Remove <var>address</var> from list of servers used during name lookup. </p></dd></dl> <hr> <a name="net_005fdel_005froute"></a> <div class="header"> <p> Next: <a href="#net_005fget_005fdhcp_005foption" accesskey="n" rel="next">net_get_dhcp_option</a>, Previous: <a href="#net_005fdel_005fdns" accesskey="p" rel="prev">net_del_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fdel_005froute-1"></a> <h4 class="subsection">16.4.8 net_del_route</h4> <dl> <dt><a name="index-net_005fdel_005froute"></a>Command: <strong>net_del_route</strong> <em><var>shortname</var></em></dt> <dd><p>Remove route entry identified by <var>shortname</var>. </p></dd></dl> <hr> <a name="net_005fget_005fdhcp_005foption"></a> <div class="header"> <p> Next: <a href="#net_005fipv6_005fautoconf" accesskey="n" rel="next">net_ipv6_autoconf</a>, Previous: <a href="#net_005fdel_005froute" accesskey="p" rel="prev">net_del_route</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fget_005fdhcp_005foption-1"></a> <h4 class="subsection">16.4.9 net_get_dhcp_option</h4> <dl> <dt><a name="index-net_005fget_005fdhcp_005foption"></a>Command: <strong>net_get_dhcp_option</strong> <em><var>var</var> <var>interface</var> <var>number</var> <var>type</var></em></dt> <dd><p>Request DHCP option <var>number</var> of <var>type</var> via <var>interface</var>. <var>type</var> can be one of ‘<samp>string</samp>’, ‘<samp>number</samp>’ or ‘<samp>hex</samp>’. If option is found, assign its value to variable <var>var</var>. Values of types ‘<samp>number</samp>’ and ‘<samp>hex</samp>’ are converted to string representation. </p></dd></dl> <hr> <a name="net_005fipv6_005fautoconf"></a> <div class="header"> <p> Next: <a href="#net_005fls_005faddr" accesskey="n" rel="next">net_ls_addr</a>, Previous: <a href="#net_005fget_005fdhcp_005foption" accesskey="p" rel="prev">net_get_dhcp_option</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fipv6_005fautoconf-1"></a> <h4 class="subsection">16.4.10 net_ipv6_autoconf</h4> <dl> <dt><a name="index-net_005fipv6_005fautoconf"></a>Command: <strong>net_ipv6_autoconf</strong> <em>[<var>card</var>]</em></dt> <dd><p>Perform IPv6 autoconfiguration by adding to the <var>card</var> interface with name <var>card</var>‘<samp>:link</samp>’ and link local MAC-based address. If no card is specified, perform autoconfiguration for all existing cards. </p></dd></dl> <hr> <a name="net_005fls_005faddr"></a> <div class="header"> <p> Next: <a href="#net_005fls_005fcards" accesskey="n" rel="next">net_ls_cards</a>, Previous: <a href="#net_005fipv6_005fautoconf" accesskey="p" rel="prev">net_ipv6_autoconf</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fls_005faddr-1"></a> <h4 class="subsection">16.4.11 net_ls_addr</h4> <dl> <dt><a name="index-net_005fls_005faddr"></a>Command: <strong>net_ls_addr</strong></dt> <dd><p>List all configured interfaces with their MAC and IP addresses. </p></dd></dl> <hr> <a name="net_005fls_005fcards"></a> <div class="header"> <p> Next: <a href="#net_005fls_005fdns" accesskey="n" rel="next">net_ls_dns</a>, Previous: <a href="#net_005fls_005faddr" accesskey="p" rel="prev">net_ls_addr</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fls_005fcards-1"></a> <h4 class="subsection">16.4.12 net_ls_cards</h4> <dl> <dt><a name="index-net_005fls_005fcards"></a>Command: <strong>net_ls_cards</strong></dt> <dd><p>List all detected network cards with their MAC address. </p></dd></dl> <hr> <a name="net_005fls_005fdns"></a> <div class="header"> <p> Next: <a href="#net_005fls_005froutes" accesskey="n" rel="next">net_ls_routes</a>, Previous: <a href="#net_005fls_005fcards" accesskey="p" rel="prev">net_ls_cards</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fls_005fdns-1"></a> <h4 class="subsection">16.4.13 net_ls_dns</h4> <dl> <dt><a name="index-net_005fls_005fdns"></a>Command: <strong>net_ls_dns</strong></dt> <dd><p>List addresses of DNS servers used during name lookup. </p></dd></dl> <hr> <a name="net_005fls_005froutes"></a> <div class="header"> <p> Next: <a href="#net_005fnslookup" accesskey="n" rel="next">net_nslookup</a>, Previous: <a href="#net_005fls_005fdns" accesskey="p" rel="prev">net_ls_dns</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fls_005froutes-1"></a> <h4 class="subsection">16.4.14 net_ls_routes</h4> <dl> <dt><a name="index-net_005fls_005froutes"></a>Command: <strong>net_ls_routes</strong></dt> <dd><p>List routing entries. </p></dd></dl> <hr> <a name="net_005fnslookup"></a> <div class="header"> <p> Previous: <a href="#net_005fls_005froutes" accesskey="p" rel="prev">net_ls_routes</a>, Up: <a href="#Networking-commands" accesskey="u" rel="up">Networking commands</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="net_005fnslookup-1"></a> <h4 class="subsection">16.4.15 net_nslookup</h4> <dl> <dt><a name="index-net_005fnslookup"></a>Command: <strong>net_nslookup</strong> <em><var>name</var> [<var>server</var>]</em></dt> <dd><p>Resolve address of <var>name</var> using DNS server <var>server</var>. If no server is given, use default list of servers. </p></dd></dl> <hr> <a name="Internationalisation"></a> <div class="header"> <p> Next: <a href="#Security" accesskey="n" rel="next">Security</a>, Previous: <a href="#Commands" accesskey="p" rel="prev">Commands</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Internationalisation-1"></a> <h2 class="chapter">17 Internationalisation</h2> <a name="Charset"></a> <h3 class="section">17.1 Charset</h3> <p>GRUB uses UTF-8 internally other than in rendering where some GRUB-specific appropriate representation is used. All text files (including config) are assumed to be encoded in UTF-8. </p> <a name="Filesystems"></a> <h3 class="section">17.2 Filesystems</h3> <p>NTFS, JFS, UDF, HFS+, exFAT, long filenames in FAT, Joliet part of ISO9660 are treated as UTF-16 as per specification. AFS and BFS are read as UTF-8, again according to specification. BtrFS, cpio, tar, squash4, minix, minix2, minix3, ROMFS, ReiserFS, XFS, ext2, ext3, ext4, FAT (short names), F2FS, RockRidge part of ISO9660, nilfs2, UFS1, UFS2 and ZFS are assumed to be UTF-8. This might be false on systems configured with legacy charset but as long as the charset used is superset of ASCII you should be able to access ASCII-named files. And it’s recommended to configure your system to use UTF-8 to access the filesystem, convmv may help with migration. ISO9660 (plain) filenames are specified as being ASCII or being described with unspecified escape sequences. GRUB assumes that the ISO9660 names are UTF-8 (since any ASCII is valid UTF-8). There are some old CD-ROMs which use CP437 in non-compliant way. You’re still able to access files with names containing only ASCII characters on such filesystems though. You’re also able to access any file if the filesystem contains valid Joliet (UTF-16) or RockRidge (UTF-8). AFFS, SFS and HFS never use unicode and GRUB assumes them to be in Latin1, Latin1 and MacRoman respectively. GRUB handles filesystem case-insensitivity however no attempt is performed at case conversion of international characters so e.g. a file named lowercase greek alpha is treated as different from the one named as uppercase alpha. The filesystems in questions are NTFS (except POSIX namespace), HFS+ (configurable at mkfs time, default insensitive), SFS (configurable at mkfs time, default insensitive), JFS (configurable at mkfs time, default sensitive), HFS, AFFS, FAT, exFAT and ZFS (configurable on per-subvolume basis by property “casesensitivity”, default sensitive). On ZFS subvolumes marked as case insensitive files containing lowercase international characters are inaccessible. Also like all supported filesystems except HFS+ and ZFS (configurable on per-subvolume basis by property “normalization”, default none) GRUB makes no attempt at check of canonical equivalence so a file name u-diaresis is treated as distinct from u+combining diaresis. This however means that in order to access file on HFS+ its name must be specified in normalisation form D. On normalized ZFS subvolumes filenames out of normalisation are inaccessible. </p> <a name="Output-terminal"></a> <h3 class="section">17.3 Output terminal</h3> <p>Firmware output console “console” on ARC and IEEE1275 are limited to ASCII. </p> <p>BIOS firmware console and VGA text are limited to ASCII and some pseudographics. </p> <p>None of above mentioned is appropriate for displaying international and any unsupported character is replaced with question mark except pseudographics which we attempt to approximate with ASCII. </p> <p>EFI console on the other hand nominally supports UTF-16 but actual language coverage depends on firmware and may be very limited. </p> <p>The encoding used on serial can be chosen with <code>terminfo</code> as either ASCII, UTF-8 or “visual UTF-8”. Last one is against the specification but results in correct rendering of right-to-left on some readers which don’t have own bidi implementation. </p> <p>On emu GRUB checks if charset is UTF-8 and uses it if so and uses ASCII otherwise. </p> <p>When using gfxterm or gfxmenu GRUB itself is responsible for rendering the text. In this case GRUB is limited by loaded fonts. If fonts contain all required characters then bidirectional text, cursive variants and combining marks other than enclosing, half (e.g. left half tilde or combining overline) and double ones. Ligatures aren’t supported though. This should cover European, Middle Eastern (if you don’t mind lack of lam-alif ligature in Arabic) and East Asian scripts. Notable unsupported scripts are Brahmic family and derived as well as Mongolian, Tifinagh, Korean Jamo (precomposed characters have no problem) and tonal writing (2e5-2e9). GRUB also ignores deprecated (as specified in Unicode) characters (e.g. tags). GRUB also doesn’t handle so called “annotation characters” If you can complete either of two lists or, better, propose a patch to improve rendering, please contact developer team. </p> <a name="Input-terminal"></a> <h3 class="section">17.4 Input terminal</h3> <p>Firmware console on BIOS, IEEE1275 and ARC doesn’t allow you to enter non-ASCII characters. EFI specification allows for such but author is unaware of any actual implementations. Serial input is currently limited for latin1 (unlikely to change). Own keyboard implementations (at_keyboard and usb_keyboard) supports any key but work on one-char-per-keystroke. So no dead keys or advanced input method. Also there is no keymap change hotkey. In practice it makes difficult to enter any text using non-Latin alphabet. Moreover all current input consumers are limited to ASCII. </p> <a name="Gettext"></a> <h3 class="section">17.5 Gettext</h3> <p>GRUB supports being translated. For this you need to have language *.mo files in $prefix/locale, load gettext module and set “lang” variable. </p> <a name="Regexp"></a> <h3 class="section">17.6 Regexp</h3> <p>Regexps work on unicode characters, however no attempt at checking cannonical equivalence has been made. Moreover the classes like [:alpha:] match only ASCII subset. </p> <a name="Other"></a> <h3 class="section">17.7 Other</h3> <p>Currently GRUB always uses YEAR-MONTH-DAY HOUR:MINUTE:SECOND [WEEKDAY] 24-hour datetime format but weekdays are translated. GRUB always uses the decimal number format with [0-9] as digits and . as descimal separator and no group separator. IEEE1275 aliases are matched case-insensitively except non-ASCII which is matched as binary. Similar behaviour is for matching OSBundleRequired. Since IEEE1275 aliases and OSBundleRequired don’t contain any non-ASCII it should never be a problem in practice. Case-sensitive identifiers are matched as raw strings, no canonical equivalence check is performed. Case-insenstive identifiers are matched as RAW but additionally [a-z] is equivalent to [A-Z]. GRUB-defined identifiers use only ASCII and so should user-defined ones. Identifiers containing non-ASCII may work but aren’t supported. Only the ASCII space characters (space U+0020, tab U+000b, CR U+000d and LF U+000a) are recognised. Other unicode space characters aren’t a valid field separator. <code>test</code> (see <a href="#test">test</a>) tests <, >, <=, >=, -pgt and -plt compare the strings in the lexicographical order of unicode codepoints, replicating the behaviour of test from coreutils. environment variables and commands are listed in the same order. </p> <hr> <a name="Security"></a> <div class="header"> <p> Next: <a href="#Platform-limitations" accesskey="n" rel="next">Platform limitations</a>, Previous: <a href="#Internationalisation" accesskey="p" rel="prev">Internationalisation</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Security-1"></a> <h2 class="chapter">18 Security</h2> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#Authentication-and-authorisation" accesskey="1">Authentication and authorisation</a>:</td><td> </td><td align="left" valign="top">Users and access control </td></tr> <tr><td align="left" valign="top">• <a href="#Using-GPG_002dstyle-digital-signatures" accesskey="2">Using GPG-style digital signatures</a>:</td><td> </td><td align="left" valign="top">Booting digitally signed code </td></tr> <tr><td align="left" valign="top">• <a href="#Using-appended-signatures" accesskey="3">Using appended signatures</a>:</td><td> </td><td align="left" valign="top">An alternative approach to booting digitally signed code </td></tr> <tr><td align="left" valign="top">• <a href="#Signing-GRUB-itself" accesskey="4">Signing GRUB itself</a>:</td><td> </td><td align="left" valign="top">Ensuring the integrity of the GRUB core image </td></tr> <tr><td align="left" valign="top">• <a href="#Secure-Boot-Advanced-Targeting" accesskey="5">Secure Boot Advanced Targeting</a>:</td><td> </td><td align="left" valign="top">Embedded information for generation number based revocation </td></tr> <tr><td align="left" valign="top">• <a href="#Lockdown" accesskey="6">Lockdown</a>:</td><td> </td><td align="left" valign="top">Lockdown when booting on a secure setup </td></tr> </table> <hr> <a name="Authentication-and-authorisation"></a> <div class="header"> <p> Next: <a href="#Using-GPG_002dstyle-digital-signatures" accesskey="n" rel="next">Using GPG-style digital signatures</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Authentication-and-authorisation-in-GRUB"></a> <h3 class="section">18.1 Authentication and authorisation in GRUB</h3> <p>By default, the boot loader interface is accessible to anyone with physical access to the console: anyone can select and edit any menu entry, and anyone can get direct access to a GRUB shell prompt. For most systems, this is reasonable since anyone with direct physical access has a variety of other ways to gain full access, and requiring authentication at the boot loader level would only serve to make it difficult to recover broken systems. </p> <p>However, in some environments, such as kiosks, it may be appropriate to lock down the boot loader to require authentication before performing certain operations. </p> <p>The ‘<samp>password</samp>’ (see <a href="#password">password</a>) and ‘<samp>password_pbkdf2</samp>’ (see <a href="#password_005fpbkdf2">password_pbkdf2</a>) commands can be used to define users, each of which has an associated password. ‘<samp>password</samp>’ sets the password in plain text, requiring <samp>grub.cfg</samp> to be secure; ‘<samp>password_pbkdf2</samp>’ sets the password hashed using the Password-Based Key Derivation Function (RFC 2898), requiring the use of <code>grub2-mkpasswd-pbkdf2</code> (see <a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2">Invoking grub2-mkpasswd-pbkdf2</a>) to generate password hashes. </p> <p>In order to enable authentication support, the ‘<samp>superusers</samp>’ environment variable must be set to a list of usernames, separated by any of spaces, commas, semicolons, pipes, or ampersands. Superusers are permitted to use the GRUB command line, edit menu entries, and execute any menu entry. If ‘<samp>superusers</samp>’ is set, then use of the command line and editing of menu entries are automatically restricted to superusers. Setting ‘<samp>superusers</samp>’ to empty string effectively disables both access to CLI and editing of menu entries. </p> <p>Other users may be allowed to execute specific menu entries by giving a list of usernames (as above) using the <samp>--users</samp> option to the ‘<samp>menuentry</samp>’ command (see <a href="#menuentry">menuentry</a>). If the <samp>--unrestricted</samp> option is used for a menu entry, then that entry is unrestricted. If the <samp>--users</samp> option is not used for a menu entry, then that only superusers are able to use it. </p> <p>Putting this together, a typical <samp>grub.cfg</samp> fragment might look like this: </p> <div class="example"> <pre class="example">set superusers="root" password_pbkdf2 root grub.pbkdf2.sha512.10000.biglongstring password user1 insecure menuentry "May be run by any user" --unrestricted { set root=(hd0,1) linux /vmlinuz } menuentry "Superusers only" --users "" { set root=(hd0,1) linux /vmlinuz single } menuentry "May be run by user1 or a superuser" --users user1 { set root=(hd0,2) chainloader +1 } </pre></div> <p>The <code>grub2-mkconfig</code> program does not yet have built-in support for generating configuration files with authentication. You can use <samp>/etc/grub.d/40_custom</samp> to add simple superuser authentication, by adding <kbd>set superusers=</kbd> and <kbd>password</kbd> or <kbd>password_pbkdf2</kbd> commands. </p> <hr> <a name="Using-GPG_002dstyle-digital-signatures"></a> <div class="header"> <p> Next: <a href="#Using-appended-signatures" accesskey="n" rel="next">Using appended signatures</a>, Previous: <a href="#Authentication-and-authorisation" accesskey="p" rel="prev">Authentication and authorisation</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Using-GPG_002dstyle-digital-signatures-in-GRUB"></a> <h3 class="section">18.2 Using GPG-style digital signatures in GRUB</h3> <p>GRUB’s <samp>core.img</samp> can optionally provide enforcement that all files subsequently read from disk are covered by a valid digital signature. This section does <strong>not</strong> cover how to ensure that your platform’s firmware (e.g., Coreboot) validates <samp>core.img</samp>. </p> <p>If environment variable <code>check_signatures</code> (see <a href="#check_005fsignatures">check_signatures</a>) is set to <code>enforce</code>, then every attempt by the GRUB <samp>core.img</samp> to load another file <samp>foo</samp> implicitly invokes <code>verify_detached foo foo.sig</code> (see <a href="#verify_005fdetached">verify_detached</a>). <code>foo.sig</code> must contain a valid digital signature over the contents of <code>foo</code>, which can be verified with a public key currently trusted by GRUB (see <a href="#list_005ftrusted">list_trusted</a>, see <a href="#trust">trust</a>, and see <a href="#distrust">distrust</a>). If validation fails, then file <samp>foo</samp> cannot be opened. This failure may halt or otherwise impact the boot process. </p> <p>An initial trusted public key can be embedded within the GRUB <samp>core.img</samp> using the <code>--pubkey</code> option to <code>grub2-install</code> (see <a href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>). </p> <p>GRUB uses GPG-style detached signatures (meaning that a file <samp>foo.sig</samp> will be produced when file <samp>foo</samp> is signed), and currently supports the DSA and RSA signing algorithms. A signing key can be generated as follows: </p> <div class="example"> <pre class="example">gpg --gen-key </pre></div> <p>An individual file can be signed as follows: </p> <div class="example"> <pre class="example">gpg --detach-sign /path/to/file </pre></div> <p>For successful validation of all of GRUB’s subcomponents and the loaded OS kernel, they must all be signed. One way to accomplish this is the following (after having already produced the desired <samp>grub.cfg</samp> file, e.g., by running <code>grub2-mkconfig</code> (see <a href="#Invoking-grub2_002dmkconfig">Invoking grub2-mkconfig</a>): </p> <div class="example"> <pre class="example"># Edit /dev/shm/passphrase.txt to contain your signing key's passphrase for i in `find /boot -name "*.cfg" -or -name "*.lst" -or \ -name "*.mod" -or -name "vmlinuz*" -or -name "initrd*" -or \ -name "grubenv"`; do gpg --batch --detach-sign --passphrase-fd 0 $i < \ /dev/shm/passphrase.txt done shred /dev/shm/passphrase.txt </pre></div> <p>See also: <a href="#check_005fsignatures">check_signatures</a>, <a href="#verify_005fdetached">verify_detached</a>, <a href="#trust">trust</a>, <a href="#list_005ftrusted">list_trusted</a>, <a href="#distrust">distrust</a>, <a href="#load_005fenv">load_env</a>, <a href="#save_005fenv">save_env</a>. </p> <p>Note that internally signature enforcement is controlled by setting the environment variable <code>check_signatures</code> equal to <code>enforce</code>. Passing one or more <code>--pubkey</code> options to <code>grub2-mkimage</code> implicitly defines <code>check_signatures</code> equal to <code>enforce</code> in <samp>core.img</samp> prior to processing any configuration files. </p> <p>Note that signature checking does <strong>not</strong> prevent an attacker with (serial, physical, ...) console access from dropping manually to the GRUB console and executing: </p> <div class="example"> <pre class="example">set check_signatures=no </pre></div> <p>To prevent this, password-protection (see <a href="#Authentication-and-authorisation">Authentication and authorisation</a>) is essential. Note that even with GRUB password protection, GRUB itself cannot prevent someone with physical access to the machine from altering that machine’s firmware (e.g., Coreboot or BIOS) configuration to cause the machine to boot from a different (attacker-controlled) device. GRUB is at best only one link in a secure boot chain. </p> <hr> <a name="Using-appended-signatures"></a> <div class="header"> <p> Next: <a href="#Signing-GRUB-itself" accesskey="n" rel="next">Signing GRUB itself</a>, Previous: <a href="#Using-GPG_002dstyle-digital-signatures" accesskey="p" rel="prev">Using GPG-style digital signatures</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Using-appended-signatures-in-GRUB"></a> <h3 class="section">18.3 Using appended signatures in GRUB</h3> <p>GRUB supports verifying Linux-style ’appended signatures’ for secure boot. Appended signatures are PKCS#7 messages containing a signature over the contents of a file, plus some metadata, appended to the end of a file. A file with an appended signature ends with the magic string: </p> <div class="example"> <pre class="example">~Module signature appended~\n </pre></div> <p>where <code>\n</code> represents the carriage-return character, <code>0x0a</code>. </p> <p>To enable appended signature verification, load the appendedsig module and an x509 certificate for verification. Building the appendedsig module into the core grub image is recommended. </p> <p>Certificates can be managed at boot time using the see <a href="#trust_005fcertificate">trust_certificate</a>, see <a href="#distrust_005fcertificate">distrust_certificate</a> and see <a href="#list_005fcertificates">list_certificates</a> commands. Certificates can also be built in to the core image using the <code>--x509</code> parameter to <code>grub-install</code> or <code>grub-mkimage</code>. </p> <p>A file can be explictly verified using the see <a href="#verify_005fappended">verify_appended</a> command. </p> <p>Only signatures made with the SHA-256 or SHA-512 hash algorithm are supported, and only RSA signatures are supported. </p> <p>A file can be signed with the <code>sign-file</code> utility supplied with the Linux kernel source. For example, if you have <code>signing.key</code> as the private key and <code>certificate.der</code> as the x509 certificate containing the public key: </p> <div class="example"> <pre class="example">sign-file SHA256 signing.key certificate.der vmlinux vmlinux.signed </pre></div> <p>Enforcement of signature verification is controlled by the <code>check_appended_signatures</code> variable. Verification will only take place when files are loaded if the variable is set to <code>enforce</code>. If a certificate is built into the grub core image with the <code>--x509</code> parameter, the variable will be automatically set to <code>enforce</code> when the appendedsig module is loaded. </p> <p>Unlike GPG-style signatures, not all files loaded by GRUB are required to be signed. Once verification is turned on, the following file types must carry appended signatures: </p> <ol> <li> Linux, Multiboot, BSD, XNU and Plan9 kernels </li><li> Grub modules, except those built in to the core image </li><li> Any new certificate files to be trusted </li></ol> <p>ACPI tables and Device Tree images will not be checked for appended signatures but must be verified by another mechanism such as GPG-style signatures before they will be loaded. </p> <p>No attempt is made to validate any other file type. In particular, chain-loaded binaries are not verified - if your platform supports chain-loading and this cannot be disabled, consider an alternative secure boot mechanism. </p> <p>As with GPG-style appended signatures, signature checking does <strong>not</strong> stop an attacker with console access from dropping manually to the GRUB console and executing: </p> <div class="example"> <pre class="example">set check_appended_signatures=no </pre></div> <p>Refer to the section on password-protecting GRUB (see <a href="#Authentication-and-authorisation">Authentication and authorisation</a>) for more information on preventing this. </p> <p>Additionally, special care must be taken around the <code>loadenv</code> command, which can be used to turn off <code>check_appended_signature</code>. </p> <hr> <a name="Signing-GRUB-itself"></a> <div class="header"> <p> Next: <a href="#Secure-Boot-Advanced-Targeting" accesskey="n" rel="next">Secure Boot Advanced Targeting</a>, Previous: <a href="#Using-appended-signatures" accesskey="p" rel="prev">Using appended signatures</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Signing-GRUB-itself-1"></a> <h3 class="section">18.4 Signing GRUB itself</h3> <p>To ensure a complete secure-boot chain, there must be a way for the code that loads GRUB to verify the integrity of the core image. </p> <p>This is ultimately platform-specific and individual platforms can define their own mechanisms. However, there are general-purpose mechanisms that can be used with GRUB. </p> <a name="Signing-GRUB-for-UEFI-secure-boot"></a> <h3 class="section">18.5 Signing GRUB for UEFI secure boot</h3> <p>On UEFI platforms, <samp>core.img</samp> is a PE binary. Therefore, it can be signed with a tool such as <code>pesign</code> or <code>sbsign</code>. It will also be necessary to enrol the public key used into a relevant firmware key database. </p> <a name="Signing-GRUB-with-an-appended-signature"></a> <h3 class="section">18.6 Signing GRUB with an appended signature</h3> <p>The <samp>core.img</samp> itself can be signed with a Linux kernel module-style appended signature. </p> <p>To support IEEE1275 platforms where the boot image is often loaded directly from a disk partition rather than from a file system, the <samp>core.img</samp> can specify the size and location of the appended signature with an ELF note added by <code>grub-install</code>. </p> <p>An image can be signed this way using the <code>sign-file</code> command from the Linux kernel: </p> <div class="example"> <pre class="example"># grub.key is your private key and certificate.der is your public key # Determine the size of the appended signature. It depends on the signing # certificate and the hash algorithm touch empty sign-file SHA256 grub.key certificate.der empty empty.sig SIG_SIZE=`stat -c '%s' empty.sig` rm empty empty.sig # Build a grub image with $SIG_SIZE reserved for the signature grub-install --appended-signature-size $SIG_SIZE --modules="..." ... # Replace the reserved size with a signature: # cut off the last $SIG_SIZE bytes with truncate's minus modifier truncate -s -$SIG_SIZE /boot/grub/powerpc-ieee1275/core.elf core.elf.unsigned # sign the trimmed file with an appended signature, restoring the correct size sign-file SHA256 grub.key certificate.der core.elf.unsigned core.elf.signed # Don't forget to install the signed image as required # (e.g. on powerpc-ieee1275, to the PReP partition) </pre></div> <p>As with UEFI secure boot, it is necessary to build in the required modules, or sign them separately. </p> <hr> <a name="Secure-Boot-Advanced-Targeting"></a> <div class="header"> <p> Next: <a href="#Lockdown" accesskey="n" rel="next">Lockdown</a>, Previous: <a href="#Signing-GRUB-itself" accesskey="p" rel="prev">Signing GRUB itself</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Embedded-information-for-generation-number-based-revocation"></a> <h3 class="section">18.7 Embedded information for generation number based revocation</h3> <p>The Secure Boot Advanced Targeting (SBAT) is a mechanism to allow the revocation of components in the boot path by using generation numbers embedded into the EFI binaries. The SBAT metadata is located in an .sbat data section that has set of UTF-8 strings as comma-separated values (CSV). See <a href="https://github.com/rhboot/shim/blob/main/SBAT.md">https://github.com/rhboot/shim/blob/main/SBAT.md</a> for more details. </p> <p>To add a data section containing the SBAT information into the binary, the <samp>--sbat</samp> option of <code>grub-mkimage</code> command should be used. The content of a CSV file, encoded with UTF-8, is copied as is to the .sbat data section into the generated EFI binary. The CSV file can be stored anywhere on the file system. </p> <div class="example"> <pre class="example">grub-mkimage -O x86_64-efi -o grubx64.efi -p '(tftp)/grub' --sbat sbat.csv efinet tftp </pre></div> <hr> <a name="Lockdown"></a> <div class="header"> <p> Previous: <a href="#Secure-Boot-Advanced-Targeting" accesskey="p" rel="prev">Secure Boot Advanced Targeting</a>, Up: <a href="#Security" accesskey="u" rel="up">Security</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Lockdown-when-booting-on-a-secure-setup"></a> <h3 class="section">18.8 Lockdown when booting on a secure setup</h3> <p>The GRUB can be locked down when booted on a secure boot environment, for example if the UEFI secure boot is enabled. On a locked down configuration, the GRUB will be restricted and some operations/commands cannot be executed. </p> <p>The ‘<samp>lockdown</samp>’ variable is set to ‘<samp>y</samp>’ when the GRUB is locked down. Otherwise it does not exit. </p> <hr> <a name="Platform-limitations"></a> <div class="header"> <p> Next: <a href="#Platform_002dspecific-operations" accesskey="n" rel="next">Platform-specific operations</a>, Previous: <a href="#Security" accesskey="p" rel="prev">Security</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Platform-limitations-1"></a> <h2 class="chapter">19 Platform limitations</h2> <p>GRUB2 is designed to be portable and is actually ported across platforms. We try to keep all platforms at the level. Unfortunately some platforms are better supported than others. This is detailed in current and 2 following sections. </p> <p>ARC platform is unable to change datetime (firmware doesn’t seem to provide a function for it). EMU has similar limitation. </p> <p>On EMU platform no serial port is available. </p> <p>Console charset refers only to firmware-assisted console. gfxterm is always Unicode (see Internationalisation section for its limitations). Serial is configurable to UTF-8 or ASCII (see Internationalisation). In case of qemu and coreboot ports the refered console is vga_text. Loongson always uses gfxterm. </p> <p>Most limited one is ASCII. CP437 provides additionally pseudographics. GRUB2 doesn’t use any language characters from CP437 as often CP437 is replaced by national encoding compatible only in pseudographics. Unicode is the most versatile charset which supports many languages. However the actual console may be much more limited depending on firmware </p> <p>On BIOS network is supported only if the image is loaded through network. On sparc64 GRUB is unable to determine which server it was booted from. </p> <p>Direct ATA/AHCI support allows to circumvent various firmware limitations but isn’t needed for normal operation except on baremetal ports. </p> <p>AT keyboard support allows keyboard layout remapping and support for keys not available through firmware. It isn’t needed for normal operation except baremetal ports. </p> <p>Speaker allows morse and spkmodem communication. </p> <p>USB support provides benefits similar to ATA (for USB disks) or AT (for USB keyboards). In addition it allows USBserial. </p> <p>Chainloading refers to the ability to load another bootloader through the same protocol </p> <p>Hints allow faster disk discovery by already knowing in advance which is the disk in question. On some platforms hints are correct unless you move the disk between boots. On other platforms it’s just an educated guess. Note that hint failure results in just reduced performance, not a failure </p> <p>BadRAM is the ability to mark some of the RAM as “bad”. Note: due to protocol limitations mips-loongson (with Linux protocol) and mips-qemu_mips can use only memory up to first hole. </p> <p>Bootlocation is ability of GRUB to automatically detect where it boots from. “disk” means the detection is limited to detecting the disk with partition being discovered on install time. “partition” means that disk and partiton can be automatically discovered. “file” means that boot image file name as well as disk and partition can be discovered. For consistency default install ignores partition and relies solely on disk detection. If no bootlocation discovery is available or boot and grub-root disks are different, UUID is used instead. On ARC if no device to install to is specified, UUID is used instead as well. </p> <table> <tr><td width="20%"></td><td width="20%">BIOS</td><td width="20%">Coreboot</td><td width="20%">Multiboot</td><td width="20%">Qemu</td></tr> <tr><td width="20%">video</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">console charset</td><td width="20%">CP437</td><td width="20%">CP437</td><td width="20%">CP437</td><td width="20%">CP437</td></tr> <tr><td width="20%">network</td><td width="20%">yes (*)</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">Speaker</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">USB</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">chainloader</td><td width="20%">local</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">cpuid</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td></tr> <tr><td width="20%">hints</td><td width="20%">guess</td><td width="20%">guess</td><td width="20%">guess</td><td width="20%">guess</td></tr> <tr><td width="20%">PCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">badram</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">compression</td><td width="20%">always</td><td width="20%">pointless</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">exit</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">disk</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> </table> <table> <tr><td width="20%"></td><td width="20%">ia32 EFI</td><td width="20%">amd64 EFI</td><td width="20%">ia32 IEEE1275</td><td width="20%">Itanium</td></tr> <tr><td width="20%">video</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">console charset</td><td width="20%">Unicode</td><td width="20%">Unicode</td><td width="20%">ASCII</td><td width="20%">Unicode</td></tr> <tr><td width="20%">network</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">Speaker</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">USB</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">chainloader</td><td width="20%">local</td><td width="20%">local</td><td width="20%">no</td><td width="20%">local</td></tr> <tr><td width="20%">cpuid</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">partial</td><td width="20%">no</td></tr> <tr><td width="20%">hints</td><td width="20%">guess</td><td width="20%">guess</td><td width="20%">good</td><td width="20%">guess</td></tr> <tr><td width="20%">PCI</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">badram</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">compression</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">exit</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">file</td><td width="20%">file</td><td width="20%">file, ignored</td><td width="20%">file</td></tr> </table> <table> <tr><td width="20%"></td><td width="20%">Loongson</td><td width="20%">sparc64</td><td width="20%">Powerpc</td><td width="20%">ARC</td></tr> <tr><td width="20%">video</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">console charset</td><td width="20%">N/A</td><td width="20%">ASCII</td><td width="20%">ASCII</td><td width="20%">ASCII</td></tr> <tr><td width="20%">network</td><td width="20%">no</td><td width="20%">yes (*)</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">Speaker</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">USB</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">chainloader</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">cpuid</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">hints</td><td width="20%">good</td><td width="20%">good</td><td width="20%">good</td><td width="20%">no</td></tr> <tr><td width="20%">PCI</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">badram</td><td width="20%">yes (*)</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">compression</td><td width="20%">configurable</td><td width="20%">no</td><td width="20%">no</td><td width="20%">configurable</td></tr> <tr><td width="20%">exit</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">yes</td><td width="20%">yes</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">no</td><td width="20%">partition</td><td width="20%">file</td><td width="20%">file (*)</td></tr> </table> <table> <tr><td width="20%"></td><td width="20%">MIPS qemu</td><td width="20%">emu</td><td width="20%">xen</td></tr> <tr><td width="20%">video</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">console charset</td><td width="20%">CP437</td><td width="20%">Unicode (*)</td><td width="20%">ASCII</td></tr> <tr><td width="20%">network</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">ATA/AHCI</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">AT keyboard</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">Speaker</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">USB</td><td width="20%">N/A</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">chainloader</td><td width="20%">yes</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">cpuid</td><td width="20%">no</td><td width="20%">no</td><td width="20%">yes</td></tr> <tr><td width="20%">hints</td><td width="20%">guess</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">PCI</td><td width="20%">no</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">badram</td><td width="20%">yes (*)</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">compression</td><td width="20%">configurable</td><td width="20%">no</td><td width="20%">no</td></tr> <tr><td width="20%">exit</td><td width="20%">no</td><td width="20%">yes</td><td width="20%">no</td></tr> <tr><td width="20%">bootlocation</td><td width="20%">no</td><td width="20%">file</td><td width="20%">no</td></tr> </table> <hr> <a name="Platform_002dspecific-operations"></a> <div class="header"> <p> Next: <a href="#Supported-kernels" accesskey="n" rel="next">Supported kernels</a>, Previous: <a href="#Platform-limitations" accesskey="p" rel="prev">Platform limitations</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Outline"></a> <h2 class="chapter">20 Outline</h2> <p>Some platforms have features which allows to implement some commands useless or not implementable on others. </p> <p>Quick summary: </p> <p>Information retrieval: </p> <ul> <li> mipsel-loongson: lsspd </li><li> mips-arc: lsdev </li><li> efi: lsefisystab, lssal, lsefimmap, lsefi </li><li> i386-pc: lsapm </li><li> i386-coreboot: lscoreboot, coreboot_boottime, cbmemc </li><li> acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): lsacpi </li></ul> <p>Workarounds for platform-specific issues: </p><ul> <li> i386-efi/x86_64-efi: loadbios, fakebios, fix_video </li><li> acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): acpi (override ACPI tables) </li><li> i386-pc: drivemap </li><li> i386-pc: sendkey </li></ul> <p>Advanced operations for power users: </p><ul> <li> x86: iorw (direct access to I/O ports) </li></ul> <p>Miscelaneous: </p><ul> <li> cmos (x86-*, ieee1275, mips-qemu_mips, mips-loongson): cmostest (used on some laptops to check for special power-on key), cmosclean </li><li> i386-pc: play </li></ul> <hr> <a name="Supported-kernels"></a> <div class="header"> <p> Next: <a href="#Troubleshooting" accesskey="n" rel="next">Troubleshooting</a>, Previous: <a href="#Platform_002dspecific-operations" accesskey="p" rel="prev">Platform-specific operations</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Supported-boot-targets"></a> <h2 class="chapter">21 Supported boot targets</h2> <p>X86 support is summarised in the following table. “Yes” means that the kernel works on the given platform, “crashes” means an early kernel crash which we hope will be fixed by concerned kernel developers. “no” means GRUB doesn’t load the given kernel on a given platform. “headless” means that the kernel works but lacks console drivers (you can still use serial or network console). In case of “no” and “crashes” the reason is given in footnote. </p><table> <tr><td width="50%"></td><td width="22%">BIOS</td><td width="22%">Coreboot</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Freedos</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">yes</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">yes</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">yes</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">yes</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">yes</td><td width="22%">crashes</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">yes</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">yes</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">yes</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> </table> <table> <tr><td width="50%"></td><td width="22%">Multiboot</td><td width="22%">Qemu</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeDOS</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">crashes (5)</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">crashes (5)</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">?</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">?</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">no (2)</td><td width="22%">no (2)</td></tr> </table> <table> <tr><td width="50%"></td><td width="22%">ia32 EFI</td><td width="22%">amd64 EFI</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeDOS</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">crashes (1)</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">headless</td><td width="22%">headless</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">no (1)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">yes</td><td width="22%">yes</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">yes (4)</td><td width="22%">yes</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">yes</td><td width="22%">no (3)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (3)</td><td width="22%">yes</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">yes</td><td width="22%">yes</td></tr> </table> <table> <tr><td width="50%"></td><td width="22%">ia32 IEEE1275</td></tr> <tr><td width="50%">BIOS chainloading</td><td width="22%">no (1)</td></tr> <tr><td width="50%">NTLDR</td><td width="22%">no (1)</td></tr> <tr><td width="50%">Plan9</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeDOS</td><td width="22%">no (1)</td></tr> <tr><td width="50%">FreeBSD bootloader</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">32-bit kFreeBSD</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">64-bit kFreeBSD</td><td width="22%">crashes (5)</td></tr> <tr><td width="50%">32-bit kNetBSD</td><td width="22%">crashes (1)</td></tr> <tr><td width="50%">64-bit kNetBSD</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit kOpenBSD</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit kOpenBSD</td><td width="22%">?</td></tr> <tr><td width="50%">Multiboot</td><td width="22%">?</td></tr> <tr><td width="50%">Multiboot2</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit Linux (legacy protocol)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">64-bit Linux (legacy protocol)</td><td width="22%">no (1)</td></tr> <tr><td width="50%">32-bit Linux (modern protocol)</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit Linux (modern protocol)</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit XNU</td><td width="22%">?</td></tr> <tr><td width="50%">64-bit XNU</td><td width="22%">?</td></tr> <tr><td width="50%">32-bit EFI chainloader</td><td width="22%">no (2)</td></tr> <tr><td width="50%">64-bit EFI chainloader</td><td width="22%">no (2)</td></tr> <tr><td width="50%">Appleloader</td><td width="22%">no (2)</td></tr> </table> <ol> <li> Requires BIOS </li><li> EFI only </li><li> 32-bit and 64-bit EFI have different structures and work in different CPU modes so it’s not possible to chainload 32-bit bootloader on 64-bit platform and vice-versa </li><li> Some modules may need to be disabled </li><li> Requires ACPI </li></ol> <p>PowerPC, IA64 and Sparc64 ports support only Linux. MIPS port supports Linux and multiboot2. </p> <a name="Boot-tests"></a> <h3 class="section">21.1 Boot tests</h3> <p>As you have seen in previous chapter the support matrix is pretty big and some of the configurations are only rarely used. To ensure the quality bootchecks are available for all x86 targets except EFI chainloader, Appleloader and XNU. All x86 platforms have bootcheck facility except ieee1275. Multiboot, multiboot2, BIOS chainloader, ntldr and freebsd-bootloader boot targets are tested only with a fake kernel images. Only Linux is tested among the payloads using Linux protocols. </p> <p>Following variables must be defined: </p> <table> <tr><td width="30%">GRUB_PAYLOADS_DIR</td><td width="65%">directory containing the required kernels</td></tr> <tr><td width="30%">GRUB_CBFSTOOL</td><td width="65%">cbfstool from Coreboot package (for coreboot platform only)</td></tr> <tr><td width="30%">GRUB_COREBOOT_ROM</td><td width="65%">empty Coreboot ROM</td></tr> <tr><td width="30%">GRUB_QEMU_OPTS</td><td width="65%">additional options to be supplied to QEMU</td></tr> </table> <p>Required files are: </p> <table> <tr><td width="40%">kfreebsd_env.i386</td><td width="55%">32-bit kFreeBSD device hints</td></tr> <tr><td width="40%">kfreebsd.i386</td><td width="55%">32-bit FreeBSD kernel image</td></tr> <tr><td width="40%">kfreebsd.x86_64, kfreebsd_env.x86_64</td><td width="55%">same from 64-bit kFreeBSD</td></tr> <tr><td width="40%">knetbsd.i386</td><td width="55%">32-bit NetBSD kernel image</td></tr> <tr><td width="40%">knetbsd.miniroot.i386</td><td width="55%">32-bit kNetBSD miniroot.kmod.</td></tr> <tr><td width="40%">knetbsd.x86_64, knetbsd.miniroot.x86_64</td><td width="55%">same from 64-bit kNetBSD</td></tr> <tr><td width="40%">kopenbsd.i386</td><td width="55%">32-bit OpenBSD kernel bsd.rd image</td></tr> <tr><td width="40%">kopenbsd.x86_64</td><td width="55%">same from 64-bit kOpenBSD</td></tr> <tr><td width="40%">linux.i386</td><td width="55%">32-bit Linux</td></tr> <tr><td width="40%">linux.x86_64</td><td width="55%">64-bit Linux</td></tr> </table> <hr> <a name="Troubleshooting"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dinstall" accesskey="n" rel="next">Invoking grub2-install</a>, Previous: <a href="#Supported-kernels" accesskey="p" rel="prev">Supported kernels</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Error-messages-produced-by-GRUB"></a> <h2 class="chapter">22 Error messages produced by GRUB</h2> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#GRUB-only-offers-a-rescue-shell" accesskey="1">GRUB only offers a rescue shell</a>:</td><td> </td><td align="left" valign="top"> </td></tr> </table> <hr> <a name="GRUB-only-offers-a-rescue-shell"></a> <div class="header"> <p> Up: <a href="#Troubleshooting" accesskey="u" rel="up">Troubleshooting</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GRUB-only-offers-a-rescue-shell-1"></a> <h3 class="section">22.1 GRUB only offers a rescue shell</h3> <p>GRUB’s normal start-up procedure involves setting the ‘<samp>prefix</samp>’ environment variable to a value set in the core image by <code>grub2-install</code>, setting the ‘<samp>root</samp>’ variable to match, loading the ‘<samp>normal</samp>’ module from the prefix, and running the ‘<samp>normal</samp>’ command (see <a href="#normal">normal</a>). This command is responsible for reading <samp>/boot/grub2/grub.cfg</samp>, running the menu, and doing all the useful things GRUB is supposed to do. </p> <p>If, instead, you only get a rescue shell, this usually means that GRUB failed to load the ‘<samp>normal</samp>’ module for some reason. It may be possible to work around this temporarily: for instance, if the reason for the failure is that ‘<samp>prefix</samp>’ is wrong (perhaps it refers to the wrong device, or perhaps the path to <samp>/boot/grub</samp> was not correctly made relative to the device), then you can correct this and enter normal mode manually: </p> <div class="example"> <pre class="example"># Inspect the current prefix (and other preset variables): set # Find out which devices are available: ls # Set to the correct value, which might be something like this: set prefix=(hd0,1)/grub set root=(hd0,1) insmod normal normal </pre></div> <p>However, any problem that leaves you in the rescue shell probably means that GRUB was not correctly installed. It may be more useful to try to reinstall it properly using <kbd>grub2-install <var>device</var></kbd> (see <a href="#Invoking-grub2_002dinstall">Invoking grub2-install</a>). When doing this, there are a few things to remember: </p> <ul> <li> Drive ordering in your operating system may not be the same as the boot drive ordering used by your firmware. Do not assume that your first hard drive (e.g. ‘<samp>/dev/sda</samp>’) is the one that your firmware will boot from. <samp>device.map</samp> (see <a href="#Device-map">Device map</a>) can be used to override this, but it is usually better to use UUIDs or file system labels and avoid depending on drive ordering entirely. </li><li> At least on BIOS systems, if you tell <code>grub2-install</code> to install GRUB to a partition but GRUB has already been installed in the master boot record, then the GRUB installation in the partition will be ignored. </li><li> If possible, it is generally best to avoid installing GRUB to a partition (unless it is a special partition for the use of GRUB alone, such as the BIOS Boot Partition used on GPT). Doing this means that GRUB may stop being able to read its core image due to a file system moving blocks around, such as while defragmenting, running checks, or even during normal operation. Installing to the whole disk device is normally more robust. </li><li> Check that GRUB actually knows how to read from the device and file system containing <samp>/boot/grub</samp>. It will not be able to read from encrypted devices with unsupported encryption scheme, nor from file systems for which support has not yet been added to GRUB. </li></ul> <hr> <a name="Invoking-grub2_002dinstall"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dmkconfig" accesskey="n" rel="next">Invoking grub2-mkconfig</a>, Previous: <a href="#Troubleshooting" accesskey="p" rel="prev">Troubleshooting</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dinstall-1"></a> <h2 class="chapter">23 Invoking grub2-install</h2> <p>The program <code>grub2-install</code> generates a GRUB core image using <code>grub2-mkimage</code> and installs it on your system. You must specify the device name on which you want to install GRUB, like this: </p> <div class="example"> <pre class="example">grub2-install <var>install_device</var> </pre></div> <p>The device name <var>install_device</var> is an OS device name or a GRUB device name. </p> <p>In order to support UEFI Secure Boot, the resulting GRUB EFI binary must be signed by a recognized private key. For this reason, for EFI platforms, most distributions also ship prebuilt GRUB EFI binaries signed by a distribution-specific private key. In this case, however, <code>grub2-install</code> should not be used because it would overwrite the signed EFI binary. </p> <p><code>grub2-install</code> accepts the following options: </p> <dl compact="compact"> <dt><samp>--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp>--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp>--boot-directory=<var>dir</var></samp></dt> <dd><p>Install GRUB images under the directory <samp><var>dir</var>/grub/</samp> This option is useful when you want to install GRUB into a separate partition or a removable disk. If this option is not specified then it defaults to <samp>/boot</samp>, so </p> <div class="example"> <pre class="example"><kbd>grub2-install /dev/sda</kbd> </pre></div> <p>is equivalent to </p> <div class="example"> <pre class="example"><kbd>grub2-install --boot-directory=/boot/ /dev/sda</kbd> </pre></div> <p>Here is an example in which you have a separate <em>boot</em> partition which is mounted on <samp>/mnt/boot</samp>: </p> <div class="example"> <pre class="example"><kbd>grub2-install --boot-directory=/mnt/boot /dev/sdb</kbd> </pre></div> </dd> <dt><samp>--recheck</samp></dt> <dd><p>Recheck the device map, even if <samp>/boot/grub2/device.map</samp> already exists. You should use this option whenever you add/remove a disk into/from your computer. </p> </dd> <dt><samp>--no-rs-codes</samp></dt> <dd><p>By default on x86 BIOS systems, <code>grub2-install</code> will use some extra space in the bootloader embedding area for Reed-Solomon error-correcting codes. This enables GRUB to still boot successfully if some blocks are corrupted. The exact amount of protection offered is dependent on available space in the embedding area. R sectors of redundancy can tolerate up to R/2 corrupted sectors. This redundancy may be cumbersome if attempting to cryptographically validate the contents of the bootloader embedding area, or in more modern systems with GPT-style partition tables (see <a href="#BIOS-installation">BIOS installation</a>) where GRUB does not reside in any unpartitioned space outside of the MBR. Disable the Reed-Solomon codes with this option. </p></dd> </dl> <hr> <a name="Invoking-grub2_002dmkconfig"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2" accesskey="n" rel="next">Invoking grub2-mkpasswd-pbkdf2</a>, Previous: <a href="#Invoking-grub2_002dinstall" accesskey="p" rel="prev">Invoking grub2-install</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dmkconfig-1"></a> <h2 class="chapter">24 Invoking grub2-mkconfig</h2> <p>The program <code>grub2-mkconfig</code> generates a configuration file for GRUB (see <a href="#Simple-configuration">Simple configuration</a>). </p> <div class="example"> <pre class="example">grub-mkconfig -o /boot/grub2/grub.cfg </pre></div> <p><code>grub2-mkconfig</code> accepts the following options: </p> <dl compact="compact"> <dt><samp>--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp>--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp>-o <var>file</var></samp></dt> <dt><samp>--output=<var>file</var></samp></dt> <dd><p>Send the generated configuration file to <var>file</var>. The default is to send it to standard output. </p></dd> </dl> <hr> <a name="Invoking-grub2_002dmkpasswd_002dpbkdf2"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dmkrelpath" accesskey="n" rel="next">Invoking grub2-mkrelpath</a>, Previous: <a href="#Invoking-grub2_002dmkconfig" accesskey="p" rel="prev">Invoking grub2-mkconfig</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dmkpasswd_002dpbkdf2-1"></a> <h2 class="chapter">25 Invoking grub2-mkpasswd-pbkdf2</h2> <p>The program <code>grub2-mkpasswd-pbkdf2</code> generates password hashes for GRUB (see <a href="#Security">Security</a>). </p> <div class="example"> <pre class="example">grub-mkpasswd-pbkdf2 </pre></div> <p><code>grub2-mkpasswd-pbkdf2</code> accepts the following options: </p> <dl compact="compact"> <dt><samp>-c <var>number</var></samp></dt> <dt><samp>--iteration-count=<var>number</var></samp></dt> <dd><p>Number of iterations of the underlying pseudo-random function. Defaults to 10000. </p> </dd> <dt><samp>-l <var>number</var></samp></dt> <dt><samp>--buflen=<var>number</var></samp></dt> <dd><p>Length of the generated hash. Defaults to 64. </p> </dd> <dt><samp>-s <var>number</var></samp></dt> <dt><samp>--salt=<var>number</var></samp></dt> <dd><p>Length of the salt. Defaults to 64. </p></dd> </dl> <hr> <a name="Invoking-grub2_002dmkrelpath"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dmkrescue" accesskey="n" rel="next">Invoking grub2-mkrescue</a>, Previous: <a href="#Invoking-grub2_002dmkpasswd_002dpbkdf2" accesskey="p" rel="prev">Invoking grub2-mkpasswd-pbkdf2</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dmkrelpath-1"></a> <h2 class="chapter">26 Invoking grub2-mkrelpath</h2> <p>The program <code>grub2-mkrelpath</code> makes a file system path relative to the root of its containing file system. For instance, if <samp>/usr</samp> is a mount point, then: </p> <div class="example"> <pre class="example">$ <kbd>grub2-mkrelpath /usr/share/grub/unicode.pf2</kbd> ‘<samp>/share/grub/unicode.pf2</samp>’ </pre></div> <p>This is mainly used internally by other GRUB utilities such as <code>grub2-mkconfig</code> (see <a href="#Invoking-grub2_002dmkconfig">Invoking grub2-mkconfig</a>), but may occasionally also be useful for debugging. </p> <p><code>grub2-mkrelpath</code> accepts the following options: </p> <dl compact="compact"> <dt><samp>--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp>--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p></dd> </dl> <hr> <a name="Invoking-grub2_002dmkrescue"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dmount" accesskey="n" rel="next">Invoking grub2-mount</a>, Previous: <a href="#Invoking-grub2_002dmkrelpath" accesskey="p" rel="prev">Invoking grub2-mkrelpath</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dmkrescue-1"></a> <h2 class="chapter">27 Invoking grub2-mkrescue</h2> <p>The program <code>grub2-mkrescue</code> generates a bootable GRUB rescue image (see <a href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>). </p> <div class="example"> <pre class="example">grub-mkrescue -o grub.iso </pre></div> <p>All arguments not explicitly listed as <code>grub2-mkrescue</code> options are passed on directly to <code>xorriso</code> in <code>mkisofs</code> emulation mode. Options passed to <code>xorriso</code> will normally be interpreted as <code>mkisofs</code> options; if the option ‘<samp>--</samp>’ is used, then anything after that will be interpreted as native <code>xorriso</code> options. </p> <p>Non-option arguments specify additional source directories. This is commonly used to add extra files to the image: </p> <div class="example"> <pre class="example">mkdir -p disk/boot/grub <span class="roman">(add extra files to <samp>disk/boot/grub</samp>)</span> grub-mkrescue -o grub.iso disk </pre></div> <p><code>grub2-mkrescue</code> accepts the following options: </p> <dl compact="compact"> <dt><samp>--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp>--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp>-o <var>file</var></samp></dt> <dt><samp>--output=<var>file</var></samp></dt> <dd><p>Save output in <var>file</var>. This "option" is required. </p> </dd> <dt><samp>--modules=<var>modules</var></samp></dt> <dd><p>Pre-load the named GRUB modules in the image. Multiple entries in <var>modules</var> should be separated by whitespace (so you will probably need to quote this for your shell). </p> </dd> <dt><samp>--rom-directory=<var>dir</var></samp></dt> <dd><p>If generating images for the QEMU or Coreboot platforms, copy the resulting <samp>qemu.img</samp> or <samp>coreboot.elf</samp> files respectively to the <var>dir</var> directory as well as including them in the image. </p> </dd> <dt><samp>--xorriso=<var>file</var></samp></dt> <dd><p>Use <var>file</var> as the <code>xorriso</code> program, rather than the built-in default. </p> </dd> <dt><samp>--grub-mkimage=<var>file</var></samp></dt> <dd><p>Use <var>file</var> as the <code>grub2-mkimage</code> program, rather than the built-in default. </p></dd> </dl> <hr> <a name="Invoking-grub2_002dmount"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dprobe" accesskey="n" rel="next">Invoking grub2-probe</a>, Previous: <a href="#Invoking-grub2_002dmkrescue" accesskey="p" rel="prev">Invoking grub2-mkrescue</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dmount-1"></a> <h2 class="chapter">28 Invoking grub2-mount</h2> <p>The program <code>grub2-mount</code> performs a read-only mount of any file system or file system image that GRUB understands, using GRUB’s file system drivers via FUSE. (It is only available if FUSE development files were present when GRUB was built.) This has a number of uses: </p> <ul> <li> It provides a convenient way to check how GRUB will view a file system at boot time. You can use normal command-line tools to compare that view with that of your operating system, making it easy to find bugs. </li><li> It offers true read-only mounts. Linux does not have these for journalling file systems, because it will always attempt to replay the journal at mount time; while you can temporarily mark the block device read-only to avoid this, that causes the mount to fail. Since GRUB intentionally contains no code for writing to file systems, it can easily provide a guaranteed read-only mount mechanism. </li><li> It allows you to examine any file system that GRUB understands without needing to load additional modules into your running kernel, which may be useful in constrained environments such as installers. </li><li> Since it can examine file system images (contained in regular files) just as easily as file systems on block devices, you can use it to inspect any file system image that GRUB understands with only enough privileges to use FUSE, even if nobody has yet written a FUSE module specifically for that file system type. </li></ul> <p>Using <code>grub2-mount</code> is normally as simple as: </p> <div class="example"> <pre class="example">grub-mount /dev/sda1 /mnt </pre></div> <p><code>grub2-mount</code> must be given one or more images and a mount point as non-option arguments (if it is given more than one image, it will treat them as a RAID set), and also accepts the following options: </p> <dl compact="compact"> <dt><samp>--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp>--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp>-C</samp></dt> <dt><samp>--crypto</samp></dt> <dd><p>Mount encrypted devices, prompting for a passphrase if necessary. </p> </dd> <dt><samp>-d <var>string</var></samp></dt> <dt><samp>--debug=<var>string</var></samp></dt> <dd><p>Show debugging output for conditions matching <var>string</var>. </p> </dd> <dt><samp>-K prompt|<var>file</var></samp></dt> <dt><samp>--zfs-key=prompt|<var>file</var></samp></dt> <dd><p>Load a ZFS encryption key. If you use ‘<samp>prompt</samp>’ as the argument, <code>grub2-mount</code> will read a passphrase from the terminal; otherwise, it will read key material from the specified file. </p> </dd> <dt><samp>-r <var>device</var></samp></dt> <dt><samp>--root=<var>device</var></samp></dt> <dd><p>Set the GRUB root device to <var>device</var>. You do not normally need to set this; <code>grub2-mount</code> will automatically set the root device to the root of the supplied file system. </p> <p>If <var>device</var> is just a number, then it will be treated as a partition number within the supplied image. This means that, if you have an image of an entire disk in <samp>disk.img</samp>, then you can use this command to mount its second partition: </p> <div class="example"> <pre class="example">grub-mount -r 2 disk.img mount-point </pre></div> </dd> <dt><samp>-v</samp></dt> <dt><samp>--verbose</samp></dt> <dd><p>Print verbose messages. </p></dd> </dl> <hr> <a name="Invoking-grub2_002dprobe"></a> <div class="header"> <p> Next: <a href="#Invoking-grub2_002dscript_002dcheck" accesskey="n" rel="next">Invoking grub2-script-check</a>, Previous: <a href="#Invoking-grub2_002dmount" accesskey="p" rel="prev">Invoking grub2-mount</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dprobe-1"></a> <h2 class="chapter">29 Invoking grub2-probe</h2> <p>The program <code>grub2-probe</code> probes device information for a given path or device. </p> <div class="example"> <pre class="example">grub-probe --target=fs /boot/grub grub-probe --target=drive --device /dev/sda1 </pre></div> <p><code>grub2-probe</code> must be given a path or device as a non-option argument, and also accepts the following options: </p> <dl compact="compact"> <dt><samp>--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp>--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp>-d</samp></dt> <dt><samp>--device</samp></dt> <dd><p>If this option is given, then the non-option argument is a system device name (such as ‘<samp>/dev/sda1</samp>’), and <code>grub2-probe</code> will print information about that device. If it is not given, then the non-option argument is a filesystem path (such as ‘<samp>/boot/grub</samp>’), and <code>grub2-probe</code> will print information about the device containing that part of the filesystem. </p> </dd> <dt><samp>-m <var>file</var></samp></dt> <dt><samp>--device-map=<var>file</var></samp></dt> <dd><p>Use <var>file</var> as the device map (see <a href="#Device-map">Device map</a>) rather than the default, usually ‘<samp>/boot/grub2/device.map</samp>’. </p> </dd> <dt><samp>-t <var>target</var></samp></dt> <dt><samp>--target=<var>target</var></samp></dt> <dd><p>Print information about the given path or device as defined by <var>target</var>. The available targets and their meanings are: </p> <dl compact="compact"> <dt>‘<samp>fs</samp>’</dt> <dd><p>GRUB filesystem module. </p></dd> <dt>‘<samp>fs_uuid</samp>’</dt> <dd><p>Filesystem Universally Unique Identifier (UUID). </p></dd> <dt>‘<samp>fs_label</samp>’</dt> <dd><p>Filesystem label. </p></dd> <dt>‘<samp>drive</samp>’</dt> <dd><p>GRUB device name. </p></dd> <dt>‘<samp>device</samp>’</dt> <dd><p>System device name. </p></dd> <dt>‘<samp>partmap</samp>’</dt> <dd><p>GRUB partition map module. </p></dd> <dt>‘<samp>abstraction</samp>’</dt> <dd><p>GRUB abstraction module (e.g. ‘<samp>lvm</samp>’). </p></dd> <dt>‘<samp>cryptodisk_uuid</samp>’</dt> <dd><p>Crypto device UUID. </p></dd> <dt>‘<samp>msdos_parttype</samp>’</dt> <dd><p>MBR partition type code (two hexadecimal digits). </p></dd> <dt>‘<samp>hints_string</samp>’</dt> <dd><p>A string of platform search hints suitable for passing to the <code>search</code> command (see <a href="#search">search</a>). </p></dd> <dt>‘<samp>bios_hints</samp>’</dt> <dd><p>Search hints for the PC BIOS platform. </p></dd> <dt>‘<samp>ieee1275_hints</samp>’</dt> <dd><p>Search hints for the IEEE1275 platform. </p></dd> <dt>‘<samp>baremetal_hints</samp>’</dt> <dd><p>Search hints for platforms where disks are addressed directly rather than via firmware. </p></dd> <dt>‘<samp>efi_hints</samp>’</dt> <dd><p>Search hints for the EFI platform. </p></dd> <dt>‘<samp>arc_hints</samp>’</dt> <dd><p>Search hints for the ARC platform. </p></dd> <dt>‘<samp>compatibility_hint</samp>’</dt> <dd><p>A guess at a reasonable GRUB drive name for this device, which may be used as a fallback if the <code>search</code> command fails. </p></dd> <dt>‘<samp>disk</samp>’</dt> <dd><p>System device name for the whole disk. </p></dd> </dl> </dd> <dt><samp>-v</samp></dt> <dt><samp>--verbose</samp></dt> <dd><p>Print verbose messages. </p></dd> </dl> <hr> <a name="Invoking-grub2_002dscript_002dcheck"></a> <div class="header"> <p> Next: <a href="#Obtaining-and-Building-GRUB" accesskey="n" rel="next">Obtaining and Building GRUB</a>, Previous: <a href="#Invoking-grub2_002dprobe" accesskey="p" rel="prev">Invoking grub2-probe</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Invoking-grub2_002dscript_002dcheck-1"></a> <h2 class="chapter">30 Invoking grub2-script-check</h2> <p>The program <code>grub2-script-check</code> takes a GRUB script file (see <a href="#Shell_002dlike-scripting">Shell-like scripting</a>) and checks it for syntax errors, similar to commands such as <code>sh -n</code>. It may take a <var>path</var> as a non-option argument; if none is supplied, it will read from standard input. </p> <div class="example"> <pre class="example">grub-script-check /boot/grub2/grub.cfg </pre></div> <p><code>grub2-script-check</code> accepts the following options: </p> <dl compact="compact"> <dt><samp>--help</samp></dt> <dd><p>Print a summary of the command-line options and exit. </p> </dd> <dt><samp>--version</samp></dt> <dd><p>Print the version number of GRUB and exit. </p> </dd> <dt><samp>-v</samp></dt> <dt><samp>--verbose</samp></dt> <dd><p>Print each line of input after reading it. </p></dd> </dl> <hr> <a name="Obtaining-and-Building-GRUB"></a> <div class="header"> <p> Next: <a href="#Reporting-bugs" accesskey="n" rel="next">Reporting bugs</a>, Previous: <a href="#Invoking-grub2_002dscript_002dcheck" accesskey="p" rel="prev">Invoking grub2-script-check</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="How-to-obtain-and-build-GRUB"></a> <h2 class="appendix">Appendix A How to obtain and build GRUB</h2> <blockquote> <p><strong>Caution:</strong> GRUB requires binutils-2.9.1.0.23 or later because the GNU assembler has been changed so that it can produce real 16bits machine code between 2.9.1 and 2.9.1.0.x. See <a href="http://sources.redhat.com/binutils/">http://sources.redhat.com/binutils/</a>, to obtain information on how to get the latest version. </p></blockquote> <p>GRUB is available from the GNU alpha archive site <a href="ftp://ftp.gnu.org/gnu/grub">ftp://ftp.gnu.org/gnu/grub</a> or any of its mirrors. The file will be named grub-version.tar.gz. The current version is 2.03, so the file you should grab is: </p> <p><a href="ftp://ftp.gnu.org/gnu/grub/grub-2.03.tar.gz">ftp://ftp.gnu.org/gnu/grub/grub-2.03.tar.gz</a> </p> <p>To unbundle GRUB use the instruction: </p> <div class="example"> <pre class="example"><kbd>zcat grub-2.03.tar.gz | tar xvf -</kbd> </pre></div> <p>which will create a directory called <samp>grub-2.03</samp> with all the sources. You can look at the file <samp>INSTALL</samp> for detailed instructions on how to build and install GRUB, but you should be able to just do: </p> <div class="example"> <pre class="example"><kbd>cd grub-2.03</kbd> <kbd>./configure</kbd> <kbd>make install</kbd> </pre></div> <p>Also, the latest version is available using Git. See <a href="http://www.gnu.org/software/grub/grub-download.html">http://www.gnu.org/software/grub/grub-download.html</a> for more information. </p> <hr> <a name="Reporting-bugs"></a> <div class="header"> <p> Next: <a href="#Future" accesskey="n" rel="next">Future</a>, Previous: <a href="#Obtaining-and-Building-GRUB" accesskey="p" rel="prev">Obtaining and Building GRUB</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Reporting-bugs-1"></a> <h2 class="appendix">Appendix B Reporting bugs</h2> <p>These are the guideline for how to report bugs. Take a look at this list below before you submit bugs: </p> <ol> <li> Before getting unsettled, read this manual through and through. Also, see the <a href="http://www.gnu.org/software/grub/grub-faq.html">GNU GRUB FAQ</a>. </li><li> Always mention the information on your GRUB. The version number and the configuration are quite important. If you build it yourself, write the options specified to the configure script and your operating system, including the versions of gcc and binutils. </li><li> If you have trouble with the installation, inform us of how you installed GRUB. Don’t omit error messages, if any. Just ‘<samp>GRUB hangs up when it boots</samp>’ is not enough. <p>The information on your hardware is also essential. These are especially important: the geometries and the partition tables of your hard disk drives and your BIOS. </p> </li><li> If GRUB cannot boot your operating system, write down <em>everything</em> you see on the screen. Don’t paraphrase them, like ‘<samp>The foo OS crashes with GRUB, even though it can boot with the bar boot loader just fine</samp>’. Mention the commands you executed, the messages printed by them, and information on your operating system including the version number. </li><li> Explain what you wanted to do. It is very useful to know your purpose and your wish, and how GRUB didn’t satisfy you. </li><li> If you can investigate the problem yourself, please do. That will give you and us much more information on the problem. Attaching a patch is even better. <p>When you attach a patch, make the patch in unified diff format, and write ChangeLog entries. But, even when you make a patch, don’t forget to explain the problem, so that we can understand what your patch is for. </p> </li><li> Write down anything that you think might be related. Please understand that we often need to reproduce the same problem you encountered in our environment. So your information should be sufficient for us to do the same thing—Don’t forget that we cannot see your computer directly. If you are not sure whether to state a fact or leave it out, state it! Reporting too many things is much better than omitting something important. </li></ol> <p>If you follow the guideline above, submit a report to the <a href="http://savannah.gnu.org/bugs/?group=grub">Bug Tracking System</a>. Alternatively, you can submit a report via electronic mail to <a href="mailto:bug-grub@gnu.org">bug-grub@gnu.org</a>, but we strongly recommend that you use the Bug Tracking System, because e-mail can be passed over easily. </p> <p>Once we get your report, we will try to fix the bugs. </p> <hr> <a name="Future"></a> <div class="header"> <p> Next: <a href="#Copying-This-Manual" accesskey="n" rel="next">Copying This Manual</a>, Previous: <a href="#Reporting-bugs" accesskey="p" rel="prev">Reporting bugs</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Where-GRUB-will-go"></a> <h2 class="appendix">Appendix C Where GRUB will go</h2> <p>GRUB 2 is now quite stable and used in many production systems. We are currently working towards a 2.0 release. </p> <p>If you are interested in the development of GRUB 2, take a look at <a href="http://www.gnu.org/software/grub/grub.html">the homepage</a>. </p> <hr> <a name="Copying-This-Manual"></a> <div class="header"> <p> Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Future" accesskey="p" rel="prev">Future</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Copying-This-Manual-1"></a> <h2 class="appendix">Appendix D Copying This Manual</h2> <table class="menu" border="0" cellspacing="0"> <tr><td align="left" valign="top">• <a href="#GNU-Free-Documentation-License" accesskey="1">GNU Free Documentation License</a>:</td><td> </td><td align="left" valign="top">License for copying this manual. </td></tr> </table> <hr> <a name="GNU-Free-Documentation-License"></a> <div class="header"> <p> Up: <a href="#Copying-This-Manual" accesskey="u" rel="up">Copying This Manual</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="GNU-Free-Documentation-License-1"></a> <h3 class="appendixsec">D.1 GNU Free Documentation License</h3> <a name="index-FDL_002c-GNU-Free-Documentation-License"></a> <div align="center">Version 1.2, November 2002 </div> <div class="display"> <pre class="display">Copyright © 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. </pre></div> <ol start="0"> <li> PREAMBLE <p>The purpose of this License is to make a manual, textbook, or other functional and useful document <em>free</em> in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. </p> <p>This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. </p> <p>We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. </p> </li><li> APPLICABILITY AND DEFINITIONS <p>This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. </p> <p>A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. </p> <p>A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. </p> <p>The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. </p> <p>The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. </p> <p>A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”. </p> <p>Examples of suitable formats for Transparent copies include plain <small>ASCII</small> without markup, Texinfo input format, LaTeX input format, <acronym>SGML</acronym> or <acronym>XML</acronym> using a publicly available <acronym>DTD</acronym>, and standard-conforming simple <acronym>HTML</acronym>, PostScript or <acronym>PDF</acronym> designed for human modification. Examples of transparent image formats include <acronym>PNG</acronym>, <acronym>XCF</acronym> and <acronym>JPG</acronym>. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, <acronym>SGML</acronym> or <acronym>XML</acronym> for which the <acronym>DTD</acronym> and/or processing tools are not generally available, and the machine-generated <acronym>HTML</acronym>, PostScript or <acronym>PDF</acronym> produced by some word processors for output purposes only. </p> <p>The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text. </p> <p>A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition. </p> <p>The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. </p> </li><li> VERBATIM COPYING <p>You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. </p> <p>You may also lend copies, under the same conditions stated above, and you may publicly display copies. </p> </li><li> COPYING IN QUANTITY <p>If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. </p> <p>If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. </p> <p>If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. </p> <p>It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. </p> </li><li> MODIFICATIONS <p>You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: </p> <ol type="A" start="1"> <li> Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. </li><li> List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. </li><li> State on the Title page the name of the publisher of the Modified Version, as the publisher. </li><li> Preserve all the copyright notices of the Document. </li><li> Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. </li><li> Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. </li><li> Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice. </li><li> Include an unaltered copy of this License. </li><li> Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. </li><li> Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. </li><li> For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. </li><li> Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. </li><li> Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version. </li><li> Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section. </li><li> Preserve any Warranty Disclaimers. </li></ol> <p>If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles. </p> <p>You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. </p> <p>You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. </p> <p>The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. </p> </li><li> COMBINING DOCUMENTS <p>You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. </p> <p>The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. </p> <p>In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.” </p> </li><li> COLLECTIONS OF DOCUMENTS <p>You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. </p> <p>You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. </p> </li><li> AGGREGATION WITH INDEPENDENT WORKS <p>A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation’s users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. </p> <p>If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. </p> </li><li> TRANSLATION <p>Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. </p> <p>If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. </p> </li><li> TERMINATION <p>You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. </p> </li><li> FUTURE REVISIONS OF THIS LICENSE <p>The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See <a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>. </p> <p>Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. </p></li></ol> <a name="ADDENDUM_003a-How-to-use-this-License-for-your-documents"></a> <h4 class="appendixsubsec">D.1.1 ADDENDUM: How to use this License for your documents</h4> <p>To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: </p> <div class="smallexample"> <pre class="smallexample"> Copyright (C) <var>year</var> <var>your name</var>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. </pre></div> <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this: </p> <div class="smallexample"> <pre class="smallexample"> with the Invariant Sections being <var>list their titles</var>, with the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts being <var>list</var>. </pre></div> <p>If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. </p> <p>If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. </p> <hr> <a name="Index"></a> <div class="header"> <p> Previous: <a href="#Copying-This-Manual" accesskey="p" rel="prev">Copying This Manual</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <a name="Index-1"></a> <h2 class="unnumbered">Index</h2> <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_symbol-1"><b>[</b></a> <br> <a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a> <a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a> <a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a> <a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a> <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a> <a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a> <a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a> <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a> <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a> <a class="summary-letter" href="#Index_cp_letter-K"><b>K</b></a> <a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a> <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a> <a class="summary-letter" href="#Index_cp_letter-N"><b>N</b></a> <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a> <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a> <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a> <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a> <a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a> <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a> <a class="summary-letter" href="#Index_cp_letter-X"><b>X</b></a> </td></tr></table> <table class="index-cp" border="0"> <tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_symbol-1">[</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-_005b"><code><code>[</code></code></a>:</td><td> </td><td valign="top"><a href="#g_t_005b">[</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-A">A</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-acpi"><code>acpi</code></a>:</td><td> </td><td valign="top"><a href="#acpi">acpi</a></td></tr> <tr><td></td><td valign="top"><a href="#index-authenticate"><code>authenticate</code></a>:</td><td> </td><td valign="top"><a href="#authenticate">authenticate</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-B">B</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-background_005fcolor"><code>background_color</code></a>:</td><td> </td><td valign="top"><a href="#background_005fcolor">background_color</a></td></tr> <tr><td></td><td valign="top"><a href="#index-background_005fimage"><code>background_image</code></a>:</td><td> </td><td valign="top"><a href="#background_005fimage">background_image</a></td></tr> <tr><td></td><td valign="top"><a href="#index-badram"><code>badram</code></a>:</td><td> </td><td valign="top"><a href="#badram">badram</a></td></tr> <tr><td></td><td valign="top"><a href="#index-blocklist"><code>blocklist</code></a>:</td><td> </td><td valign="top"><a href="#blocklist">blocklist</a></td></tr> <tr><td></td><td valign="top"><a href="#index-boot"><code>boot</code></a>:</td><td> </td><td valign="top"><a href="#boot">boot</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-cat"><code>cat</code></a>:</td><td> </td><td valign="top"><a href="#cat">cat</a></td></tr> <tr><td></td><td valign="top"><a href="#index-chainloader"><code>chainloader</code></a>:</td><td> </td><td valign="top"><a href="#chainloader">chainloader</a></td></tr> <tr><td></td><td valign="top"><a href="#index-clear"><code>clear</code></a>:</td><td> </td><td valign="top"><a href="#clear">clear</a></td></tr> <tr><td></td><td valign="top"><a href="#index-CMOS"><code>CMOS</code></a>:</td><td> </td><td valign="top"><a href="#cmosdump">cmosdump</a></td></tr> <tr><td></td><td valign="top"><a href="#index-cmosclean"><code>cmosclean</code></a>:</td><td> </td><td valign="top"><a href="#cmosclean">cmosclean</a></td></tr> <tr><td></td><td valign="top"><a href="#index-cmostest"><code>cmostest</code></a>:</td><td> </td><td valign="top"><a href="#cmostest">cmostest</a></td></tr> <tr><td></td><td valign="top"><a href="#index-cmp"><code>cmp</code></a>:</td><td> </td><td valign="top"><a href="#cmp">cmp</a></td></tr> <tr><td></td><td valign="top"><a href="#index-configfile"><code>configfile</code></a>:</td><td> </td><td valign="top"><a href="#configfile">configfile</a></td></tr> <tr><td></td><td valign="top"><a href="#index-cpuid"><code>cpuid</code></a>:</td><td> </td><td valign="top"><a href="#cpuid">cpuid</a></td></tr> <tr><td></td><td valign="top"><a href="#index-crc"><code>crc</code></a>:</td><td> </td><td valign="top"><a href="#crc">crc</a></td></tr> <tr><td></td><td valign="top"><a href="#index-cryptomount"><code>cryptomount</code></a>:</td><td> </td><td valign="top"><a href="#cryptomount">cryptomount</a></td></tr> <tr><td></td><td valign="top"><a href="#index-cutmem"><code>cutmem</code></a>:</td><td> </td><td valign="top"><a href="#cutmem">cutmem</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-D">D</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-date"><code>date</code></a>:</td><td> </td><td valign="top"><a href="#date">date</a></td></tr> <tr><td></td><td valign="top"><a href="#index-devicetree"><code>devicetree</code></a>:</td><td> </td><td valign="top"><a href="#devicetree">devicetree</a></td></tr> <tr><td></td><td valign="top"><a href="#index-distrust"><code>distrust</code></a>:</td><td> </td><td valign="top"><a href="#distrust">distrust</a></td></tr> <tr><td></td><td valign="top"><a href="#index-distrust_005fcertificate"><code>distrust_certificate</code></a>:</td><td> </td><td valign="top"><a href="#distrust_005fcertificate">distrust_certificate</a></td></tr> <tr><td></td><td valign="top"><a href="#index-drivemap"><code>drivemap</code></a>:</td><td> </td><td valign="top"><a href="#drivemap">drivemap</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-E">E</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-echo"><code>echo</code></a>:</td><td> </td><td valign="top"><a href="#echo">echo</a></td></tr> <tr><td></td><td valign="top"><a href="#index-eval"><code>eval</code></a>:</td><td> </td><td valign="top"><a href="#eval">eval</a></td></tr> <tr><td></td><td valign="top"><a href="#index-export"><code>export</code></a>:</td><td> </td><td valign="top"><a href="#export">export</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-F">F</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-false"><code>false</code></a>:</td><td> </td><td valign="top"><a href="#false">false</a></td></tr> <tr><td></td><td valign="top"><a href="#index-FDL_002c-GNU-Free-Documentation-License">FDL, GNU Free Documentation License</a>:</td><td> </td><td valign="top"><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-G">G</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-gettext"><code>gettext</code></a>:</td><td> </td><td valign="top"><a href="#gettext">gettext</a></td></tr> <tr><td></td><td valign="top"><a href="#index-gptsync"><code>gptsync</code></a>:</td><td> </td><td valign="top"><a href="#gptsync">gptsync</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-halt"><code>halt</code></a>:</td><td> </td><td valign="top"><a href="#halt">halt</a></td></tr> <tr><td></td><td valign="top"><a href="#index-hashsum"><code>hashsum</code></a>:</td><td> </td><td valign="top"><a href="#hashsum">hashsum</a></td></tr> <tr><td></td><td valign="top"><a href="#index-help"><code>help</code></a>:</td><td> </td><td valign="top"><a href="#help">help</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-initrd"><code>initrd</code></a>:</td><td> </td><td valign="top"><a href="#initrd">initrd</a></td></tr> <tr><td></td><td valign="top"><a href="#index-initrd16"><code>initrd16</code></a>:</td><td> </td><td valign="top"><a href="#initrd16">initrd16</a></td></tr> <tr><td></td><td valign="top"><a href="#index-insmod"><code>insmod</code></a>:</td><td> </td><td valign="top"><a href="#insmod">insmod</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-K">K</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-keystatus"><code>keystatus</code></a>:</td><td> </td><td valign="top"><a href="#keystatus">keystatus</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-L">L</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-linux"><code>linux</code></a>:</td><td> </td><td valign="top"><a href="#linux">linux</a></td></tr> <tr><td></td><td valign="top"><a href="#index-linux16"><code>linux16</code></a>:</td><td> </td><td valign="top"><a href="#linux16">linux16</a></td></tr> <tr><td></td><td valign="top"><a href="#index-list_005fcertificates"><code>list_certificates</code></a>:</td><td> </td><td valign="top"><a href="#list_005fcertificates">list_certificates</a></td></tr> <tr><td></td><td valign="top"><a href="#index-list_005fenv"><code>list_env</code></a>:</td><td> </td><td valign="top"><a href="#list_005fenv">list_env</a></td></tr> <tr><td></td><td valign="top"><a href="#index-list_005ftrusted"><code>list_trusted</code></a>:</td><td> </td><td valign="top"><a href="#list_005ftrusted">list_trusted</a></td></tr> <tr><td></td><td valign="top"><a href="#index-loadfont"><code>loadfont</code></a>:</td><td> </td><td valign="top"><a href="#loadfont">loadfont</a></td></tr> <tr><td></td><td valign="top"><a href="#index-load_005fenv"><code>load_env</code></a>:</td><td> </td><td valign="top"><a href="#load_005fenv">load_env</a></td></tr> <tr><td></td><td valign="top"><a href="#index-loopback"><code>loopback</code></a>:</td><td> </td><td valign="top"><a href="#loopback">loopback</a></td></tr> <tr><td></td><td valign="top"><a href="#index-ls"><code>ls</code></a>:</td><td> </td><td valign="top"><a href="#ls">ls</a></td></tr> <tr><td></td><td valign="top"><a href="#index-lsfonts"><code>lsfonts</code></a>:</td><td> </td><td valign="top"><a href="#lsfonts">lsfonts</a></td></tr> <tr><td></td><td valign="top"><a href="#index-lsmod"><code>lsmod</code></a>:</td><td> </td><td valign="top"><a href="#lsmod">lsmod</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-M">M</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-md5sum"><code>md5sum</code></a>:</td><td> </td><td valign="top"><a href="#md5sum">md5sum</a></td></tr> <tr><td></td><td valign="top"><a href="#index-menuentry"><code>menuentry</code></a>:</td><td> </td><td valign="top"><a href="#menuentry">menuentry</a></td></tr> <tr><td></td><td valign="top"><a href="#index-module"><code>module</code></a>:</td><td> </td><td valign="top"><a href="#module">module</a></td></tr> <tr><td></td><td valign="top"><a href="#index-multiboot"><code>multiboot</code></a>:</td><td> </td><td valign="top"><a href="#multiboot">multiboot</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-N">N</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-nativedisk"><code>nativedisk</code></a>:</td><td> </td><td valign="top"><a href="#nativedisk">nativedisk</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fadd_005faddr"><code>net_add_addr</code></a>:</td><td> </td><td valign="top"><a href="#net_005fadd_005faddr">net_add_addr</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fadd_005fdns"><code>net_add_dns</code></a>:</td><td> </td><td valign="top"><a href="#net_005fadd_005fdns">net_add_dns</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fadd_005froute"><code>net_add_route</code></a>:</td><td> </td><td valign="top"><a href="#net_005fadd_005froute">net_add_route</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fbootp"><code>net_bootp</code></a>:</td><td> </td><td valign="top"><a href="#net_005fbootp">net_bootp</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fbootp6"><code>net_bootp6</code></a>:</td><td> </td><td valign="top"><a href="#net_005fbootp6">net_bootp6</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fdel_005faddr"><code>net_del_addr</code></a>:</td><td> </td><td valign="top"><a href="#net_005fdel_005faddr">net_del_addr</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fdel_005fdns"><code>net_del_dns</code></a>:</td><td> </td><td valign="top"><a href="#net_005fdel_005fdns">net_del_dns</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fdel_005froute"><code>net_del_route</code></a>:</td><td> </td><td valign="top"><a href="#net_005fdel_005froute">net_del_route</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fget_005fdhcp_005foption"><code>net_get_dhcp_option</code></a>:</td><td> </td><td valign="top"><a href="#net_005fget_005fdhcp_005foption">net_get_dhcp_option</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fipv6_005fautoconf"><code>net_ipv6_autoconf</code></a>:</td><td> </td><td valign="top"><a href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fls_005faddr"><code>net_ls_addr</code></a>:</td><td> </td><td valign="top"><a href="#net_005fls_005faddr">net_ls_addr</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fls_005fcards"><code>net_ls_cards</code></a>:</td><td> </td><td valign="top"><a href="#net_005fls_005fcards">net_ls_cards</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fls_005fdns"><code>net_ls_dns</code></a>:</td><td> </td><td valign="top"><a href="#net_005fls_005fdns">net_ls_dns</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fls_005froutes"><code>net_ls_routes</code></a>:</td><td> </td><td valign="top"><a href="#net_005fls_005froutes">net_ls_routes</a></td></tr> <tr><td></td><td valign="top"><a href="#index-net_005fnslookup"><code>net_nslookup</code></a>:</td><td> </td><td valign="top"><a href="#net_005fnslookup">net_nslookup</a></td></tr> <tr><td></td><td valign="top"><a href="#index-normal"><code>normal</code></a>:</td><td> </td><td valign="top"><a href="#normal">normal</a></td></tr> <tr><td></td><td valign="top"><a href="#index-normal_005fexit"><code>normal_exit</code></a>:</td><td> </td><td valign="top"><a href="#normal_005fexit">normal_exit</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-parttool"><code>parttool</code></a>:</td><td> </td><td valign="top"><a href="#parttool">parttool</a></td></tr> <tr><td></td><td valign="top"><a href="#index-password"><code>password</code></a>:</td><td> </td><td valign="top"><a href="#password">password</a></td></tr> <tr><td></td><td valign="top"><a href="#index-password_005fpbkdf2"><code>password_pbkdf2</code></a>:</td><td> </td><td valign="top"><a href="#password_005fpbkdf2">password_pbkdf2</a></td></tr> <tr><td></td><td valign="top"><a href="#index-play"><code>play</code></a>:</td><td> </td><td valign="top"><a href="#play">play</a></td></tr> <tr><td></td><td valign="top"><a href="#index-probe"><code>probe</code></a>:</td><td> </td><td valign="top"><a href="#probe">probe</a></td></tr> <tr><td></td><td valign="top"><a href="#index-pxe_005funload"><code>pxe_unload</code></a>:</td><td> </td><td valign="top"><a href="#pxe_005funload">pxe_unload</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-read"><code>read</code></a>:</td><td> </td><td valign="top"><a href="#read">read</a></td></tr> <tr><td></td><td valign="top"><a href="#index-reboot"><code>reboot</code></a>:</td><td> </td><td valign="top"><a href="#reboot">reboot</a></td></tr> <tr><td></td><td valign="top"><a href="#index-regexp"><code>regexp</code></a>:</td><td> </td><td valign="top"><a href="#regexp">regexp</a></td></tr> <tr><td></td><td valign="top"><a href="#index-rmmod"><code>rmmod</code></a>:</td><td> </td><td valign="top"><a href="#rmmod">rmmod</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-save_005fenv"><code>save_env</code></a>:</td><td> </td><td valign="top"><a href="#save_005fenv">save_env</a></td></tr> <tr><td></td><td valign="top"><a href="#index-search"><code>search</code></a>:</td><td> </td><td valign="top"><a href="#search">search</a></td></tr> <tr><td></td><td valign="top"><a href="#index-sendkey"><code>sendkey</code></a>:</td><td> </td><td valign="top"><a href="#sendkey">sendkey</a></td></tr> <tr><td></td><td valign="top"><a href="#index-serial"><code>serial</code></a>:</td><td> </td><td valign="top"><a href="#serial">serial</a></td></tr> <tr><td></td><td valign="top"><a href="#index-set"><code>set</code></a>:</td><td> </td><td valign="top"><a href="#set">set</a></td></tr> <tr><td></td><td valign="top"><a href="#index-sha1sum"><code>sha1sum</code></a>:</td><td> </td><td valign="top"><a href="#sha1sum">sha1sum</a></td></tr> <tr><td></td><td valign="top"><a href="#index-sha256sum"><code>sha256sum</code></a>:</td><td> </td><td valign="top"><a href="#sha256sum">sha256sum</a></td></tr> <tr><td></td><td valign="top"><a href="#index-sha512sum"><code>sha512sum</code></a>:</td><td> </td><td valign="top"><a href="#sha512sum">sha512sum</a></td></tr> <tr><td></td><td valign="top"><a href="#index-sleep"><code>sleep</code></a>:</td><td> </td><td valign="top"><a href="#sleep">sleep</a></td></tr> <tr><td></td><td valign="top"><a href="#index-source"><code>source</code></a>:</td><td> </td><td valign="top"><a href="#source">source</a></td></tr> <tr><td></td><td valign="top"><a href="#index-submenu"><code>submenu</code></a>:</td><td> </td><td valign="top"><a href="#submenu">submenu</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-terminal_005finput"><code>terminal_input</code></a>:</td><td> </td><td valign="top"><a href="#terminal_005finput">terminal_input</a></td></tr> <tr><td></td><td valign="top"><a href="#index-terminal_005foutput"><code>terminal_output</code></a>:</td><td> </td><td valign="top"><a href="#terminal_005foutput">terminal_output</a></td></tr> <tr><td></td><td valign="top"><a href="#index-terminfo"><code>terminfo</code></a>:</td><td> </td><td valign="top"><a href="#terminfo">terminfo</a></td></tr> <tr><td></td><td valign="top"><a href="#index-test"><code>test</code></a>:</td><td> </td><td valign="top"><a href="#test">test</a></td></tr> <tr><td></td><td valign="top"><a href="#index-true"><code>true</code></a>:</td><td> </td><td valign="top"><a href="#true">true</a></td></tr> <tr><td></td><td valign="top"><a href="#index-trust"><code>trust</code></a>:</td><td> </td><td valign="top"><a href="#trust">trust</a></td></tr> <tr><td></td><td valign="top"><a href="#index-trust_005fcertificate"><code>trust_certificate</code></a>:</td><td> </td><td valign="top"><a href="#trust_005fcertificate">trust_certificate</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-U">U</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-unset"><code>unset</code></a>:</td><td> </td><td valign="top"><a href="#unset">unset</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-V">V</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-verify_005fappended"><code>verify_appended</code></a>:</td><td> </td><td valign="top"><a href="#verify_005fappended">verify_appended</a></td></tr> <tr><td></td><td valign="top"><a href="#index-verify_005fdetached"><code>verify_detached</code></a>:</td><td> </td><td valign="top"><a href="#verify_005fdetached">verify_detached</a></td></tr> <tr><td></td><td valign="top"><a href="#index-videoinfo"><code>videoinfo</code></a>:</td><td> </td><td valign="top"><a href="#videoinfo">videoinfo</a></td></tr> <tr><td colspan="4"> <hr></td></tr> <tr><th><a name="Index_cp_letter-X">X</a></th><td></td><td></td></tr> <tr><td></td><td valign="top"><a href="#index-xen_005fhypervisor"><code>xen_hypervisor</code></a>:</td><td> </td><td valign="top"><a href="#xen_005fhypervisor">xen_hypervisor</a></td></tr> <tr><td></td><td valign="top"><a href="#index-xen_005fmodule"><code>xen_module</code></a>:</td><td> </td><td valign="top"><a href="#xen_005fmodule">xen_module</a></td></tr> <tr><td colspan="4"> <hr></td></tr> </table> <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Index_cp_symbol-1"><b>[</b></a> <br> <a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a> <a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a> <a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a> <a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a> <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a> <a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a> <a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a> <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a> <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a> <a class="summary-letter" href="#Index_cp_letter-K"><b>K</b></a> <a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a> <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a> <a class="summary-letter" href="#Index_cp_letter-N"><b>N</b></a> <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a> <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a> <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a> <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a> <a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a> <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a> <a class="summary-letter" href="#Index_cp_letter-X"><b>X</b></a> </td></tr></table> <hr> <a name="SEC_Foot"></a> <div class="header"> <p> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p> </div> <h4 class="footnotes-heading">Footnotes</h4> <h3><a name="FOOT1" href="#DOCF1">(1)</a></h3> <p><em>chain-load</em> is the mechanism for loading unsupported operating systems by loading another boot loader. It is typically used for loading DOS or Windows.</p> <h3><a name="FOOT2" href="#DOCF2">(2)</a></h3> <p>The NetBSD/i386 kernel is Multiboot-compliant, but lacks support for Multiboot modules.</p> <h3><a name="FOOT3" href="#DOCF3">(3)</a></h3> <p>Only CRC32 data integrity check is supported (xz default is CRC64 so one should use –check=crc32 option). LZMA BCJ filters are supported.</p> <h3><a name="FOOT4" href="#DOCF4">(4)</a></h3> <p>There are a few pathological cases where loading a very badly organized ELF kernel might take longer, but in practice this never happen.</p> <h3><a name="FOOT5" href="#DOCF5">(5)</a></h3> <p>The LInux LOader, a boot loader that everybody uses, but nobody likes.</p> <h3><a name="FOOT6" href="#DOCF6">(6)</a></h3> <p>El Torito is a specification for bootable CD using BIOS functions.</p> <h3><a name="FOOT7" href="#DOCF7">(7)</a></h3> <p>Currently a backslash-newline pair within a variable name is not handled properly, so use this feature with some care.</p> <h3><a name="FOOT8" href="#DOCF8">(8)</a></h3> <p>However, this behavior will be changed in the future version, in a user-invisible way.</p> <hr> </body> </html> PK��\ o�)�)INSTALLnu�[���PK��\P��S3W3W�)NEWSnu�[���PK��\�+�!!c�READMEnu�[���PK��\���vv��THANKSnu�[���PK��\ ��>>f�TODOnu�[���PK��\6ʁ�;@;@؋font_char_metrics.pngnu�[���PK��\���$�$ X�grub-dev.htmlnu�[���PK��\�P�,D,D w�grub.htmlnu�[���PKF�5
/home/emeraadmin/www/test/../node_modules/safe-buffer/../debug/../.././4d695/grub2-common.zip