Edit File: grub.html
<html lang="en"> <head> <title>GNU GRUB Manual 2.02~beta2</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU GRUB Manual 2.02~beta2"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="top" href="#Top"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- This manual is for GNU GRUB (version 2.02~beta2, 28 October 2021). 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. --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <h1 class="settitle">GNU GRUB Manual 2.02~beta2</h1> <div class="contents"> <h2>Table of Contents</h2> <ul> <li><a name="toc_Top" href="#Top">GNU GRUB manual</a> <li><a name="toc_Introduction" href="#Introduction">1 Introduction to GRUB</a> <ul> <li><a href="#Overview">1.1 Overview</a> <li><a href="#History">1.2 History of GRUB</a> <li><a href="#Changes-from-GRUB-Legacy">1.3 Differences from previous versions</a> <li><a href="#Features">1.4 GRUB features</a> <li><a href="#Role-of-a-boot-loader">1.5 The role of a boot loader</a> </li></ul> <li><a name="toc_Naming-convention" href="#Naming-convention">2 Naming convention</a> <li><a name="toc_OS_002dspecific-notes-about-grub-tools" href="#OS_002dspecific-notes-about-grub-tools">3 OS-specific notes about grub tools</a> <li><a name="toc_Installation" href="#Installation">4 Installation</a> <ul> <li><a href="#Installing-GRUB-using-grub_002dinstall">4.1 Installing GRUB using grub-install</a> <li><a href="#Making-a-GRUB-bootable-CD_002dROM">4.2 Making a GRUB bootable CD-ROM</a> <li><a href="#Device-map">4.3 The map between BIOS drives and OS devices</a> <li><a href="#BIOS-installation">4.4 BIOS installation</a> </li></ul> <li><a name="toc_Booting" href="#Booting">5 Booting</a> <ul> <li><a href="#General-boot-methods">5.1 How to boot operating systems</a> <ul> <li><a href="#Loading-an-operating-system-directly">5.1.1 How to boot an OS directly with GRUB</a> <li><a href="#Chain_002dloading">5.1.2 Chain-loading an OS</a> </li></ul> <li><a href="#Loopback-booting">5.2 Loopback booting</a> <li><a href="#OS_002dspecific-notes">5.3 Some caveats on OS-specific issues</a> <ul> <li><a href="#GNU_002fHurd">5.3.1 GNU/Hurd</a> <li><a href="#GNU_002fLinux">5.3.2 GNU/Linux</a> <li><a href="#NetBSD">5.3.3 NetBSD</a> <li><a href="#DOS_002fWindows">5.3.4 DOS/Windows</a> </li></ul> </li></ul> <li><a name="toc_Configuration" href="#Configuration">6 Writing your own configuration file</a> <ul> <li><a href="#Simple-configuration">6.1 Simple configuration handling</a> <li><a href="#Shell_002dlike-scripting">6.2 Writing full configuration files directly</a> <li><a href="#Multi_002dboot-manual-config">6.3 Multi-boot manual config</a> <li><a href="#Embedded-configuration">6.4 Embedding a configuration file into GRUB</a> </li></ul> <li><a name="toc_Theme-file-format" href="#Theme-file-format">7 Theme file format</a> <ul> <li><a href="#Theme-file-format">7.1 Introduction</a> <li><a href="#Theme-file-format">7.2 Theme Elements</a> <ul> <li><a href="#Theme-file-format">7.2.1 Colors</a> <li><a href="#Theme-file-format">7.2.2 Fonts</a> <li><a href="#Theme-file-format">7.2.3 Progress Bar</a> <li><a href="#Theme-file-format">7.2.4 Circular Progress Indicator</a> <li><a href="#Theme-file-format">7.2.5 Labels</a> <li><a href="#Theme-file-format">7.2.6 Boot Menu</a> <li><a href="#Theme-file-format">7.2.7 Styled Boxes</a> <li><a href="#Theme-file-format">7.2.8 Creating Styled Box Images</a> </li></ul> <li><a href="#Theme-file-format">7.3 Theme File Manual</a> <ul> <li><a href="#Theme-file-format">7.3.1 Global Properties</a> <li><a href="#Theme-file-format">7.3.2 Format</a> <li><a href="#Theme-file-format">7.3.3 Global Property List</a> <li><a href="#Theme-file-format">7.3.4 Component Construction</a> <li><a href="#Theme-file-format">7.3.5 Component List</a> <li><a href="#Theme-file-format">7.3.6 Common properties</a> </li></ul> </li></ul> <li><a name="toc_Network" href="#Network">8 Booting GRUB from the network</a> <li><a name="toc_Serial-terminal" href="#Serial-terminal">9 Using GRUB via a serial line</a> <li><a name="toc_Vendor-power_002don-keys" href="#Vendor-power_002don-keys">10 Using GRUB with vendor power-on keys</a> <li><a name="toc_Images" href="#Images">11 GRUB image files</a> <li><a name="toc_Core-image-size-limitation" href="#Core-image-size-limitation">12 Core image size limitation</a> <li><a name="toc_Filesystem" href="#Filesystem">13 Filesystem syntax and semantics</a> <ul> <li><a href="#Device-syntax">13.1 How to specify devices</a> <li><a href="#File-name-syntax">13.2 How to specify files</a> <li><a href="#Block-list-syntax">13.3 How to specify block lists</a> </li></ul> <li><a name="toc_Interface" href="#Interface">14 GRUB's user interface</a> <ul> <li><a href="#Command_002dline-interface">14.1 The flexible command-line interface</a> <li><a href="#Menu-interface">14.2 The simple menu interface</a> <li><a href="#Menu-entry-editor">14.3 Editing a menu entry</a> </li></ul> <li><a name="toc_Environment" href="#Environment">15 GRUB environment variables</a> <ul> <li><a href="#Special-environment-variables">15.1 Special environment variables</a> <ul> <li><a href="#biosnum">15.1.1 biosnum</a> <li><a href="#check_005fsignatures">15.1.2 check_signatures</a> <li><a href="#chosen">15.1.3 chosen</a> <li><a href="#cmdpath">15.1.4 cmdpath</a> <li><a href="#color_005fhighlight">15.1.5 color_highlight</a> <li><a href="#color_005fnormal">15.1.6 color_normal</a> <li><a href="#debug">15.1.7 debug</a> <li><a href="#default">15.1.8 default</a> <li><a href="#fallback">15.1.9 fallback</a> <li><a href="#gfxmode">15.1.10 gfxmode</a> <li><a href="#gfxpayload">15.1.11 gfxpayload</a> <li><a href="#gfxterm_005ffont">15.1.12 gfxterm_font</a> <li><a href="#grub_005fcpu">15.1.13 grub_cpu</a> <li><a href="#grub_005fplatform">15.1.14 grub_platform</a> <li><a href="#icondir">15.1.15 icondir</a> <li><a href="#lang">15.1.16 lang</a> <li><a href="#locale_005fdir">15.1.17 locale_dir</a> <li><a href="#menu_005fcolor_005fhighlight">15.1.18 menu_color_highlight</a> <li><a href="#menu_005fcolor_005fnormal">15.1.19 menu_color_normal</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fboot_005ffile">15.1.20 net_<var><interface></var>_boot_file</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdhcp_005fserver_005fname">15.1.21 net_<var><interface></var>_dhcp_server_name</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdomain">15.1.22 net_<var><interface></var>_domain</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fextensionspath">15.1.23 net_<var><interface></var>_extensionspath</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fhostname">15.1.24 net_<var><interface></var>_hostname</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fip">15.1.25 net_<var><interface></var>_ip</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fmac">15.1.26 net_<var><interface></var>_mac</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005frootpath">15.1.27 net_<var><interface></var>_rootpath</a> <li><a href="#net_005fdefault_005finterface">15.1.28 net_default_interface</a> <li><a href="#net_005fdefault_005fip">15.1.29 net_default_ip</a> <li><a href="#net_005fdefault_005fmac">15.1.30 net_default_mac</a> <li><a href="#net_005fdefault_005fserver">15.1.31 net_default_server</a> <li><a href="#pager">15.1.32 pager</a> <li><a href="#prefix">15.1.33 prefix</a> <li><a href="#pxe_005fblksize">15.1.34 pxe_blksize</a> <li><a href="#pxe_005fdefault_005fgateway">15.1.35 pxe_default_gateway</a> <li><a href="#pxe_005fdefault_005fserver">15.1.36 pxe_default_server</a> <li><a href="#root">15.1.37 root</a> <li><a href="#superusers">15.1.38 superusers</a> <li><a href="#theme">15.1.39 theme</a> <li><a href="#timeout">15.1.40 timeout</a> <li><a href="#timeout_005fstyle">15.1.41 timeout_style</a> </li></ul> <li><a href="#Environment-block">15.2 The GRUB environment block</a> </li></ul> <li><a name="toc_Commands" href="#Commands">16 The list of available commands</a> <ul> <li><a href="#Menu_002dspecific-commands">16.1 The list of commands for the menu only</a> <ul> <li><a href="#menuentry">16.1.1 menuentry</a> <li><a href="#submenu">16.1.2 submenu</a> </li></ul> <li><a href="#General-commands">16.2 The list of general commands</a> <ul> <li><a href="#serial">16.2.1 serial</a> <li><a href="#terminal_005finput">16.2.2 terminal_input</a> <li><a href="#terminal_005foutput">16.2.3 terminal_output</a> <li><a href="#terminfo">16.2.4 terminfo</a> </li></ul> <li><a href="#Command_002dline-and-menu-entry-commands">16.3 The list of command-line and menu entry commands</a> <ul> <li><a href="#_005b">16.3.1 [</a> <li><a href="#acpi">16.3.2 acpi</a> <li><a href="#authenticate">16.3.3 authenticate</a> <li><a href="#background_005fcolor">16.3.4 background_color</a> <li><a href="#background_005fimage">16.3.5 background_image</a> <li><a href="#badram">16.3.6 badram</a> <li><a href="#blocklist">16.3.7 blocklist</a> <li><a href="#boot">16.3.8 boot</a> <li><a href="#cat">16.3.9 cat</a> <li><a href="#chainloader">16.3.10 chainloader</a> <li><a href="#clear">16.3.11 clear</a> <li><a href="#cmosclean">16.3.12 cmosclean</a> <li><a href="#cmosdump">16.3.13 cmosdump</a> <li><a href="#cmostest">16.3.14 cmostest</a> <li><a href="#cmp">16.3.15 cmp</a> <li><a href="#configfile">16.3.16 configfile</a> <li><a href="#cpuid">16.3.17 cpuid</a> <li><a href="#crc">16.3.18 crc</a> <li><a href="#cryptomount">16.3.19 cryptomount</a> <li><a href="#cutmem">16.3.20 cutmem</a> <li><a href="#date">16.3.21 date</a> <li><a href="#devicetree">16.3.22 devicetree</a> <li><a href="#distrust">16.3.23 distrust</a> <li><a href="#drivemap">16.3.24 drivemap</a> <li><a href="#echo">16.3.25 echo</a> <li><a href="#eval">16.3.26 eval</a> <li><a href="#export">16.3.27 export</a> <li><a href="#false">16.3.28 false</a> <li><a href="#gettext">16.3.29 gettext</a> <li><a href="#gptsync">16.3.30 gptsync</a> <li><a href="#halt">16.3.31 halt</a> <li><a href="#hashsum">16.3.32 hashsum</a> <li><a href="#help">16.3.33 help</a> <li><a href="#initrd">16.3.34 initrd</a> <li><a href="#initrd16">16.3.35 initrd16</a> <li><a href="#insmod">16.3.36 insmod</a> <li><a href="#keystatus">16.3.37 keystatus</a> <li><a href="#linux">16.3.38 linux</a> <li><a href="#linux16">16.3.39 linux16</a> <li><a href="#list_005fenv">16.3.40 list_env</a> <li><a href="#list_005ftrusted">16.3.41 list_trusted</a> <li><a href="#load_005fenv">16.3.42 load_env</a> <li><a href="#loadfont">16.3.43 loadfont</a> <li><a href="#loopback">16.3.44 loopback</a> <li><a href="#ls">16.3.45 ls</a> <li><a href="#lsfonts">16.3.46 lsfonts</a> <li><a href="#lsmod">16.3.47 lsmod</a> <li><a href="#md5sum">16.3.48 md5sum</a> <li><a href="#module">16.3.49 module</a> <li><a href="#multiboot">16.3.50 multiboot</a> <li><a href="#nativedisk">16.3.51 nativedisk</a> <li><a href="#normal">16.3.52 normal</a> <li><a href="#normal_005fexit">16.3.53 normal_exit</a> <li><a href="#parttool">16.3.54 parttool</a> <li><a href="#password">16.3.55 password</a> <li><a href="#password_005fpbkdf2">16.3.56 password_pbkdf2</a> <li><a href="#play">16.3.57 play</a> <li><a href="#probe">16.3.58 probe</a> <li><a href="#pxe_005funload">16.3.59 pxe_unload</a> <li><a href="#read">16.3.60 read</a> <li><a href="#reboot">16.3.61 reboot</a> <li><a href="#regexp">16.3.62 regexp</a> <li><a href="#rmmod">16.3.63 rmmod</a> <li><a href="#save_005fenv">16.3.64 save_env</a> <li><a href="#search">16.3.65 search</a> <li><a href="#sendkey">16.3.66 sendkey</a> <li><a href="#set">16.3.67 set</a> <li><a href="#sha1sum">16.3.68 sha1sum</a> <li><a href="#sha256sum">16.3.69 sha256sum</a> <li><a href="#sha512sum">16.3.70 sha512sum</a> <li><a href="#sleep">16.3.71 sleep</a> <li><a href="#source">16.3.72 source</a> <li><a href="#test">16.3.73 test</a> <li><a href="#true">16.3.74 true</a> <li><a href="#trust">16.3.75 trust</a> <li><a href="#unset">16.3.76 unset</a> <li><a href="#uppermem">16.3.77 uppermem</a> <li><a href="#verify_005fdetached">16.3.78 verify_detached</a> <li><a href="#videoinfo">16.3.79 videoinfo</a> </li></ul> <li><a href="#Networking-commands">16.4 The list of networking commands</a> <ul> <li><a href="#net_005fadd_005faddr">16.4.1 net_add_addr</a> <li><a href="#net_005fadd_005fdns">16.4.2 net_add_dns</a> <li><a href="#net_005fadd_005froute">16.4.3 net_add_route</a> <li><a href="#net_005fbootp">16.4.4 net_bootp</a> <li><a href="#net_005fbootp6">16.4.5 net_bootp6</a> <li><a href="#net_005fdel_005faddr">16.4.6 net_del_addr</a> <li><a href="#net_005fdel_005fdns">16.4.7 net_del_dns</a> <li><a href="#net_005fdel_005froute">16.4.8 net_del_route</a> <li><a href="#net_005fget_005fdhcp_005foption">16.4.9 net_get_dhcp_option</a> <li><a href="#net_005fipv6_005fautoconf">16.4.10 net_ipv6_autoconf</a> <li><a href="#net_005fls_005faddr">16.4.11 net_ls_addr</a> <li><a href="#net_005fls_005fcards">16.4.12 net_ls_cards</a> <li><a href="#net_005fls_005fdns">16.4.13 net_ls_dns</a> <li><a href="#net_005fls_005froutes">16.4.14 net_ls_routes</a> <li><a href="#net_005fnslookup">16.4.15 net_nslookup</a> </li></ul> </li></ul> <li><a name="toc_Internationalisation" href="#Internationalisation">17 Internationalisation</a> <ul> <li><a href="#Internationalisation">17.1 Charset</a> <li><a href="#Internationalisation">17.2 Filesystems</a> <li><a href="#Internationalisation">17.3 Output terminal</a> <li><a href="#Internationalisation">17.4 Input terminal</a> <li><a href="#Internationalisation">17.5 Gettext</a> <li><a href="#Internationalisation">17.6 Regexp</a> <li><a href="#Internationalisation">17.7 Other</a> </li></ul> <li><a name="toc_Security" href="#Security">18 Security</a> <ul> <li><a href="#Authentication-and-authorisation">18.1 Authentication and authorisation in GRUB</a> <li><a href="#Using-digital-signatures">18.2 Using digital signatures in GRUB</a> <li><a href="#Secure-Boot-Advanced-Targeting">18.3 Embedded information for generation number based revocation</a> <li><a href="#Lockdown">18.4 Lockdown when booting on a secure setup</a> </li></ul> <li><a name="toc_Platform-limitations" href="#Platform-limitations">19 Platform limitations</a> <li><a name="toc_Platform_002dspecific-operations" href="#Platform_002dspecific-operations">20 Outline</a> <li><a name="toc_Supported-kernels" href="#Supported-kernels">21 Supported boot targets</a> <ul> <li><a href="#Supported-kernels">21.1 Boot tests</a> </li></ul> <li><a name="toc_Troubleshooting" href="#Troubleshooting">22 Error messages produced by GRUB</a> <ul> <li><a href="#GRUB-only-offers-a-rescue-shell">22.1 GRUB only offers a rescue shell</a> </li></ul> <li><a name="toc_Invoking-grub_002dinstall" href="#Invoking-grub_002dinstall">23 Invoking grub-install</a> <li><a name="toc_Invoking-grub_002dmkconfig" href="#Invoking-grub_002dmkconfig">24 Invoking grub-mkconfig</a> <li><a name="toc_Invoking-grub_002dmkpasswd_002dpbkdf2" href="#Invoking-grub_002dmkpasswd_002dpbkdf2">25 Invoking grub-mkpasswd-pbkdf2</a> <li><a name="toc_Invoking-grub_002dmkrelpath" href="#Invoking-grub_002dmkrelpath">26 Invoking grub-mkrelpath</a> <li><a name="toc_Invoking-grub_002dmkrescue" href="#Invoking-grub_002dmkrescue">27 Invoking grub-mkrescue</a> <li><a name="toc_Invoking-grub_002dmount" href="#Invoking-grub_002dmount">28 Invoking grub-mount</a> <li><a name="toc_Invoking-grub_002dprobe" href="#Invoking-grub_002dprobe">29 Invoking grub-probe</a> <li><a name="toc_Invoking-grub_002dscript_002dcheck" href="#Invoking-grub_002dscript_002dcheck">30 Invoking grub-script-check</a> <li><a name="toc_Obtaining-and-Building-GRUB" href="#Obtaining-and-Building-GRUB">Appendix A How to obtain and build GRUB</a> <li><a name="toc_Reporting-bugs" href="#Reporting-bugs">Appendix B Reporting bugs</a> <li><a name="toc_Future" href="#Future">Appendix C Where GRUB will go</a> <li><a name="toc_Copying-This-Manual" href="#Copying-This-Manual">Appendix D Copying This Manual</a> <ul> <li><a href="#GNU-Free-Documentation-License">D.1 GNU Free Documentation License</a> <ul> <li><a href="#GNU-Free-Documentation-License">D.1.1 ADDENDUM: How to use this License for your documents</a> </li></ul> </li></ul> <li><a name="toc_Index" href="#Index">Index</a> </li></ul> </div> <div class="node"> <a name="Top"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Introduction">Introduction</a>, Up: <a rel="up" accesskey="u" href="#dir">(dir)</a> </div> <h2 class="unnumbered">GNU GRUB manual</h2> <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>This edition documents version 2.02~beta2. <p>This manual is for GNU GRUB (version 2.02~beta2, 28 October 2021). <p>Copyright © 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc. <blockquote> 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. </blockquote> <ul class="menu"> <li><a accesskey="1" href="#Introduction">Introduction</a>: Capturing the spirit of GRUB <li><a accesskey="2" href="#Naming-convention">Naming convention</a>: Names of your drives in GRUB <li><a accesskey="3" href="#OS_002dspecific-notes-about-grub-tools">OS-specific notes about grub tools</a> Some notes about OS-specific behaviour of GRUB tools <li><a accesskey="4" href="#Installation">Installation</a>: Installing GRUB on your drive <li><a accesskey="5" href="#Booting">Booting</a>: How to boot different operating systems <li><a accesskey="6" href="#Configuration">Configuration</a>: Writing your own configuration file <li><a accesskey="7" href="#Theme-file-format">Theme file format</a>: Format of GRUB theme files <li><a accesskey="8" href="#Network">Network</a>: Downloading OS images from a network <li><a accesskey="9" href="#Serial-terminal">Serial terminal</a>: Using GRUB via a serial line <li><a href="#Vendor-power_002don-keys">Vendor power-on keys</a>: Changing GRUB behaviour on vendor power-on keys <li><a href="#Images">Images</a>: GRUB image files <li><a href="#Core-image-size-limitation">Core image size limitation</a>: GRUB image files size limitations <li><a href="#Filesystem">Filesystem</a>: Filesystem syntax and semantics <li><a href="#Interface">Interface</a>: The menu and the command-line <li><a href="#Environment">Environment</a>: GRUB environment variables <li><a href="#Commands">Commands</a>: The list of available builtin commands <li><a href="#Internationalisation">Internationalisation</a>: Topics relating to language support <li><a href="#Security">Security</a>: Authentication, authorisation, and signatures <li><a href="#Platform-limitations">Platform limitations</a>: The list of platform-specific limitations <li><a href="#Platform_002dspecific-operations">Platform-specific operations</a>: Platform-specific operations <li><a href="#Supported-kernels">Supported kernels</a>: The list of supported kernels <li><a href="#Troubleshooting">Troubleshooting</a>: Error messages produced by GRUB <li><a href="#Invoking-grub_002dinstall">Invoking grub-install</a>: How to use the GRUB installer <li><a href="#Invoking-grub_002dmkconfig">Invoking grub-mkconfig</a>: Generate a GRUB configuration file <li><a href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub-mkpasswd-pbkdf2</a> Generate GRUB password hashes <li><a href="#Invoking-grub_002dmkrelpath">Invoking grub-mkrelpath</a>: Make system path relative to its root <li><a href="#Invoking-grub_002dmkrescue">Invoking grub-mkrescue</a>: Make a GRUB rescue image <li><a href="#Invoking-grub_002dmount">Invoking grub-mount</a>: Mount a file system using GRUB <li><a href="#Invoking-grub_002dprobe">Invoking grub-probe</a>: Probe device information for GRUB <li><a href="#Invoking-grub_002dscript_002dcheck">Invoking grub-script-check</a>: Check GRUB script file for syntax errors <li><a href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>: How to obtain and build GRUB <li><a href="#Reporting-bugs">Reporting bugs</a>: Where you should send a bug report <li><a href="#Future">Future</a>: Some future plans on GRUB <li><a href="#Copying-This-Manual">Copying This Manual</a>: Copying This Manual <li><a href="#Index">Index</a> </ul> <div class="node"> <a name="Introduction"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Naming-convention">Naming convention</a>, Previous: <a rel="previous" accesskey="p" href="#Top">Top</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">1 Introduction to GRUB</h2> <ul class="menu"> <li><a accesskey="1" href="#Overview">Overview</a>: What exactly GRUB is and how to use it <li><a accesskey="2" href="#History">History</a>: From maggot to house fly <li><a accesskey="3" href="#Changes-from-GRUB-Legacy">Changes from GRUB Legacy</a>: Differences from previous versions <li><a accesskey="4" href="#Features">Features</a>: GRUB features <li><a accesskey="5" href="#Role-of-a-boot-loader">Role of a boot loader</a>: The role of a boot loader </ul> <div class="node"> <a name="Overview"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#History">History</a>, Up: <a rel="up" accesskey="u" href="#Introduction">Introduction</a> </div> <h3 class="section">1.1 Overview</h3> <p>Briefly, a <dfn>boot loader</dfn> is the first software program that runs when a computer starts. It is responsible for loading and transferring control to an operating system <dfn>kernel</dfn> software (such as Linux or GNU Mach). The kernel, in turn, initializes the rest of the operating system (e.g. a GNU system). <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 rel="footnote" href="#fn-1" name="fnd-1"><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>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>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>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. <div class="node"> <a name="History"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Changes-from-GRUB-Legacy">Changes from GRUB Legacy</a>, Previous: <a rel="previous" accesskey="p" href="#Overview">Overview</a>, Up: <a rel="up" accesskey="u" href="#Introduction">Introduction</a> </div> <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="multiboot.html#Top">Multiboot Specification</a>), because they were determined not to add to the large number of mutually-incompatible PC boot methods. <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>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>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>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. <div class="node"> <a name="Changes-from-GRUB-Legacy"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Features">Features</a>, Previous: <a rel="previous" accesskey="p" href="#History">History</a>, Up: <a rel="up" accesskey="u" href="#Introduction">Introduction</a> </div> <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. <ul> <li>The configuration file has a new name (<samp><span class="file">grub.cfg</span></samp> rather than <samp><span class="file">menu.lst</span></samp> or <samp><span class="file">grub.conf</span></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><samp><span class="file">grub.cfg</span></samp> is typically automatically generated by <samp><span class="command">grub-mkconfig</span></samp> (see <a href="#Simple-configuration">Simple configuration</a>). This makes it easier to handle versioned kernel upgrades. <li>Partition numbers in GRUB device names now start at 1, not 0 (see <a href="#Naming-convention">Naming convention</a>). <li>The configuration file is now written in something closer to a full scripting language: variables, conditionals, and loops are available. <li>A small amount of persistent storage is available across reboots, using the <samp><span class="command">save_env</span></samp> and <samp><span class="command">load_env</span></samp> commands in GRUB and the <samp><span class="command">grub-editenv</span></samp> utility. This is not available in all configurations (see <a href="#Environment-block">Environment block</a>). <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>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>Many more file systems are supported, including but not limited to ext4, HFS+, and NTFS. <li>GRUB 2 can read files directly from LVM and RAID devices. <li>A graphical terminal and a graphical menu system are available. <li>GRUB 2's interface can be translated, including menu entry names. <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>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. </ul> <div class="node"> <a name="Features"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Role-of-a-boot-loader">Role of a boot loader</a>, Previous: <a rel="previous" accesskey="p" href="#Changes-from-GRUB-Legacy">Changes from GRUB Legacy</a>, Up: <a rel="up" accesskey="u" href="#Introduction">Introduction</a> </div> <h3 class="section">1.4 GRUB features</h3> <p>The primary requirement for GRUB is that it be compliant with the <dfn>Multiboot Specification</dfn>, which is described in <a href="multiboot.html#Top">Multiboot Specification</a>. <p>The other goals, listed in approximate order of importance, are: <ul> <li>Basic functions must be straightforward for end-users. <li>Rich functionality to support kernel experts and designers. <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. </ul> <p>Except for specific compatibility modes (chain-loading and the Linux <dfn>piggyback</dfn> 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>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): <dl> <dt>Recognize multiple executable formats<dd>Support many of the <dfn>a.out</dfn> variants plus <dfn>ELF</dfn>. Symbol tables are also loaded. <br><dt>Support non-Multiboot kernels<dd>Support many of the various free 32-bit kernels that lack Multiboot compliance (primarily FreeBSD, NetBSD<a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a>, OpenBSD, and Linux). Chain-loading of other boot loaders is also supported. <br><dt>Load multiples modules<dd>Fully support the Multiboot feature of loading multiple modules. <br><dt>Load a configuration file<dd>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>. <br><dt>Provide a menu interface<dd>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. <br><dt>Have a flexible command-line interface<dd>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>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">Bash</a>), with <TAB>-completion of commands, devices, partitions, and files in a directory depending on context. <br><dt>Support multiple filesystem types<dd>Support multiple filesystem types transparently, plus a useful explicit blocklist notation. The currently supported filesystem types are <dfn>Amiga Fast FileSystem (AFFS)</dfn>, <dfn>AtheOS fs</dfn>, <dfn>BeFS</dfn>, <dfn>BtrFS</dfn> (including raid0, raid1, raid10, gzip and lzo), <dfn>cpio</dfn> (little- and big-endian bin, odc and newc variants), <dfn>Linux ext2/ext3/ext4</dfn>, <dfn>DOS FAT12/FAT16/FAT32</dfn>, <dfn>exFAT</dfn>, <dfn>HFS</dfn>, <dfn>HFS+</dfn>, <dfn>ISO9660</dfn> (including Joliet, Rock-ridge and multi-chunk files), <dfn>JFS</dfn>, <dfn>Minix fs</dfn> (versions 1, 2 and 3), <dfn>nilfs2</dfn>, <dfn>NTFS</dfn> (including compression), <dfn>ReiserFS</dfn>, <dfn>ROMFS</dfn>, <dfn>Amiga Smart FileSystem (SFS)</dfn>, <dfn>Squash4</dfn>, <dfn>tar</dfn>, <dfn>UDF</dfn>, <dfn>BSD UFS/UFS2</dfn>, <dfn>XFS</dfn>, and <dfn>ZFS</dfn> (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. <br><dt>Support automatic decompression<dd>Can decompress files which were compressed by <samp><span class="command">gzip</span></samp> or <samp><span class="command">xz</span></samp><a rel="footnote" href="#fn-3" name="fnd-3"><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 rel="footnote" href="#fn-4" name="fnd-4"><sup>4</sup></a> <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. <br><dt>Access data on any installed device<dd>Support reading data from any or all floppies or hard disk(s) recognized by the BIOS, independent of the setting of the root device. <br><dt>Be independent of drive geometry translations<dd>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. <br><dt>Detect all installed <span class="sc">ram</span><dd>GRUB can generally find all the installed <span class="sc">ram</span> 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="multiboot.html#Top">Multiboot Specification</a>), not all kernels make use of this information, but GRUB provides it for those who do. <br><dt>Support Logical Block Address mode<dd>In traditional disk calls (called <dfn>CHS mode</dfn>), 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 (<dfn>LBA</dfn>) mode. GRUB automatically detects if LBA mode is available and uses it if available. In LBA mode, GRUB can access the entire disk. <br><dt>Support network booting<dd>GRUB is basically a disk-based boot loader but also has network support. You can load OS images from a network by using the <dfn>TFTP</dfn> protocol. <br><dt>Support remote terminals<dd>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. </dl> <div class="node"> <a name="Role-of-a-boot-loader"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Features">Features</a>, Up: <a rel="up" accesskey="u" href="#Introduction">Introduction</a> </div> <h3 class="section">1.5 The role of a boot loader</h3> <p>The following is a quotation from Gordon Matzigkeit, a GRUB fanatic: <blockquote> 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>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 rel="footnote" href="#fn-5" name="fnd-5"><sup>5</sup></a> or “GRUB” systems. <p>Unfortunately, nobody ever understood what I was talking about; now I just use the word “GNU” as a pseudonym for GRUB. <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<small class="dots">...</small> GRUB! </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. <div class="node"> <a name="Naming-convention"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#OS_002dspecific-notes-about-grub-tools">OS-specific notes about grub tools</a>, Previous: <a rel="previous" accesskey="p" href="#Introduction">Introduction</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>Look at the following examples and explanations: <pre class="example"> (fd0) </pre> <p>First of all, GRUB requires that the device name be enclosed with ‘<samp><span class="samp">(</span></samp>’ and ‘<samp><span class="samp">)</span></samp>’. The ‘<samp><span class="samp">fd</span></samp>’ part means that it is a floppy disk. The number ‘<samp><span class="samp">0</span></samp>’ is the drive number, which is counted from <em>zero</em>. This expression means that GRUB will use the whole floppy disk. <pre class="example"> (hd0,msdos2) </pre> <p>Here, ‘<samp><span class="samp">hd</span></samp>’ means it is a hard disk drive. The first integer ‘<samp><span class="samp">0</span></samp>’ indicates the drive number, that is, the first hard disk, the string ‘<samp><span class="samp">msdos</span></samp>’ indicates the partition scheme, while the second integer, ‘<samp><span class="samp">2</span></samp>’, indicates the partition number (or the <span class="sc">pc</span> 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. <pre class="example"> (hd0,msdos5) </pre> <p>This specifies the first <dfn>extended partition</dfn> of the first hard disk drive. Note that the partition numbers for extended partitions are counted from ‘<samp><span class="samp">5</span></samp>’, regardless of the actual number of primary partitions on your hard disk. <pre class="example"> (hd1,msdos1,bsd1) </pre> <p>This means the BSD ‘<samp><span class="samp">a</span></samp>’ partition on first <span class="sc">pc</span> slice number of the second hard disk. <p>Of course, to actually access the disks or partitions with GRUB, you need to use the device specification in a command, like ‘<samp><span class="samp">set root=(fd0)</span></samp>’ or ‘<samp><span class="samp">parttool (hd0,msdos3) hidden-</span></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 <pre class="example"> set root=( </pre> <p>followed by a <TAB>, 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>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>Now the question is, how to specify a file? Again, consider an example: <pre class="example"> (hd0,msdos1)/vmlinuz </pre> <p>This specifies the file named ‘<samp><span class="samp">vmlinuz</span></samp>’, found on the first partition of the first hard disk drive. Note that the argument completion works with file names, too. <p>That was easy, admit it. Now read the next chapter, to find out how to actually install GRUB on your drive. <div class="node"> <a name="OS-specific-notes-about-grub-tools"></a> <a name="OS_002dspecific-notes-about-grub-tools"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Installation">Installation</a>, Previous: <a rel="previous" accesskey="p" href="#Naming-convention">Naming convention</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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: <pre class="example"> # <kbd>grub-install /dev/sda</kbd> </pre> <p>On AROS we use another syntax. For volumes: <pre class="example"> //:<volume name> </pre> <p>E.g. <pre class="example"> //:DH0 </pre> <p>For disks we use syntax: <pre class="example"> //:<driver name>/unit/flags </pre> <p>E.g. <pre class="example"> # <kbd>grub-install //:ata.device/0/0</kbd> </pre> <p>On Windows we use UNC path. For volumes it's typically <pre class="example"> \\?\Volume{<GUID>} \\?\<drive letter>: </pre> <p>E.g. <pre class="example"> \\?\Volume{17f34d50-cf64-4b02-800e-51d79c3aa2ff} \\?\C: </pre> <p>For disks it's <pre class="example"> \\?\PhysicalDrive<number> </pre> <p>E.g. <pre class="example"> # <kbd>grub-install \\?\PhysicalDrive0</kbd> </pre> <p>Beware that you may need to further escape the backslashes depending on your shell. <p>When compiled with cygwin support then cygwin drive names are automatically when needed. E.g. <pre class="example"> # <kbd>grub-install /dev/sda</kbd> </pre> <div class="node"> <a name="Installation"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Booting">Booting</a>, Previous: <a rel="previous" accesskey="p" href="#OS_002dspecific-notes-about-grub-tools">OS-specific notes about grub tools</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>After you have done that, you need to install the boot loader on a drive (floppy or hard disk) by using the utility <samp><span class="command">grub-install</span></samp> (see <a href="#Invoking-grub_002dinstall">Invoking grub-install</a>) on a UNIX-like OS. <p>GRUB comes with boot images, which are normally put in the directory <samp><span class="file">/usr/lib/grub/<cpu>-<platform></span></samp> (for BIOS-based machines <samp><span class="file">/usr/lib/grub/i386-pc</span></samp>). Hereafter, the directory where GRUB images are initially placed (normally <samp><span class="file">/usr/lib/grub/<cpu>-<platform></span></samp>) will be called the <dfn>image directory</dfn>, and the directory where the boot loader needs to find them (usually <samp><span class="file">/boot</span></samp>) will be called the <dfn>boot directory</dfn>. <ul class="menu"> <li><a accesskey="1" href="#Installing-GRUB-using-grub_002dinstall">Installing GRUB using grub-install</a> <li><a accesskey="2" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a> <li><a accesskey="3" href="#Device-map">Device map</a> <li><a accesskey="4" href="#BIOS-installation">BIOS installation</a> </ul> <div class="node"> <a name="Installing-GRUB-using-grub-install"></a> <a name="Installing-GRUB-using-grub_002dinstall"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>, Up: <a rel="up" accesskey="u" href="#Installation">Installation</a> </div> <h3 class="section">4.1 Installing GRUB using grub-install</h3> <p>For information on where GRUB should be installed on PC BIOS platforms, see <a href="#BIOS-installation">BIOS installation</a>. <p>In order to install GRUB under a UNIX-like OS (such as <span class="sc">gnu</span>), invoke the program <samp><span class="command">grub-install</span></samp> (see <a href="#Invoking-grub_002dinstall">Invoking grub-install</a>) as the superuser (<dfn>root</dfn>). <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><span class="samp">/dev/hda</span></samp>’). For example, under Linux the following will install GRUB into the MBR of the first IDE disk: <pre class="example"> # <kbd>grub-install /dev/sda</kbd> </pre> <p>Likewise, under GNU/Hurd, this has the same effect: <pre class="example"> # <kbd>grub-install /dev/hd0</kbd> </pre> <p>But all the above examples assume that GRUB should put images under the <samp><span class="file">/boot</span></samp> directory. If you want GRUB to put images under a directory other than <samp><span class="file">/boot</span></samp>, you need to specify the option <samp><span class="option">--boot-directory</span></samp>. The typical usage is that you create a GRUB boot floppy with a filesystem. Here is an example: <pre class="example"> # <kbd>mke2fs /dev/fd0</kbd> # <kbd>mount -t ext2 /dev/fd0 /mnt</kbd> # <kbd>mkdir /mnt/boot</kbd> # <kbd>grub-install --boot-directory=/mnt/boot /dev/fd0</kbd> # <kbd>umount /mnt</kbd> </pre> <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: <pre class="example"> # <kbd>losetup /dev/loop0 /dev/sdb1</kbd> # <kbd>mount /dev/loop0 /mnt/usb</kbd> # <kbd>grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0</kbd> </pre> <p>This install doesn't conflict with standard install as long as they are in separate directories. <p>Note that <samp><span class="command">grub-install</span></samp> is actually just a shell script and the real task is done by other tools such as <samp><span class="command">grub-mkimage</span></samp>. Therefore, you may run those commands directly to install GRUB, without using <samp><span class="command">grub-install</span></samp>. Don't do that, however, unless you are very familiar with the internals of GRUB. Installing a boot loader on a running OS may be extremely dangerous. <p>On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at <samp><span class="file">/boot/efi</span></samp> then you don't need any special arguments: <pre class="example"> # <kbd>grub-install</kbd> </pre> <p>Otherwise you need to specify where your EFI System partition is mounted: <pre class="example"> # <kbd>grub-install --efi-directory=/mnt/efi</kbd> </pre> <p>For removable installs you have to use <samp><span class="option">--removable</span></samp> and specify both <samp><span class="option">--boot-directory</span></samp> and <samp><span class="option">--efi-directory</span></samp>: <pre class="example"> # <kbd>grub-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable</kbd> </pre> <div class="node"> <a name="Making-a-GRUB-bootable-CD-ROM"></a> <a name="Making-a-GRUB-bootable-CD_002dROM"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Device-map">Device map</a>, Previous: <a rel="previous" accesskey="p" href="#Installing-GRUB-using-grub_002dinstall">Installing GRUB using grub-install</a>, Up: <a rel="up" accesskey="u" href="#Installation">Installation</a> </div> <h3 class="section">4.2 Making a GRUB bootable CD-ROM</h3> <p>GRUB supports the <dfn>no emulation mode</dfn> in the El Torito specification<a rel="footnote" href="#fn-6" name="fnd-6"><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>For booting from a CD-ROM, GRUB uses a special image called <samp><span class="file">cdboot.img</span></samp>, which is concatenated with <samp><span class="file">core.img</span></samp>. The <samp><span class="file">core.img</span></samp> used for this should be built with at least the ‘<samp><span class="samp">iso9660</span></samp>’ and ‘<samp><span class="samp">biosdisk</span></samp>’ modules. Your bootable CD-ROM will usually also need to include a configuration file <samp><span class="file">grub.cfg</span></samp> and some other GRUB modules. <p>To make a simple generic GRUB rescue CD, you can use the <samp><span class="command">grub-mkrescue</span></samp> program (see <a href="#Invoking-grub_002dmkrescue">Invoking grub-mkrescue</a>): <pre class="example"> $ <kbd>grub-mkrescue -o grub.iso</kbd> </pre> <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><span class="samp">iso</span></samp>’: <pre class="example"> $ <kbd>mkdir iso</kbd> </pre> <p>Make a directory for GRUB: <pre class="example"> $ <kbd>mkdir -p iso/boot/grub</kbd> </pre> <p>If desired, make the config file <samp><span class="file">grub.cfg</span></samp> under <samp><span class="file">iso/boot/grub</span></samp> (see <a href="#Configuration">Configuration</a>), and copy any files and directories for the disc to the directory <samp><span class="file">iso/</span></samp>. <p>Finally, make the image: <pre class="example"> $ <kbd>grub-mkrescue -o grub.iso iso</kbd> </pre> <p>This produces a file named <samp><span class="file">grub.iso</span></samp>, which then can be burned into a CD (or a DVD), or written to a USB mass storage device. <p>The root device will be set up appropriately on entering your <samp><span class="file">grub.cfg</span></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. <div class="node"> <a name="Device-map"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#BIOS-installation">BIOS installation</a>, Previous: <a rel="previous" accesskey="p" href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>, Up: <a rel="up" accesskey="u" href="#Installation">Installation</a> </div> <h3 class="section">4.3 The map between BIOS drives and OS devices</h3> <p>If the device map file exists, the GRUB utilities (<samp><span class="command">grub-probe</span></samp>, etc.) read it to map BIOS drives to OS devices. This file consists of lines like this: <pre class="example"> (<var>device</var>) <var>file</var> </pre> <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>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>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><span class="file">/dev/hd*</span></samp> versus <samp><span class="file">/dev/sd*</span></samp>) may change depending on the driver subsystem in use. As a result, the device map file required frequent editing on some systems. <p>GRUB avoids this problem nowadays by using UUIDs or file system labels when generating <samp><span class="file">grub.cfg</span></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>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><span class="samp">#</span></samp>’. <div class="node"> <a name="BIOS-installation"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Device-map">Device map</a>, Up: <a rel="up" accesskey="u" href="#Installation">Installation</a> </div> <h3 class="section">4.4 BIOS installation</h3> <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>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><span class="file">/boot</span></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>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. <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>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: <pre class="example"> # <kbd>parted /dev/</kbd><var>disk</var><kbd> set </kbd><var>partition-number</var><kbd> bios_grub on</kbd> </pre> <p>If you are using gdisk, set the partition type to ‘<samp><span class="samp">0xEF02</span></samp>’. With partitioning programs that require setting the GUID directly, it should be ‘<samp><span class="samp">21686148-6449-6e6f-744e656564454649</span></samp>’. <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. <div class="node"> <a name="Booting"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Configuration">Configuration</a>, Previous: <a rel="previous" accesskey="p" href="#Installation">Installation</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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. <ul class="menu"> <li><a accesskey="1" href="#General-boot-methods">General boot methods</a>: How to boot OSes with GRUB generally <li><a accesskey="2" href="#Loopback-booting">Loopback booting</a>: Notes on booting from loopbacks <li><a accesskey="3" href="#OS_002dspecific-notes">OS-specific notes</a>: Notes on some operating systems </ul> <div class="node"> <a name="General-boot-methods"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Loopback-booting">Loopback booting</a>, Up: <a rel="up" accesskey="u" href="#Booting">Booting</a> </div> <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. <ul class="menu"> <li><a accesskey="1" href="#Loading-an-operating-system-directly">Loading an operating system directly</a> <li><a accesskey="2" href="#Chain_002dloading">Chain-loading</a> </ul> <div class="node"> <a name="Loading-an-operating-system-directly"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Chain_002dloading">Chain-loading</a>, Up: <a rel="up" accesskey="u" href="#General-boot-methods">General boot methods</a> </div> <h4 class="subsection">5.1.1 How to boot an OS directly with GRUB</h4> <p>Multiboot (see <a href="multiboot.html#Top">Multiboot Specification</a>) 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>FIXME: this section is incomplete. <ol type=1 start=1> <li>Run the command <samp><span class="command">boot</span></samp> (see <a href="#boot">boot</a>). </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. <div class="node"> <a name="Chain-loading"></a> <a name="Chain_002dloading"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Loading-an-operating-system-directly">Loading an operating system directly</a>, Up: <a rel="up" accesskey="u" href="#General-boot-methods">General boot methods</a> </div> <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>The <samp><span class="command">chainloader</span></samp> 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: <pre class="verbatim">menuentry "Windows" { insmod chain insmod ntfs set root=(hd0,1) chainloader +1 } </pre> <!-- FIXME: document UUIDs. --> <p>On systems with multiple hard disks, an additional workaround may be required. See <a href="#DOS_002fWindows">DOS/Windows</a>. <p>Chain-loading is only supported on PC BIOS and EFI platforms. <div class="node"> <a name="Loopback-booting"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#OS_002dspecific-notes">OS-specific notes</a>, Previous: <a rel="previous" accesskey="p" href="#General-boot-methods">General boot methods</a>, Up: <a rel="up" accesskey="u" href="#Booting">Booting</a> </div> <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 <samp><span class="command">kfreebsd_module</span></samp>, <samp><span class="command">knetbsd_module_elf</span></samp>, <samp><span class="command">kopenbsd_ramdisk</span></samp>, <samp><span class="command">initrd</span></samp> (see <a href="#initrd">initrd</a>), <samp><span class="command">initrd16</span></samp> (see <a href="#initrd">initrd</a>), <samp><span class="command">multiboot_module</span></samp>, <samp><span class="command">multiboot2_module</span></samp> or <samp><span class="command">xnu_ramdisk</span></samp> 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 <div class="node"> <a name="OS-specific-notes"></a> <a name="OS_002dspecific-notes"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Loopback-booting">Loopback booting</a>, Up: <a rel="up" accesskey="u" href="#Booting">Booting</a> </div> <h3 class="section">5.3 Some caveats on OS-specific issues</h3> <p>Here, we describe some caveats on several operating systems. <ul class="menu"> <li><a accesskey="1" href="#GNU_002fHurd">GNU/Hurd</a> <li><a accesskey="2" href="#GNU_002fLinux">GNU/Linux</a> <li><a accesskey="3" href="#NetBSD">NetBSD</a> <li><a accesskey="4" href="#DOS_002fWindows">DOS/Windows</a> </ul> <div class="node"> <a name="GNU%2fHurd"></a> <a name="GNU_002fHurd"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#GNU_002fLinux">GNU/Linux</a>, Up: <a rel="up" accesskey="u" href="#OS_002dspecific-notes">OS-specific notes</a> </div> <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. <ol type=1 start=1> <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>Load the kernel and the modules, like this: <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> <li>Finally, run the command <samp><span class="command">boot</span></samp> (see <a href="#boot">boot</a>). </ol> <div class="node"> <a name="GNU%2fLinux"></a> <a name="GNU_002fLinux"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#NetBSD">NetBSD</a>, Previous: <a rel="previous" accesskey="p" href="#GNU_002fHurd">GNU/Hurd</a>, Up: <a rel="up" accesskey="u" href="#OS_002dspecific-notes">OS-specific notes</a> </div> <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. <ol type=1 start=1> <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>Load the kernel using the command <samp><span class="command">linux</span></samp> (see <a href="#linux">linux</a>): <pre class="example"> grub> <kbd>linux /vmlinuz root=/dev/sda1</kbd> </pre> <p>If you need to specify some kernel parameters, just append them to the command. For example, to set <samp><span class="option">acpi</span></samp> to ‘<samp><span class="samp">off</span></samp>’, do this: <pre class="example"> grub> <kbd>linux /vmlinuz root=/dev/sda1 acpi=off</kbd> </pre> <p>See the documentation in the Linux source tree for complete information on the available options. <p>With <samp><span class="command">linux</span></samp> 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 <samp><span class="command">linux16</span></samp> <pre class="example"> grub> <kbd>linux16 /vmlinuz root=/dev/sda1 acpi=off</kbd> </pre> <li>If you use an initrd, execute the command <samp><span class="command">initrd</span></samp> (see <a href="#initrd">initrd</a>) after <samp><span class="command">linux</span></samp>: <pre class="example"> grub> <kbd>initrd /initrd</kbd> </pre> <p>If you used <samp><span class="command">linux16</span></samp> you need to use <samp><span class="command">initrd16</span></samp>: <pre class="example"> grub> <kbd>initrd16 /initrd</kbd> </pre> <li>Finally, run the command <samp><span class="command">boot</span></samp> (see <a href="#boot">boot</a>). </ol> <p><strong>Caution:</strong> If you use an initrd and specify the ‘<samp><span class="samp">mem=</span></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 <samp><span class="command">uppermem</span></samp> <em>before</em> loading the kernel. See <a href="#uppermem">uppermem</a>, for more information. <div class="node"> <a name="NetBSD"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#DOS_002fWindows">DOS/Windows</a>, Previous: <a rel="previous" accesskey="p" href="#GNU_002fLinux">GNU/Linux</a>, Up: <a rel="up" accesskey="u" href="#OS_002dspecific-notes">OS-specific notes</a> </div> <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 <samp><span class="command">boot</span></samp>. <ol type=1 start=1> <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: <pre class="example"> grub> <kbd>insmod part_bsd</kbd> grub> <kbd>set root=(hd0,netbsd1)</kbd> </pre> <p>For a disk with a GUID Partition Table (GPT), and assuming that the NetBSD root partition is the third GPT partition, do this: <pre class="example"> grub> <kbd>insmod part_gpt</kbd> grub> <kbd>set root=(hd0,gpt3)</kbd> </pre> <li>Load the kernel using the command <samp><span class="command">knetbsd</span></samp>: <pre class="example"> grub> <kbd>knetbsd /netbsd</kbd> </pre> <p>Various options may be given to <samp><span class="command">knetbsd</span></samp>. 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: <pre class="example"> grub> <kbd>knetbsd /netbsd -s -v</kbd> </pre> <li>If needed, load kernel modules with the command <samp><span class="command">knetbsd_module_elf</span></samp>. A typical example is the module for the root file system: <pre class="example"> grub> <kbd>knetbsd_module_elf /stand/amd64/6.0/modules/ffs/ffs.kmod</kbd> </pre> <li>Finally, run the command <samp><span class="command">boot</span></samp> (see <a href="#boot">boot</a>). </ol> <div class="node"> <a name="DOS%2fWindows"></a> <a name="DOS_002fWindows"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#NetBSD">NetBSD</a>, Up: <a rel="up" accesskey="u" href="#OS_002dspecific-notes">OS-specific notes</a> </div> <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>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 <samp><span class="command">drivemap</span></samp> (see <a href="#drivemap">drivemap</a>), like this: <pre class="example"> drivemap -s (hd0) (hd1) </pre> <p>This performs a <dfn>virtual</dfn> swap between your first and second hard drive. <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>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>If GRUB <dfn>hides</dfn> a DOS (or Windows) partition (see <a href="#parttool">parttool</a>), DOS (or Windows) will ignore the partition. If GRUB <dfn>unhides</dfn> 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: <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 class="node"> <a name="Configuration"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Theme-file-format">Theme file format</a>, Previous: <a rel="previous" accesskey="p" href="#Booting">Booting</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">6 Writing your own configuration file</h2> <p>GRUB is configured using <samp><span class="file">grub.cfg</span></samp>, usually located under <samp><span class="file">/boot/grub</span></samp>. This file is quite flexible, but most users will not need to write the whole thing by hand. <ul class="menu"> <li><a accesskey="1" href="#Simple-configuration">Simple configuration</a>: Recommended for most users <li><a accesskey="2" href="#Shell_002dlike-scripting">Shell-like scripting</a>: For power users and developers <li><a accesskey="3" href="#Multi_002dboot-manual-config">Multi-boot manual config</a>: For non-standard multi-OS scenarios <li><a accesskey="4" href="#Embedded-configuration">Embedded configuration</a>: Embedding a configuration file into GRUB </ul> <div class="node"> <a name="Simple-configuration"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Shell_002dlike-scripting">Shell-like scripting</a>, Up: <a rel="up" accesskey="u" href="#Configuration">Configuration</a> </div> <h3 class="section">6.1 Simple configuration handling</h3> <p>The program <samp><span class="command">grub-mkconfig</span></samp> (see <a href="#Invoking-grub_002dmkconfig">Invoking grub-mkconfig</a>) generates <samp><span class="file">grub.cfg</span></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><samp><span class="command">grub-mkconfig</span></samp> does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing <samp><span class="file">/etc/grub.d/40_custom</span></samp> or creating <samp><span class="file">/boot/grub/custom.cfg</span></samp>, changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in <samp><span class="file">/etc/grub.d/</span></samp>. This may be improved in the future. In the meantime, those who feel that it would be easier to write <samp><span class="file">grub.cfg</span></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 <samp><span class="command">grub-mkconfig</span></samp>. <p>The file <samp><span class="file">/etc/default/grub</span></samp> controls the operation of <samp><span class="command">grub-mkconfig</span></samp>. It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ‘<samp><span class="samp">KEY=value</span></samp>’ lines, but if the value contains spaces or other special characters then it must be quoted. For example: <pre class="example"> GRUB_TERMINAL_INPUT="console serial" </pre> <p>Valid keys in <samp><span class="file">/etc/default/grub</span></samp> are as follows: <dl> <dt>‘<samp><span class="samp">GRUB_DEFAULT</span></samp>’<dd>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><span class="samp">saved</span></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>For example, if you have: <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: <pre class="example"> GRUB_DEFAULT=example-gnu-linux </pre> <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>If you set this to ‘<samp><span class="samp">saved</span></samp>’, then the default menu entry will be that saved by ‘<samp><span class="samp">GRUB_SAVEDEFAULT</span></samp>’ or <samp><span class="command">grub-set-default</span></samp>. This relies on the environment block, which may not be available in all situations (see <a href="#Environment-block">Environment block</a>). <p>The default is ‘<samp><span class="samp">0</span></samp>’. <br><dt>‘<samp><span class="samp">GRUB_SAVEDEFAULT</span></samp>’<dd>If this option is set to ‘<samp><span class="samp">true</span></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><span class="samp">GRUB_DEFAULT=saved</span></samp>’; it is a separate option because ‘<samp><span class="samp">GRUB_DEFAULT=saved</span></samp>’ is useful without this option, in conjunction with <samp><span class="command">grub-set-default</span></samp>. 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>). <br><dt>‘<samp><span class="samp">GRUB_TIMEOUT</span></samp>’<dd>Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is ‘<samp><span class="samp">5</span></samp>’. Set to ‘<samp><span class="samp">0</span></samp>’ to boot immediately without displaying the menu, or to ‘<samp><span class="samp">-1</span></samp>’ to wait indefinitely. <p>If ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE</span></samp>’ is set to ‘<samp><span class="samp">countdown</span></samp>’ or ‘<samp><span class="samp">hidden</span></samp>’, the timeout is instead counted before the menu is displayed. <br><dt>‘<samp><span class="samp">GRUB_TIMEOUT_STYLE</span></samp>’<dd>If this option is unset or set to ‘<samp><span class="samp">menu</span></samp>’, then GRUB will display the menu and then wait for the timeout set by ‘<samp><span class="samp">GRUB_TIMEOUT</span></samp>’ to expire before booting the default entry. Pressing a key interrupts the timeout. <p>If this option is set to ‘<samp><span class="samp">countdown</span></samp>’ or ‘<samp><span class="samp">hidden</span></samp>’, then, before displaying the menu, GRUB will wait for the timeout set by ‘<samp><span class="samp">GRUB_TIMEOUT</span></samp>’ to expire. If <ESC> 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><span class="samp">countdown</span></samp>’ case, it will show a one-line indication of the remaining time. <br><dt>‘<samp><span class="samp">GRUB_DEFAULT_BUTTON</span></samp>’<dt>‘<samp><span class="samp">GRUB_TIMEOUT_BUTTON</span></samp>’<dt>‘<samp><span class="samp">GRUB_TIMEOUT_STYLE_BUTTON</span></samp>’<dt>‘<samp><span class="samp">GRUB_BUTTON_CMOS_ADDRESS</span></samp>’<dd>Variants of the corresponding variables without the ‘<samp><span class="samp">_BUTTON</span></samp>’ suffix, used to support vendor-specific power buttons. See <a href="#Vendor-power_002don-keys">Vendor power-on keys</a>. <br><dt>‘<samp><span class="samp">GRUB_DISTRIBUTOR</span></samp>’<dd>Set by distributors of GRUB to their identifying name. This is used to generate more informative menu entry titles. <br><dt>‘<samp><span class="samp">GRUB_TERMINAL_INPUT</span></samp>’<dd>Select the terminal input device. You may select multiple devices here, separated by spaces. <p>Valid terminal input names depend on the platform, but may include ‘<samp><span class="samp">console</span></samp>’ (native platform console), ‘<samp><span class="samp">serial</span></samp>’ (serial terminal), ‘<samp><span class="samp">serial_<port></span></samp>’ (serial terminal with explicit port selection), ‘<samp><span class="samp">at_keyboard</span></samp>’ (PC AT keyboard), or ‘<samp><span class="samp">usb_keyboard</span></samp>’ (USB keyboard using the HID Boot Protocol, for cases where the firmware does not handle this). <p>The default is to use the platform's native terminal input. <br><dt>‘<samp><span class="samp">GRUB_TERMINAL_OUTPUT</span></samp>’<dd>Select the terminal output device. You may select multiple devices here, separated by spaces. <p>Valid terminal output names depend on the platform, but may include ‘<samp><span class="samp">console</span></samp>’ (native platform console), ‘<samp><span class="samp">serial</span></samp>’ (serial terminal), ‘<samp><span class="samp">serial_<port></span></samp>’ (serial terminal with explicit port selection), ‘<samp><span class="samp">gfxterm</span></samp>’ (graphics-mode output), ‘<samp><span class="samp">vga_text</span></samp>’ (VGA text output), ‘<samp><span class="samp">mda_text</span></samp>’ (MDA text output), ‘<samp><span class="samp">morse</span></samp>’ (Morse-coding using system beeper) or ‘<samp><span class="samp">spkmodem</span></samp>’ (simple data protocol using system speaker). <p>‘<samp><span class="samp">spkmodem</span></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><span class="samp">spkmodem-recv</span></samp>’ from ‘<samp><span class="samp">util/spkmodem-recv.c</span></samp>’ and run: <pre class="example"> parecord --channels=1 --rate=48000 --format=s16le | ./spkmodem-recv </pre> <p>The default is to use the platform's native terminal output. <br><dt>‘<samp><span class="samp">GRUB_TERMINAL</span></samp>’<dd>If this option is set, it overrides both ‘<samp><span class="samp">GRUB_TERMINAL_INPUT</span></samp>’ and ‘<samp><span class="samp">GRUB_TERMINAL_OUTPUT</span></samp>’ to the same value. <br><dt>‘<samp><span class="samp">GRUB_SERIAL_COMMAND</span></samp>’<dd>A command to configure the serial port when using the serial console. See <a href="#serial">serial</a>. Defaults to ‘<samp><span class="samp">serial</span></samp>’. <br><dt>‘<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>’<dd>Command-line arguments to add to menu entries for the Linux kernel. <br><dt>‘<samp><span class="samp">GRUB_CMDLINE_LINUX_DEFAULT</span></samp>’<dd>Unless ‘<samp><span class="samp">GRUB_DISABLE_RECOVERY</span></samp>’ is set to ‘<samp><span class="samp">true</span></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><span class="samp">GRUB_CMDLINE_LINUX</span></samp>’. <br><dt>‘<samp><span class="samp">GRUB_CMDLINE_NETBSD</span></samp>’<dt>‘<samp><span class="samp">GRUB_CMDLINE_NETBSD_DEFAULT</span></samp>’<dd>As ‘<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>’ and ‘<samp><span class="samp">GRUB_CMDLINE_LINUX_DEFAULT</span></samp>’, but for NetBSD. <br><dt>‘<samp><span class="samp">GRUB_CMDLINE_GNUMACH</span></samp>’<dd>As ‘<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>’, but for GNU Mach. <br><dt>‘<samp><span class="samp">GRUB_CMDLINE_XEN</span></samp>’<dt>‘<samp><span class="samp">GRUB_CMDLINE_XEN_DEFAULT</span></samp>’<dd>The values of these options are passed to Xen hypervisor Xen menu entries, for all respectively normal entries. <br><dt>‘<samp><span class="samp">GRUB_CMDLINE_LINUX_XEN_REPLACE</span></samp>’<br><dt>‘<samp><span class="samp">GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT</span></samp>’<dd>The values of these options replace the values of ‘<samp><span class="samp">GRUB_CMDLINE_LINUX</span></samp>’ and ‘<samp><span class="samp">GRUB_CMDLINE_LINUX_DEFAULT</span></samp>’ for Linux and Xen menu entries. <br><dt>‘<samp><span class="samp">GRUB_DISABLE_LINUX_UUID</span></samp>’<dd>Normally, <samp><span class="command">grub-mkconfig</span></samp> will generate menu entries that use universally-unique identifiers (UUIDs) to identify the root filesystem to the Linux kernel, using a ‘<samp><span class="samp">root=UUID=...</span></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><span class="samp">true</span></samp>’. <br><dt>‘<samp><span class="samp">GRUB_DISABLE_RECOVERY</span></samp>’<dd>If this option is set to ‘<samp><span class="samp">true</span></samp>’, disable the generation of recovery mode menu entries. <br><dt>‘<samp><span class="samp">GRUB_DISABLE_UUID</span></samp>’<dd>Normally, <samp><span class="command">grub-mkconfig</span></samp> 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><span class="samp">true</span></samp>’. <br><dt>‘<samp><span class="samp">GRUB_VIDEO_BACKEND</span></samp>’<dd>If graphical video support is required, either because the ‘<samp><span class="samp">gfxterm</span></samp>’ graphical terminal is in use or because ‘<samp><span class="samp">GRUB_GFXPAYLOAD_LINUX</span></samp>’ is set, then <samp><span class="command">grub-mkconfig</span></samp> 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>After <samp><span class="command">grub-install</span></samp> has been run, the available video drivers are listed in <samp><span class="file">/boot/grub/video.lst</span></samp>. <br><dt>‘<samp><span class="samp">GRUB_GFXMODE</span></samp>’<dd>Set the resolution used on the ‘<samp><span class="samp">gfxterm</span></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><span class="samp">auto</span></samp>’, which tries to select a preferred resolution. See <a href="#gfxmode">gfxmode</a>. <br><dt>‘<samp><span class="samp">GRUB_BACKGROUND</span></samp>’<dd>Set a background image for use with the ‘<samp><span class="samp">gfxterm</span></samp>’ graphical terminal. The value of this option must be a file readable by GRUB at boot time, and it must end with <samp><span class="file">.png</span></samp>, <samp><span class="file">.tga</span></samp>, <samp><span class="file">.jpg</span></samp>, or <samp><span class="file">.jpeg</span></samp>. The image will be scaled if necessary to fit the screen. <br><dt>‘<samp><span class="samp">GRUB_THEME</span></samp>’<dd>Set a theme for use with the ‘<samp><span class="samp">gfxterm</span></samp>’ graphical terminal. <br><dt>‘<samp><span class="samp">GRUB_GFXPAYLOAD_LINUX</span></samp>’<dd>Set to ‘<samp><span class="samp">text</span></samp>’ to force the Linux kernel to boot in normal text mode, ‘<samp><span class="samp">keep</span></samp>’ to preserve the graphics mode set using ‘<samp><span class="samp">GRUB_GFXMODE</span></samp>’, ‘<samp><var>width</var><span class="samp">x</span><var>height</var></samp>’[‘<samp><span class="samp">x</span><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>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><span class="samp">text</span></samp>’ and GRUB will tell Linux to boot in normal text mode. <br><dt>‘<samp><span class="samp">GRUB_DISABLE_OS_PROBER</span></samp>’<dd>Normally, <samp><span class="command">grub-mkconfig</span></samp> will try to use the external <samp><span class="command">os-prober</span></samp> 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><span class="samp">true</span></samp>’ to disable this. <br><dt>‘<samp><span class="samp">GRUB_OS_PROBER_SKIP_LIST</span></samp>’<dd>List of space-separated FS UUIDs of filesystems to be ignored from os-prober output. For efi chainloaders it's <UUID>@<EFI FILE> <br><dt>‘<samp><span class="samp">GRUB_DISABLE_SUBMENU</span></samp>’<dd>Normally, <samp><span class="command">grub-mkconfig</span></samp> 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 <samp><span class="command">os-prober</span></samp> first entry will be put on top level and all others in submenu. If this option is set to ‘<samp><span class="samp">y</span></samp>’, flat menu with all entries on top level will be generated instead. Changing this option will require changing existing values of ‘<samp><span class="samp">GRUB_DEFAULT</span></samp>’, ‘<samp><span class="samp">fallback</span></samp>’ (see <a href="#fallback">fallback</a>) and ‘<samp><span class="samp">default</span></samp>’ (see <a href="#default">default</a>) environment variables as well as saved default entry using <samp><span class="command">grub-set-default</span></samp> and value used with <samp><span class="command">grub-reboot</span></samp>. <br><dt>‘<samp><span class="samp">GRUB_ENABLE_CRYPTODISK</span></samp>’<dd>If set to ‘<samp><span class="samp">y</span></samp>’, <samp><span class="command">grub-mkconfig</span></samp> and <samp><span class="command">grub-install</span></samp> 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. <br><dt>‘<samp><span class="samp">GRUB_INIT_TUNE</span></samp>’<dd>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>. <br><dt>‘<samp><span class="samp">GRUB_BADRAM</span></samp>’<dd>If this option is set, GRUB will issue a <a href="#badram">badram</a> command to filter out specified regions of RAM. <br><dt>‘<samp><span class="samp">GRUB_PRELOAD_MODULES</span></samp>’<dd>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><span class="file">grub.cfg</span></samp>. </dl> <p>The following options are still accepted for compatibility with existing configurations, but have better replacements: <dl> <dt>‘<samp><span class="samp">GRUB_HIDDEN_TIMEOUT</span></samp>’<dd>Wait this many seconds before displaying the menu. If <ESC> is pressed during that time, display the menu and wait for input according to ‘<samp><span class="samp">GRUB_TIMEOUT</span></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><span class="samp">GRUB_TIMEOUT</span></samp>’ before booting the default entry. <p>If you set ‘<samp><span class="samp">GRUB_HIDDEN_TIMEOUT</span></samp>’, you should also set ‘<samp><span class="samp">GRUB_TIMEOUT=0</span></samp>’ so that the menu is not displayed at all unless <ESC> is pressed. <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE=countdown</span></samp>’ or ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE=hidden</span></samp>’. <br><dt>‘<samp><span class="samp">GRUB_HIDDEN_TIMEOUT_QUIET</span></samp>’<dd>In conjunction with ‘<samp><span class="samp">GRUB_HIDDEN_TIMEOUT</span></samp>’, set this to ‘<samp><span class="samp">true</span></samp>’ to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu. <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE=countdown</span></samp>’. <br><dt>‘<samp><span class="samp">GRUB_HIDDEN_TIMEOUT_BUTTON</span></samp>’<dd>Variant of ‘<samp><span class="samp">GRUB_HIDDEN_TIMEOUT</span></samp>’, used to support vendor-specific power buttons. See <a href="#Vendor-power_002don-keys">Vendor power-on keys</a>. <p>This option is unset by default, and is deprecated in favour of the less confusing ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE=countdown</span></samp>’ or ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE=hidden</span></samp>’. </dl> <p>For more detailed customisation of <samp><span class="command">grub-mkconfig</span></samp>'s output, you may edit the scripts in <samp><span class="file">/etc/grub.d</span></samp> directly. <samp><span class="file">/etc/grub.d/40_custom</span></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. <div class="node"> <a name="Shell-like-scripting"></a> <a name="Shell_002dlike-scripting"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Multi_002dboot-manual-config">Multi-boot manual config</a>, Previous: <a rel="previous" accesskey="p" href="#Simple-configuration">Simple configuration</a>, Up: <a rel="up" accesskey="u" href="#Configuration">Configuration</a> </div> <h3 class="section">6.2 Writing full configuration files directly</h3> <!-- Some of this section is derived from the GNU Bash manual page, also --> <!-- copyrighted by the FSF. --> <p><samp><span class="file">grub.cfg</span></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. <h3 class="heading">Words</h3> <p>A <dfn>word</dfn> is a sequence of characters considered as a single unit by GRUB. Words are separated by <dfn>metacharacters</dfn>, which are the following plus space, tab, and newline: <pre class="example"> { } | & $ ; < > </pre> <p>Quoting may be used to include metacharacters in words; see below. <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: <pre class="example"> ! [[ ]] { } case do done elif else esac fi for function if in menuentry select then time until while </pre> <p>Not all of these reserved words have a useful purpose yet; some are reserved for future expansion. <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>There are three quoting mechanisms: the escape character, single quotes, and double quotes. <p>A non-quoted backslash (\) is the <dfn>escape character</dfn>. It preserves the literal value of the next character that follows, with the exception of newline. <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>Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of ‘<samp><span class="samp">$</span></samp>’ and ‘<samp><span class="samp">\</span></samp>’. The ‘<samp><span class="samp">$</span></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><span class="samp">$</span></samp>’, ‘<samp><span class="samp">"</span></samp>’, ‘<samp><span class="samp">\</span></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 rel="footnote" href="#fn-7" name="fnd-7"><sup>7</sup></a>). A double quote may be quoted within double quotes by preceding it with a backslash. <h3 class="heading">Variable expansion</h3> <p>The ‘<samp><span class="samp">$</span></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>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>Positional variable names consist of one or more digits. They represent parameters passed to function calls, with ‘<samp><span class="samp">$1</span></samp>’ representing the first parameter, and so on. <p>The special variable name ‘<samp><span class="samp">?</span></samp>’ expands to the exit status of the most recently executed command. When positional variable names are active, other special variable names ‘<samp><span class="samp">@</span></samp>’, ‘<samp><span class="samp">*</span></samp>’ and ‘<samp><span class="samp">#</span></samp>’ are defined and they expand to all positional parameters with necessary quoting, positional parameters without any quoting, and positional parameter count respectively. <h3 class="heading">Comments</h3> <p>A word beginning with ‘<samp><span class="samp">#</span></samp>’ causes that word and all remaining characters on that line to be ignored. <h3 class="heading">Simple commands</h3> <p>A <dfn>simple command</dfn> 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>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. <h3 class="heading">Compound commands</h3> <p>A <dfn>compound command</dfn> is one of the following: <dl> <dt>for <var>name</var> in <var>word</var> <small class="dots">...</small>; do <var>list</var>; done<dd>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. <br><dt>if <var>list</var>; then <var>list</var>; [elif <var>list</var>; then <var>list</var>;] <small class="dots">...</small> [else <var>list</var>;] fi<dd>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. <br><dt>while <var>cond</var>; do <var>list</var>; done<dt>until <var>cond</var>; do <var>list</var>; done<dd>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. <br><dt>function <var>name</var> { <var>command</var>; <small class="dots">...</small> }<dd>This defines a function named <var>name</var>. The <dfn>body</dfn> 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. <br><dt>menuentry <var>title</var> [<samp><span class="option">--class=class</span></samp> <small class="dots">...</small>] [<samp><span class="option">--users=users</span></samp>] [<samp><span class="option">--unrestricted</span></samp>] [<samp><span class="option">--hotkey=key</span></samp>] [<samp><span class="option">--id=id</span></samp>] { <var>command</var>; <small class="dots">...</small> }<dd>See <a href="#menuentry">menuentry</a>. </dl> <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. <dl> <dt>break [<code>n</code>]<dd>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. <br><dt>continue [<code>n</code>]<dd>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 <dfn>top-level</dfn> loop) is resumed. The return value is 0 unless <code>n</code> is not greater than or equal to 1. <br><dt>return [<code>n</code>]<dd>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. <br><dt>setparams [<code>arg</code>] <small class="dots">...</small><dd>Replace positional parameters starting with <code>$1</code> with arguments to <samp><span class="command">setparams</span></samp>. <br><dt>shift [<code>n</code>]<dd>The positional parameters from <code>n</code>+1 <small class="dots">...</small> are renamed to <code>$1</code><small class="dots">...</small>. 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. </dl> <div class="node"> <a name="Multi-boot-manual-config"></a> <a name="Multi_002dboot-manual-config"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Embedded-configuration">Embedded configuration</a>, Previous: <a rel="previous" accesskey="p" href="#Shell_002dlike-scripting">Shell-like scripting</a>, Up: <a rel="up" accesskey="u" href="#Configuration">Configuration</a> </div> <h3 class="section">6.3 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>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><code>grub-install --boot-directory=/mnt/boot /dev/sda</code> <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><code>GRUB_DISABLE_OS_PROBER=true</code> <p>in /etc/default/grub <p>Then write a grub.cfg (/mnt/boot/grub/grub.cfg): <pre class="example"> menuentry "OS using grub2" { insmod xfs search --set=root --label OS1 --hint hd0,msdos8 configfile /boot/grub/grub.cfg } menuentry "OS using grub2-legacy" { insmod ext2 search --set=root --label OS2 --hint hd0,msdos6 legacy_configfile /boot/grub/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> <p>Notes: <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. </ul> <div class="node"> <a name="Embedded-configuration"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Multi_002dboot-manual-config">Multi-boot manual config</a>, Up: <a rel="up" accesskey="u" href="#Configuration">Configuration</a> </div> <h3 class="section">6.4 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. <samp><span class="command">grub-install</span></samp> uses this feature when it is not using BIOS disk functions or when installing to a different disk from the one containing <samp><span class="file">/boot/grub</span></samp>, in which case it needs to use the <samp><span class="command">search</span></samp> command (see <a href="#search">search</a>) to find <samp><span class="file">/boot/grub</span></samp>. <p>To embed a configuration file, use the <samp><span class="option">-c</span></samp> option to <samp><span class="command">grub-mkimage</span></samp>. The file is copied into the core image, so it may reside anywhere on the file system, and may be removed after running <samp><span class="command">grub-mkimage</span></samp>. <p>After the embedded configuration file (if any) is executed, GRUB will load the ‘<samp><span class="samp">normal</span></samp>’ module (see <a href="#normal">normal</a>), which will then read the real configuration file from <samp><span class="file">$prefix/grub.cfg</span></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><span class="samp">(hd0,1)/boot/grub</span></samp>’, and <code>root</code> might be set to ‘<samp><span class="samp">hd0,1</span></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: <pre class="example"> search.fs_uuid 01234567-89ab-cdef-0123-456789abcdef root set prefix=($root)/boot/grub </pre> <p>(The ‘<samp><span class="samp">search_fs_uuid</span></samp>’ module must be included in the core image for this example to work.) <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><span class="file">grub.cfg</span></samp>, or reading files from a directory other than that where GRUB's loadable modules are installed. To do this, include the ‘<samp><span class="samp">configfile</span></samp>’ and ‘<samp><span class="samp">normal</span></samp>’ modules in the core image, and embed a configuration file that uses the <samp><span class="command">configfile</span></samp> command to load another file. The following example of this also requires the <samp><span class="command">echo</span></samp>, <samp><span class="command">search_label</span></samp>, and <samp><span class="command">test</span></samp> modules to be included in the core image: <pre class="example"> search.fs_label grub root if [ -e /boot/grub/example/test1.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub/example/test1.cfg else if [ -e /boot/grub/example/test2.cfg ]; then set prefix=($root)/boot/grub configfile /boot/grub/example/test2.cfg else echo "Could not find an example configuration file!" fi fi </pre> <p>The embedded configuration file may not contain menu entries directly, but may only read them from elsewhere using <samp><span class="command">configfile</span></samp>. <div class="node"> <a name="Theme-file-format"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Network">Network</a>, Previous: <a rel="previous" accesskey="p" href="#Configuration">Configuration</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">7 Theme file format</h2> <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 <h3 class="section">7.2 Theme Elements</h3> <h4 class="subsection">7.2.1 Colors</h4> <p>Colors can be specified in several ways: <ul> <li>HTML-style “#RRGGBB” or “#RGB” format, where *R*, *G*, and *B* are hexadecimal digits (e.g., “#8899FF”) <li>as comma-separated decimal RGB values (e.g., “128, 128, 255”) <li>with “SVG 1.0 color names” (e.g., “cornflowerblue”) which must be specified in lowercase. </ul> <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”. <h4 class="subsection">7.2.3 Progress Bar</h4> <div class="float"> <a name="Pixmap_002dstyled-progress-bar"></a><!-- @image{Theme_progress_bar,,,,png} --> <p><strong class="float-caption">Figure 7.1</strong></p></div> <div class="float"> <a name="Plain-progress-bar"></a><!-- @image{Theme_progress_bar_filled,,,,png} --> <p><strong class="float-caption">Figure 7.2</strong></p></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>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. <h4 class="subsection">7.2.4 Circular Progress Indicator</h4> <!-- @image{Theme_circular_progress,,,,.png} --> <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. <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. <h4 class="subsection">7.2.6 Boot Menu</h4> <!-- @image{Theme_boot_menu,,,,.png} --> <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. <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 summary=""><tr align="left"><td valign="top" width="30%">Northwest (nw) </td><td valign="top" width="30%">North (n) </td><td valign="top" width="30%">Northeast (ne) <br></td></tr><tr align="left"><td valign="top" width="30%">West (w) </td><td valign="top" width="30%">Center (c) </td><td valign="top" width="30%">East (e) <br></td></tr><tr align="left"><td valign="top" width="30%">Southwest (sw) </td><td valign="top" width="30%">South (s) </td><td valign="top" width="30%">Southeast (se) <br></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: <ol type=1 start=1> <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>The corner slices (northwest, northeast, southeast, and southwest) are not scaled. <li>The center slice is scaled to fill the remaining space in the middle. </ol> <p>As an example of how an image might be sliced up, consider the styled box used for a terminal view. <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"></a><!-- @image{Box_slice_example_terminal,,,,.png} --> <p><strong class="float-caption">Figure 7.3</strong></p></div> <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: <ol type=1 start=1> <li>Create or open the drawing you'd like use. <li>Create a new layer on the top of the layer stack. Make it visible. Select this layer as the current layer. <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>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>Save the drawing. <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>Click the layer hide icon for the slice layer in the layer palette. The rectangles will remain selected, even though they are hidden. <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. </ol> <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>The theme file contains two types of statements: <ol type=1 start=1> <li>Global properties. <li>Component construction. </ol> <h4 class="subsection">7.3.1 Global Properties</h4> <h4 class="subsection">7.3.2 Format</h4> <p>Global properties are specified with the simple format: <ul> <li>name1: value1 <li>name2: "value which may contain spaces" <li>name3: #88F </ul> <p>In this example, name3 is assigned a color value. <h4 class="subsection">7.3.3 Global Property List</h4> <p><table summary=""><tr align="left"><td valign="top" width="30%">title-text </td><td valign="top" width="60%">Specifies the text to display at the top center of the screen as a title. <br></td></tr><tr align="left"><td valign="top" width="30%">title-font </td><td valign="top" width="60%">Defines the font used for the title message at the top of the screen. <br></td></tr><tr align="left"><td valign="top" width="30%">title-color </td><td valign="top" width="60%">Defines the color of the title message. <br></td></tr><tr align="left"><td valign="top" width="30%">message-font </td><td valign="top" width="60%">Currently unused. Left for backward compatibility. <br></td></tr><tr align="left"><td valign="top" width="30%">message-color </td><td valign="top" width="60%">Currently unused. Left for backward compatibility. <br></td></tr><tr align="left"><td valign="top" width="30%">message-bg-color </td><td valign="top" width="60%">Currently unused. Left for backward compatibility. <br></td></tr><tr align="left"><td valign="top" width="30%">desktop-image </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="30%">desktop-image-scale-method </td><td valign="top" 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“. <br></td></tr><tr align="left"><td valign="top" width="30%">desktop-image-h-align </td><td valign="top" 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“. <br></td></tr><tr align="left"><td valign="top" width="30%">desktop-image-v-align </td><td valign="top" 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“. <br></td></tr><tr align="left"><td valign="top" width="30%">desktop-color </td><td valign="top" width="60%">Specifies the color for the background if *desktop-image* is not specified. <br></td></tr><tr align="left"><td valign="top" width="30%">terminal-box </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="30%">terminal-border </td><td valign="top" width="60%">Specifies the border width of the terminal window. <br></td></tr><tr align="left"><td valign="top" width="30%">terminal-left </td><td valign="top" width="60%">Specifies the left coordinate of the terminal window. <br></td></tr><tr align="left"><td valign="top" width="30%">terminal-top </td><td valign="top" width="60%">Specifies the top coordinate of the terminal window. <br></td></tr><tr align="left"><td valign="top" width="30%">terminal-width </td><td valign="top" width="60%">Specifies the width of the terminal window. <br></td></tr><tr align="left"><td valign="top" width="30%">terminal-height </td><td valign="top" width="60%">Specifies the height of the terminal window. <br></td></tr></table> <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>Components are created in the theme file by prefixing the type of component with a '+' sign: <p><code> + label { text="GRUB" font="aqui 11" color="#8FF" } </code> <p>properties of a component are specified as "name = value" (whitespace surrounding tokens is optional and is ignored) where *value* may be: <ul> <li>a single word (e.g., “align = center“, “color = #FF8080“), <li>a quoted string (e.g., “text = "Hello, World!"“), or <li>a tuple (e.g., “preferred_size = (120, 80)“). </ul> <h4 class="subsection">7.3.5 Component List</h4> <p>The following is a list of the components and the properties they support. <ul> <li>label A label displays a line of text. <p>Properties: <p><table summary=""> <tr align="left"><td valign="top" width="20%">id </td><td valign="top" width="70%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry. <br></td></tr><tr align="left"><td valign="top" width="20%">text </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="20%">font </td><td valign="top" width="70%">The font to use for text display. <br></td></tr><tr align="left"><td valign="top" width="20%">color </td><td valign="top" width="70%">The color of the text. <br></td></tr><tr align="left"><td valign="top" width="20%">align </td><td valign="top" width="70%">The horizontal alignment of the text within the component. Options are “left“, “center“ and “right“. <br></td></tr><tr align="left"><td valign="top" width="20%">visible </td><td valign="top" width="70%">Set to “false“ to hide the label. <br></td></tr></table> <li>image A component that displays an image. The image is scaled to fit the component. <p>Properties: <p><table summary=""> <tr align="left"><td valign="top" width="20%">file </td><td valign="top" width="70%">The full path to the image file to load. <br></td></tr></table> <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 summary=""> <tr align="left"><td valign="top" width="20%">id </td><td valign="top" width="70%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry. <br></td></tr><tr align="left"><td valign="top" width="20%">fg_color </td><td valign="top" width="70%">The foreground color for plain solid color rendering. <br></td></tr><tr align="left"><td valign="top" width="20%">bg_color </td><td valign="top" width="70%">The background color for plain solid color rendering. <br></td></tr><tr align="left"><td valign="top" width="20%">border_color </td><td valign="top" width="70%">The border color for plain solid color rendering. <br></td></tr><tr align="left"><td valign="top" width="20%">text_color </td><td valign="top" width="70%">The text color. <br></td></tr><tr align="left"><td valign="top" width="20%">bar_style </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="20%">highlight_style </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="20%">highlight_overlay </td><td valign="top" 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“. <br></td></tr><tr align="left"><td valign="top" width="20%">font </td><td valign="top" width="70%">The font to use for progress bar. <br></td></tr><tr align="left"><td valign="top" width="20%">text </td><td valign="top" 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. <br></td></tr></table> <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 summary=""> <tr align="left"><td valign="top" width="30%">id </td><td valign="top" width="60%">Set to “__timeout__“ to display the time elapsed to an automatical boot of the default entry. <br></td></tr><tr align="left"><td valign="top" width="30%">center_bitmap </td><td valign="top" width="60%">The file name of the image to draw in the center of the component. <br></td></tr><tr align="left"><td valign="top" width="30%">tick_bitmap </td><td valign="top" width="60%">The file name of the image to draw for the tick marks. <br></td></tr><tr align="left"><td valign="top" width="30%">num_ticks </td><td valign="top" width="60%">The number of ticks that make up a full circle. <br></td></tr><tr align="left"><td valign="top" width="30%">ticks_disappear </td><td valign="top" 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“. <br></td></tr><tr align="left"><td valign="top" width="30%">start_angle </td><td valign="top" 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. <br></td></tr></table> <li>boot_menu Displays the GRUB boot menu. It allows selecting items and executing them. <p>Properties: <p><table summary=""> <tr align="left"><td valign="top" width="40%">item_font </td><td valign="top" width="50%">The font to use for the menu item titles. <br></td></tr><tr align="left"><td valign="top" width="40%">selected_item_font </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="40%">item_color </td><td valign="top" width="50%">The color to use for the menu item titles. <br></td></tr><tr align="left"><td valign="top" width="40%">selected_item_color </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="40%">icon_width </td><td valign="top" width="50%">The width of menu item icons. Icons are scaled to the specified size. <br></td></tr><tr align="left"><td valign="top" width="40%">icon_height </td><td valign="top" width="50%">The height of menu item icons. <br></td></tr><tr align="left"><td valign="top" width="40%">item_height </td><td valign="top" width="50%">The height of each menu item in pixels. <br></td></tr><tr align="left"><td valign="top" width="40%">item_padding </td><td valign="top" width="50%">The amount of space in pixels to leave on each side of the menu item contents. <br></td></tr><tr align="left"><td valign="top" width="40%">item_icon_space </td><td valign="top" width="50%">The space between an item's icon and the title text, in pixels. <br></td></tr><tr align="left"><td valign="top" width="40%">item_spacing </td><td valign="top" width="50%">The amount of space to leave between menu items, in pixels. <br></td></tr><tr align="left"><td valign="top" width="40%">menu_pixmap_style </td><td valign="top" 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.) <br></td></tr><tr align="left"><td valign="top" width="40%">item_pixmap_style </td><td valign="top" width="50%">The image file pattern for the item styled box. <br></td></tr><tr align="left"><td valign="top" width="40%">selected_item_pixmap_style </td><td valign="top" width="50%">The image file pattern for the selected item highlight styled box. <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar </td><td valign="top" width="50%">Boolean value indicating whether the scroll bar should be drawn if the frame and thumb styled boxes are configured. <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_frame </td><td valign="top" width="50%">The image file pattern for the entire scroll bar. Example: “scrollbar_*.png“ <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_thumb </td><td valign="top" 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“ <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_thumb_overlay </td><td valign="top" 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“. <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_slice </td><td valign="top" 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. <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_left_pad </td><td valign="top" width="50%">The left scrollbar padding in pixels. Unused if “scrollbar_slice“ is “west“. <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_right_pad </td><td valign="top" width="50%">The right scrollbar padding in pixels. Unused if “scrollbar_slice“ is “east“. <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_top_pad </td><td valign="top" width="50%">The top scrollbar padding in pixels. <br></td></tr><tr align="left"><td valign="top" width="40%">scrollbar_bottom_pad </td><td valign="top" width="50%">The bottom scrollbar padding in pixels. <br></td></tr><tr align="left"><td valign="top" width="40%">visible </td><td valign="top" width="50%">Set to “false“ to hide the boot menu. <br></td></tr></table> <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>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>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. </ul> <h4 class="subsection">7.3.6 Common properties</h4> <p>The following properties are supported by all components: <dl> <dt>‘<samp><span class="samp">left</span></samp>’<dd> The distance from the left border of container to left border of the object in either of three formats: <p><table summary=""> <tr align="left"><td valign="top" width="20%">x </td><td valign="top" width="70%">Value in pixels <br></td></tr><tr align="left"><td valign="top" width="20%">p% </td><td valign="top" width="70%">Percentage <br></td></tr><tr align="left"><td valign="top" width="20%">p%+x </td><td valign="top" width="70%">mixture of both <br></td></tr></table> <br><dt>‘<samp><span class="samp">top</span></samp>’<dd> The distance from the left border of container to left border of the object in same format. <br><dt>‘<samp><span class="samp">width</span></samp>’<dd> The width of object in same format. <br><dt>‘<samp><span class="samp">height</span></samp>’<dd> The height of object in same format. <br><dt>‘<samp><span class="samp">id</span></samp>’<dd> 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 summary=""> <tr align="left"><td valign="top" width="20%">“__timeout__“ </td><td valign="top" 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“. <br></td></tr></table> </dl> <div class="node"> <a name="Network"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Serial-terminal">Serial terminal</a>, Previous: <a rel="previous" accesskey="p" href="#Theme-file-format">Theme file format</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>To generate a netbootable directory, run: <pre class="example"> grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/<platform> </pre> <p>E.g. for i386-pc: <pre class="example"> grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i386-pc </pre> <p>Then follow instructions printed out by grub-mknetdir on configuring your DHCP server. <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. <pre class="example"> ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-‘<samp><span class="samp">(UUID OF NIC)</span></samp>’ ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-‘<samp><span class="samp">(MAC ADDRESS OF NIC)</span></samp>’ ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-‘<samp><span class="samp">(IPv4 OR IPv6 ADDRESS)</span></samp>’ ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg </pre> <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. <pre class="example"> UUID: 7726a678-7fc0-4853-a4f6-c85ac36a120a MAC: 52:54:00:ec:33:81 IPV4: 10.0.0.130 (0A000082) </pre> <pre class="example"> ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-7726a678-7fc0-4853-a4f6-c85ac36a120a ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-52-54-00-ec-33-81 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0A000082 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0A00008 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0A0000 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0A000 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0A00 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0A0 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0A ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg-0 ‘<samp><span class="samp">(FWPATH)</span></samp>’/grub.cfg </pre> <p>After GRUB has started, files on the TFTP server will be accessible via the ‘<samp><span class="samp">(tftp)</span></samp>’ device. <p>The server IP address can be controlled by changing the ‘<samp><span class="samp">(tftp)</span></samp>’ device name to ‘<samp><span class="samp">(tftp,</span><var>server-ip</var><span class="samp">)</span></samp>’. Note that this should be changed both in the prefix and in any references to the device name in the configuration file. <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): <dl> <dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_ip</span></samp>’<dd>The network interface's IP address. Read-only. <br><dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_mac</span></samp>’<dd>The network interface's MAC address. Read-only. <br><dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_hostname</span></samp>’<dd>The client host name provided by DHCP. Read-only. <br><dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_domain</span></samp>’<dd>The client domain name provided by DHCP. Read-only. <br><dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_rootpath</span></samp>’<dd>The path to the client's root disk provided by DHCP. Read-only. <br><dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_extensionspath</span></samp>’<dd>The path to additional DHCP vendor extensions provided by DHCP. Read-only. <br><dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_boot_file</span></samp>’<dd>The boot file name provided by DHCP. Read-only. <br><dt>‘<samp><span class="samp">net_</span><var><interface></var><span class="samp">_dhcp_server_name</span></samp>’<dd>The name of the DHCP server responsible for these boot parameters. Read-only. <br><dt>‘<samp><span class="samp">net_default_interface</span></samp>’<dd>Initially set to name of network interface that was used to load grub. Read-write, although setting it affects only interpretation of ‘<samp><span class="samp">net_default_ip</span></samp>’ and ‘<samp><span class="samp">net_default_mac</span></samp>’ <br><dt>‘<samp><span class="samp">net_default_ip</span></samp>’<dd>The IP address of default interface. Read-only. This is alias for the ‘<samp><span class="samp">net_${net_default_interface}_ip</span></samp>’. <br><dt>‘<samp><span class="samp">net_default_mac</span></samp>’<dd>The default interface's MAC address. Read-only. This is alias for the ‘<samp><span class="samp">net_${net_default_interface}_mac</span></samp>’. <br><dt>‘<samp><span class="samp">net_default_server</span></samp>’<dd>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. </dl> <div class="node"> <a name="Serial-terminal"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Vendor-power_002don-keys">Vendor power-on keys</a>, Previous: <a rel="previous" accesskey="p" href="#Network">Network</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>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>As for GRUB, the instruction to set up a serial terminal is quite simple. Here is an example: <pre class="example"> grub> <kbd>serial --unit=0 --speed=9600</kbd> grub> <kbd>terminal_input serial; terminal_output serial</kbd> </pre> <p>The command <samp><span class="command">serial</span></samp> initializes the serial unit 0 with the speed 9600bps. The serial unit 0 is usually called ‘<samp><span class="samp">COM1</span></samp>’, so, if you want to use COM2, you must specify ‘<samp><span class="samp">--unit=1</span></samp>’ instead. This command accepts many other options, so please refer to <a href="#serial">serial</a>, for more details. <p>The commands <samp><span class="command">terminal_input</span></samp> (see <a href="#terminal_005finput">terminal_input</a>) and <samp><span class="command">terminal_output</span></samp> (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><span class="samp">terminal_input serial console</span></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>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><span class="option">--dumb</span></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. <div class="node"> <a name="Vendor-power-on-keys"></a> <a name="Vendor-power_002don-keys"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Images">Images</a>, Previous: <a rel="previous" accesskey="p" href="#Serial-terminal">Serial terminal</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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><span class="samp">GRUB_TIMEOUT_BUTTON</span></samp>’, ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE_BUTTON</span></samp>’, ‘<samp><span class="samp">GRUB_DEFAULT_BUTTON</span></samp>’, and ‘<samp><span class="samp">GRUB_BUTTON_CMOS_ADDRESS</span></samp>’ variables in default/grub (see <a href="#Simple-configuration">Simple configuration</a>). ‘<samp><span class="samp">GRUB_TIMEOUT_BUTTON</span></samp>’, ‘<samp><span class="samp">GRUB_TIMEOUT_STYLE_BUTTON</span></samp>’, and ‘<samp><span class="samp">GRUB_DEFAULT_BUTTON</span></samp>’ are used instead of the corresponding variables without the ‘<samp><span class="samp">_BUTTON</span></samp>’ suffix when powered on using the special button. ‘<samp><span class="samp">GRUB_BUTTON_CMOS_ADDRESS</span></samp>’ is vendor-specific and partially model-specific. Values known to the GRUB team are: <dl> <dt><Dell XPS M1330M><dd>121:3 <br><dt><Dell XPS M1530><dd>85:3 <br><dt><Dell Latitude E4300><dd>85:3 <br><dt><Asus EeePC 1005PE><dd>84:1 (unconfirmed) </dl> <p>To take full advantage of this function, install GRUB into the MBR (see <a href="#Installing-GRUB-using-grub_002dinstall">Installing GRUB using grub-install</a>). <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: <ul> <li>boot normally <li> <pre class="example"> sudo modprobe nvram sudo cat /dev/nvram | xxd > normal_button.txt </pre> <li>boot using vendor button <li> <pre class="example"> sudo modprobe nvram sudo cat /dev/nvram | xxd > normal_vendor.txt </pre> </ul> <p>Then compare these text files and find where a bit was toggled. E.g. in case of Dell XPS it was: <pre class="example"> byte 0x47: 20 --> 28 </pre> <p>It's a bit number 3 as seen from following table: <p><table summary=""><tr align="left"><td valign="top" width="20%">0 </td><td valign="top" width="20%">01 <br></td></tr><tr align="left"><td valign="top" width="20%">1 </td><td valign="top" width="20%">02 <br></td></tr><tr align="left"><td valign="top" width="20%">2 </td><td valign="top" width="20%">04 <br></td></tr><tr align="left"><td valign="top" width="20%">3 </td><td valign="top" width="20%">08 <br></td></tr><tr align="left"><td valign="top" width="20%">4 </td><td valign="top" width="20%">10 <br></td></tr><tr align="left"><td valign="top" width="20%">5 </td><td valign="top" width="20%">20 <br></td></tr><tr align="left"><td valign="top" width="20%">6 </td><td valign="top" width="20%">40 <br></td></tr><tr align="left"><td valign="top" width="20%">7 </td><td valign="top" width="20%">80 <br></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 <div class="node"> <a name="Images"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Core-image-size-limitation">Core image size limitation</a>, Previous: <a rel="previous" accesskey="p" href="#Vendor-power_002don-keys">Vendor power-on keys</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">11 GRUB image files</h2> <!-- FIXME: parts of this section are specific to PC BIOS right now. --> <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. <dl> <dt><samp><span class="file">boot.img</span></samp><dd>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>The sole function of <samp><span class="file">boot.img</span></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><span class="file">boot.img</span></samp> cannot understand any file system structure, so <samp><span class="command">grub-install</span></samp> hardcodes the location of the first sector of the core image into <samp><span class="file">boot.img</span></samp> when installing GRUB. <br><dt><samp><span class="file">diskboot.img</span></samp><dd>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. <br><dt><samp><span class="file">cdboot.img</span></samp><dd>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><span class="file">diskboot.img</span></samp>. <br><dt><samp><span class="file">pxeboot.img</span></samp><dd>This image is used as the start of the core image when booting from the network using PXE. See <a href="#Network">Network</a>. <br><dt><samp><span class="file">lnxboot.img</span></samp><dd>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><span class="samp">image=</span></samp>’ section. <br><dt><samp><span class="file">kernel.img</span></samp><dd>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. <br><dt><samp><span class="file">core.img</span></samp><dd>This is the core image of GRUB. It is built dynamically from the kernel image and an arbitrary list of modules by the <samp><span class="command">grub-mkimage</span></samp> program. Usually, it contains enough modules to access <samp><span class="file">/boot/grub</span></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>See <a href="#BIOS-installation">BIOS installation</a>, for details on where the core image can be installed on PC systems. <br><dt><samp><span class="file">*.mod</span></samp><dd>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 <samp><span class="command">insmod</span></samp> command (see <a href="#insmod">insmod</a>). </dl> <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. <dl> <dt><samp><span class="file">stage1</span></samp><dd>Stage 1 from GRUB Legacy was very similar to <samp><span class="file">boot.img</span></samp> in GRUB 2, and they serve the same function. <br><dt><samp><span class="file">*_stage1_5</span></samp><dd>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><span class="file">core.img</span></samp> in GRUB 2. However, <samp><span class="file">core.img</span></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><span class="file">core.img</span></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>GRUB Legacy could run with only Stage 1 and Stage 2 in some limited configurations, while GRUB 2 requires <samp><span class="file">core.img</span></samp> and cannot work without it. <br><dt><samp><span class="file">stage2</span></samp><dd>GRUB 2 has no single Stage 2 image. Instead, it loads modules from <samp><span class="file">/boot/grub</span></samp> at run-time. <br><dt><samp><span class="file">stage2_eltorito</span></samp><dd>In GRUB 2, images for booting from CD-ROM drives are now constructed using <samp><span class="file">cdboot.img</span></samp> and <samp><span class="file">core.img</span></samp>, making sure that the core image contains the ‘<samp><span class="samp">iso9660</span></samp>’ module. It is usually best to use the <samp><span class="command">grub-mkrescue</span></samp> program for this. <br><dt><samp><span class="file">nbgrub</span></samp><dd>There is as yet no equivalent for <samp><span class="file">nbgrub</span></samp> in GRUB 2; it was used by Etherboot and some other network boot loaders. <br><dt><samp><span class="file">pxegrub</span></samp><dd>In GRUB 2, images for PXE network booting are now constructed using <samp><span class="file">pxeboot.img</span></samp> and <samp><span class="file">core.img</span></samp>, making sure that the core image contains the ‘<samp><span class="samp">pxe</span></samp>’ and ‘<samp><span class="samp">pxecmd</span></samp>’ modules. See <a href="#Network">Network</a>. </dl> <div class="node"> <a name="Core-image-size-limitation"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Filesystem">Filesystem</a>, Previous: <a rel="previous" accesskey="p" href="#Images">Images</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">12 Core image size limitation</h2> <p>Heavily limited platforms: <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>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>i386-ieee1275: kernel.img (.text + .data + .bss) + modules is limited by memory available at 0x10000, at most 596K </ul> <p>Lightly limited platforms: <ul> <li>*-xen: limited only by adress space and RAM size. <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>All EFI platforms: limited by contiguous RAM size and possibly firmware bugs <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>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>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>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>powerpc-ieee1275: kernel.img (.text + .data + .bss) + modules is limited by space available at 0x200000 </ul> <div class="node"> <a name="Filesystem"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Interface">Interface</a>, Previous: <a rel="previous" accesskey="p" href="#Core-image-size-limitation">Core image size limitation</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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 <samp><span class="command">search</span></samp> (see <a href="#search">search</a>). <ul class="menu"> <li><a accesskey="1" href="#Device-syntax">Device syntax</a>: How to specify devices <li><a accesskey="2" href="#File-name-syntax">File name syntax</a>: How to specify files <li><a accesskey="3" href="#Block-list-syntax">Block list syntax</a>: How to specify block lists </ul> <div class="node"> <a name="Device-syntax"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#File-name-syntax">File name syntax</a>, Up: <a rel="up" accesskey="u" href="#Filesystem">Filesystem</a> </div> <h3 class="section">13.1 How to specify devices</h3> <p>The device syntax is like this: <pre class="example"> <code>(</code><var>device</var><code>[,</code><var>partmap-name1</var><var>part-num1</var><code>[,</code><var>partmap-name2</var><var>part-num2</var><code>[,...]]])</code> </pre> <p>‘<samp><span class="samp">[]</span></samp>’ means the parameter is optional. <var>device</var> depends on the disk driver in use. BIOS and EFI disks use either ‘<samp><span class="samp">fd</span></samp>’ or ‘<samp><span class="samp">hd</span></samp>’ followed by a digit, like ‘<samp><span class="samp">fd0</span></samp>’, or ‘<samp><span class="samp">cd</span></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 <samp><span class="command">loopback</span></samp> 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>. <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> <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>The syntax ‘<samp><span class="samp">(hd0)</span></samp>’ represents using the entire disk (or the MBR when installing GRUB), while the syntax ‘<samp><span class="samp">(hd0,1)</span></samp>’ represents using the first partition of the disk (or the boot sector of the partition when installing GRUB). <pre class="example"> (hd0,msdos1) (hd0,msdos1,msdos5) (hd0,msdos1,bsd3) (hd0,netbsd1) (hd0,gpt1) (hd0,1,3) </pre> <p>If you enabled the network support, the special drives <code>(</code><var>protocol</var><code>[,</code><var>server</var><code>])</code> are also available. Supported protocols are ‘<samp><span class="samp">http</span></samp>’ and ‘<samp><span class="samp">tftp</span></samp>’. If <var>server</var> is omitted, value of environment variable ‘<samp><span class="samp">net_default_server</span></samp>’ is used. Before using the network drive, you must initialize the network. See <a href="#Network">Network</a>, for more information. <p>If you boot GRUB from a CD-ROM, ‘<samp><span class="samp">(cd)</span></samp>’ is available. See <a href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>, for details. <div class="node"> <a name="File-name-syntax"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Block-list-syntax">Block list syntax</a>, Previous: <a rel="previous" accesskey="p" href="#Device-syntax">Device syntax</a>, Up: <a rel="up" accesskey="u" href="#Filesystem">Filesystem</a> </div> <h3 class="section">13.2 How to specify files</h3> <p>There are two ways to specify files, by <dfn>absolute file name</dfn> and by <dfn>block list</dfn>. <p>An absolute file name resembles a Unix absolute file name, using ‘<samp><span class="samp">/</span></samp>’ for the directory separator (not ‘<samp><span class="samp">\</span></samp>’ as in DOS). One example is ‘<samp><span class="samp">(hd0,1)/boot/grub/grub.cfg</span></samp>’. This means the file <samp><span class="file">/boot/grub/grub.cfg</span></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 <dfn>root device</dfn> implicitly. So if you set the root device to, say, ‘<samp><span class="samp">(hd1,1)</span></samp>’ by the command ‘<samp><span class="samp">set root=(hd1,1)</span></samp>’ (see <a href="#set">set</a>), then <code>/boot/kernel</code> is the same as <code>(hd1,1)/boot/kernel</code>. <p>On ZFS filesystem the first path component must be <var>volume</var>‘<samp><span class="samp">@</span></samp>’[<var>snapshot</var>]. So ‘<samp><span class="samp">/rootvol@snap-129/boot/grub/grub.cfg</span></samp>’ refers to file ‘<samp><span class="samp">/boot/grub/grub.cfg</span></samp>’ in snapshot of volume ‘<samp><span class="samp">rootvol</span></samp>’ with name ‘<samp><span class="samp">snap-129</span></samp>’. Trailing ‘<samp><span class="samp">@</span></samp>’ after volume name is mandatory even if snapshot name is omitted. <div class="node"> <a name="Block-list-syntax"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#File-name-syntax">File name syntax</a>, Up: <a rel="up" accesskey="u" href="#Filesystem">Filesystem</a> </div> <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>[</code><var>offset</var><code>]+</code><var>length</var><code>[,[</code><var>offset</var><code>]+</code><var>length</var><code>]...</code>. Here is an example: <pre class="example"> <code>0+100,200+1,300+300</code> </pre> <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>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 <dfn>root device</dfn>. So <code>(hd0,2)+1</code> is the same as <code>+1</code> when the root device is ‘<samp><span class="samp">(hd0,2)</span></samp>’. <div class="node"> <a name="Interface"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Environment">Environment</a>, Previous: <a rel="previous" accesskey="p" href="#Filesystem">Filesystem</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>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 <dfn>command-line</dfn> menu option, or if the configuration file was not found, then GRUB drops to the command-line interface. <ul class="menu"> <li><a accesskey="1" href="#Command_002dline-interface">Command-line interface</a>: The flexible command-line interface <li><a accesskey="2" href="#Menu-interface">Menu interface</a>: The simple menu interface <li><a accesskey="3" href="#Menu-entry-editor">Menu entry editor</a>: Editing a menu entry </ul> <div class="node"> <a name="Command-line-interface"></a> <a name="Command_002dline-interface"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Menu-interface">Menu interface</a>, Up: <a rel="up" accesskey="u" href="#Interface">Interface</a> </div> <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 rel="footnote" href="#fn-8" name="fnd-8"><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>Cursor movement and editing of the text on the line can be done via a subset of the functions available in the Bash shell: <dl> <dt><C-f><dt><PC right key><dd>Move forward one character. <br><dt><C-b><dt><PC left key><dd>Move back one character. <br><dt><C-a><dt><HOME><dd>Move to the start of the line. <br><dt><C-e><dt><END><dd>Move the the end of the line. <br><dt><C-d><dt><DEL><dd>Delete the character underneath the cursor. <br><dt><C-h><dt><BS><dd>Delete the character to the left of the cursor. <br><dt><C-k><dd>Kill the text from the current cursor position to the end of the line. <br><dt><C-u><dd>Kill backward from the cursor to the beginning of the line. <br><dt><C-y><dd>Yank the killed text back into the buffer at the cursor. <br><dt><C-p><dt><PC up key><dd>Move up through the history list. <br><dt><C-n><dt><PC down key><dd>Move down through the history list. </dl> <p>When typing commands interactively, if the cursor is within or before the first word in the command-line, pressing the <TAB> key (or <C-i>) will display a listing of the available commands, and if the cursor is after the first word, the <kbd><TAB></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 <samp><span class="command">root (</span></samp>. <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. <div class="node"> <a name="Menu-interface"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Menu-entry-editor">Menu entry editor</a>, Previous: <a rel="previous" accesskey="p" href="#Command_002dline-interface">Command-line interface</a>, Up: <a rel="up" accesskey="u" href="#Interface">Interface</a> </div> <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>Basically, the menu interface provides a list of <dfn>boot entries</dfn> to the user to choose from. Use the arrow keys to select the entry of choice, then press <RET> 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>Commands are available to enter a bare command-line by pressing <c> (which operates exactly like the non-config-file version of GRUB, but allows one to return to the menu if desired by pressing <ESC>) or to edit any of the <dfn>boot entries</dfn> by pressing <e>. <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 <RET>, or press <p> to enter the password. <div class="node"> <a name="Menu-entry-editor"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Menu-interface">Menu interface</a>, Up: <a rel="up" accesskey="u" href="#Interface">Interface</a> </div> <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>If an <ESC> is pressed in the editor, it aborts all the changes made to the configuration entry and returns to the main menu interface. <p>Each line in the menu entry can be edited freely, and you can add new lines by pressing <RET> at the end of a line. To boot the edited entry, press <Ctrl-x>. <p>Although GRUB unfortunately does not support <dfn>undo</dfn>, you can do almost the same thing by just returning to the main menu using <ESC>. <div class="node"> <a name="Environment"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Commands">Commands</a>, Previous: <a rel="previous" accesskey="p" href="#Interface">Interface</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>A number of environment variables have special meanings to various parts of GRUB. Others may be used freely in GRUB configuration files. <ul class="menu"> <li><a accesskey="1" href="#Special-environment-variables">Special environment variables</a> <li><a accesskey="2" href="#Environment-block">Environment block</a> </ul> <div class="node"> <a name="Special-environment-variables"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Environment-block">Environment block</a>, Up: <a rel="up" accesskey="u" href="#Environment">Environment</a> </div> <h3 class="section">15.1 Special environment variables</h3> <p>These variables have special meaning to GRUB. <ul class="menu"> <li><a accesskey="1" href="#biosnum">biosnum</a> <li><a accesskey="2" href="#check_005fsignatures">check_signatures</a> <li><a accesskey="3" href="#chosen">chosen</a> <li><a accesskey="4" href="#cmdpath">cmdpath</a> <li><a accesskey="5" href="#color_005fhighlight">color_highlight</a> <li><a accesskey="6" href="#color_005fnormal">color_normal</a> <li><a accesskey="7" href="#debug">debug</a> <li><a accesskey="8" href="#default">default</a> <li><a accesskey="9" href="#fallback">fallback</a> <li><a href="#gfxmode">gfxmode</a> <li><a href="#gfxpayload">gfxpayload</a> <li><a href="#gfxterm_005ffont">gfxterm_font</a> <li><a href="#grub_005fcpu">grub_cpu</a> <li><a href="#grub_005fplatform">grub_platform</a> <li><a href="#icondir">icondir</a> <li><a href="#lang">lang</a> <li><a href="#locale_005fdir">locale_dir</a> <li><a href="#menu_005fcolor_005fhighlight">menu_color_highlight</a> <li><a href="#menu_005fcolor_005fnormal">menu_color_normal</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fboot_005ffile">net_<var><interface></var>_boot_file</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdhcp_005fserver_005fname">net_<var><interface></var>_dhcp_server_name</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdomain">net_<var><interface></var>_domain</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fextensionspath">net_<var><interface></var>_extensionspath</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fhostname">net_<var><interface></var>_hostname</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fip">net_<var><interface></var>_ip</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fmac">net_<var><interface></var>_mac</a> <li><a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005frootpath">net_<var><interface></var>_rootpath</a> <li><a href="#net_005fdefault_005finterface">net_default_interface</a> <li><a href="#net_005fdefault_005fip">net_default_ip</a> <li><a href="#net_005fdefault_005fmac">net_default_mac</a> <li><a href="#net_005fdefault_005fserver">net_default_server</a> <li><a href="#pager">pager</a> <li><a href="#prefix">prefix</a> <li><a href="#pxe_005fblksize">pxe_blksize</a> <li><a href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a> <li><a href="#pxe_005fdefault_005fserver">pxe_default_server</a> <li><a href="#root">root</a> <li><a href="#superusers">superusers</a> <li><a href="#theme">theme</a> <li><a href="#timeout">timeout</a> <li><a href="#timeout_005fstyle">timeout_style</a> </ul> <div class="node"> <a name="biosnum"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#check_005fsignatures">check_signatures</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <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>For an alternative approach which also changes BIOS drive mappings for the chain-loaded system, see <a href="#drivemap">drivemap</a>. <div class="node"> <a name="check_signatures"></a> <a name="check_005fsignatures"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#chosen">chosen</a>, Previous: <a rel="previous" accesskey="p" href="#biosnum">biosnum</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.2 check_signatures</h4> <p>This variable controls whether GRUB enforces digital signature validation on loaded files. See <a href="#Using-digital-signatures">Using digital signatures</a>. <div class="node"> <a name="chosen"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cmdpath">cmdpath</a>, Previous: <a rel="previous" accesskey="p" href="#check_005fsignatures">check_signatures</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.3 chosen</h4> <p>When executing a menu entry, GRUB sets the <var>chosen</var> variable to the title of the entry being executed. <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><span class="samp">></span></samp>’. <div class="node"> <a name="cmdpath"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#color_005fhighlight">color_highlight</a>, Previous: <a rel="previous" accesskey="p" href="#chosen">chosen</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.4 cmdpath</h4> <p>The location from which <samp><span class="file">core.img</span></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. <div class="node"> <a name="color_highlight"></a> <a name="color_005fhighlight"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#color_005fnormal">color_normal</a>, Previous: <a rel="previous" accesskey="p" href="#cmdpath">cmdpath</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.5 color_highlight</h4> <p>This variable contains the “highlight” foreground and background terminal colors, separated by a slash (‘<samp><span class="samp">/</span></samp>’). Setting this variable changes those colors. For the available color names, see <a href="#color_005fnormal">color_normal</a>. <p>The default is ‘<samp><span class="samp">black/light-gray</span></samp>’. <div class="node"> <a name="color_normal"></a> <a name="color_005fnormal"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#debug">debug</a>, Previous: <a rel="previous" accesskey="p" href="#color_005fhighlight">color_highlight</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.6 color_normal</h4> <p>This variable contains the “normal” foreground and background terminal colors, separated by a slash (‘<samp><span class="samp">/</span></samp>’). Setting this variable changes those colors. Each color must be a name from the following list: <ul> <li>black <li>blue <li>green <li>cyan <li>red <li>magenta <li>brown <li>light-gray <li>dark-gray <li>light-blue <li>light-green <li>light-cyan <li>light-red <li>light-magenta <li>yellow <li>white </ul> <p>The default is ‘<samp><span class="samp">light-gray/black</span></samp>’. <p>The color support support varies from terminal to terminal. <p>‘<samp><span class="samp">morse</span></samp>’ has no color support at all. <p>‘<samp><span class="samp">mda_text</span></samp>’ color support is limited to highlighting by black/white reversal. <p>‘<samp><span class="samp">console</span></samp>’ on ARC, EMU and IEEE1275, ‘<samp><span class="samp">serial_*</span></samp>’ and ‘<samp><span class="samp">spkmodem</span></samp>’ are governed by terminfo and support only 8 colors if in modes ‘<samp><span class="samp">vt100-color</span></samp>’ (default for console on emu), ‘<samp><span class="samp">arc</span></samp>’ (default for console on ARC), ‘<samp><span class="samp">ieee1275</span></samp>’ (default for console on IEEE1275). When in mode ‘<samp><span class="samp">vt100</span></samp>’ then the color support is limited to highlighting by black/white reversal. When in mode ‘<samp><span class="samp">dumb</span></samp>’ there is no color support. <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>‘<samp><span class="samp">console</span></samp>’ on EFI and BIOS and ‘<samp><span class="samp">vga_text</span></samp>’ support all 16 colors. <p>‘<samp><span class="samp">gfxterm</span></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. <div class="node"> <a name="debug"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#default">default</a>, Previous: <a rel="previous" accesskey="p" href="#color_005fnormal">color_normal</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.7 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><span class="samp">,</span></samp>’, or ‘<samp><span class="samp">all</span></samp>’ to enable all available debugging output. The facility names are the first argument to grub_dprintf. Consult source for more details. <div class="node"> <a name="default"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#fallback">fallback</a>, Previous: <a rel="previous" accesskey="p" href="#debug">debug</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.8 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 or by id. <p>For example, if you have: <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: <pre class="example"> default=example-gnu-linux </pre> <p>If the entry is in a submenu, then it must be identified using the titles of each of the submenus starting from the top level followed by the number or title of the menu entry itself, separated by ‘<samp><span class="samp">></span></samp>’. For example, take the following menu structure: <pre class="example"> Submenu 1 Menu Entry 1 Menu Entry 2 Submenu 2 Submenu 3 Menu Entry 3 Menu Entry 4 Menu Entry 5 </pre> <p>“Menu Entry 3” would then be identified as ‘<samp><span class="samp">Submenu 2>Submenu 3>Menu Entry 3</span></samp>’. <p>This variable is often set by ‘<samp><span class="samp">GRUB_DEFAULT</span></samp>’ (see <a href="#Simple-configuration">Simple configuration</a>), <samp><span class="command">grub-set-default</span></samp>, or <samp><span class="command">grub-reboot</span></samp>. <div class="node"> <a name="fallback"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#gfxmode">gfxmode</a>, Previous: <a rel="previous" accesskey="p" href="#default">default</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.9 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><span class="samp">default</span></samp>’ (see <a href="#default">default</a>). <div class="node"> <a name="gfxmode"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#gfxpayload">gfxpayload</a>, Previous: <a rel="previous" accesskey="p" href="#fallback">fallback</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.10 gfxmode</h4> <p>If this variable is set, it sets the resolution used on the ‘<samp><span class="samp">gfxterm</span></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><span class="samp">auto</span></samp>’, which selects a platform-specific default that should look reasonable. Supported modes can be listed by ‘<samp><span class="samp">videoinfo</span></samp>’ command in GRUB. <p>The resolution may be specified as a sequence of one or more modes, separated by commas (‘<samp><span class="samp">,</span></samp>’) or semicolons (‘<samp><span class="samp">;</span></samp>’); each will be tried in turn until one is found. Each mode should be either ‘<samp><span class="samp">auto</span></samp>’, ‘<samp><var>width</var><span class="samp">x</span><var>height</var></samp>’, or ‘<samp><var>width</var><span class="samp">x</span><var>height</var><span class="samp">x</span><var>depth</var></samp>’. <div class="node"> <a name="gfxpayload"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#gfxterm_005ffont">gfxterm_font</a>, Previous: <a rel="previous" accesskey="p" href="#gfxmode">gfxmode</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.11 gfxpayload</h4> <p>If this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ‘<samp><span class="samp">vga=</span></samp>’ boot option (see <a href="#linux">linux</a>). It may be set to ‘<samp><span class="samp">text</span></samp>’ to force the Linux kernel to boot in normal text mode, ‘<samp><span class="samp">keep</span></samp>’ to preserve the graphics mode set using ‘<samp><span class="samp">gfxmode</span></samp>’, or any of the permitted values for ‘<samp><span class="samp">gfxmode</span></samp>’ to set a particular graphics mode (see <a href="#gfxmode">gfxmode</a>). <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><span class="samp">text</span></samp>’ and GRUB will tell Linux to boot in normal text mode. <p>The default is platform-specific. On platforms with a native text mode (such as PC BIOS platforms), the default is ‘<samp><span class="samp">text</span></samp>’. Otherwise the default may be ‘<samp><span class="samp">auto</span></samp>’ or a specific video mode. <p>This variable is often set by ‘<samp><span class="samp">GRUB_GFXPAYLOAD_LINUX</span></samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). <div class="node"> <a name="gfxterm_font"></a> <a name="gfxterm_005ffont"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#grub_005fcpu">grub_cpu</a>, Previous: <a rel="previous" accesskey="p" href="#gfxpayload">gfxpayload</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.12 gfxterm_font</h4> <p>If this variable is set, it names a font to use for text on the ‘<samp><span class="samp">gfxterm</span></samp>’ graphical terminal. Otherwise, ‘<samp><span class="samp">gfxterm</span></samp>’ may use any available font. <div class="node"> <a name="grub_cpu"></a> <a name="grub_005fcpu"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#grub_005fplatform">grub_platform</a>, Previous: <a rel="previous" accesskey="p" href="#gfxterm_005ffont">gfxterm_font</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.13 grub_cpu</h4> <p>In normal mode (see <a href="#normal">normal</a>), GRUB sets the ‘<samp><span class="samp">grub_cpu</span></samp>’ variable to the CPU type for which GRUB was built (e.g. ‘<samp><span class="samp">i386</span></samp>’ or ‘<samp><span class="samp">powerpc</span></samp>’). <div class="node"> <a name="grub_platform"></a> <a name="grub_005fplatform"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#icondir">icondir</a>, Previous: <a rel="previous" accesskey="p" href="#grub_005fcpu">grub_cpu</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.14 grub_platform</h4> <p>In normal mode (see <a href="#normal">normal</a>), GRUB sets the ‘<samp><span class="samp">grub_platform</span></samp>’ variable to the platform for which GRUB was built (e.g. ‘<samp><span class="samp">pc</span></samp>’ or ‘<samp><span class="samp">efi</span></samp>’). <div class="node"> <a name="icondir"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#lang">lang</a>, Previous: <a rel="previous" accesskey="p" href="#grub_005fplatform">grub_platform</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.15 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><span class="samp">icons</span></samp>’ directory. See <a href="#Theme-file-format">Theme file format</a>. <div class="node"> <a name="lang"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#locale_005fdir">locale_dir</a>, Previous: <a rel="previous" accesskey="p" href="#icondir">icondir</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.16 lang</h4> <p>If this variable is set, it names the language code that the <samp><span class="command">gettext</span></samp> command (see <a href="#gettext">gettext</a>) uses to translate strings. For example, French would be named as ‘<samp><span class="samp">fr</span></samp>’, and Simplified Chinese as ‘<samp><span class="samp">zh_CN</span></samp>’. <p><samp><span class="command">grub-mkconfig</span></samp> (see <a href="#Simple-configuration">Simple configuration</a>) will try to set a reasonable default for this variable based on the system locale. <div class="node"> <a name="locale_dir"></a> <a name="locale_005fdir"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#menu_005fcolor_005fhighlight">menu_color_highlight</a>, Previous: <a rel="previous" accesskey="p" href="#lang">lang</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.17 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><span class="file">/boot/grub/locale</span></samp>. Otherwise, internationalization is disabled. <p><samp><span class="command">grub-mkconfig</span></samp> (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. <div class="node"> <a name="menu_color_highlight"></a> <a name="menu_005fcolor_005fhighlight"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#menu_005fcolor_005fnormal">menu_color_normal</a>, Previous: <a rel="previous" accesskey="p" href="#locale_005fdir">locale_dir</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.18 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><span class="samp">/</span></samp>’). Setting this variable changes those colors. For the available color names, see <a href="#color_005fnormal">color_normal</a>. <p>The default is the value of ‘<samp><span class="samp">color_highlight</span></samp>’ (see <a href="#color_005fhighlight">color_highlight</a>). <div class="node"> <a name="menu_color_normal"></a> <a name="menu_005fcolor_005fnormal"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fboot_005ffile">net_<var><interface></var>_boot_file</a>, Previous: <a rel="previous" accesskey="p" href="#menu_005fcolor_005fhighlight">menu_color_highlight</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.19 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><span class="samp">/</span></samp>’). Setting this variable changes those colors. For the available color names, see <a href="#color_005fnormal">color_normal</a>. <p>The default is the value of ‘<samp><span class="samp">color_normal</span></samp>’ (see <a href="#color_005fnormal">color_normal</a>). <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_boot_file"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fboot_005ffile"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdhcp_005fserver_005fname">net_<var><interface></var>_dhcp_server_name</a>, Previous: <a rel="previous" accesskey="p" href="#menu_005fcolor_005fnormal">menu_color_normal</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.20 net_<var><interface></var>_boot_file</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_dhcp_server_name"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdhcp_005fserver_005fname"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdomain">net_<var><interface></var>_domain</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fboot_005ffile">net_<var><interface></var>_boot_file</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.21 net_<var><interface></var>_dhcp_server_name</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_domain"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdomain"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fextensionspath">net_<var><interface></var>_extensionspath</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdhcp_005fserver_005fname">net_<var><interface></var>_dhcp_server_name</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.22 net_<var><interface></var>_domain</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_extensionspath"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fextensionspath"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fhostname">net_<var><interface></var>_hostname</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdomain">net_<var><interface></var>_domain</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.23 net_<var><interface></var>_extensionspath</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_hostname"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fhostname"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fip">net_<var><interface></var>_ip</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fextensionspath">net_<var><interface></var>_extensionspath</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.24 net_<var><interface></var>_hostname</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_ip"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fip"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fmac">net_<var><interface></var>_mac</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fhostname">net_<var><interface></var>_hostname</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.25 net_<var><interface></var>_ip</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_mac"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fmac"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005frootpath">net_<var><interface></var>_rootpath</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fip">net_<var><interface></var>_ip</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.26 net_<var><interface></var>_mac</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_%3cvar%3e%3cinterface%3e%3c%2fvar%3e_rootpath"></a> <a name="net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005frootpath"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fdefault_005finterface">net_default_interface</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fmac">net_<var><interface></var>_mac</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.27 net_<var><interface></var>_rootpath</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_default_interface"></a> <a name="net_005fdefault_005finterface"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fdefault_005fip">net_default_ip</a>, Previous: <a rel="previous" accesskey="p" href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005frootpath">net_<var><interface></var>_rootpath</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.28 net_default_interface</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_default_ip"></a> <a name="net_005fdefault_005fip"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fdefault_005fmac">net_default_mac</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fdefault_005finterface">net_default_interface</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.29 net_default_ip</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_default_mac"></a> <a name="net_005fdefault_005fmac"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fdefault_005fserver">net_default_server</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fdefault_005fip">net_default_ip</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.30 net_default_mac</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="net_default_server"></a> <a name="net_005fdefault_005fserver"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#pager">pager</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fdefault_005fmac">net_default_mac</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.31 net_default_server</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="pager"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#prefix">prefix</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fdefault_005fserver">net_default_server</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.32 pager</h4> <p>If set to ‘<samp><span class="samp">1</span></samp>’, pause output after each screenful and wait for keyboard input. The default is not to pause output. <div class="node"> <a name="prefix"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#pxe_005fblksize">pxe_blksize</a>, Previous: <a rel="previous" accesskey="p" href="#pager">pager</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.33 prefix</h4> <p>The location of the ‘<samp><span class="samp">/boot/grub</span></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 <samp><span class="command">grub-install</span></samp>. GRUB modules are dynamically loaded from this directory, so it must be set correctly in order for many parts of GRUB to work. <div class="node"> <a name="pxe_blksize"></a> <a name="pxe_005fblksize"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a>, Previous: <a rel="previous" accesskey="p" href="#prefix">prefix</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.34 pxe_blksize</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="pxe_default_gateway"></a> <a name="pxe_005fdefault_005fgateway"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#pxe_005fdefault_005fserver">pxe_default_server</a>, Previous: <a rel="previous" accesskey="p" href="#pxe_005fblksize">pxe_blksize</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.35 pxe_default_gateway</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="pxe_default_server"></a> <a name="pxe_005fdefault_005fserver"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#root">root</a>, Previous: <a rel="previous" accesskey="p" href="#pxe_005fdefault_005fgateway">pxe_default_gateway</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.36 pxe_default_server</h4> <p>See <a href="#Network">Network</a>. <div class="node"> <a name="root"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#superusers">superusers</a>, Previous: <a rel="previous" accesskey="p" href="#pxe_005fdefault_005fserver">pxe_default_server</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.37 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><span class="samp">prefix</span></samp>’ (see <a href="#prefix">prefix</a>). <p>For example, if GRUB was installed to the first partition of the first hard disk, then ‘<samp><span class="samp">prefix</span></samp>’ might be set to ‘<samp><span class="samp">(hd0,msdos1)/boot/grub</span></samp>’ and ‘<samp><span class="samp">root</span></samp>’ to ‘<samp><span class="samp">hd0,msdos1</span></samp>’. <div class="node"> <a name="superusers"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#theme">theme</a>, Previous: <a rel="previous" accesskey="p" href="#root">root</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.38 superusers</h4> <p>This variable may be set to a list of superuser names to enable authentication support. See <a href="#Security">Security</a>. <div class="node"> <a name="theme"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#timeout">timeout</a>, Previous: <a rel="previous" accesskey="p" href="#superusers">superusers</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.39 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>This variable is often set by ‘<samp><span class="samp">GRUB_THEME</span></samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). <div class="node"> <a name="timeout"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#timeout_005fstyle">timeout_style</a>, Previous: <a rel="previous" accesskey="p" href="#theme">theme</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.40 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><span class="samp">0</span></samp>’ means to boot the default entry immediately without displaying the menu; a timeout of ‘<samp><span class="samp">-1</span></samp>’ (or unset) means to wait indefinitely. <p>If ‘<samp><span class="samp">timeout_style</span></samp>’ (see <a href="#timeout_005fstyle">timeout_style</a>) is set to ‘<samp><span class="samp">countdown</span></samp>’ or ‘<samp><span class="samp">hidden</span></samp>’, the timeout is instead counted before the menu is displayed. <p>This variable is often set by ‘<samp><span class="samp">GRUB_TIMEOUT</span></samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). <div class="node"> <a name="timeout_style"></a> <a name="timeout_005fstyle"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#timeout">timeout</a>, Up: <a rel="up" accesskey="u" href="#Special-environment-variables">Special environment variables</a> </div> <h4 class="subsection">15.1.41 timeout_style</h4> <p>This variable may be set to ‘<samp><span class="samp">menu</span></samp>’, ‘<samp><span class="samp">countdown</span></samp>’, or ‘<samp><span class="samp">hidden</span></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><span class="samp">GRUB_TIMEOUT_STYLE</span></samp>’ (see <a href="#Simple-configuration">Simple configuration</a>) for details. <div class="node"> <a name="Environment-block"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Special-environment-variables">Special environment variables</a>, Up: <a rel="up" accesskey="u" href="#Environment">Environment</a> </div> <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>The environment block is a preallocated 1024-byte file, which normally lives in <samp><span class="file">/boot/grub/grubenv</span></samp> (although you should not assume this). At boot time, the <samp><span class="command">load_env</span></samp> command (see <a href="#load_005fenv">load_env</a>) loads environment variables from it, and the <samp><span class="command">save_env</span></samp> (see <a href="#save_005fenv">save_env</a>) command saves environment variables to it. From a running system, the <samp><span class="command">grub-editenv</span></samp> utility can be used to edit the environment block. <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><samp><span class="command">grub-mkconfig</span></samp> uses this facility to implement ‘<samp><span class="samp">GRUB_SAVEDEFAULT</span></samp>’ (see <a href="#Simple-configuration">Simple configuration</a>). <div class="node"> <a name="Commands"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Internationalisation">Internationalisation</a>, Previous: <a rel="previous" accesskey="p" href="#Environment">Environment</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">16 The list of available commands</h2> <p>In this chapter, we list all commands that are available in GRUB. <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>In rescue mode, only the <samp><span class="command">insmod</span></samp> (see <a href="#insmod">insmod</a>), <samp><span class="command">ls</span></samp> (see <a href="#ls">ls</a>), <samp><span class="command">set</span></samp> (see <a href="#set">set</a>), and <samp><span class="command">unset</span></samp> (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>. <ul class="menu"> <li><a accesskey="1" href="#Menu_002dspecific-commands">Menu-specific commands</a> <li><a accesskey="2" href="#General-commands">General commands</a> <li><a accesskey="3" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> <li><a accesskey="4" href="#Networking-commands">Networking commands</a> </ul> <div class="node"> <a name="Menu-specific-commands"></a> <a name="Menu_002dspecific-commands"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#General-commands">General commands</a>, Up: <a rel="up" accesskey="u" href="#Commands">Commands</a> </div> <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: <ul> <li>The files <em>must</em> be in plain-text format. <li>‘<samp><span class="samp">#</span></samp>’ at the beginning of a line in a configuration file means it is only a comment. <li>Options are separated by spaces. <li>All numbers can be either decimal or hexadecimal. A hexadecimal number must be preceded by ‘<samp><span class="samp">0x</span></samp>’, and is case-insensitive. </ul> <p>These commands can only be used in the menu: <ul class="menu"> <li><a accesskey="1" href="#menuentry">menuentry</a>: Start a menu entry <li><a accesskey="2" href="#submenu">submenu</a>: Group menu entries </ul> <div class="node"> <a name="menuentry"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#submenu">submenu</a>, Up: <a rel="up" accesskey="u" href="#Menu_002dspecific-commands">Menu-specific commands</a> </div> <h4 class="subsection">16.1.1 menuentry</h4> <div class="defun"> — Command: <b>menuentry</b><var> title </var>[<samp><span class="option">--class=class</span></samp><var> <small class="dots">...</small></var>] [<samp><span class="option">--users=users</span></samp>] [<samp><span class="option">--unrestricted</span></samp>] [<samp><span class="option">--hotkey=key</span></samp>] [<samp><span class="option">--id=id</span></samp>] [<var>arg <small class="dots">...</small></var>]<var> { command; <small class="dots">...</small> }<a name="index-menuentry-1"></a></var><br> <blockquote><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><span class="option">--id</span></samp> if <samp><span class="option">--id</span></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 <samp><span class="command">boot</span></samp> command. <p>The <samp><span class="option">--class</span></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>The <samp><span class="option">--users</span></samp> option grants specific users access to specific menu entries. See <a href="#Security">Security</a>. <p>The <samp><span class="option">--unrestricted</span></samp> option grants all users access to specific menu entries. See <a href="#Security">Security</a>. <p>The <samp><span class="option">--hotkey</span></samp> option associates a hotkey with a menu entry. <var>key</var> may be a single letter, or one of the aliases ‘<samp><span class="samp">backspace</span></samp>’, ‘<samp><span class="samp">tab</span></samp>’, or ‘<samp><span class="samp">delete</span></samp>’. <p>The <samp><span class="option">--id</span></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>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></blockquote></div> <div class="node"> <a name="submenu"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#menuentry">menuentry</a>, Up: <a rel="up" accesskey="u" href="#Menu_002dspecific-commands">Menu-specific commands</a> </div> <h4 class="subsection">16.1.2 submenu</h4> <div class="defun"> — Command: <b>submenu</b><var> title </var>[<samp><span class="option">--class=class</span></samp><var> <small class="dots">...</small></var>] [<samp><span class="option">--users=users</span></samp>] [<samp><span class="option">--unrestricted</span></samp>] [<samp><span class="option">--hotkey=key</span></samp>] [<samp><span class="option">--id=id</span></samp>]<var> { menu entries <small class="dots">...</small> }<a name="index-submenu-2"></a></var><br> <blockquote><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>All options are the same as in the <samp><span class="command">menuentry</span></samp> command (see <a href="#menuentry">menuentry</a>). </p></blockquote></div> <div class="node"> <a name="General-commands"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>, Previous: <a rel="previous" accesskey="p" href="#Menu_002dspecific-commands">Menu-specific commands</a>, Up: <a rel="up" accesskey="u" href="#Commands">Commands</a> </div> <h3 class="section">16.2 The list of general commands</h3> <p>Commands usable anywhere in the menu and in the command-line. <ul class="menu"> <li><a accesskey="1" href="#serial">serial</a>: Set up a serial device <li><a accesskey="2" href="#terminal_005finput">terminal_input</a>: Manage input terminals <li><a accesskey="3" href="#terminal_005foutput">terminal_output</a>: Manage output terminals <li><a accesskey="4" href="#terminfo">terminfo</a>: Define terminal type </ul> <div class="node"> <a name="serial"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#terminal_005finput">terminal_input</a>, Up: <a rel="up" accesskey="u" href="#General-commands">General commands</a> </div> <h4 class="subsection">16.2.1 serial</h4> <div class="defun"> — Command: <b>serial</b> [<samp><span class="option">--unit=unit</span></samp>] [<samp><span class="option">--port=port</span></samp>] [<samp><span class="option">--speed=speed</span></samp>] [<samp><span class="option">--word=word</span></samp>] [<samp><span class="option">--parity=parity</span></samp>] [<samp><span class="option">--stop=stop</span></samp>]<var><a name="index-serial-3"></a></var><br> <blockquote><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><span class="samp">no</span></samp>’, ‘<samp><span class="samp">odd</span></samp>’, ‘<samp><span class="samp">even</span></samp>’ and defaults to ‘<samp><span class="samp">no</span></samp>’. <p>The serial port is not used as a communication channel unless the <samp><span class="command">terminal_input</span></samp> or <samp><span class="command">terminal_output</span></samp> command is used (see <a href="#terminal_005finput">terminal_input</a>, see <a href="#terminal_005foutput">terminal_output</a>). <p>See also <a href="#Serial-terminal">Serial terminal</a>. </p></blockquote></div> <div class="node"> <a name="terminal_input"></a> <a name="terminal_005finput"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#terminal_005foutput">terminal_output</a>, Previous: <a rel="previous" accesskey="p" href="#serial">serial</a>, Up: <a rel="up" accesskey="u" href="#General-commands">General commands</a> </div> <h4 class="subsection">16.2.2 terminal_input</h4> <div class="defun"> — Command: <b>terminal_input</b> [<samp><span class="option">--append</span></samp><var>|</var><samp><span class="option">--remove</span></samp>] [<var>terminal1</var>] [<var>terminal2</var>]<var> <small class="dots">...</small><a name="index-terminal_005finput-4"></a></var><br> <blockquote><p>List or select an input terminal. <p>With no arguments, list the active and available input terminals. <p>With <samp><span class="option">--append</span></samp>, add the named terminals to the list of active input terminals; any of these may be used to provide input to GRUB. <p>With <samp><span class="option">--remove</span></samp>, remove the named terminals from the active list. <p>With no options but a list of terminal names, make only the listed terminal names active. </p></blockquote></div> <div class="node"> <a name="terminal_output"></a> <a name="terminal_005foutput"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#terminfo">terminfo</a>, Previous: <a rel="previous" accesskey="p" href="#terminal_005finput">terminal_input</a>, Up: <a rel="up" accesskey="u" href="#General-commands">General commands</a> </div> <h4 class="subsection">16.2.3 terminal_output</h4> <div class="defun"> — Command: <b>terminal_output</b> [<samp><span class="option">--append</span></samp><var>|</var><samp><span class="option">--remove</span></samp>] [<var>terminal1</var>] [<var>terminal2</var>]<var> <small class="dots">...</small><a name="index-terminal_005foutput-5"></a></var><br> <blockquote><p>List or select an output terminal. <p>With no arguments, list the active and available output terminals. <p>With <samp><span class="option">--append</span></samp>, add the named terminals to the list of active output terminals; all of these will receive output from GRUB. <p>With <samp><span class="option">--remove</span></samp>, remove the named terminals from the active list. <p>With no options but a list of terminal names, make only the listed terminal names active. </p></blockquote></div> <div class="node"> <a name="terminfo"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#terminal_005foutput">terminal_output</a>, Up: <a rel="up" accesskey="u" href="#General-commands">General commands</a> </div> <h4 class="subsection">16.2.4 terminfo</h4> <div class="defun"> — Command: <b>terminfo</b> [<var>-a|-u|-v</var>] [<var>term</var>]<var><a name="index-terminfo-6"></a></var><br> <blockquote><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><span class="samp">TERM</span></samp>’ environment variable in Unix. <p>The currently available terminal types are ‘<samp><span class="samp">vt100</span></samp>’, ‘<samp><span class="samp">vt100-color</span></samp>’, ‘<samp><span class="samp">ieee1275</span></samp>’, and ‘<samp><span class="samp">dumb</span></samp>’. If you need other terminal types, please contact us to discuss the best way to include support for these in GRUB. <p>The <samp><span class="option">-a</span></samp> (<samp><span class="option">--ascii</span></samp>), <samp><span class="option">-u</span></samp> (<samp><span class="option">--utf8</span></samp>), and <samp><span class="option">-v</span></samp> (<samp><span class="option">--visual-utf8</span></samp>) options control how non-ASCII text is displayed. <samp><span class="option">-a</span></samp> specifies an ASCII-only terminal; <samp><span class="option">-u</span></samp> specifies logically-ordered UTF-8; and <samp><span class="option">-v</span></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>If no option or terminal type is specified, the current terminal type is printed. </p></blockquote></div> <div class="node"> <a name="Command-line-and-menu-entry-commands"></a> <a name="Command_002dline-and-menu-entry-commands"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Networking-commands">Networking commands</a>, Previous: <a rel="previous" accesskey="p" href="#General-commands">General commands</a>, Up: <a rel="up" accesskey="u" href="#Commands">Commands</a> </div> <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 <samp><span class="command">help</span></samp> (see <a href="#help">help</a>). <ul class="menu"> <li><a accesskey="1" href="#g_t_005b">[</a>: Check file types and compare values <li><a accesskey="2" href="#acpi">acpi</a>: Load ACPI tables <li><a accesskey="3" href="#authenticate">authenticate</a>: Check whether user is in user list <li><a accesskey="4" href="#background_005fcolor">background_color</a>: Set background color for active terminal <li><a accesskey="5" href="#background_005fimage">background_image</a>: Load background image for active terminal <li><a accesskey="6" href="#badram">badram</a>: Filter out bad regions of RAM <li><a accesskey="7" href="#blocklist">blocklist</a>: Print a block list <li><a accesskey="8" href="#boot">boot</a>: Start up your operating system <li><a accesskey="9" href="#cat">cat</a>: Show the contents of a file <li><a href="#chainloader">chainloader</a>: Chain-load another boot loader <li><a href="#clear">clear</a>: Clear the screen <li><a href="#cmosclean">cmosclean</a>: Clear bit in CMOS <li><a href="#cmosdump">cmosdump</a>: Dump CMOS contents <li><a href="#cmostest">cmostest</a>: Test bit in CMOS <li><a href="#cmp">cmp</a>: Compare two files <li><a href="#configfile">configfile</a>: Load a configuration file <li><a href="#cpuid">cpuid</a>: Check for CPU features <li><a href="#crc">crc</a>: Compute or check CRC32 checksums <li><a href="#cryptomount">cryptomount</a>: Mount a crypto device <li><a href="#cutmem">cutmem</a>: Remove memory regions <li><a href="#date">date</a>: Display or set current date and time <li><a href="#devicetree">devicetree</a>: Load a device tree blob <li><a href="#distrust">distrust</a>: Remove a pubkey from trusted keys <li><a href="#drivemap">drivemap</a>: Map a drive to another <li><a href="#echo">echo</a>: Display a line of text <li><a href="#eval">eval</a>: Evaluate agruments as GRUB commands <li><a href="#export">export</a>: Export an environment variable <li><a href="#false">false</a>: Do nothing, unsuccessfully <li><a href="#gettext">gettext</a>: Translate a string <li><a href="#gptsync">gptsync</a>: Fill an MBR based on GPT entries <li><a href="#halt">halt</a>: Shut down your computer <li><a href="#hashsum">hashsum</a>: Compute or check hash checksum <li><a href="#help">help</a>: Show help messages <li><a href="#initrd">initrd</a>: Load a Linux initrd <li><a href="#initrd16">initrd16</a>: Load a Linux initrd (16-bit mode) <li><a href="#insmod">insmod</a>: Insert a module <li><a href="#keystatus">keystatus</a>: Check key modifier status <li><a href="#linux">linux</a>: Load a Linux kernel <li><a href="#linux16">linux16</a>: Load a Linux kernel (16-bit mode) <li><a href="#list_005fenv">list_env</a>: List variables in environment block <li><a href="#list_005ftrusted">list_trusted</a>: List trusted public keys <li><a href="#load_005fenv">load_env</a>: Load variables from environment block <li><a href="#loadfont">loadfont</a>: Load font files <li><a href="#loopback">loopback</a>: Make a device from a filesystem image <li><a href="#ls">ls</a>: List devices or files <li><a href="#lsfonts">lsfonts</a>: List loaded fonts <li><a href="#lsmod">lsmod</a>: Show loaded modules <li><a href="#md5sum">md5sum</a>: Compute or check MD5 hash <li><a href="#module">module</a>: Load module for multiboot kernel <li><a href="#multiboot">multiboot</a>: Load multiboot compliant kernel <li><a href="#nativedisk">nativedisk</a>: Switch to native disk drivers <li><a href="#normal">normal</a>: Enter normal mode <li><a href="#normal_005fexit">normal_exit</a>: Exit from normal mode <li><a href="#parttool">parttool</a>: Modify partition table entries <li><a href="#password">password</a>: Set a clear-text password <li><a href="#password_005fpbkdf2">password_pbkdf2</a>: Set a hashed password <li><a href="#play">play</a>: Play a tune <li><a href="#probe">probe</a>: Retrieve device info <li><a href="#pxe_005funload">pxe_unload</a>: Unload the PXE environment <li><a href="#read">read</a>: Read user input <li><a href="#reboot">reboot</a>: Reboot your computer <li><a href="#regexp">regexp</a>: Test if regular expression matches string <li><a href="#rmmod">rmmod</a>: Remove a module <li><a href="#save_005fenv">save_env</a>: Save variables to environment block <li><a href="#search">search</a>: Search devices by file, label, or UUID <li><a href="#sendkey">sendkey</a>: Emulate keystrokes <li><a href="#set">set</a>: Set an environment variable <li><a href="#sha1sum">sha1sum</a>: Compute or check SHA1 hash <li><a href="#sha256sum">sha256sum</a>: Compute or check SHA256 hash <li><a href="#sha512sum">sha512sum</a>: Compute or check SHA512 hash <li><a href="#sleep">sleep</a>: Wait for a specified number of seconds <li><a href="#source">source</a>: Read a configuration file in same context <li><a href="#test">test</a>: Check file types and compare values <li><a href="#true">true</a>: Do nothing, successfully <li><a href="#trust">trust</a>: Add public key to list of trusted keys <li><a href="#unset">unset</a>: Unset an environment variable <li><a href="#uppermem">uppermem</a>: Set the upper memory size <!-- * vbeinfo:: List available video modes --> <li><a href="#verify_005fdetached">verify_detached</a>: Verify detached digital signature <li><a href="#videoinfo">videoinfo</a>: List available video modes </ul> <div class="node"> <a name="%5b"></a> <a name="g_t_005b"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#acpi">acpi</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.1 [</h4> <div class="defun"> — Command: <code>[</code><var> expression </var><code>]</code><var><a name="index-g_t_0040code_007b_005b_007d-7"></a></var><br> <blockquote><p>Alias for <code>test </code><var>expression</var> (see <a href="#test">test</a>). </p></blockquote></div> <div class="node"> <a name="acpi"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#authenticate">authenticate</a>, Previous: <a rel="previous" accesskey="p" href="#g_t_005b">[</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.2 acpi</h4> <div class="defun"> — Command: <b>acpi</b> [<samp><span class="option">-1</span></samp><var>|</var><samp><span class="option">-2</span></samp>] [<samp><span class="option">--exclude=table1,...</span></samp><var>|</var><samp><span class="option">--load-only=table1,...</span></samp>] [<samp><span class="option">--oemid=id</span></samp>] [<samp><span class="option">--oemtable=table</span></samp>] [<samp><span class="option">--oemtablerev=rev</span></samp>] [<samp><span class="option">--oemtablecreator=creator</span></samp>] [<samp><span class="option">--oemtablecreatorrev=rev</span></samp>] [<samp><span class="option">--no-ebda</span></samp>]<var> filename <small class="dots">...</small><a name="index-acpi-8"></a></var><br> <blockquote><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>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><span class="option">--no-ebda</span></samp> option is used, the new tables will be known only to GRUB, but may be used by GRUB's EFI emulation. <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></blockquote></div> <div class="node"> <a name="authenticate"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#background_005fcolor">background_color</a>, Previous: <a rel="previous" accesskey="p" href="#acpi">acpi</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.3 authenticate</h4> <div class="defun"> — Command: <b>authenticate</b> [<var>userlist</var>]<var><a name="index-authenticate-9"></a></var><br> <blockquote><p>Check whether user is in <var>userlist</var> or listed in the value of variable ‘<samp><span class="samp">superusers</span></samp>’. See see <a href="#superusers">superusers</a> for valid user list format. If ‘<samp><span class="samp">superusers</span></samp>’ is empty, this command returns true. See <a href="#Security">Security</a>. </p></blockquote></div> <div class="node"> <a name="background_color"></a> <a name="background_005fcolor"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#background_005fimage">background_image</a>, Previous: <a rel="previous" accesskey="p" href="#authenticate">authenticate</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.4 background_color</h4> <div class="defun"> — Command: <b>background_color</b><var> color<a name="index-background_005fcolor-10"></a></var><br> <blockquote><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><span class="samp">gfxterm</span></samp>’ for terminal output. <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></blockquote></div> <div class="node"> <a name="background_image"></a> <a name="background_005fimage"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#badram">badram</a>, Previous: <a rel="previous" accesskey="p" href="#background_005fcolor">background_color</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.5 background_image</h4> <div class="defun"> — Command: <b>background_image</b> [[<samp><span class="option">--mode</span></samp><var> ‘</var><samp><span class="samp">stretch</span></samp><var>’|‘</var><samp><span class="samp">normal</span></samp><var>’</var>]<var> file</var>]<var><a name="index-background_005fimage-11"></a></var><br> <blockquote><p>Load background image for active terminal from <var>file</var>. Image is stretched to fill up entire screen unless option <samp><span class="option">--mode</span></samp> ‘<samp><span class="samp">normal</span></samp>’ is given. Without arguments remove currently loaded background image. Background image can be changed only when using ‘<samp><span class="samp">gfxterm</span></samp>’ for terminal output. </blockquote></div> <div class="node"> <a name="badram"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#blocklist">blocklist</a>, Previous: <a rel="previous" accesskey="p" href="#background_005fimage">background_image</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.6 badram</h4> <div class="defun"> — Command: <b>badram</b><var> addr,mask</var>[<var>,addr,mask...</var>]<var><a name="index-badram-12"></a></var><br> <blockquote><p>Filter out bad RAM. </p></blockquote></div> <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>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>The command is similar to <samp><span class="command">cutmem</span></samp> command. <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. <div class="node"> <a name="blocklist"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#boot">boot</a>, Previous: <a rel="previous" accesskey="p" href="#badram">badram</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.7 blocklist</h4> <div class="defun"> — Command: <b>blocklist</b><var> file<a name="index-blocklist-13"></a></var><br> <blockquote><p>Print a block list (see <a href="#Block-list-syntax">Block list syntax</a>) for <var>file</var>. </p></blockquote></div> <div class="node"> <a name="boot"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cat">cat</a>, Previous: <a rel="previous" accesskey="p" href="#blocklist">blocklist</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.8 boot</h4> <div class="defun"> — Command: <b>boot</b><var><a name="index-boot-14"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="cat"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#chainloader">chainloader</a>, Previous: <a rel="previous" accesskey="p" href="#boot">boot</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.9 cat</h4> <div class="defun"> — Command: <b>cat</b> [<samp><span class="option">--dos</span></samp>]<var> file<a name="index-cat-15"></a></var><br> <blockquote><p>Display the contents of the file <var>file</var>. This command may be useful to remind you of your OS's root partition: <pre class="example"> grub> <kbd>cat /etc/fstab</kbd> </pre> <p>If the <samp><span class="option">--dos</span></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><span class="samp"><d></span></samp>’) to make it easier to see when boot problems are caused by a file formatted using DOS-style line endings. </p></blockquote></div> <div class="node"> <a name="chainloader"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#clear">clear</a>, Previous: <a rel="previous" accesskey="p" href="#cat">cat</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.10 chainloader</h4> <div class="defun"> — Command: <b>chainloader</b> [<samp><span class="option">--force</span></samp>]<var> file<a name="index-chainloader-16"></a></var><br> <blockquote><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><span class="samp">+1</span></samp>’. If you specify the option <samp><span class="option">--force</span></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></blockquote></div> <div class="node"> <a name="clear"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cmosclean">cmosclean</a>, Previous: <a rel="previous" accesskey="p" href="#chainloader">chainloader</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.11 clear</h4> <div class="defun"> — Command: <b>clear</b><var><a name="index-clear-17"></a></var><br> <blockquote><p>Clear the screen. </p></blockquote></div> <div class="node"> <a name="cmosclean"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cmosdump">cmosdump</a>, Previous: <a rel="previous" accesskey="p" href="#clear">clear</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.12 cmosclean</h4> <div class="defun"> — Command: <b>cmosclean</b><var> byte:bit<a name="index-cmosclean-18"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="cmosdump"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cmostest">cmostest</a>, Previous: <a rel="previous" accesskey="p" href="#cmosclean">cmosclean</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.13 cmosdump</h4> <div class="defun"> — Dump: <b>CMOS</b><var> contents<a name="index-CMOS-19"></a></var><br> <blockquote><p>Dump full CMOS contents as hexadecimal values. This command is available only on platforms that support CMOS. </p></blockquote></div> <div class="node"> <a name="cmostest"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cmp">cmp</a>, Previous: <a rel="previous" accesskey="p" href="#cmosdump">cmosdump</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.14 cmostest</h4> <div class="defun"> — Command: <b>cmostest</b><var> byte:bit<a name="index-cmostest-20"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="cmp"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#configfile">configfile</a>, Previous: <a rel="previous" accesskey="p" href="#cmostest">cmostest</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.15 cmp</h4> <div class="defun"> — Command: <b>cmp</b><var> file1 file2<a name="index-cmp-21"></a></var><br> <blockquote><p>Compare the file <var>file1</var> with the file <var>file2</var>. If they differ in size, print the sizes like this: <pre class="example"> Differ in size: 0x1234 [foo], 0x4321 [bar] </pre> <p>If the sizes are equal but the bytes at an offset differ, then print the bytes like this: <pre class="example"> Differ at the offset 777: 0xbe [foo], 0xef [bar] </pre> <p>If they are completely identical, nothing will be printed. </p></blockquote></div> <div class="node"> <a name="configfile"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cpuid">cpuid</a>, Previous: <a rel="previous" accesskey="p" href="#cmp">cmp</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.16 configfile</h4> <div class="defun"> — Command: <b>configfile</b><var> file<a name="index-configfile-22"></a></var><br> <blockquote><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 <samp><span class="command">configfile</span></samp> returns. </p></blockquote></div> <div class="node"> <a name="cpuid"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#crc">crc</a>, Previous: <a rel="previous" accesskey="p" href="#configfile">configfile</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.17 cpuid</h4> <div class="defun"> — Command: <b>cpuid</b> [<var>-l</var>]<var><a name="index-cpuid-23"></a></var><br> <blockquote><p>Check for CPU features. This command is only available on x86 systems. <p>With the <samp><span class="option">-l</span></samp> option, return true if the CPU supports long mode (64-bit). <p>If invoked without options, this command currently behaves as if it had been invoked with <samp><span class="option">-l</span></samp>. This may change in the future. </p></blockquote></div> <div class="node"> <a name="crc"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cryptomount">cryptomount</a>, Previous: <a rel="previous" accesskey="p" href="#cpuid">cpuid</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.18 crc</h4> <div class="defun"> — Command: <b>crc</b><var> arg <small class="dots">...</small><a name="index-crc-24"></a></var><br> <blockquote><p>Alias for <code>hashsum --hash crc32 arg ...</code>. See command <samp><span class="command">hashsum</span></samp> (see <a href="#hashsum">hashsum</a>) for full description. </p></blockquote></div> <div class="node"> <a name="cryptomount"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#cutmem">cutmem</a>, Previous: <a rel="previous" accesskey="p" href="#crc">crc</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.19 cryptomount</h4> <div class="defun"> — Command: <b>cryptomount</b><var> device|</var><samp><span class="option">-u</span></samp><var> uuid|</var><samp><span class="option">-a</span></samp><var>|</var><samp><span class="option">-b</span></samp><var><a name="index-cryptomount-25"></a></var><br> <blockquote><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><span class="option">-u</span></samp> <var>uuid</var> configures device with specified <var>uuid</var>; option <samp><span class="option">-a</span></samp> configures all detected encrypted devices; option <samp><span class="option">-b</span></samp> configures all geli containers that have boot flag set. <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></blockquote></div> <div class="node"> <a name="cutmem"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#date">date</a>, Previous: <a rel="previous" accesskey="p" href="#cryptomount">cryptomount</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.20 cutmem</h4> <div class="defun"> — Command: <b>cutmem</b><var> from</var>[<var>K|M|G</var>]<var> to</var>[<var>K|M|G</var>]<var><a name="index-cutmem-26"></a></var><br> <blockquote><p>Remove any memory regions in specified range. </p></blockquote></div> <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>The command is similar to <samp><span class="command">badram</span></samp> command. <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. <div class="node"> <a name="date"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#devicetree">devicetree</a>, Previous: <a rel="previous" accesskey="p" href="#cutmem">cutmem</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.21 date</h4> <div class="defun"> — Command: <b>date</b> [[<var>year-</var>]<var>month-day</var>] [<var>hour:minute</var>[<var>:second</var>]]<var><a name="index-date-27"></a></var><br> <blockquote><p>With no arguments, print the current date and time. <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></blockquote></div> <div class="node"> <a name="devicetree"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#distrust">distrust</a>, Previous: <a rel="previous" accesskey="p" href="#date">date</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.22 devicetree</h4> <div class="defun"> — Command: <b>devicetree</b><var> file<a name="index-devicetree-28"></a></var><br> <blockquote><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>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></blockquote></div> <div class="node"> <a name="distrust"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#drivemap">drivemap</a>, Previous: <a rel="previous" accesskey="p" href="#devicetree">devicetree</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.23 distrust</h4> <div class="defun"> — Command: <b>distrust</b><var> pubkey_id<a name="index-distrust-29"></a></var><br> <blockquote><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 <samp><span class="command">list_trusted</span></samp> (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 <samp><span class="command">verify_detached</span></samp> (see <a href="#verify_005fdetached">verify_detached</a>). See <a href="#Using-digital-signatures">Using digital signatures</a>, for more information. </p></blockquote></div> <div class="node"> <a name="drivemap"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#echo">echo</a>, Previous: <a rel="previous" accesskey="p" href="#distrust">distrust</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.24 drivemap</h4> <div class="defun"> — Command: <b>drivemap</b> <samp><span class="option">-l</span></samp><var>|</var><samp><span class="option">-r</span></samp><var>|</var>[<samp><span class="option">-s</span></samp>]<var> from_drive to_drive<a name="index-drivemap-30"></a></var><br> <blockquote><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>With the <samp><span class="option">-s</span></samp> option, perform the reverse mapping as well, swapping the two drives. <p>With the <samp><span class="option">-l</span></samp> option, list the current mappings. <p>With the <samp><span class="option">-r</span></samp> option, reset all mappings to the default values. <p>For example: <pre class="example"> drivemap -s (hd0) (hd1) </pre> </blockquote></div> <div class="node"> <a name="echo"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#eval">eval</a>, Previous: <a rel="previous" accesskey="p" href="#drivemap">drivemap</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.25 echo</h4> <div class="defun"> — Command: <b>echo</b> [<samp><span class="option">-n</span></samp>] [<samp><span class="option">-e</span></samp>]<var> string <small class="dots">...</small><a name="index-echo-31"></a></var><br> <blockquote><p>Display the requested text and, unless the <samp><span class="option">-n</span></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><span class="samp">${var}</span></samp>’. <p>The <samp><span class="option">-e</span></samp> option enables interpretation of backslash escapes. The following sequences are recognised: <dl> <dt><code>\\</code><dd>backslash <br><dt><code>\a</code><dd>alert (BEL) <br><dt><code>\c</code><dd>suppress trailing new line <br><dt><code>\f</code><dd>form feed <br><dt><code>\n</code><dd>new line <br><dt><code>\r</code><dd>carriage return <br><dt><code>\t</code><dd>horizontal tab <br><dt><code>\v</code><dd>vertical tab </dl> <p>When interpreting backslash escapes, backslash followed by any other character will print that character. </p></blockquote></div> <div class="node"> <a name="eval"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#export">export</a>, Previous: <a rel="previous" accesskey="p" href="#echo">echo</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.26 eval</h4> <div class="defun"> — Command: <b>eval</b><var> string ...<a name="index-eval-32"></a></var><br> <blockquote><p>Concatenate arguments together using single space as separator and evaluate result as sequence of GRUB commands. </p></blockquote></div> <div class="node"> <a name="export"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#false">false</a>, Previous: <a rel="previous" accesskey="p" href="#eval">eval</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.27 export</h4> <div class="defun"> — Command: <b>export</b><var> envvar<a name="index-export-33"></a></var><br> <blockquote><p>Export the environment variable <var>envvar</var>. Exported variables are visible to subsidiary configuration files loaded using <samp><span class="command">configfile</span></samp>. </p></blockquote></div> <div class="node"> <a name="false"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#gettext">gettext</a>, Previous: <a rel="previous" accesskey="p" href="#export">export</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.28 false</h4> <div class="defun"> — Command: <b>false</b><var><a name="index-false-34"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="gettext"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#gptsync">gptsync</a>, Previous: <a rel="previous" accesskey="p" href="#false">false</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.29 gettext</h4> <div class="defun"> — Command: <b>gettext</b><var> string<a name="index-gettext-35"></a></var><br> <blockquote><p>Translate <var>string</var> into the current language. <p>The current language code is stored in the ‘<samp><span class="samp">lang</span></samp>’ variable in GRUB's environment (see <a href="#lang">lang</a>). Translation files in MO format are read from ‘<samp><span class="samp">locale_dir</span></samp>’ (see <a href="#locale_005fdir">locale_dir</a>), usually <samp><span class="file">/boot/grub/locale</span></samp>. </p></blockquote></div> <div class="node"> <a name="gptsync"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#halt">halt</a>, Previous: <a rel="previous" accesskey="p" href="#gettext">gettext</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.30 gptsync</h4> <div class="defun"> — Command: <b>gptsync</b><var> device </var>[<var>partition</var>[<var>+/-</var>[<var>type</var>]]]<var> <small class="dots">...</small><a name="index-gptsync-36"></a></var><br> <blockquote><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>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><var>type</var> is an MBR partition type code; prefix with ‘<samp><span class="samp">0x</span></samp>’ if you want to enter this in hexadecimal. The separator between <var>partition</var> and <var>type</var> may be ‘<samp><span class="samp">+</span></samp>’ to make the partition active, or ‘<samp><span class="samp">-</span></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></blockquote></div> <div class="node"> <a name="halt"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#hashsum">hashsum</a>, Previous: <a rel="previous" accesskey="p" href="#gptsync">gptsync</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.31 halt</h4> <div class="defun"> — Command: <b>halt</b> <samp><span class="option">--no-apm</span></samp><var><a name="index-halt-37"></a></var><br> <blockquote><p>The command halts the computer. If the <samp><span class="option">--no-apm</span></samp> option is specified, no APM BIOS call is performed. Otherwise, the computer is shut down using APM. </p></blockquote></div> <div class="node"> <a name="hashsum"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#help">help</a>, Previous: <a rel="previous" accesskey="p" href="#halt">halt</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.32 hashsum</h4> <div class="defun"> — Command: <b>hashsum</b> <samp><span class="option">--hash</span></samp><var> hash </var><samp><span class="option">--keep-going</span></samp> <samp><span class="option">--uncompress</span></samp> <samp><span class="option">--check</span></samp><var> file </var>[<samp><span class="option">--prefix</span></samp><var> dir</var>]<var>|file <small class="dots">...</small><a name="index-hashsum-38"></a></var><br> <blockquote><p>Compute or verify file hashes. Hash type is selected with option <samp><span class="option">--hash</span></samp>. Supported hashes are: ‘<samp><span class="samp">adler32</span></samp>’, ‘<samp><span class="samp">crc64</span></samp>’, ‘<samp><span class="samp">crc32</span></samp>’, ‘<samp><span class="samp">crc32rfc1510</span></samp>’, ‘<samp><span class="samp">crc24rfc2440</span></samp>’, ‘<samp><span class="samp">md4</span></samp>’, ‘<samp><span class="samp">md5</span></samp>’, ‘<samp><span class="samp">ripemd160</span></samp>’, ‘<samp><span class="samp">sha1</span></samp>’, ‘<samp><span class="samp">sha224</span></samp>’, ‘<samp><span class="samp">sha256</span></samp>’, ‘<samp><span class="samp">sha512</span></samp>’, ‘<samp><span class="samp">sha384</span></samp>’, ‘<samp><span class="samp">tiger192</span></samp>’, ‘<samp><span class="samp">tiger</span></samp>’, ‘<samp><span class="samp">tiger2</span></samp>’, ‘<samp><span class="samp">whirlpool</span></samp>’. Option <samp><span class="option">--uncompress</span></samp> uncompresses files before computing hash. <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>When option <samp><span class="option">--check</span></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 <samp><span class="command">md5sum</span></samp> command. Option <samp><span class="option">--prefix</span></samp> may be used to give directory where files are located. Hash verification stops after the first mismatch was found unless option <samp><span class="option">--keep-going</span></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></blockquote></div> <div class="node"> <a name="help"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#initrd">initrd</a>, Previous: <a rel="previous" accesskey="p" href="#hashsum">hashsum</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.33 help</h4> <div class="defun"> — Command: <b>help</b> [<var>pattern <small class="dots">...</small></var>]<var><a name="index-help-39"></a></var><br> <blockquote><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>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></blockquote></div> <div class="node"> <a name="initrd"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#initrd16">initrd16</a>, Previous: <a rel="previous" accesskey="p" href="#help">help</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.34 initrd</h4> <div class="defun"> — Command: <b>initrd</b><var> file<a name="index-initrd-40"></a></var><br> <blockquote><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 <samp><span class="command">linux</span></samp> command (see <a href="#linux">linux</a>) has been run. See also <a href="#GNU_002fLinux">GNU/Linux</a>. </p></blockquote></div> <div class="node"> <a name="initrd16"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#insmod">insmod</a>, Previous: <a rel="previous" accesskey="p" href="#initrd">initrd</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.35 initrd16</h4> <div class="defun"> — Command: <b>initrd16</b><var> file<a name="index-initrd16-41"></a></var><br> <blockquote><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 <samp><span class="command">linux16</span></samp> command (see <a href="#linux16">linux16</a>) has been run. See also <a href="#GNU_002fLinux">GNU/Linux</a>. <p>This command is only available on x86 systems. </p></blockquote></div> <div class="node"> <a name="insmod"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#keystatus">keystatus</a>, Previous: <a rel="previous" accesskey="p" href="#initrd16">initrd16</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.36 insmod</h4> <div class="defun"> — Command: <b>insmod</b><var> module<a name="index-insmod-42"></a></var><br> <blockquote><p>Insert the dynamic GRUB module called <var>module</var>. </p></blockquote></div> <div class="node"> <a name="keystatus"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#linux">linux</a>, Previous: <a rel="previous" accesskey="p" href="#insmod">insmod</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.37 keystatus</h4> <div class="defun"> — Command: <b>keystatus</b> [<samp><span class="option">--shift</span></samp>] [<samp><span class="option">--ctrl</span></samp>] [<samp><span class="option">--alt</span></samp>]<var><a name="index-keystatus-43"></a></var><br> <blockquote><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>Checking key modifier status is only supported on some platforms. If invoked without any options, the <samp><span class="command">keystatus</span></samp> command returns true if and only if checking key modifier status is supported. </p></blockquote></div> <div class="node"> <a name="linux"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#linux16">linux16</a>, Previous: <a rel="previous" accesskey="p" href="#keystatus">keystatus</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.38 linux</h4> <div class="defun"> — Command: <b>linux</b><var> file <small class="dots">...</small><a name="index-linux-44"></a></var><br> <blockquote><p>Load a Linux kernel image from <var>file</var>. The rest of the line is passed verbatim as the <dfn>kernel command-line</dfn>. Any initrd must be reloaded after using this command (see <a href="#initrd">initrd</a>). <p>On x86 systems, the kernel will be booted using the 32-bit boot protocol. Note that this means that the ‘<samp><span class="samp">vga=</span></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><span class="samp">set gfxpayload=1024x768</span></samp>’ or ‘<samp><span class="samp">set gfxpayload=keep</span></samp>’ (to keep the same mode as used in GRUB) instead. GRUB can automatically detect some uses of ‘<samp><span class="samp">vga=</span></samp>’ and translate them to appropriate settings of ‘<samp><span class="samp">gfxpayload</span></samp>’. The <samp><span class="command">linux16</span></samp> command (see <a href="#linux16">linux16</a>) avoids this restriction. </p></blockquote></div> <div class="node"> <a name="linux16"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#list_005fenv">list_env</a>, Previous: <a rel="previous" accesskey="p" href="#linux">linux</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.39 linux16</h4> <div class="defun"> — Command: <b>linux16</b><var> file <small class="dots">...</small><a name="index-linux16-45"></a></var><br> <blockquote><p>Load a Linux kernel image from <var>file</var> in 16-bit mode. The rest of the line is passed verbatim as the <dfn>kernel command-line</dfn>. Any initrd must be reloaded after using this command (see <a href="#initrd16">initrd16</a>). <p>The kernel will be booted using the traditional 16-bit boot protocol. As well as bypassing problems with ‘<samp><span class="samp">vga=</span></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>This command is only available on x86 systems. </p></blockquote></div> <div class="node"> <a name="list_env"></a> <a name="list_005fenv"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#list_005ftrusted">list_trusted</a>, Previous: <a rel="previous" accesskey="p" href="#linux16">linux16</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.40 list_env</h4> <div class="defun"> — Command: <b>list_env</b> [<samp><span class="option">--file</span></samp><var> file</var>]<var><a name="index-list_005fenv-46"></a></var><br> <blockquote><p>List all variables in the environment block file. See <a href="#Environment-block">Environment block</a>. <p>The <samp><span class="option">--file</span></samp> option overrides the default location of the environment block. </p></blockquote></div> <div class="node"> <a name="list_trusted"></a> <a name="list_005ftrusted"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#load_005fenv">load_env</a>, Previous: <a rel="previous" accesskey="p" href="#list_005fenv">list_env</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.41 list_trusted</h4> <div class="defun"> — Command: <b>list_trusted</b><var><a name="index-list_005ftrusted-47"></a></var><br> <blockquote><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 <samp><span class="command">distrust</span></samp> (see <a href="#distrust">distrust</a>). See <a href="#Using-digital-signatures">Using digital signatures</a>, for more information about uses for these keys. </p></blockquote></div> <div class="node"> <a name="load_env"></a> <a name="load_005fenv"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#loadfont">loadfont</a>, Previous: <a rel="previous" accesskey="p" href="#list_005ftrusted">list_trusted</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.42 load_env</h4> <div class="defun"> — Command: <b>load_env</b> [<samp><span class="option">--file</span></samp><var> file</var>] [<samp><span class="option">--skip-sig</span></samp>] [<var>whitelisted_variable_name</var>]<var> <small class="dots">...</small><a name="index-load_005fenv-48"></a></var><br> <blockquote><p>Load all variables from the environment block file into the environment. See <a href="#Environment-block">Environment block</a>. <p>The <samp><span class="option">--file</span></samp> option overrides the default location of the environment block. <p>The <samp><span class="option">--skip-sig</span></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>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>The <samp><span class="option">--skip-sig</span></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>When used with care, <samp><span class="option">--skip-sig</span></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-digital-signatures">Using digital signatures</a>, for more information. </p></blockquote></div> <div class="node"> <a name="loadfont"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#loopback">loopback</a>, Previous: <a rel="previous" accesskey="p" href="#load_005fenv">load_env</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.43 loadfont</h4> <div class="defun"> — Command: <b>loadfont</b><var> file <small class="dots">...</small><a name="index-loadfont-49"></a></var><br> <blockquote><p>Load specified font files. Unless absolute pathname is given, <var>file</var> is assumed to be in directory ‘<samp><span class="samp">$prefix/fonts</span></samp>’ with suffix ‘<samp><span class="samp">.pf2</span></samp>’ appended. See <a href="#Theme-file-format">Fonts</a>. </p></blockquote></div> <div class="node"> <a name="loopback"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#ls">ls</a>, Previous: <a rel="previous" accesskey="p" href="#loadfont">loadfont</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.44 loopback</h4> <div class="defun"> — Command: <b>loopback</b> [<samp><span class="option">-d</span></samp>]<var> device file<a name="index-loopback-50"></a></var><br> <blockquote><p>Make the device named <var>device</var> correspond to the contents of the filesystem image in <var>file</var>. For example: <pre class="example"> loopback loop0 /path/to/image ls (loop0)/ </pre> <p>With the <samp><span class="option">-d</span></samp> option, delete a device previously created using this command. </p></blockquote></div> <div class="node"> <a name="ls"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#lsfonts">lsfonts</a>, Previous: <a rel="previous" accesskey="p" href="#loopback">loopback</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.45 ls</h4> <div class="defun"> — Command: <b>ls</b> [<var>arg <small class="dots">...</small></var>]<var><a name="index-ls-51"></a></var><br> <blockquote><p>List devices or files. <p>With no arguments, print all devices known to GRUB. <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>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></blockquote></div> <div class="node"> <a name="lsfonts"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#lsmod">lsmod</a>, Previous: <a rel="previous" accesskey="p" href="#ls">ls</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.46 lsfonts</h4> <div class="defun"> — Command: <b>lsfonts</b><var><a name="index-lsfonts-52"></a></var><br> <blockquote><p>List loaded fonts. </p></blockquote></div> <div class="node"> <a name="lsmod"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#md5sum">md5sum</a>, Previous: <a rel="previous" accesskey="p" href="#lsfonts">lsfonts</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.47 lsmod</h4> <div class="defun"> — Command: <b>lsmod</b><var><a name="index-lsmod-53"></a></var><br> <blockquote><p>Show list of loaded modules. </p></blockquote></div> <div class="node"> <a name="md5sum"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#module">module</a>, Previous: <a rel="previous" accesskey="p" href="#lsmod">lsmod</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.48 md5sum</h4> <div class="defun"> — Command: <b>md5sum</b><var> arg <small class="dots">...</small><a name="index-md5sum-54"></a></var><br> <blockquote><p>Alias for <code>hashsum --hash md5 arg ...</code>. See command <samp><span class="command">hashsum</span></samp> (see <a href="#hashsum">hashsum</a>) for full description. </p></blockquote></div> <div class="node"> <a name="module"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#multiboot">multiboot</a>, Previous: <a rel="previous" accesskey="p" href="#md5sum">md5sum</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.49 module</h4> <div class="defun"> — Command: <b>module</b> [<var>–nounzip</var>]<var> file </var>[<var>arguments</var>]<var><a name="index-module-55"></a></var><br> <blockquote><p>Load a module for multiboot kernel image. The rest of the line is passed verbatim as the module command line. </p></blockquote></div> <div class="node"> <a name="multiboot"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#nativedisk">nativedisk</a>, Previous: <a rel="previous" accesskey="p" href="#module">module</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.50 multiboot</h4> <div class="defun"> — Command: <b>multiboot</b> [<var>–quirk-bad-kludge</var>] [<var>–quirk-modules-after-kernel</var>]<var> file <small class="dots">...</small><a name="index-multiboot-56"></a></var><br> <blockquote><p>Load a multiboot kernel image from <var>file</var>. The rest of the line is passed verbatim as the <dfn>kernel command-line</dfn>. Any module must be reloaded after using this command (see <a href="#module">module</a>). <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>–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></blockquote></div> <div class="node"> <a name="nativedisk"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#normal">normal</a>, Previous: <a rel="previous" accesskey="p" href="#multiboot">multiboot</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.51 nativedisk</h4> <div class="defun"> — Command: <b>nativedisk</b><var><a name="index-nativedisk-57"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="normal"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#normal_005fexit">normal_exit</a>, Previous: <a rel="previous" accesskey="p" href="#nativedisk">nativedisk</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.52 normal</h4> <div class="defun"> — Command: <b>normal</b> [<var>file</var>]<var><a name="index-normal-58"></a></var><br> <blockquote><p>Enter normal mode and display the GRUB menu. <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 <samp><span class="command">insmod</span></samp> (see <a href="#insmod">insmod</a>). <p>If a <var>file</var> is given, then commands will be read from that file. Otherwise, they will be read from <samp><span class="file">$prefix/grub.cfg</span></samp> if it exists. <p><samp><span class="command">normal</span></samp> may be called from within normal mode, creating a nested environment. It is more usual to use <samp><span class="command">configfile</span></samp> (see <a href="#configfile">configfile</a>) for this. </p></blockquote></div> <div class="node"> <a name="normal_exit"></a> <a name="normal_005fexit"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#parttool">parttool</a>, Previous: <a rel="previous" accesskey="p" href="#normal">normal</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.53 normal_exit</h4> <div class="defun"> — Command: <b>normal_exit</b><var><a name="index-normal_005fexit-59"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="parttool"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#password">password</a>, Previous: <a rel="previous" accesskey="p" href="#normal_005fexit">normal_exit</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.54 parttool</h4> <div class="defun"> — Command: <b>parttool</b><var> partition commands<a name="index-parttool-60"></a></var><br> <blockquote><p>Make various modifications to partition table entries. <p>Each <var>command</var> is either a boolean option, in which case it must be followed with ‘<samp><span class="samp">+</span></samp>’ or ‘<samp><span class="samp">-</span></samp>’ (with no intervening space) to enable or disable that option, or else it takes a value in the form ‘<samp><var>command</var><span class="samp">=</span><var>value</var></samp>’. <p>Currently, <samp><span class="command">parttool</span></samp> is only useful on DOS partition tables (also known as Master Boot Record, or MBR). On these partition tables, the following commands are available: <dl> <dt>‘<samp><span class="samp">boot</span></samp>’ (boolean)<dd>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. <br><dt>‘<samp><span class="samp">type</span></samp>’ (value)<dd>Change the type of an existing partition. The value must be a number in the range 0-0xFF (prefix with ‘<samp><span class="samp">0x</span></samp>’ to enter it in hexadecimal). <br><dt>‘<samp><span class="samp">hidden</span></samp>’ (boolean)<dd>When enabled, this hides the selected partition by setting the <dfn>hidden</dfn> bit in its partition type code; when disabled, unhides the selected partition by clearing this bit. This is useful only when booting DOS or Wwindows and multiple primary FAT partitions exist in one disk. See also <a href="#DOS_002fWindows">DOS/Windows</a>. </dl> </p></blockquote></div> <div class="node"> <a name="password"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#password_005fpbkdf2">password_pbkdf2</a>, Previous: <a rel="previous" accesskey="p" href="#parttool">parttool</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.55 password</h4> <div class="defun"> — Command: <b>password</b><var> user clear-password<a name="index-password-61"></a></var><br> <blockquote><p>Define a user named <var>user</var> with password <var>clear-password</var>. See <a href="#Security">Security</a>. </p></blockquote></div> <div class="node"> <a name="password_pbkdf2"></a> <a name="password_005fpbkdf2"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#play">play</a>, Previous: <a rel="previous" accesskey="p" href="#password">password</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.56 password_pbkdf2</h4> <div class="defun"> — Command: <b>password_pbkdf2</b><var> user hashed-password<a name="index-password_005fpbkdf2-62"></a></var><br> <blockquote><p>Define a user named <var>user</var> with password hash <var>hashed-password</var>. Use <samp><span class="command">grub-mkpasswd-pbkdf2</span></samp> (see <a href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub-mkpasswd-pbkdf2</a>) to generate password hashes. See <a href="#Security">Security</a>. </p></blockquote></div> <div class="node"> <a name="play"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#probe">probe</a>, Previous: <a rel="previous" accesskey="p" href="#password_005fpbkdf2">password_pbkdf2</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.57 play</h4> <div class="defun"> — Command: <b>play</b><var> file | tempo </var>[<var>pitch1 duration1</var>] [<var>pitch2 duration2</var>]<var> <small class="dots">...</small><a name="index-play-63"></a></var><br> <blockquote><p>Plays a tune <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>If the arguments are a series of numbers, play the inline tune. <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></blockquote></div> <div class="node"> <a name="probe"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#pxe_005funload">pxe_unload</a>, Previous: <a rel="previous" accesskey="p" href="#play">play</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.58 probe</h4> <div class="defun"> — Command: <b>probe</b> [<samp><span class="option">--set</span></samp><var> var</var>] <samp><span class="option">--driver</span></samp><var>|</var><samp><span class="option">--partmap</span></samp><var>|</var><samp><span class="option">--fs</span></samp><var>|</var><samp><span class="option">--fs-uuid</span></samp><var>|</var><samp><span class="option">--label</span></samp><var> device<a name="index-probe-64"></a></var><br> <blockquote><p>Retrieve device information. If option <samp><span class="option">--set</span></samp> is given, assign result to variable <var>var</var>, otherwise print information on the screen. </p></blockquote></div> <div class="node"> <a name="pxe_unload"></a> <a name="pxe_005funload"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#read">read</a>, Previous: <a rel="previous" accesskey="p" href="#probe">probe</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.59 pxe_unload</h4> <div class="defun"> — Command: <b>pxe_unload</b><var><a name="index-pxe_005funload-65"></a></var><br> <blockquote><p>Unload the PXE environment (see <a href="#Network">Network</a>). <p>This command is only available on PC BIOS systems. </p></blockquote></div> <div class="node"> <a name="read"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#reboot">reboot</a>, Previous: <a rel="previous" accesskey="p" href="#pxe_005funload">pxe_unload</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.60 read</h4> <div class="defun"> — Command: <b>read</b> [<var>var</var>]<var><a name="index-read-66"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="reboot"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#regexp">regexp</a>, Previous: <a rel="previous" accesskey="p" href="#read">read</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.61 reboot</h4> <div class="defun"> — Command: <b>reboot</b><var><a name="index-reboot-67"></a></var><br> <blockquote><p>Reboot the computer. </p></blockquote></div> <div class="node"> <a name="regexp"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#rmmod">rmmod</a>, Previous: <a rel="previous" accesskey="p" href="#reboot">reboot</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.62 regexp</h4> <div class="defun"> — Command: <b>regexp</b> [<samp><span class="option">--set</span></samp> [<var>number:</var>]<var>var</var>]<var> regexp string<a name="index-regexp-68"></a></var><br> <blockquote><p>Test if regular expression <var>regexp</var> matches <var>string</var>. Supported regular expressions are POSIX.2 Extended Regular Expressions. If option <samp><span class="option">--set</span></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><span class="samp">1</span></samp>’. <var>number</var> defaults to ‘<samp><span class="samp">1</span></samp>’. </p></blockquote></div> <div class="node"> <a name="rmmod"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#save_005fenv">save_env</a>, Previous: <a rel="previous" accesskey="p" href="#regexp">regexp</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.63 rmmod</h4> <div class="defun"> — Command: <b>rmmod</b><var> module<a name="index-rmmod-69"></a></var><br> <blockquote><p>Remove a loaded <var>module</var>. </p></blockquote></div> <div class="node"> <a name="save_env"></a> <a name="save_005fenv"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#search">search</a>, Previous: <a rel="previous" accesskey="p" href="#rmmod">rmmod</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.64 save_env</h4> <div class="defun"> — Command: <b>save_env</b> [<samp><span class="option">--file</span></samp><var> file</var>]<var> var <small class="dots">...</small><a name="index-save_005fenv-70"></a></var><br> <blockquote><p>Save the named variables from the environment to the environment block file. See <a href="#Environment-block">Environment block</a>. <p>The <samp><span class="option">--file</span></samp> option overrides the default location of the environment block. <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-digital-signatures">Using digital signatures</a>, for more information. </p></blockquote></div> <div class="node"> <a name="search"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#sendkey">sendkey</a>, Previous: <a rel="previous" accesskey="p" href="#save_005fenv">save_env</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.65 search</h4> <div class="defun"> — Command: <b>search</b> [<samp><span class="option">--file</span></samp><var>|</var><samp><span class="option">--label</span></samp><var>|</var><samp><span class="option">--fs-uuid</span></samp>] [<samp><span class="option">--set</span></samp> [<var>var</var>]] [<samp><span class="option">--no-floppy</span></samp>]<var> name<a name="index-search-71"></a></var><br> <blockquote><p>Search devices by file (<samp><span class="option">-f</span></samp>, <samp><span class="option">--file</span></samp>), filesystem label (<samp><span class="option">-l</span></samp>, <samp><span class="option">--label</span></samp>), or filesystem UUID (<samp><span class="option">-u</span></samp>, <samp><span class="option">--fs-uuid</span></samp>). <p>If the <samp><span class="option">--set</span></samp> option is used, the first device found is set as the value of environment variable <var>var</var>. The default variable is ‘<samp><span class="samp">root</span></samp>’. <p>The <samp><span class="option">--no-floppy</span></samp> option prevents searching floppy devices, which can be slow. <p>The ‘<samp><span class="samp">search.file</span></samp>’, ‘<samp><span class="samp">search.fs_label</span></samp>’, and ‘<samp><span class="samp">search.fs_uuid</span></samp>’ commands are aliases for ‘<samp><span class="samp">search --file</span></samp>’, ‘<samp><span class="samp">search --label</span></samp>’, and ‘<samp><span class="samp">search --fs-uuid</span></samp>’ respectively. </p></blockquote></div> <div class="node"> <a name="sendkey"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#set">set</a>, Previous: <a rel="previous" accesskey="p" href="#search">search</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.66 sendkey</h4> <div class="defun"> — Command: <b>sendkey</b> [<samp><span class="option">--num</span></samp><var>|</var><samp><span class="option">--caps</span></samp><var>|</var><samp><span class="option">--scroll</span></samp><var>|</var><samp><span class="option">--insert</span></samp><var>| </var><samp><span class="option">--pause</span></samp><var>|</var><samp><span class="option">--left-shift</span></samp><var>|</var><samp><span class="option">--right-shift</span></samp><var>| </var><samp><span class="option">--sysrq</span></samp><var>|</var><samp><span class="option">--numkey</span></samp><var>|</var><samp><span class="option">--capskey</span></samp><var>|</var><samp><span class="option">--scrollkey</span></samp><var>| </var><samp><span class="option">--insertkey</span></samp><var>|</var><samp><span class="option">--left-alt</span></samp><var>|</var><samp><span class="option">--right-alt</span></samp><var>| </var><samp><span class="option">--left-ctrl</span></samp><var>|</var><samp><span class="option">--right-ctrl</span></samp><var> ‘</var><samp><span class="samp">on</span></samp><var>’|‘</var><samp><span class="samp">off</span></samp><var>’</var>]<var><small class="dots">...</small> </var>[<samp><span class="option">no-led</span></samp>]<var> keystroke<a name="index-sendkey-72"></a></var><br> <blockquote><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>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: <!-- Please keep this table in the same order as in --> <!-- commands/i386/pc/sendkey.c, for ease of maintenance. --> <!-- Exception: The function and numeric keys are sorted, for aesthetics. --> <p><table summary=""><tr align="left"><th valign="top" width="40%">Name </th><th valign="top" width="50%">Key <br></th></tr><tr align="left"><td valign="top" width="40%">escape </td><td valign="top" width="50%">Escape <br></td></tr><tr align="left"><td valign="top" width="40%">exclam </td><td valign="top" width="50%">! <br></td></tr><tr align="left"><td valign="top" width="40%">at </td><td valign="top" width="50%">@ <br></td></tr><tr align="left"><td valign="top" width="40%">numbersign </td><td valign="top" width="50%"># <br></td></tr><tr align="left"><td valign="top" width="40%">dollar </td><td valign="top" width="50%">$ <br></td></tr><tr align="left"><td valign="top" width="40%">percent </td><td valign="top" width="50%">% <br></td></tr><tr align="left"><td valign="top" width="40%">caret </td><td valign="top" width="50%">^ <br></td></tr><tr align="left"><td valign="top" width="40%">ampersand </td><td valign="top" width="50%">& <br></td></tr><tr align="left"><td valign="top" width="40%">asterisk </td><td valign="top" width="50%">* <br></td></tr><tr align="left"><td valign="top" width="40%">parenleft </td><td valign="top" width="50%">( <br></td></tr><tr align="left"><td valign="top" width="40%">parenright </td><td valign="top" width="50%">) <br></td></tr><tr align="left"><td valign="top" width="40%">minus </td><td valign="top" width="50%">- <br></td></tr><tr align="left"><td valign="top" width="40%">underscore </td><td valign="top" width="50%">_ <br></td></tr><tr align="left"><td valign="top" width="40%">equal </td><td valign="top" width="50%">= <br></td></tr><tr align="left"><td valign="top" width="40%">plus </td><td valign="top" width="50%">+ <br></td></tr><tr align="left"><td valign="top" width="40%">backspace </td><td valign="top" width="50%">Backspace <br></td></tr><tr align="left"><td valign="top" width="40%">tab </td><td valign="top" width="50%">Tab <br></td></tr><tr align="left"><td valign="top" width="40%">bracketleft </td><td valign="top" width="50%">[ <br></td></tr><tr align="left"><td valign="top" width="40%">braceleft </td><td valign="top" width="50%">{ <br></td></tr><tr align="left"><td valign="top" width="40%">bracketright </td><td valign="top" width="50%">] <br></td></tr><tr align="left"><td valign="top" width="40%">braceright </td><td valign="top" width="50%">} <br></td></tr><tr align="left"><td valign="top" width="40%">enter </td><td valign="top" width="50%">Enter <br></td></tr><tr align="left"><td valign="top" width="40%">control </td><td valign="top" width="50%">press and release Control <br></td></tr><tr align="left"><td valign="top" width="40%">semicolon </td><td valign="top" width="50%">; <br></td></tr><tr align="left"><td valign="top" width="40%">colon </td><td valign="top" width="50%">: <br></td></tr><tr align="left"><td valign="top" width="40%">quote </td><td valign="top" width="50%">' <br></td></tr><tr align="left"><td valign="top" width="40%">doublequote </td><td valign="top" width="50%">" <br></td></tr><tr align="left"><td valign="top" width="40%">backquote </td><td valign="top" width="50%">` <br></td></tr><tr align="left"><td valign="top" width="40%">tilde </td><td valign="top" width="50%">~ <br></td></tr><tr align="left"><td valign="top" width="40%">shift </td><td valign="top" width="50%">press and release left Shift <br></td></tr><tr align="left"><td valign="top" width="40%">backslash </td><td valign="top" width="50%">\ <br></td></tr><tr align="left"><td valign="top" width="40%">bar </td><td valign="top" width="50%">| <br></td></tr><tr align="left"><td valign="top" width="40%">comma </td><td valign="top" width="50%">, <br></td></tr><tr align="left"><td valign="top" width="40%">less </td><td valign="top" width="50%">< <br></td></tr><tr align="left"><td valign="top" width="40%">period </td><td valign="top" width="50%">. <br></td></tr><tr align="left"><td valign="top" width="40%">greater </td><td valign="top" width="50%">> <br></td></tr><tr align="left"><td valign="top" width="40%">slash </td><td valign="top" width="50%">/ <br></td></tr><tr align="left"><td valign="top" width="40%">question </td><td valign="top" width="50%">? <br></td></tr><tr align="left"><td valign="top" width="40%">rshift </td><td valign="top" width="50%">press and release right Shift <br></td></tr><tr align="left"><td valign="top" width="40%">alt </td><td valign="top" width="50%">press and release Alt <br></td></tr><tr align="left"><td valign="top" width="40%">space </td><td valign="top" width="50%">space bar <br></td></tr><tr align="left"><td valign="top" width="40%">capslock </td><td valign="top" width="50%">Caps Lock <br></td></tr><tr align="left"><td valign="top" width="40%">F1 </td><td valign="top" width="50%">F1 <br></td></tr><tr align="left"><td valign="top" width="40%">F2 </td><td valign="top" width="50%">F2 <br></td></tr><tr align="left"><td valign="top" width="40%">F3 </td><td valign="top" width="50%">F3 <br></td></tr><tr align="left"><td valign="top" width="40%">F4 </td><td valign="top" width="50%">F4 <br></td></tr><tr align="left"><td valign="top" width="40%">F5 </td><td valign="top" width="50%">F5 <br></td></tr><tr align="left"><td valign="top" width="40%">F6 </td><td valign="top" width="50%">F6 <br></td></tr><tr align="left"><td valign="top" width="40%">F7 </td><td valign="top" width="50%">F7 <br></td></tr><tr align="left"><td valign="top" width="40%">F8 </td><td valign="top" width="50%">F8 <br></td></tr><tr align="left"><td valign="top" width="40%">F9 </td><td valign="top" width="50%">F9 <br></td></tr><tr align="left"><td valign="top" width="40%">F10 </td><td valign="top" width="50%">F10 <br></td></tr><tr align="left"><td valign="top" width="40%">F11 </td><td valign="top" width="50%">F11 <br></td></tr><tr align="left"><td valign="top" width="40%">F12 </td><td valign="top" width="50%">F12 <br></td></tr><tr align="left"><td valign="top" width="40%">num1 </td><td valign="top" width="50%">1 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num2 </td><td valign="top" width="50%">2 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num3 </td><td valign="top" width="50%">3 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num4 </td><td valign="top" width="50%">4 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num5 </td><td valign="top" width="50%">5 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num6 </td><td valign="top" width="50%">6 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num7 </td><td valign="top" width="50%">7 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num8 </td><td valign="top" width="50%">8 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num9 </td><td valign="top" width="50%">9 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">num0 </td><td valign="top" width="50%">0 (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numperiod </td><td valign="top" width="50%">. (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numend </td><td valign="top" width="50%">End (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numdown </td><td valign="top" width="50%">Down (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numpgdown </td><td valign="top" width="50%">Page Down (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numleft </td><td valign="top" width="50%">Left (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numcenter </td><td valign="top" width="50%">5 with Num Lock inactive (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numright </td><td valign="top" width="50%">Right (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numhome </td><td valign="top" width="50%">Home (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numup </td><td valign="top" width="50%">Up (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numpgup </td><td valign="top" width="50%">Page Up (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numinsert </td><td valign="top" width="50%">Insert (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numdelete </td><td valign="top" width="50%">Delete (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numasterisk </td><td valign="top" width="50%">* (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numminus </td><td valign="top" width="50%">- (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numplus </td><td valign="top" width="50%">+ (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numslash </td><td valign="top" width="50%">/ (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">numenter </td><td valign="top" width="50%">Enter (numeric keypad) <br></td></tr><tr align="left"><td valign="top" width="40%">delete </td><td valign="top" width="50%">Delete <br></td></tr><tr align="left"><td valign="top" width="40%">insert </td><td valign="top" width="50%">Insert <br></td></tr><tr align="left"><td valign="top" width="40%">home </td><td valign="top" width="50%">Home <br></td></tr><tr align="left"><td valign="top" width="40%">end </td><td valign="top" width="50%">End <br></td></tr><tr align="left"><td valign="top" width="40%">pgdown </td><td valign="top" width="50%">Page Down <br></td></tr><tr align="left"><td valign="top" width="40%">pgup </td><td valign="top" width="50%">Page Up <br></td></tr><tr align="left"><td valign="top" width="40%">down </td><td valign="top" width="50%">Down <br></td></tr><tr align="left"><td valign="top" width="40%">up </td><td valign="top" width="50%">Up <br></td></tr><tr align="left"><td valign="top" width="40%">left </td><td valign="top" width="50%">Left <br></td></tr><tr align="left"><td valign="top" width="40%">right </td><td valign="top" width="50%">Right <br></td></tr></table> <p>As well as keystrokes, the <samp><span class="command">sendkey</span></samp> command takes various options that affect the BIOS keyboard status flags. These options take an ‘<samp><span class="samp">on</span></samp>’ or ‘<samp><span class="samp">off</span></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><span class="option">--num</span></samp>, <samp><span class="option">--caps</span></samp>, <samp><span class="option">--scroll</span></samp>, and <samp><span class="option">--insert</span></samp> options emulate setting the corresponding mode, while the <samp><span class="option">--numkey</span></samp>, <samp><span class="option">--capskey</span></samp>, <samp><span class="option">--scrollkey</span></samp>, and <samp><span class="option">--insertkey</span></samp> options emulate pressing and holding the corresponding key. The other status flag options are self-explanatory. <p>If the <samp><span class="option">--no-led</span></samp> option is given, the status flag options will have no effect on keyboard LEDs. <p>If the <samp><span class="command">sendkey</span></samp> command is given multiple times, then only the last invocation has any effect. <p>Since <samp><span class="command">sendkey</span></samp> 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 <samp><span class="command">sendkey</span></samp> will have no effect. <p>This command is only available on PC BIOS systems. </p></blockquote></div> <div class="node"> <a name="set"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#sha1sum">sha1sum</a>, Previous: <a rel="previous" accesskey="p" href="#sendkey">sendkey</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.67 set</h4> <div class="defun"> — Command: <b>set</b> [<var>envvar=value</var>]<var><a name="index-set-73"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="sha1sum"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#sha256sum">sha256sum</a>, Previous: <a rel="previous" accesskey="p" href="#set">set</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.68 sha1sum</h4> <div class="defun"> — Command: <b>sha1sum</b><var> arg <small class="dots">...</small><a name="index-sha1sum-74"></a></var><br> <blockquote><p>Alias for <code>hashsum --hash sha1 arg ...</code>. See command <samp><span class="command">hashsum</span></samp> (see <a href="#hashsum">hashsum</a>) for full description. </p></blockquote></div> <div class="node"> <a name="sha256sum"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#sha512sum">sha512sum</a>, Previous: <a rel="previous" accesskey="p" href="#sha1sum">sha1sum</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.69 sha256sum</h4> <div class="defun"> — Command: <b>sha256sum</b><var> arg <small class="dots">...</small><a name="index-sha256sum-75"></a></var><br> <blockquote><p>Alias for <code>hashsum --hash sha256 arg ...</code>. See command <samp><span class="command">hashsum</span></samp> (see <a href="#hashsum">hashsum</a>) for full description. </p></blockquote></div> <div class="node"> <a name="sha512sum"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#sleep">sleep</a>, Previous: <a rel="previous" accesskey="p" href="#sha256sum">sha256sum</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.70 sha512sum</h4> <div class="defun"> — Command: <b>sha512sum</b><var> arg <small class="dots">...</small><a name="index-sha512sum-76"></a></var><br> <blockquote><p>Alias for <code>hashsum --hash sha512 arg ...</code>. See command <samp><span class="command">hashsum</span></samp> (see <a href="#hashsum">hashsum</a>) for full description. </p></blockquote></div> <div class="node"> <a name="sleep"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#source">source</a>, Previous: <a rel="previous" accesskey="p" href="#sha512sum">sha512sum</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.71 sleep</h4> <div class="defun"> — Command: <b>sleep</b> [<samp><span class="option">--verbose</span></samp>] [<samp><span class="option">--interruptible</span></samp>]<var> count<a name="index-sleep-77"></a></var><br> <blockquote><p>Sleep for <var>count</var> seconds. If option <samp><span class="option">--interruptible</span></samp> is given, allow <ESC> to interrupt sleep. With <samp><span class="option">--verbose</span></samp> show countdown of remaining seconds. Exit code is set to 0 if timeout expired and to 1 if timeout was interrupted by <ESC>. </p></blockquote></div> <div class="node"> <a name="source"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#test">test</a>, Previous: <a rel="previous" accesskey="p" href="#sleep">sleep</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.72 source</h4> <div class="defun"> — Command: <b>source</b><var> file<a name="index-source-78"></a></var><br> <blockquote><p>Read <var>file</var> as a configuration file, as if its contents had been incorporated directly into the sourcing file. Unlike <samp><span class="command">configfile</span></samp> (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 <samp><span class="command">source</span></samp> returns, and the menu will not be shown immediately. </p></blockquote></div> <div class="node"> <a name="test"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#true">true</a>, Previous: <a rel="previous" accesskey="p" href="#source">source</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.73 test</h4> <div class="defun"> — Command: <b>test</b><var> expression<a name="index-test-79"></a></var><br> <blockquote><p>Evaluate <var>expression</var> and return zero exit status if result is true, non zero status otherwise. <p><var>expression</var> is one of: <dl> <dt><var>string1</var> <code>==</code> <var>string2</var><dd>the strings are equal <br><dt><var>string1</var> <code>!=</code> <var>string2</var><dd>the strings are not equal <br><dt><var>string1</var> <code><</code> <var>string2</var><dd><var>string1</var> is lexicographically less than <var>string2</var> <br><dt><var>string1</var> <code><=</code> <var>string2</var><dd><var>string1</var> is lexicographically less or equal than <var>string2</var> <br><dt><var>string1</var> <code>></code> <var>string2</var><dd><var>string1</var> is lexicographically greater than <var>string2</var> <br><dt><var>string1</var> <code>>=</code> <var>string2</var><dd><var>string1</var> is lexicographically greater or equal than <var>string2</var> <br><dt><var>integer1</var> <code>-eq</code> <var>integer2</var><dd><var>integer1</var> is equal to <var>integer2</var> <br><dt><var>integer1</var> <code>-ge</code> <var>integer2</var><dd><var>integer1</var> is greater than or equal to <var>integer2</var> <br><dt><var>integer1</var> <code>-gt</code> <var>integer2</var><dd><var>integer1</var> is greater than <var>integer2</var> <br><dt><var>integer1</var> <code>-le</code> <var>integer2</var><dd><var>integer1</var> is less than or equal to <var>integer2</var> <br><dt><var>integer1</var> <code>-lt</code> <var>integer2</var><dd><var>integer1</var> is less than <var>integer2</var> <br><dt><var>integer1</var> <code>-ne</code> <var>integer2</var><dd><var>integer1</var> is not equal to <var>integer2</var> <br><dt><var>prefix</var><var>integer1</var> <code>-pgt</code> <var>prefix</var><var>integer2</var><dd><var>integer1</var> is greater than <var>integer2</var> after stripping off common non-numeric <var>prefix</var>. <br><dt><var>prefix</var><var>integer1</var> <code>-plt</code> <var>prefix</var><var>integer2</var><dd><var>integer1</var> is less than <var>integer2</var> after stripping off common non-numeric <var>prefix</var>. <br><dt><var>file1</var> <code>-nt</code> <var>file2</var><dd><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. <br><dt><var>file1</var> <code>-ot</code> <var>file2</var><dd><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. <br><dt><code>-d</code> <var>file</var><dd><var>file</var> exists and is a directory <br><dt><code>-e</code> <var>file</var><dd><var>file</var> exists <br><dt><code>-f</code> <var>file</var><dd><var>file</var> exists and is not a directory <br><dt><code>-s</code> <var>file</var><dd><var>file</var> exists and has a size greater than zero <br><dt><code>-n</code> <var>string</var><dd>the length of <var>string</var> is nonzero <br><dt><var>string</var><dd><var>string</var> is equivalent to <code>-n </code><var>string</var> <br><dt><code>-z</code> <var>string</var><dd>the length of <var>string</var> is zero <br><dt><code>(</code> <var>expression</var> <code>)</code><dd><var>expression</var> is true <br><dt><code>!</code> <var>expression</var><dd><var>expression</var> is false <br><dt><var>expression1</var> <code>-a</code> <var>expression2</var><dd>both <var>expression1</var> and <var>expression2</var> are true <br><dt><var>expression1</var> <code>-o</code> <var>expression2</var><dd>either <var>expression1</var> or <var>expression2</var> is true </dl> </p></blockquote></div> <div class="node"> <a name="true"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#trust">trust</a>, Previous: <a rel="previous" accesskey="p" href="#test">test</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.74 true</h4> <div class="defun"> — Command: <b>true</b><var><a name="index-true-80"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="trust"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#unset">unset</a>, Previous: <a rel="previous" accesskey="p" href="#true">true</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.75 trust</h4> <div class="defun"> — Command: <b>trust</b> [<samp><span class="option">--skip-sig</span></samp>]<var> pubkey_file<a name="index-trust-81"></a></var><br> <blockquote><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 <samp><span class="command">trust</span></samp> executes, then <var>pubkey_file</var> must itself be properly signed. The <samp><span class="option">--skip-sig</span></samp> option can be used to disable signature-checking when reading <var>pubkey_file</var> itself. It is expected that <samp><span class="option">--skip-sig</span></samp> is useful for testing and manual booting. See <a href="#Using-digital-signatures">Using digital signatures</a>, for more information. </p></blockquote></div> <div class="node"> <a name="unset"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#uppermem">uppermem</a>, Previous: <a rel="previous" accesskey="p" href="#trust">trust</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.76 unset</h4> <div class="defun"> — Command: <b>unset</b><var> envvar<a name="index-unset-82"></a></var><br> <blockquote><p>Unset the environment variable <var>envvar</var>. </p></blockquote></div> <div class="node"> <a name="uppermem"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#verify_005fdetached">verify_detached</a>, Previous: <a rel="previous" accesskey="p" href="#unset">unset</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.77 uppermem</h4> <p>This command is not yet implemented for GRUB 2, although it is planned. <div class="node"> <a name="verify_detached"></a> <a name="verify_005fdetached"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#videoinfo">videoinfo</a>, Previous: <a rel="previous" accesskey="p" href="#uppermem">uppermem</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.78 verify_detached</h4> <div class="defun"> — Command: <b>verify_detached</b> [<samp><span class="option">--skip-sig</span></samp>]<var> file signature_file </var>[<var>pubkey_file</var>]<var><a name="index-verify_005fdetached-83"></a></var><br> <blockquote><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><span class="option">--skip-sig</span></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>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-digital-signatures">Using digital signatures</a>, for more information. </p></blockquote></div> <div class="node"> <a name="videoinfo"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#verify_005fdetached">verify_detached</a>, Up: <a rel="up" accesskey="u" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a> </div> <h4 class="subsection">16.3.79 videoinfo</h4> <div class="defun"> — Command: <b>videoinfo</b> [[<var>WxH</var>]<var>xD</var>]<var><a name="index-videoinfo-84"></a></var><br> <blockquote><p>List available video modes. If resolution is given, show only matching modes. </p></blockquote></div> <div class="node"> <a name="Networking-commands"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Command_002dline-and-menu-entry-commands">Command-line and menu entry commands</a>, Up: <a rel="up" accesskey="u" href="#Commands">Commands</a> </div> <h3 class="section">16.4 The list of networking commands</h3> <ul class="menu"> <li><a accesskey="1" href="#net_005fadd_005faddr">net_add_addr</a>: Add a network address <li><a accesskey="2" href="#net_005fadd_005fdns">net_add_dns</a>: Add a DNS server <li><a accesskey="3" href="#net_005fadd_005froute">net_add_route</a>: Add routing entry <li><a accesskey="4" href="#net_005fbootp">net_bootp</a>: Perform a bootp autoconfiguration <li><a accesskey="5" href="#net_005fbootp6">net_bootp6</a>: Perform a DHCPv6 autoconfiguration <li><a accesskey="6" href="#net_005fdel_005faddr">net_del_addr</a>: Remove IP address from interface <li><a accesskey="7" href="#net_005fdel_005fdns">net_del_dns</a>: Remove a DNS server <li><a accesskey="8" href="#net_005fdel_005froute">net_del_route</a>: Remove a route entry <li><a accesskey="9" href="#net_005fget_005fdhcp_005foption">net_get_dhcp_option</a>: Retrieve DHCP options <li><a href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a>: Perform IPv6 autoconfiguration <li><a href="#net_005fls_005faddr">net_ls_addr</a>: List interfaces <li><a href="#net_005fls_005fcards">net_ls_cards</a>: List network cards <li><a href="#net_005fls_005fdns">net_ls_dns</a>: List DNS servers <li><a href="#net_005fls_005froutes">net_ls_routes</a>: List routing entries <li><a href="#net_005fnslookup">net_nslookup</a>: Perform a DNS lookup </ul> <div class="node"> <a name="net_add_addr"></a> <a name="net_005fadd_005faddr"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fadd_005fdns">net_add_dns</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.1 net_add_addr</h4> <div class="defun"> — Command: <b>net_add_addr</b><var> interface card address<a name="index-net_005fadd_005faddr-85"></a></var><br> <blockquote><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><span class="samp">:local</span></samp>’ via <var>interface</var>. </p></blockquote></div> <div class="node"> <a name="net_add_dns"></a> <a name="net_005fadd_005fdns"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fadd_005froute">net_add_route</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fadd_005faddr">net_add_addr</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.2 net_add_dns</h4> <div class="defun"> — Command: <b>net_add_dns</b><var> server<a name="index-net_005fadd_005fdns-86"></a></var><br> <blockquote><p>Resolve <var>server</var> IP address and add to the list of DNS servers used during name lookup. </p></blockquote></div> <div class="node"> <a name="net_add_route"></a> <a name="net_005fadd_005froute"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fbootp">net_bootp</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fadd_005fdns">net_add_dns</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.3 net_add_route</h4> <div class="defun"> — Command: <b>net_add_route</b><var> shortname ip</var>[<var>/prefix</var>] [<var>interface | ‘</var><samp><span class="samp">gw</span></samp><var>’ gateway</var>]<var><a name="index-net_005fadd_005froute-87"></a></var><br> <blockquote><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></blockquote></div> <div class="node"> <a name="net_bootp"></a> <a name="net_005fbootp"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fbootp6">net_bootp6</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fadd_005froute">net_add_route</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.4 net_bootp</h4> <div class="defun"> — Command: <b>net_bootp</b> [<var>card</var>]<var><a name="index-net_005fbootp-88"></a></var><br> <blockquote><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><span class="samp">:dhcp</span></samp>’ and configured address is added to <var>card</var>. <!-- If server provided gateway information in --> <!-- DHCP ACK packet, it is added as route entry with the name @var{card}@samp{:dhcp:gw}. --> Additionally the following DHCP options are recognized and processed: <dl> <dt>‘<samp><span class="samp">1 (Subnet Mask)</span></samp>’<dd>Used to calculate network local routing entry for interface <var>card</var>‘<samp><span class="samp">:dhcp</span></samp>’. <br><dt>‘<samp><span class="samp">3 (Router)</span></samp>’<dd>Adds default route entry with the name <var>card</var>‘<samp><span class="samp">:dhcp:default</span></samp>’ via gateway from DHCP option. Note that only option with single route is accepted. <br><dt>‘<samp><span class="samp">6 (Domain Name Server)</span></samp>’<dd>Adds all servers from option value to the list of servers used during name resolution. <br><dt>‘<samp><span class="samp">12 (Host Name)</span></samp>’<dd>Sets environment variable ‘<samp><span class="samp">net_</span></samp>’<var><card></var>‘<samp><span class="samp">_dhcp_hostname</span></samp>’ (see <a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fhostname">net_<var><interface></var>_hostname</a>) to the value of option. <br><dt>‘<samp><span class="samp">15 (Domain Name)</span></samp>’<dd>Sets environment variable ‘<samp><span class="samp">net_</span></samp>’<var><card></var>‘<samp><span class="samp">_dhcp_domain</span></samp>’ (see <a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fdomain">net_<var><interface></var>_domain</a>) to the value of option. <br><dt>‘<samp><span class="samp">17 (Root Path)</span></samp>’<dd>Sets environment variable ‘<samp><span class="samp">net_</span></samp>’<var><card></var>‘<samp><span class="samp">_dhcp_rootpath</span></samp>’ (see <a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005frootpath">net_<var><interface></var>_rootpath</a>) to the value of option. <br><dt>‘<samp><span class="samp">18 (Extensions Path)</span></samp>’<dd>Sets environment variable ‘<samp><span class="samp">net_</span></samp>’<var><card></var>‘<samp><span class="samp">_dhcp_extensionspath</span></samp>’ (see <a href="#net_005f_003cvar_003e_003cinterface_003e_003c_002fvar_003e_005fextensionspath">net_<var><interface></var>_extensionspath</a>) to the value of option. </dl> </blockquote></div> <div class="node"> <a name="net_bootp6"></a> <a name="net_005fbootp6"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fdel_005faddr">net_del_addr</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fbootp">net_bootp</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.5 net_bootp6</h4> <div class="defun"> — Command: <b>net_bootp6</b> [<var>card</var>]<var><a name="index-net_005fbootp6-89"></a></var><br> <blockquote><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><span class="samp">:dhcp6</span></samp>’ and configured address is added to <var>card</var>. <dl> <dt>‘<samp><span class="samp">1 (Domain Name Server)</span></samp>’<dd>Adds all servers from option value to the list of servers used during name resolution. </dl> </blockquote></div> <div class="node"> <a name="net_del_addr"></a> <a name="net_005fdel_005faddr"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fdel_005fdns">net_del_dns</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fbootp6">net_bootp6</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.6 net_del_addr</h4> <div class="defun"> — Command: <b>net_del_addr</b><var> interface<a name="index-net_005fdel_005faddr-90"></a></var><br> <blockquote><p>Remove configured <var>interface</var> with associated address. </p></blockquote></div> <div class="node"> <a name="net_del_dns"></a> <a name="net_005fdel_005fdns"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fdel_005froute">net_del_route</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fdel_005faddr">net_del_addr</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.7 net_del_dns</h4> <div class="defun"> — Command: <b>net_del_dns</b><var> address<a name="index-net_005fdel_005fdns-91"></a></var><br> <blockquote><p>Remove <var>address</var> from list of servers used during name lookup. </p></blockquote></div> <div class="node"> <a name="net_del_route"></a> <a name="net_005fdel_005froute"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fget_005fdhcp_005foption">net_get_dhcp_option</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fdel_005fdns">net_del_dns</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.8 net_del_route</h4> <div class="defun"> — Command: <b>net_del_route</b><var> shortname<a name="index-net_005fdel_005froute-92"></a></var><br> <blockquote><p>Remove route entry identified by <var>shortname</var>. </p></blockquote></div> <div class="node"> <a name="net_get_dhcp_option"></a> <a name="net_005fget_005fdhcp_005foption"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fdel_005froute">net_del_route</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.9 net_get_dhcp_option</h4> <div class="defun"> — Command: <b>net_get_dhcp_option</b><var> var interface number type<a name="index-net_005fget_005fdhcp_005foption-93"></a></var><br> <blockquote><p>Request DHCP option <var>number</var> of <var>type</var> via <var>interface</var>. <var>type</var> can be one of ‘<samp><span class="samp">string</span></samp>’, ‘<samp><span class="samp">number</span></samp>’ or ‘<samp><span class="samp">hex</span></samp>’. If option is found, assign its value to variable <var>var</var>. Values of types ‘<samp><span class="samp">number</span></samp>’ and ‘<samp><span class="samp">hex</span></samp>’ are converted to string representation. </p></blockquote></div> <div class="node"> <a name="net_ipv6_autoconf"></a> <a name="net_005fipv6_005fautoconf"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fls_005faddr">net_ls_addr</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fget_005fdhcp_005foption">net_get_dhcp_option</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.10 net_ipv6_autoconf</h4> <div class="defun"> — Command: <b>net_ipv6_autoconf</b> [<var>card</var>]<var><a name="index-net_005fipv6_005fautoconf-94"></a></var><br> <blockquote><p>Perform IPv6 autoconfiguration by adding to the <var>card</var> interface with name <var>card</var>‘<samp><span class="samp">:link</span></samp>’ and link local MAC-based address. If no card is specified, perform autoconfiguration for all existing cards. </p></blockquote></div> <div class="node"> <a name="net_ls_addr"></a> <a name="net_005fls_005faddr"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fls_005fcards">net_ls_cards</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.11 net_ls_addr</h4> <div class="defun"> — Command: <b>net_ls_addr</b><var><a name="index-net_005fls_005faddr-95"></a></var><br> <blockquote><p>List all configured interfaces with their MAC and IP addresses. </p></blockquote></div> <div class="node"> <a name="net_ls_cards"></a> <a name="net_005fls_005fcards"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fls_005fdns">net_ls_dns</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fls_005faddr">net_ls_addr</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.12 net_ls_cards</h4> <div class="defun"> — Command: <b>net_ls_cards</b><var><a name="index-net_005fls_005fcards-96"></a></var><br> <blockquote><p>List all detected network cards with their MAC address. </p></blockquote></div> <div class="node"> <a name="net_ls_dns"></a> <a name="net_005fls_005fdns"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fls_005froutes">net_ls_routes</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fls_005fcards">net_ls_cards</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.13 net_ls_dns</h4> <div class="defun"> — Command: <b>net_ls_dns</b><var><a name="index-net_005fls_005fdns-97"></a></var><br> <blockquote><p>List addresses of DNS servers used during name lookup. </p></blockquote></div> <div class="node"> <a name="net_ls_routes"></a> <a name="net_005fls_005froutes"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#net_005fnslookup">net_nslookup</a>, Previous: <a rel="previous" accesskey="p" href="#net_005fls_005fdns">net_ls_dns</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.14 net_ls_routes</h4> <div class="defun"> — Command: <b>net_ls_routes</b><var><a name="index-net_005fls_005froutes-98"></a></var><br> <blockquote><p>List routing entries. </p></blockquote></div> <div class="node"> <a name="net_nslookup"></a> <a name="net_005fnslookup"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#net_005fls_005froutes">net_ls_routes</a>, Up: <a rel="up" accesskey="u" href="#Networking-commands">Networking commands</a> </div> <h4 class="subsection">16.4.15 net_nslookup</h4> <div class="defun"> — Command: <b>net_nslookup</b><var> name </var>[<var>server</var>]<var><a name="index-net_005fnslookup-99"></a></var><br> <blockquote><p>Resolve address of <var>name</var> using DNS server <var>server</var>. If no server is given, use default list of servers. </p></blockquote></div> <div class="node"> <a name="Internationalisation"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Security">Security</a>, Previous: <a rel="previous" accesskey="p" href="#Commands">Commands</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">17 Internationalisation</h2> <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. <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), 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. <h3 class="section">17.3 Output terminal</h3> <p>Firmware output console “console” on ARC and IEEE1275 are limited to ASCII. <p>BIOS firmware console and VGA text are limited to ASCII and some pseudographics. <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>EFI console on the other hand nominally supports UTF-16 but actual language coverage depends on firmware and may be very limited. <p>The encoding used on serial can be chosen with <samp><span class="command">terminfo</span></samp> 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>On emu GRUB checks if charset is UTF-8 and uses it if so and uses ASCII otherwise. <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. <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. <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. <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. <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. <samp><span class="command">test</span></samp> (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. <div class="node"> <a name="Security"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Platform-limitations">Platform limitations</a>, Previous: <a rel="previous" accesskey="p" href="#Internationalisation">Internationalisation</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">18 Security</h2> <ul class="menu"> <li><a accesskey="1" href="#Authentication-and-authorisation">Authentication and authorisation</a>: Users and access control <li><a accesskey="2" href="#Using-digital-signatures">Using digital signatures</a>: Booting digitally signed code <li><a accesskey="3" href="#Secure-Boot-Advanced-Targeting">Secure Boot Advanced Targeting</a>: Embedded information for generation number based revocation <li><a accesskey="4" href="#Lockdown">Lockdown</a>: Lockdown when booting on a secure setup </ul> <div class="node"> <a name="Authentication-and-authorisation"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Using-digital-signatures">Using digital signatures</a>, Up: <a rel="up" accesskey="u" href="#Security">Security</a> </div> <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>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>The ‘<samp><span class="samp">password</span></samp>’ (see <a href="#password">password</a>) and ‘<samp><span class="samp">password_pbkdf2</span></samp>’ (see <a href="#password_005fpbkdf2">password_pbkdf2</a>) commands can be used to define users, each of which has an associated password. ‘<samp><span class="samp">password</span></samp>’ sets the password in plain text, requiring <samp><span class="file">grub.cfg</span></samp> to be secure; ‘<samp><span class="samp">password_pbkdf2</span></samp>’ sets the password hashed using the Password-Based Key Derivation Function (RFC 2898), requiring the use of <samp><span class="command">grub-mkpasswd-pbkdf2</span></samp> (see <a href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub-mkpasswd-pbkdf2</a>) to generate password hashes. <p>In order to enable authentication support, the ‘<samp><span class="samp">superusers</span></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><span class="samp">superusers</span></samp>’ is set, then use of the command line is automatically restricted to superusers. <p>Other users may be given access to specific menu entries by giving a list of usernames (as above) using the <samp><span class="option">--users</span></samp> option to the ‘<samp><span class="samp">menuentry</span></samp>’ command (see <a href="#menuentry">menuentry</a>). If the <samp><span class="option">--unrestricted</span></samp> option is used for a menu entry, then that entry is unrestricted. If the <samp><span class="option">--users</span></samp> option is not used for a menu entry, then that only superusers are able to use it. <p>Putting this together, a typical <samp><span class="file">grub.cfg</span></samp> fragment might look like this: <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> <p>The <samp><span class="command">grub-mkconfig</span></samp> program does not yet have built-in support for generating configuration files with authentication. You can use <samp><span class="file">/etc/grub.d/40_custom</span></samp> to add simple superuser authentication, by adding <kbd>set superusers=</kbd> and <kbd>password</kbd> or <kbd>password_pbkdf2</kbd> commands. <div class="node"> <a name="Using-digital-signatures"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Secure-Boot-Advanced-Targeting">Secure Boot Advanced Targeting</a>, Previous: <a rel="previous" accesskey="p" href="#Authentication-and-authorisation">Authentication and authorisation</a>, Up: <a rel="up" accesskey="u" href="#Security">Security</a> </div> <h3 class="section">18.2 Using digital signatures in GRUB</h3> <p>GRUB's <samp><span class="file">core.img</span></samp> can optionally provide enforcement that all files subsequently read from disk are covered by a valid digital signature. This document does <strong>not</strong> cover how to ensure that your platform's firmware (e.g., Coreboot) validates <samp><span class="file">core.img</span></samp>. <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><span class="file">core.img</span></samp> to load another file <samp><span class="file">foo</span></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><span class="file">foo</span></samp> cannot be opened. This failure may halt or otherwise impact the boot process. <!-- Unfortunately -pubkey is not yet supported by grub-install, --> <!-- but we should not bring up internal detail grub-mkimage here --> <!-- in the user guide (as opposed to developer's manual). --> <!-- An initial trusted public key can be embedded within the GRUB --> <!-- @file{core.img} using the @code{-pubkey} option to --> <!-- @command{grub-mkimage} (@pxref{Invoking grub-install}). Presently it --> <!-- is necessary to write a custom wrapper around @command{grub-mkimage} --> <!-- using the @code{-grub-mkimage} flag to @command{grub-install}. --> <p>GRUB uses GPG-style detached signatures (meaning that a file <samp><span class="file">foo.sig</span></samp> will be produced when file <samp><span class="file">foo</span></samp> is signed), and currently supports the DSA and RSA signing algorithms. A signing key can be generated as follows: <pre class="example"> gpg --gen-key </pre> <p>An individual file can be signed as follows: <pre class="example"> gpg --detach-sign /path/to/file </pre> <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><span class="file">grub.cfg</span></samp> file, e.g., by running <samp><span class="command">grub-mkconfig</span></samp> (see <a href="#Invoking-grub_002dmkconfig">Invoking grub-mkconfig</a>): <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> <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>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 <samp><span class="command">grub-mkimage</span></samp> implicitly defines <code>check_signatures</code> equal to <code>enforce</code> in <samp><span class="file">core.img</span></samp> prior to processing any configuration files. <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: <pre class="example"> set check_signatures=no </pre> <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. <div class="node"> <a name="Secure-Boot-Advanced-Targeting"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Lockdown">Lockdown</a>, Previous: <a rel="previous" accesskey="p" href="#Using-digital-signatures">Using digital signatures</a>, Up: <a rel="up" accesskey="u" href="#Security">Security</a> </div> <h3 class="section">18.3 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>To add a data section containing the SBAT information into the binary, the <samp><span class="option">--sbat</span></samp> option of <samp><span class="command">grub-mkimage</span></samp> 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. <pre class="example"> grub-mkimage -O x86_64-efi -o grubx64.efi -p '(tftp)/grub' --sbat sbat.csv efinet tftp </pre> <div class="node"> <a name="Lockdown"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Secure-Boot-Advanced-Targeting">Secure Boot Advanced Targeting</a>, Up: <a rel="up" accesskey="u" href="#Security">Security</a> </div> <h3 class="section">18.4 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>The ‘<samp><span class="samp">lockdown</span></samp>’ variable is set to ‘<samp><span class="samp">y</span></samp>’ when the GRUB is locked down. Otherwise it does not exit. <div class="node"> <a name="Platform-limitations"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Platform_002dspecific-operations">Platform-specific operations</a>, Previous: <a rel="previous" accesskey="p" href="#Security">Security</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>ARC platform is unable to change datetime (firmware doesn't seem to provide a function for it). EMU has similar limitation. <p>On EMU platform no serial port is available. <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>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>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>Direct ATA/AHCI support allows to circumvent various firmware limitations but isn't needed for normal operation except on baremetal ports. <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>Speaker allows morse and spkmodem communication. <p>USB support provides benefits similar to ATA (for USB disks) or AT (for USB keyboards). In addition it allows USBserial. <p>Chainloading refers to the ability to load another bootloader through the same protocol <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>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><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">BIOS </td><td valign="top" width="20%">Coreboot </td><td valign="top" width="20%">Multiboot </td><td valign="top" width="20%">Qemu <br></td></tr><tr align="left"><td valign="top" width="20%">video </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">console charset </td><td valign="top" width="20%">CP437 </td><td valign="top" width="20%">CP437 </td><td valign="top" width="20%">CP437 </td><td valign="top" width="20%">CP437 <br></td></tr><tr align="left"><td valign="top" width="20%">network </td><td valign="top" width="20%">yes (*) </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">Speaker </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">USB </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">chainloader </td><td valign="top" width="20%">local </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">cpuid </td><td valign="top" width="20%">partial </td><td valign="top" width="20%">partial </td><td valign="top" width="20%">partial </td><td valign="top" width="20%">partial <br></td></tr><tr align="left"><td valign="top" width="20%">hints </td><td valign="top" width="20%">guess </td><td valign="top" width="20%">guess </td><td valign="top" width="20%">guess </td><td valign="top" width="20%">guess <br></td></tr><tr align="left"><td valign="top" width="20%">PCI </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">badram </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">compression </td><td valign="top" width="20%">always </td><td valign="top" width="20%">pointless </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">exit </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr></table> <p><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">ia32 EFI </td><td valign="top" width="20%">amd64 EFI </td><td valign="top" width="20%">ia32 IEEE1275 </td><td valign="top" width="20%">Itanium <br></td></tr><tr align="left"><td valign="top" width="20%">video </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">console charset </td><td valign="top" width="20%">Unicode </td><td valign="top" width="20%">Unicode </td><td valign="top" width="20%">ASCII </td><td valign="top" width="20%">Unicode <br></td></tr><tr align="left"><td valign="top" width="20%">network </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">Speaker </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">USB </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">chainloader </td><td valign="top" width="20%">local </td><td valign="top" width="20%">local </td><td valign="top" width="20%">no </td><td valign="top" width="20%">local <br></td></tr><tr align="left"><td valign="top" width="20%">cpuid </td><td valign="top" width="20%">partial </td><td valign="top" width="20%">partial </td><td valign="top" width="20%">partial </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">hints </td><td valign="top" width="20%">guess </td><td valign="top" width="20%">guess </td><td valign="top" width="20%">good </td><td valign="top" width="20%">guess <br></td></tr><tr align="left"><td valign="top" width="20%">PCI </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">badram </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">compression </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">exit </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr></table> <p><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">Loongson </td><td valign="top" width="20%">sparc64 </td><td valign="top" width="20%">Powerpc </td><td valign="top" width="20%">ARC <br></td></tr><tr align="left"><td valign="top" width="20%">video </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">console charset </td><td valign="top" width="20%">N/A </td><td valign="top" width="20%">ASCII </td><td valign="top" width="20%">ASCII </td><td valign="top" width="20%">ASCII <br></td></tr><tr align="left"><td valign="top" width="20%">network </td><td valign="top" width="20%">no </td><td valign="top" width="20%">yes (*) </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">Speaker </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">USB </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">chainloader </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">cpuid </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">hints </td><td valign="top" width="20%">good </td><td valign="top" width="20%">good </td><td valign="top" width="20%">good </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">PCI </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">badram </td><td valign="top" width="20%">yes (*) </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">compression </td><td valign="top" width="20%">configurable </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no </td><td valign="top" width="20%">configurable <br></td></tr><tr align="left"><td valign="top" width="20%">exit </td><td valign="top" width="20%">no </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">yes <br></td></tr></table> <p><table summary=""><tr align="left"><td valign="top" width="20%"></td><td valign="top" width="20%">MIPS qemu </td><td valign="top" width="20%">emu <br></td></tr><tr align="left"><td valign="top" width="20%">video </td><td valign="top" width="20%">no </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">console charset </td><td valign="top" width="20%">CP437 </td><td valign="top" width="20%">Unicode (*) <br></td></tr><tr align="left"><td valign="top" width="20%">network </td><td valign="top" width="20%">no </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">ATA/AHCI </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">AT keyboard </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">Speaker </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">USB </td><td valign="top" width="20%">N/A </td><td valign="top" width="20%">yes <br></td></tr><tr align="left"><td valign="top" width="20%">chainloader </td><td valign="top" width="20%">yes </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">cpuid </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">hints </td><td valign="top" width="20%">guess </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">PCI </td><td valign="top" width="20%">no </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">badram </td><td valign="top" width="20%">yes (*) </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">compression </td><td valign="top" width="20%">configurable </td><td valign="top" width="20%">no <br></td></tr><tr align="left"><td valign="top" width="20%">exit </td><td valign="top" width="20%">no </td><td valign="top" width="20%">yes <br></td></tr></table> <div class="node"> <a name="Platform-specific-operations"></a> <a name="Platform_002dspecific-operations"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Supported-kernels">Supported kernels</a>, Previous: <a rel="previous" accesskey="p" href="#Platform-limitations">Platform limitations</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">20 Outline</h2> <p>Some platforms have features which allows to implement some commands useless or not implementable on others. <p>Quick summary: <p>Information retrieval: <ul> <li>mipsel-loongson: lsspd <li>mips-arc: lsdev <li>efi: lsefisystab, lssal, lsefimmap, lsefi <li>i386-pc: lsapm <li>i386-coreboot: lscoreboot, coreboot_boottime, cbmemc <li>acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): lsacpi </ul> <p>Workarounds for platform-specific issues: <ul> <li>i386-efi/x86_64-efi: loadbios, fakebios, fix_video <li>acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): acpi (override ACPI tables) <li>i386-pc: drivemap <li>i386-pc: sendkey </ul> <p>Advanced operations for power users: <ul> <li>x86: iorw (direct access to I/O ports) </ul> <p>Miscelaneous: <ul> <li>cmos (x86-*, ieee1275, mips-qemu_mips, mips-loongson): cmostest (used on some laptops to check for special power-on key), cmosclean <li>i386-pc: play </ul> <div class="node"> <a name="Supported-kernels"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Troubleshooting">Troubleshooting</a>, Previous: <a rel="previous" accesskey="p" href="#Platform_002dspecific-operations">Platform-specific operations</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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 summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">BIOS </td><td valign="top" width="22%">Coreboot <br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">Plan9 </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">Freedos </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">crashes (5) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">crashes (5) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">crashes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2 </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader </td><td valign="top" width="22%">no (2) </td><td valign="top" width="22%">no (2) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader </td><td valign="top" width="22%">no (2) </td><td valign="top" width="22%">no (2) <br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader </td><td valign="top" width="22%">no (2) </td><td valign="top" width="22%">no (2) <br></td></tr></table> <p><table summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">Multiboot </td><td valign="top" width="22%">Qemu <br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">Plan9 </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">FreeDOS </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader </td><td valign="top" width="22%">crashes (1) </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD </td><td valign="top" width="22%">crashes (5) </td><td valign="top" width="22%">crashes (5) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD </td><td valign="top" width="22%">crashes (5) </td><td valign="top" width="22%">crashes (5) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD </td><td valign="top" width="22%">crashes (1) </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2 </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU </td><td valign="top" width="22%">? </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU </td><td valign="top" width="22%">? </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader </td><td valign="top" width="22%">no (2) </td><td valign="top" width="22%">no (2) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader </td><td valign="top" width="22%">no (2) </td><td valign="top" width="22%">no (2) <br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader </td><td valign="top" width="22%">no (2) </td><td valign="top" width="22%">no (2) <br></td></tr></table> <p><table summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">ia32 EFI </td><td valign="top" width="22%">amd64 EFI <br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">Plan9 </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">FreeDOS </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader </td><td valign="top" width="22%">crashes (1) </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD </td><td valign="top" width="22%">headless </td><td valign="top" width="22%">headless <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD </td><td valign="top" width="22%">headless </td><td valign="top" width="22%">headless <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD </td><td valign="top" width="22%">crashes (1) </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD </td><td valign="top" width="22%">headless </td><td valign="top" width="22%">headless <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD </td><td valign="top" width="22%">headless </td><td valign="top" width="22%">headless <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2 </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU </td><td valign="top" width="22%">yes (4) </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">no (3) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader </td><td valign="top" width="22%">no (3) </td><td valign="top" width="22%">yes <br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader </td><td valign="top" width="22%">yes </td><td valign="top" width="22%">yes <br></td></tr></table> <p><table summary=""><tr align="left"><td valign="top" width="50%"></td><td valign="top" width="22%">ia32 IEEE1275 <br></td></tr><tr align="left"><td valign="top" width="50%">BIOS chainloading </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">NTLDR </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">Plan9 </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">FreeDOS </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">FreeBSD bootloader </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kFreeBSD </td><td valign="top" width="22%">crashes (5) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kFreeBSD </td><td valign="top" width="22%">crashes (5) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kNetBSD </td><td valign="top" width="22%">crashes (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kNetBSD </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit kOpenBSD </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit kOpenBSD </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">Multiboot2 </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (legacy protocol) </td><td valign="top" width="22%">no (1) <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit Linux (modern protocol) </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit Linux (modern protocol) </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit XNU </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit XNU </td><td valign="top" width="22%">? <br></td></tr><tr align="left"><td valign="top" width="50%">32-bit EFI chainloader </td><td valign="top" width="22%">no (2) <br></td></tr><tr align="left"><td valign="top" width="50%">64-bit EFI chainloader </td><td valign="top" width="22%">no (2) <br></td></tr><tr align="left"><td valign="top" width="50%">Appleloader </td><td valign="top" width="22%">no (2) <br></td></tr></table> <ol type=1 start=1> <li>Requires BIOS <li>EFI only <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>Some modules may need to be disabled <li>Requires ACPI </ol> <p>PowerPC, IA64 and Sparc64 ports support only Linux. MIPS port supports Linux and multiboot2. <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>Following variables must be defined: <p><table summary=""><tr align="left"><td valign="top" width="30%">GRUB_PAYLOADS_DIR </td><td valign="top" width="65%">directory containing the required kernels <br></td></tr><tr align="left"><td valign="top" width="30%">GRUB_CBFSTOOL </td><td valign="top" width="65%">cbfstoll from Coreboot package (for coreboot platform only) <br></td></tr><tr align="left"><td valign="top" width="30%">GRUB_COREBOOT_ROM </td><td valign="top" width="65%">empty Coreboot ROM <br></td></tr><tr align="left"><td valign="top" width="30%">GRUB_QEMU_OPTS </td><td valign="top" width="65%">additional options to be supplied to QEMU <br></td></tr></table> <p>Required files are: <p><table summary=""><tr align="left"><td valign="top" width="40%">kfreebsd_env.i386 </td><td valign="top" width="55%">32-bit kFreeBSD device hints <br></td></tr><tr align="left"><td valign="top" width="40%">kfreebsd.i386 </td><td valign="top" width="55%">32-bit FreeBSD kernel image <br></td></tr><tr align="left"><td valign="top" width="40%">kfreebsd.x86_64, kfreebsd_env.x86_64 </td><td valign="top" width="55%">same from 64-bit kFreeBSD <br></td></tr><tr align="left"><td valign="top" width="40%">knetbsd.i386 </td><td valign="top" width="55%">32-bit NetBSD kernel image <br></td></tr><tr align="left"><td valign="top" width="40%">knetbsd.miniroot.i386 </td><td valign="top" width="55%">32-bit kNetBSD miniroot.kmod. <br></td></tr><tr align="left"><td valign="top" width="40%">knetbsd.x86_64, knetbsd.miniroot.x86_64 </td><td valign="top" width="55%">same from 64-bit kNetBSD <br></td></tr><tr align="left"><td valign="top" width="40%">kopenbsd.i386 </td><td valign="top" width="55%">32-bit OpenBSD kernel bsd.rd image <br></td></tr><tr align="left"><td valign="top" width="40%">kopenbsd.x86_64 </td><td valign="top" width="55%">same from 64-bit kOpenBSD <br></td></tr><tr align="left"><td valign="top" width="40%">linux.i386 </td><td valign="top" width="55%">32-bit Linux <br></td></tr><tr align="left"><td valign="top" width="40%">linux.x86_64 </td><td valign="top" width="55%">64-bit Linux <br></td></tr></table> <div class="node"> <a name="Troubleshooting"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dinstall">Invoking grub-install</a>, Previous: <a rel="previous" accesskey="p" href="#Supported-kernels">Supported kernels</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">22 Error messages produced by GRUB</h2> <ul class="menu"> <li><a accesskey="1" href="#GRUB-only-offers-a-rescue-shell">GRUB only offers a rescue shell</a> </ul> <div class="node"> <a name="GRUB-only-offers-a-rescue-shell"></a> <p><hr> Up: <a rel="up" accesskey="u" href="#Troubleshooting">Troubleshooting</a> </div> <h3 class="section">22.1 GRUB only offers a rescue shell</h3> <p>GRUB's normal start-up procedure involves setting the ‘<samp><span class="samp">prefix</span></samp>’ environment variable to a value set in the core image by <samp><span class="command">grub-install</span></samp>, setting the ‘<samp><span class="samp">root</span></samp>’ variable to match, loading the ‘<samp><span class="samp">normal</span></samp>’ module from the prefix, and running the ‘<samp><span class="samp">normal</span></samp>’ command (see <a href="#normal">normal</a>). This command is responsible for reading <samp><span class="file">/boot/grub/grub.cfg</span></samp>, running the menu, and doing all the useful things GRUB is supposed to do. <p>If, instead, you only get a rescue shell, this usually means that GRUB failed to load the ‘<samp><span class="samp">normal</span></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><span class="samp">prefix</span></samp>’ is wrong (perhaps it refers to the wrong device, or perhaps the path to <samp><span class="file">/boot/grub</span></samp> was not correctly made relative to the device), then you can correct this and enter normal mode manually: <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> <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>grub-install </kbd><var>device</var> (see <a href="#Invoking-grub_002dinstall">Invoking grub-install</a>). When doing this, there are a few things to remember: <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><span class="samp">/dev/sda</span></samp>’) is the one that your firmware will boot from. <samp><span class="file">device.map</span></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>At least on BIOS systems, if you tell <samp><span class="command">grub-install</span></samp> 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>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>Check that GRUB actually knows how to read from the device and file system containing <samp><span class="file">/boot/grub</span></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. </ul> <div class="node"> <a name="Invoking-grub-install"></a> <a name="Invoking-grub_002dinstall"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dmkconfig">Invoking grub-mkconfig</a>, Previous: <a rel="previous" accesskey="p" href="#Troubleshooting">Troubleshooting</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">23 Invoking grub-install</h2> <p>The program <samp><span class="command">grub-install</span></samp> generates a GRUB core image using <samp><span class="command">grub-mkimage</span></samp> and installs it on your system. You must specify the device name on which you want to install GRUB, like this: <pre class="example"> grub-install <var>install_device</var> </pre> <p>The device name <var>install_device</var> is an OS device name or a GRUB device name. <p><samp><span class="command">grub-install</span></samp> accepts the following options: <dl> <dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit. <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit. <br><dt><samp><span class="option">--boot-directory=</span><var>dir</var></samp><dd>Install GRUB images under the directory <samp><var>dir</var><span class="file">/grub/</span></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><span class="file">/boot</span></samp>, so <pre class="example"> <kbd>grub-install /dev/sda</kbd> </pre> <p>is equivalent to <pre class="example"> <kbd>grub-install --boot-directory=/boot/ /dev/sda</kbd> </pre> <p>Here is an example in which you have a separate <dfn>boot</dfn> partition which is mounted on <samp><span class="file">/mnt/boot</span></samp>: <pre class="example"> <kbd>grub-install --boot-directory=/mnt/boot /dev/sdb</kbd> </pre> <br><dt><samp><span class="option">--recheck</span></samp><dd>Recheck the device map, even if <samp><span class="file">/boot/grub/device.map</span></samp> already exists. You should use this option whenever you add/remove a disk into/from your computer. <br><dt><samp><span class="option">--no-rs-codes</span></samp><dd>By default on x86 BIOS systems, <samp><span class="command">grub-install</span></samp> 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. </dl> <div class="node"> <a name="Invoking-grub-mkconfig"></a> <a name="Invoking-grub_002dmkconfig"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub-mkpasswd-pbkdf2</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dinstall">Invoking grub-install</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">24 Invoking grub-mkconfig</h2> <p>The program <samp><span class="command">grub-mkconfig</span></samp> generates a configuration file for GRUB (see <a href="#Simple-configuration">Simple configuration</a>). <pre class="example"> grub-mkconfig -o /boot/grub/grub.cfg </pre> <p><samp><span class="command">grub-mkconfig</span></samp> accepts the following options: <dl> <dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit. <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit. <br><dt><samp><span class="option">-o </span><var>file</var></samp><dt><samp><span class="option">--output=</span><var>file</var></samp><dd>Send the generated configuration file to <var>file</var>. The default is to send it to standard output. </dl> <div class="node"> <a name="Invoking-grub-mkpasswd-pbkdf2"></a> <a name="Invoking-grub_002dmkpasswd_002dpbkdf2"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dmkrelpath">Invoking grub-mkrelpath</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dmkconfig">Invoking grub-mkconfig</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">25 Invoking grub-mkpasswd-pbkdf2</h2> <p>The program <samp><span class="command">grub-mkpasswd-pbkdf2</span></samp> generates password hashes for GRUB (see <a href="#Security">Security</a>). <pre class="example"> grub-mkpasswd-pbkdf2 </pre> <p><samp><span class="command">grub-mkpasswd-pbkdf2</span></samp> accepts the following options: <dl> <dt><samp><span class="option">-c </span><var>number</var></samp><dt><samp><span class="option">--iteration-count=</span><var>number</var></samp><dd>Number of iterations of the underlying pseudo-random function. Defaults to 10000. <br><dt><samp><span class="option">-l </span><var>number</var></samp><dt><samp><span class="option">--buflen=</span><var>number</var></samp><dd>Length of the generated hash. Defaults to 64. <br><dt><samp><span class="option">-s </span><var>number</var></samp><dt><samp><span class="option">--salt=</span><var>number</var></samp><dd>Length of the salt. Defaults to 64. </dl> <div class="node"> <a name="Invoking-grub-mkrelpath"></a> <a name="Invoking-grub_002dmkrelpath"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dmkrescue">Invoking grub-mkrescue</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dmkpasswd_002dpbkdf2">Invoking grub-mkpasswd-pbkdf2</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">26 Invoking grub-mkrelpath</h2> <p>The program <samp><span class="command">grub-mkrelpath</span></samp> makes a file system path relative to the root of its containing file system. For instance, if <samp><span class="file">/usr</span></samp> is a mount point, then: <pre class="example"> $ <kbd>grub-mkrelpath /usr/share/grub/unicode.pf2</kbd> ‘<samp><span class="samp">/share/grub/unicode.pf2</span></samp>’ </pre> <p>This is mainly used internally by other GRUB utilities such as <samp><span class="command">grub-mkconfig</span></samp> (see <a href="#Invoking-grub_002dmkconfig">Invoking grub-mkconfig</a>), but may occasionally also be useful for debugging. <p><samp><span class="command">grub-mkrelpath</span></samp> accepts the following options: <dl> <dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit. <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit. </dl> <div class="node"> <a name="Invoking-grub-mkrescue"></a> <a name="Invoking-grub_002dmkrescue"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dmount">Invoking grub-mount</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dmkrelpath">Invoking grub-mkrelpath</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">27 Invoking grub-mkrescue</h2> <p>The program <samp><span class="command">grub-mkrescue</span></samp> generates a bootable GRUB rescue image (see <a href="#Making-a-GRUB-bootable-CD_002dROM">Making a GRUB bootable CD-ROM</a>). <pre class="example"> grub-mkrescue -o grub.iso </pre> <p>All arguments not explicitly listed as <samp><span class="command">grub-mkrescue</span></samp> options are passed on directly to <samp><span class="command">xorriso</span></samp> in <samp><span class="command">mkisofs</span></samp> emulation mode. Options passed to <samp><span class="command">xorriso</span></samp> will normally be interpreted as <samp><span class="command">mkisofs</span></samp> options; if the option ‘<samp><span class="samp">--</span></samp>’ is used, then anything after that will be interpreted as native <samp><span class="command">xorriso</span></samp> options. <p>Non-option arguments specify additional source directories. This is commonly used to add extra files to the image: <pre class="example"> mkdir -p disk/boot/grub <span class="roman">(add extra files to </span><samp><span class="file">disk/boot/grub</span></samp><span class="roman">)</span> grub-mkrescue -o grub.iso disk </pre> <p><samp><span class="command">grub-mkrescue</span></samp> accepts the following options: <dl> <dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit. <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit. <br><dt><samp><span class="option">-o </span><var>file</var></samp><dt><samp><span class="option">--output=</span><var>file</var></samp><dd>Save output in <var>file</var>. This "option" is required. <br><dt><samp><span class="option">--modules=</span><var>modules</var></samp><dd>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). <br><dt><samp><span class="option">--rom-directory=</span><var>dir</var></samp><dd>If generating images for the QEMU or Coreboot platforms, copy the resulting <samp><span class="file">qemu.img</span></samp> or <samp><span class="file">coreboot.elf</span></samp> files respectively to the <var>dir</var> directory as well as including them in the image. <br><dt><samp><span class="option">--xorriso=</span><var>file</var></samp><dd>Use <var>file</var> as the <samp><span class="command">xorriso</span></samp> program, rather than the built-in default. <br><dt><samp><span class="option">--grub-mkimage=</span><var>file</var></samp><dd>Use <var>file</var> as the <samp><span class="command">grub-mkimage</span></samp> program, rather than the built-in default. </dl> <div class="node"> <a name="Invoking-grub-mount"></a> <a name="Invoking-grub_002dmount"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dprobe">Invoking grub-probe</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dmkrescue">Invoking grub-mkrescue</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">28 Invoking grub-mount</h2> <p>The program <samp><span class="command">grub-mount</span></samp> 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: <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>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>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>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. </ul> <p>Using <samp><span class="command">grub-mount</span></samp> is normally as simple as: <pre class="example"> grub-mount /dev/sda1 /mnt </pre> <p><samp><span class="command">grub-mount</span></samp> 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: <dl> <dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit. <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit. <br><dt><samp><span class="option">-C</span></samp><dt><samp><span class="option">--crypto</span></samp><dd>Mount encrypted devices, prompting for a passphrase if necessary. <br><dt><samp><span class="option">-d </span><var>string</var></samp><dt><samp><span class="option">--debug=</span><var>string</var></samp><dd>Show debugging output for conditions matching <var>string</var>. <br><dt><samp><span class="option">-K prompt|</span><var>file</var></samp><dt><samp><span class="option">--zfs-key=prompt|</span><var>file</var></samp><dd>Load a ZFS encryption key. If you use ‘<samp><span class="samp">prompt</span></samp>’ as the argument, <samp><span class="command">grub-mount</span></samp> will read a passphrase from the terminal; otherwise, it will read key material from the specified file. <br><dt><samp><span class="option">-r </span><var>device</var></samp><dt><samp><span class="option">--root=</span><var>device</var></samp><dd>Set the GRUB root device to <var>device</var>. You do not normally need to set this; <samp><span class="command">grub-mount</span></samp> will automatically set the root device to the root of the supplied file system. <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><span class="file">disk.img</span></samp>, then you can use this command to mount its second partition: <pre class="example"> grub-mount -r 2 disk.img mount-point </pre> <br><dt><samp><span class="option">-v</span></samp><dt><samp><span class="option">--verbose</span></samp><dd>Print verbose messages. </dl> <div class="node"> <a name="Invoking-grub-probe"></a> <a name="Invoking-grub_002dprobe"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Invoking-grub_002dscript_002dcheck">Invoking grub-script-check</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dmount">Invoking grub-mount</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">29 Invoking grub-probe</h2> <p>The program <samp><span class="command">grub-probe</span></samp> probes device information for a given path or device. <pre class="example"> grub-probe --target=fs /boot/grub grub-probe --target=drive --device /dev/sda1 </pre> <p><samp><span class="command">grub-probe</span></samp> must be given a path or device as a non-option argument, and also accepts the following options: <dl> <dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit. <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit. <br><dt><samp><span class="option">-d</span></samp><dt><samp><span class="option">--device</span></samp><dd>If this option is given, then the non-option argument is a system device name (such as ‘<samp><span class="samp">/dev/sda1</span></samp>’), and <samp><span class="command">grub-probe</span></samp> will print information about that device. If it is not given, then the non-option argument is a filesystem path (such as ‘<samp><span class="samp">/boot/grub</span></samp>’), and <samp><span class="command">grub-probe</span></samp> will print information about the device containing that part of the filesystem. <br><dt><samp><span class="option">-m </span><var>file</var></samp><dt><samp><span class="option">--device-map=</span><var>file</var></samp><dd>Use <var>file</var> as the device map (see <a href="#Device-map">Device map</a>) rather than the default, usually ‘<samp><span class="samp">/boot/grub/device.map</span></samp>’. <br><dt><samp><span class="option">-t </span><var>target</var></samp><dt><samp><span class="option">--target=</span><var>target</var></samp><dd>Print information about the given path or device as defined by <var>target</var>. The available targets and their meanings are: <dl> <dt>‘<samp><span class="samp">fs</span></samp>’<dd>GRUB filesystem module. <br><dt>‘<samp><span class="samp">fs_uuid</span></samp>’<dd>Filesystem Universally Unique Identifier (UUID). <br><dt>‘<samp><span class="samp">fs_label</span></samp>’<dd>Filesystem label. <br><dt>‘<samp><span class="samp">drive</span></samp>’<dd>GRUB device name. <br><dt>‘<samp><span class="samp">device</span></samp>’<dd>System device name. <br><dt>‘<samp><span class="samp">partmap</span></samp>’<dd>GRUB partition map module. <br><dt>‘<samp><span class="samp">abstraction</span></samp>’<dd>GRUB abstraction module (e.g. ‘<samp><span class="samp">lvm</span></samp>’). <br><dt>‘<samp><span class="samp">cryptodisk_uuid</span></samp>’<dd>Crypto device UUID. <br><dt>‘<samp><span class="samp">msdos_parttype</span></samp>’<dd>MBR partition type code (two hexadecimal digits). <br><dt>‘<samp><span class="samp">hints_string</span></samp>’<dd>A string of platform search hints suitable for passing to the <samp><span class="command">search</span></samp> command (see <a href="#search">search</a>). <br><dt>‘<samp><span class="samp">bios_hints</span></samp>’<dd>Search hints for the PC BIOS platform. <br><dt>‘<samp><span class="samp">ieee1275_hints</span></samp>’<dd>Search hints for the IEEE1275 platform. <br><dt>‘<samp><span class="samp">baremetal_hints</span></samp>’<dd>Search hints for platforms where disks are addressed directly rather than via firmware. <br><dt>‘<samp><span class="samp">efi_hints</span></samp>’<dd>Search hints for the EFI platform. <br><dt>‘<samp><span class="samp">arc_hints</span></samp>’<dd>Search hints for the ARC platform. <br><dt>‘<samp><span class="samp">compatibility_hint</span></samp>’<dd>A guess at a reasonable GRUB drive name for this device, which may be used as a fallback if the <samp><span class="command">search</span></samp> command fails. <br><dt>‘<samp><span class="samp">disk</span></samp>’<dd>System device name for the whole disk. </dl> <br><dt><samp><span class="option">-v</span></samp><dt><samp><span class="option">--verbose</span></samp><dd>Print verbose messages. </dl> <div class="node"> <a name="Invoking-grub-script-check"></a> <a name="Invoking-grub_002dscript_002dcheck"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dprobe">Invoking grub-probe</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="chapter">30 Invoking grub-script-check</h2> <p>The program <samp><span class="command">grub-script-check</span></samp> 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 <samp><span class="command">sh -n</span></samp>. It may take a <var>path</var> as a non-option argument; if none is supplied, it will read from standard input. <pre class="example"> grub-script-check /boot/grub/grub.cfg </pre> <p><samp><span class="command">grub-script-check</span></samp> accepts the following options: <dl> <dt><samp><span class="option">--help</span></samp><dd>Print a summary of the command-line options and exit. <br><dt><samp><span class="option">--version</span></samp><dd>Print the version number of GRUB and exit. <br><dt><samp><span class="option">-v</span></samp><dt><samp><span class="option">--verbose</span></samp><dd>Print each line of input after reading it. </dl> <div class="node"> <a name="Obtaining-and-Building-GRUB"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Reporting-bugs">Reporting bugs</a>, Previous: <a rel="previous" accesskey="p" href="#Invoking-grub_002dscript_002dcheck">Invoking grub-script-check</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="appendix">Appendix A How to obtain and build GRUB</h2> <blockquote> <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. </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.02~beta2, so the file you should grab is: <p><a href="ftp://ftp.gnu.org/gnu/grub/grub-2.02~beta2.tar.gz">ftp://ftp.gnu.org/gnu/grub/grub-2.02~beta2.tar.gz</a> <p>To unbundle GRUB use the instruction: <pre class="example"> <kbd>zcat grub-2.02~beta2.tar.gz | tar xvf -</kbd> </pre> <p>which will create a directory called <samp><span class="file">grub-2.02~beta2</span></samp> with all the sources. You can look at the file <samp><span class="file">INSTALL</span></samp> for detailed instructions on how to build and install GRUB, but you should be able to just do: <pre class="example"> <kbd>cd grub-2.02~beta2</kbd> <kbd>./configure</kbd> <kbd>make install</kbd> </pre> <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. <div class="node"> <a name="Reporting-bugs"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Future">Future</a>, Previous: <a rel="previous" accesskey="p" href="#Obtaining-and-Building-GRUB">Obtaining and Building GRUB</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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: <ol type=1 start=1> <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>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>If you have trouble with the installation, inform us of how you installed GRUB. Don't omit error messages, if any. Just ‘<samp><span class="samp">GRUB hangs up when it boots</span></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. <li>If GRUB cannot boot your operating system, write down <em>everything</em> you see on the screen. Don't paraphrase them, like ‘<samp><span class="samp">The foo OS crashes with GRUB, even though it can boot with the bar boot loader just fine</span></samp>’. Mention the commands you executed, the messages printed by them, and information on your operating system including the version number. <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>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. <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. </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>Once we get your report, we will try to fix the bugs. <div class="node"> <a name="Future"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Copying-This-Manual">Copying This Manual</a>, Previous: <a rel="previous" accesskey="p" href="#Reporting-bugs">Reporting bugs</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <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>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>. <div class="node"> <a name="Copying-This-Manual"></a> <p><hr> Next: <a rel="next" accesskey="n" href="#Index">Index</a>, Previous: <a rel="previous" accesskey="p" href="#Future">Future</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="appendix">Appendix D Copying This Manual</h2> <ul class="menu"> <li><a accesskey="1" href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>: License for copying this manual. </ul> <div class="node"> <a name="GNU-Free-Documentation-License"></a> <p><hr> Up: <a rel="up" accesskey="u" href="#Copying-This-Manual">Copying This Manual</a> </div> <h3 class="appendixsec">D.1 GNU Free Documentation License</h3> <p><a name="index-FDL_002c-GNU-Free-Documentation-License-100"></a><div align="center">Version 1.2, November 2002</div> <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> <ol type=1 start=0> <li>PREAMBLE <p>The purpose of this License is to make a manual, textbook, or other functional and useful document <dfn>free</dfn> 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>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>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. <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>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>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>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>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>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>Examples of suitable formats for Transparent copies include plain <span class="sc">ascii</span> 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>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>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>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. <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>You may also lend copies, under the same conditions stated above, and you may publicly display copies. <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>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>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>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. <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: <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>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>State on the Title page the name of the publisher of the Modified Version, as the publisher. <li>Preserve all the copyright notices of the Document. <li>Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. <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>Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. <li>Include an unaltered copy of this License. <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>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>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>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>Delete any section Entitled “Endorsements”. Such a section may not be included in the Modified Version. <li>Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section. <li>Preserve any Warranty Disclaimers. </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>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>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>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. <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>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>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.” <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>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. <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>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. <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>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. <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. <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>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. </ol> <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: <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> <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this: <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> <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>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. <!-- Local Variables: --> <!-- ispell-local-pdict: "ispell-dict" --> <!-- End: --> <div class="node"> <a name="Index"></a> <p><hr> Previous: <a rel="previous" accesskey="p" href="#Copying-This-Manual">Copying This Manual</a>, Up: <a rel="up" accesskey="u" href="#Top">Top</a> </div> <h2 class="unnumbered">Index</h2> <!-- Currently, we use only the Concept Index. --> <ul class="index-cp" compact> <li><a href="#index-g_t_0040code_007b_005b_007d-7"><code>[</code></a>: <a href="#g_t_005b">[</a></li> <li><a href="#index-acpi-8"><code>acpi</code></a>: <a href="#acpi">acpi</a></li> <li><a href="#index-authenticate-9"><code>authenticate</code></a>: <a href="#authenticate">authenticate</a></li> <li><a href="#index-background_005fcolor-10"><code>background_color</code></a>: <a href="#background_005fcolor">background_color</a></li> <li><a href="#index-background_005fimage-11"><code>background_image</code></a>: <a href="#background_005fimage">background_image</a></li> <li><a href="#index-badram-12"><code>badram</code></a>: <a href="#badram">badram</a></li> <li><a href="#index-blocklist-13"><code>blocklist</code></a>: <a href="#blocklist">blocklist</a></li> <li><a href="#index-boot-14"><code>boot</code></a>: <a href="#boot">boot</a></li> <li><a href="#index-cat-15"><code>cat</code></a>: <a href="#cat">cat</a></li> <li><a href="#index-chainloader-16"><code>chainloader</code></a>: <a href="#chainloader">chainloader</a></li> <li><a href="#index-clear-17"><code>clear</code></a>: <a href="#clear">clear</a></li> <li><a href="#index-CMOS-19"><code>CMOS</code></a>: <a href="#cmosdump">cmosdump</a></li> <li><a href="#index-cmosclean-18"><code>cmosclean</code></a>: <a href="#cmosclean">cmosclean</a></li> <li><a href="#index-cmostest-20"><code>cmostest</code></a>: <a href="#cmostest">cmostest</a></li> <li><a href="#index-cmp-21"><code>cmp</code></a>: <a href="#cmp">cmp</a></li> <li><a href="#index-configfile-22"><code>configfile</code></a>: <a href="#configfile">configfile</a></li> <li><a href="#index-cpuid-23"><code>cpuid</code></a>: <a href="#cpuid">cpuid</a></li> <li><a href="#index-crc-24"><code>crc</code></a>: <a href="#crc">crc</a></li> <li><a href="#index-cryptomount-25"><code>cryptomount</code></a>: <a href="#cryptomount">cryptomount</a></li> <li><a href="#index-cutmem-26"><code>cutmem</code></a>: <a href="#cutmem">cutmem</a></li> <li><a href="#index-date-27"><code>date</code></a>: <a href="#date">date</a></li> <li><a href="#index-devicetree-28"><code>devicetree</code></a>: <a href="#devicetree">devicetree</a></li> <li><a href="#index-distrust-29"><code>distrust</code></a>: <a href="#distrust">distrust</a></li> <li><a href="#index-drivemap-30"><code>drivemap</code></a>: <a href="#drivemap">drivemap</a></li> <li><a href="#index-echo-31"><code>echo</code></a>: <a href="#echo">echo</a></li> <li><a href="#index-eval-32"><code>eval</code></a>: <a href="#eval">eval</a></li> <li><a href="#index-export-33"><code>export</code></a>: <a href="#export">export</a></li> <li><a href="#index-false-34"><code>false</code></a>: <a href="#false">false</a></li> <li><a href="#index-FDL_002c-GNU-Free-Documentation-License-100">FDL, GNU Free Documentation License</a>: <a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a></li> <li><a href="#index-gettext-35"><code>gettext</code></a>: <a href="#gettext">gettext</a></li> <li><a href="#index-gptsync-36"><code>gptsync</code></a>: <a href="#gptsync">gptsync</a></li> <li><a href="#index-halt-37"><code>halt</code></a>: <a href="#halt">halt</a></li> <li><a href="#index-hashsum-38"><code>hashsum</code></a>: <a href="#hashsum">hashsum</a></li> <li><a href="#index-help-39"><code>help</code></a>: <a href="#help">help</a></li> <li><a href="#index-initrd-40"><code>initrd</code></a>: <a href="#initrd">initrd</a></li> <li><a href="#index-initrd16-41"><code>initrd16</code></a>: <a href="#initrd16">initrd16</a></li> <li><a href="#index-insmod-42"><code>insmod</code></a>: <a href="#insmod">insmod</a></li> <li><a href="#index-keystatus-43"><code>keystatus</code></a>: <a href="#keystatus">keystatus</a></li> <li><a href="#index-linux-44"><code>linux</code></a>: <a href="#linux">linux</a></li> <li><a href="#index-linux16-45"><code>linux16</code></a>: <a href="#linux16">linux16</a></li> <li><a href="#index-list_005fenv-46"><code>list_env</code></a>: <a href="#list_005fenv">list_env</a></li> <li><a href="#index-list_005ftrusted-47"><code>list_trusted</code></a>: <a href="#list_005ftrusted">list_trusted</a></li> <li><a href="#index-load_005fenv-48"><code>load_env</code></a>: <a href="#load_005fenv">load_env</a></li> <li><a href="#index-loadfont-49"><code>loadfont</code></a>: <a href="#loadfont">loadfont</a></li> <li><a href="#index-loopback-50"><code>loopback</code></a>: <a href="#loopback">loopback</a></li> <li><a href="#index-ls-51"><code>ls</code></a>: <a href="#ls">ls</a></li> <li><a href="#index-lsfonts-52"><code>lsfonts</code></a>: <a href="#lsfonts">lsfonts</a></li> <li><a href="#index-lsmod-53"><code>lsmod</code></a>: <a href="#lsmod">lsmod</a></li> <li><a href="#index-md5sum-54"><code>md5sum</code></a>: <a href="#md5sum">md5sum</a></li> <li><a href="#index-menuentry-1"><code>menuentry</code></a>: <a href="#menuentry">menuentry</a></li> <li><a href="#index-module-55"><code>module</code></a>: <a href="#module">module</a></li> <li><a href="#index-multiboot-56"><code>multiboot</code></a>: <a href="#multiboot">multiboot</a></li> <li><a href="#index-nativedisk-57"><code>nativedisk</code></a>: <a href="#nativedisk">nativedisk</a></li> <li><a href="#index-net_005fadd_005faddr-85"><code>net_add_addr</code></a>: <a href="#net_005fadd_005faddr">net_add_addr</a></li> <li><a href="#index-net_005fadd_005fdns-86"><code>net_add_dns</code></a>: <a href="#net_005fadd_005fdns">net_add_dns</a></li> <li><a href="#index-net_005fadd_005froute-87"><code>net_add_route</code></a>: <a href="#net_005fadd_005froute">net_add_route</a></li> <li><a href="#index-net_005fbootp-88"><code>net_bootp</code></a>: <a href="#net_005fbootp">net_bootp</a></li> <li><a href="#index-net_005fbootp6-89"><code>net_bootp6</code></a>: <a href="#net_005fbootp6">net_bootp6</a></li> <li><a href="#index-net_005fdel_005faddr-90"><code>net_del_addr</code></a>: <a href="#net_005fdel_005faddr">net_del_addr</a></li> <li><a href="#index-net_005fdel_005fdns-91"><code>net_del_dns</code></a>: <a href="#net_005fdel_005fdns">net_del_dns</a></li> <li><a href="#index-net_005fdel_005froute-92"><code>net_del_route</code></a>: <a href="#net_005fdel_005froute">net_del_route</a></li> <li><a href="#index-net_005fget_005fdhcp_005foption-93"><code>net_get_dhcp_option</code></a>: <a href="#net_005fget_005fdhcp_005foption">net_get_dhcp_option</a></li> <li><a href="#index-net_005fipv6_005fautoconf-94"><code>net_ipv6_autoconf</code></a>: <a href="#net_005fipv6_005fautoconf">net_ipv6_autoconf</a></li> <li><a href="#index-net_005fls_005faddr-95"><code>net_ls_addr</code></a>: <a href="#net_005fls_005faddr">net_ls_addr</a></li> <li><a href="#index-net_005fls_005fcards-96"><code>net_ls_cards</code></a>: <a href="#net_005fls_005fcards">net_ls_cards</a></li> <li><a href="#index-net_005fls_005fdns-97"><code>net_ls_dns</code></a>: <a href="#net_005fls_005fdns">net_ls_dns</a></li> <li><a href="#index-net_005fls_005froutes-98"><code>net_ls_routes</code></a>: <a href="#net_005fls_005froutes">net_ls_routes</a></li> <li><a href="#index-net_005fnslookup-99"><code>net_nslookup</code></a>: <a href="#net_005fnslookup">net_nslookup</a></li> <li><a href="#index-normal-58"><code>normal</code></a>: <a href="#normal">normal</a></li> <li><a href="#index-normal_005fexit-59"><code>normal_exit</code></a>: <a href="#normal_005fexit">normal_exit</a></li> <li><a href="#index-parttool-60"><code>parttool</code></a>: <a href="#parttool">parttool</a></li> <li><a href="#index-password-61"><code>password</code></a>: <a href="#password">password</a></li> <li><a href="#index-password_005fpbkdf2-62"><code>password_pbkdf2</code></a>: <a href="#password_005fpbkdf2">password_pbkdf2</a></li> <li><a href="#index-play-63"><code>play</code></a>: <a href="#play">play</a></li> <li><a href="#index-probe-64"><code>probe</code></a>: <a href="#probe">probe</a></li> <li><a href="#index-pxe_005funload-65"><code>pxe_unload</code></a>: <a href="#pxe_005funload">pxe_unload</a></li> <li><a href="#index-read-66"><code>read</code></a>: <a href="#read">read</a></li> <li><a href="#index-reboot-67"><code>reboot</code></a>: <a href="#reboot">reboot</a></li> <li><a href="#index-regexp-68"><code>regexp</code></a>: <a href="#regexp">regexp</a></li> <li><a href="#index-rmmod-69"><code>rmmod</code></a>: <a href="#rmmod">rmmod</a></li> <li><a href="#index-save_005fenv-70"><code>save_env</code></a>: <a href="#save_005fenv">save_env</a></li> <li><a href="#index-search-71"><code>search</code></a>: <a href="#search">search</a></li> <li><a href="#index-sendkey-72"><code>sendkey</code></a>: <a href="#sendkey">sendkey</a></li> <li><a href="#index-serial-3"><code>serial</code></a>: <a href="#serial">serial</a></li> <li><a href="#index-set-73"><code>set</code></a>: <a href="#set">set</a></li> <li><a href="#index-sha1sum-74"><code>sha1sum</code></a>: <a href="#sha1sum">sha1sum</a></li> <li><a href="#index-sha256sum-75"><code>sha256sum</code></a>: <a href="#sha256sum">sha256sum</a></li> <li><a href="#index-sha512sum-76"><code>sha512sum</code></a>: <a href="#sha512sum">sha512sum</a></li> <li><a href="#index-sleep-77"><code>sleep</code></a>: <a href="#sleep">sleep</a></li> <li><a href="#index-source-78"><code>source</code></a>: <a href="#source">source</a></li> <li><a href="#index-submenu-2"><code>submenu</code></a>: <a href="#submenu">submenu</a></li> <li><a href="#index-terminal_005finput-4"><code>terminal_input</code></a>: <a href="#terminal_005finput">terminal_input</a></li> <li><a href="#index-terminal_005foutput-5"><code>terminal_output</code></a>: <a href="#terminal_005foutput">terminal_output</a></li> <li><a href="#index-terminfo-6"><code>terminfo</code></a>: <a href="#terminfo">terminfo</a></li> <li><a href="#index-test-79"><code>test</code></a>: <a href="#test">test</a></li> <li><a href="#index-true-80"><code>true</code></a>: <a href="#true">true</a></li> <li><a href="#index-trust-81"><code>trust</code></a>: <a href="#trust">trust</a></li> <li><a href="#index-unset-82"><code>unset</code></a>: <a href="#unset">unset</a></li> <li><a href="#index-verify_005fdetached-83"><code>verify_detached</code></a>: <a href="#verify_005fdetached">verify_detached</a></li> <li><a href="#index-videoinfo-84"><code>videoinfo</code></a>: <a href="#videoinfo">videoinfo</a></li> </ul><div class="footnote"> <hr> <a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> <dfn>chain-load</dfn> is the mechanism for loading unsupported operating systems by loading another boot loader. It is typically used for loading DOS or Windows.</p> <p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small> The NetBSD/i386 kernel is Multiboot-compliant, but lacks support for Multiboot modules.</p> <p class="footnote"><small>[<a name="fn-3" href="#fnd-3">3</a>]</small> Only CRC32 data integrity check is supported (xz default is CRC64 so one should use –check=crc32 option). LZMA BCJ filters are supported.</p> <p class="footnote"><small>[<a name="fn-4" href="#fnd-4">4</a>]</small> There are a few pathological cases where loading a very badly organized ELF kernel might take longer, but in practice this never happen.</p> <p class="footnote"><small>[<a name="fn-5" href="#fnd-5">5</a>]</small> The LInux LOader, a boot loader that everybody uses, but nobody likes.</p> <p class="footnote"><small>[<a name="fn-6" href="#fnd-6">6</a>]</small> El Torito is a specification for bootable CD using BIOS functions.</p> <p class="footnote"><small>[<a name="fn-7" href="#fnd-7">7</a>]</small> Currently a backslash-newline pair within a variable name is not handled properly, so use this feature with some care.</p> <p class="footnote"><small>[<a name="fn-8" href="#fnd-8">8</a>]</small> However, this behavior will be changed in the future version, in a user-invisible way.</p> <hr></div> </body></html>
Back to File Manager