Difference between revisions of "Package:Boot-Update"

(added info about running as root)
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
{{Ebuild
 +
|Summary=Funtoo Core Boot Framework for global boot loader configuration
 +
|CatPkg=sys-boot/boot-update
 +
|Maintainer=Drobbins
 +
|Repository=Funtoo Overlay
 +
|Organization=Funtoo Technologies
 +
|Overlay=Funtoo
 +
}}
 
Funtoo boot-update provides a unified mechanism for configuring the GRUB 1.9x ({{Package|sys-boot/grub}}) and GRUB 0.97 ({{Package|sys-boot/grub-legacy}}) boot loaders. It is the recommended, official way to configure Funtoo Linux systems for booting.
 
Funtoo boot-update provides a unified mechanism for configuring the GRUB 1.9x ({{Package|sys-boot/grub}}) and GRUB 0.97 ({{Package|sys-boot/grub-legacy}}) boot loaders. It is the recommended, official way to configure Funtoo Linux systems for booting.
  
Line 13: Line 21:
 
== GRUB 1.97+ Quick Start ==
 
== GRUB 1.97+ Quick Start ==
  
If using ''<code>sys-boot/grub-1.97</code>'' or later, perform the following steps:
+
If using <code>sys-boot/grub-1.97</code> or later, perform the following steps:
  
 
* Partition disk using GPT/GUID (recommended) or MBR partitions.
 
* Partition disk using GPT/GUID (recommended) or MBR partitions.
* Install kernel/initrd to /boot
+
* Install kernel/initrd to <code>/boot</code>
  
 
<console>
 
<console>
Line 22: Line 30:
 
###i## grub-install --no-floppy /dev/sda
 
###i## grub-install --no-floppy /dev/sda
 
</console>
 
</console>
Ensure that ''<code>/etc/fstab</code>'' is correct, and edit ''<tt>/etc/boot.conf</tt>'' to reflect your installation. Then run:
+
Ensure that <code>/etc/fstab</code> is correct, and edit <code>/etc/boot.conf</code> to reflect your installation (see <code>/etc/boot.conf.example</code>). Then run:
  
 
<console>
 
<console>
 
###i## boot-update
 
###i## boot-update
 
</console>
 
</console>
This will auto-generate the complex ''<tt>/boot/grub/grub.cfg</tt>'' required for booting. Re-run ''<tt>boot-update</tt>'' every time your available kernels/initrds or ''<tt>/etc/boot.conf</tt>'' configuration changes.
+
This will auto-generate the complex <code>/boot/grub/grub.cfg</code> required for booting. Re-run <code>boot-update</code> every time your available kernels/initrds or <code>/etc/boot.conf</code> configuration changes.
  
 
= GRUB 0.97 (grub-legacy) Quick Start =
 
= GRUB 0.97 (grub-legacy) Quick Start =
  
If using ''<code>sys-boot/grub-legacy-0.97</code>'', perform the following steps:
+
If using <code>sys-boot/grub-legacy-0.97</code>, perform the following steps:
  
 
* Partition disk using MBR partitions '''(GPT not supported)'''
 
* Partition disk using MBR partitions '''(GPT not supported)'''
* Install kernel/initrd to ''<code>/boot</code>''
+
* Install kernel/initrd to <code>/boot</code>
  
 
<console>
 
<console>
###i## emerge -av sys-boot/boot-update
+
###i## emerge sys-boot/boot-update
 
###i## emerge ">=sys-boot/grub-legacy-0.97-r11"
 
###i## emerge ">=sys-boot/grub-legacy-0.97-r11"
 
###i## grub-install-legacy /dev/sda
 
###i## grub-install-legacy /dev/sda
 
</console>
 
</console>
Due to an issue with ''<code>grub-legacy</code>'', you may see the following message:
+
Due to an issue with <code>grub-legacy</code>, you may see the following message:
 
<console>
 
<console>
 
###i## grub-install-legacy /dev/sda
 
###i## grub-install-legacy /dev/sda
 
The file /boot/grub-legacy/stage1 not read correctly.
 
The file /boot/grub-legacy/stage1 not read correctly.
 
</console>
 
</console>
Should you receive this message, you will have to install ''<code>grub-legacy</code>'' from the grub shell.
+
Should you receive this message, you will have to install <code>grub-legacy</code> from the grub shell.
Assuming ''<code>/boot</code>'' is ''<code>/dev/sda1</code>'' and you want to install grub to the MBR, you would run the following:
+
Assuming <code>/boot</code> is the partition <code>/dev/sda1</code> and you want to install grub to the MBR, you would run the following:
 
<console>
 
<console>
 
###i## grub-legacy
 
###i## grub-legacy
Line 54: Line 62:
 
quit
 
quit
 
</console>
 
</console>
When adjusting to fit your setup, remember 'root' is the location of your boot partition, 'setup' is where you want to install grub, and don't forget about grub's unique naming conventions for harddrives/partitions. For more information run:
+
When adjusting to fit your setup, remember 'root' is the location of your boot partition, 'setup' is where you want to install grub, and don't forget about grub's unique naming conventions for hard drives / partitions. For more information run:
 
<console>
 
<console>
 
###i## info grub-legacy
 
###i## info grub-legacy
 
</console>
 
</console>
  
Ensure that ''<tt>/etc/fstab</tt>'' is correct, and edit ''<tt>/etc/boot.conf</tt>'' to reflect your installation. Ensure a ''<tt>generate grub-legacy</tt>'' setting in the ''<tt>boot</tt>'' section. Then run:
+
Ensure that <code>/etc/fstab</code> is correct, and edit <code>/etc/boot.conf</code> to reflect your installation.
 +
Ensure a <code>generate grub-legacy</code> setting in the <code>boot</code> section. Then run:
  
 
<console>
 
<console>
 
###i## boot-update
 
###i## boot-update
 
</console>
 
</console>
This will auto-generate the ''<tt>/boot/grub-legacy/grub.conf</tt>'' required for booting. Note that grub-legacy-0.97-r11 and later stores ''<tt>grub.conf</tt>'' in the ''<tt>/boot/grub-legacy</tt>'' directory.
+
This will auto-generate the <code>/boot/grub-legacy/grub.conf</code> required for booting. Note that <code>grub-legacy-0.97-r11</code> and later stores <code>grub.conf</code> in the <code>/boot/grub-legacy</code> directory.
 +
 
 +
Re-run <code>boot-update</code> every time your available kernels / initrds or <code>/etc/boot.conf</code> configuration changes.
 +
 
 +
== Additional Information ==
 +
Loop mounting is not currently supported by boot-update.  Some text color options are also missing.  Many Funtooers find a loop mounted iso of systemrescuecd or similar utility disk handy.  This can be implemented by a simple bash script run after boot-update.  Or you could make an aliases to run them both with one command line statement if you wish.  Here is an example, change partition information and other options as necessary:
 +
{{file|name=/home/<username>boot-fix|desc=a simple automatic way to add loop mounts and color options to your grub.cfg|body=
 +
#!/bin/bash
 +
 
 +
# boot-fix
 +
 
 +
FILENAME=$(ls /opt/sysrcd/systemrescuecd*)
  
Re-run ''<tt>boot-update</tt>'' every time your available kernels/initrds or ''<tt>/etc/boot.conf</tt>'' configuration changes.
+
sed -i 's%set menu_color_highlight=white/light-blue%set menu_color_highlight=white/light-blue\
 +
set color_normal=brown/black%' /boot/grub/grub.cfg
  
[[Category:HOWTO]]
+
sed -i 's%set default%menuentry "SystemRescueCd (isoloop with backstore)" {\
 +
insmod part_gpt\
 +
        insmod ext2\
 +
        set root=(hostdisk//dev/sda,gpt4)\
 +
        loopback loop (hd0,gpt4)'$FILENAME'\
 +
        linux (loop)/isolinux/rescue64 setkmap=us backstore=alldev,/opt/sysrcd/sysrcd.bs docache isoloop='$FILENAME'\
 +
        initrd (loop)/isolinux/initram.igz\
 +
}\n\
 +
menuentry "SystemRescueCd (isoloop no backstore)" {\
 +
        insmod ext2\
 +
        insmod part_gpt\
 +
        set root=(hostdisk//dev/sda,gpt4)\
 +
        loopback loop (hd0,gpt4)'$FILENAME'\
 +
        linux (loop)/isolinux/rescue64 setkmap=us backstore=off docache isoloop='$FILENAME'\
 +
        initrd (loop)/isolinux/initram.igz\
 +
}\n\
 +
set default%' /boot/grub/grub.cfg
 +
}}
 +
This file must be executable and owned as root, run as root.
 
[[Category:Projects]]
 
[[Category:Projects]]
 
[[Category:Funtoo features]]
 
[[Category:Funtoo features]]
 +
{{EbuildFooter}}

Latest revision as of 17:38, October 14, 2014

sys-boot/boot-update


Current Maintainer(s):Daniel Robbins
Source Repository:Funtoo Overlay

Summary: Funtoo Core Boot Framework for global boot loader configuration



Boot-Update


Funtoo boot-update provides a unified mechanism for configuring the GRUB 1.9x (sys-boot/grub (package not on wiki - please add)) and GRUB 0.97 (sys-boot/grub-legacy (package not on wiki - please add)) boot loaders. It is the recommended, official way to configure Funtoo Linux systems for booting.

Current Version

  • Boot-Update

Man Pages

Consult the following man pages for detailed, up-to-date information on configuration file settings and command-line arguments:

  • boot-update(8)
  • boot.conf(5)

GRUB 1.97+ Quick Start

If using sys-boot/grub-1.97 or later, perform the following steps:

  • Partition disk using GPT/GUID (recommended) or MBR partitions.
  • Install kernel/initrd to /boot
# emerge sys-boot/boot-update
# grub-install --no-floppy /dev/sda

Ensure that /etc/fstab is correct, and edit /etc/boot.conf to reflect your installation (see /etc/boot.conf.example). Then run:

# boot-update

This will auto-generate the complex /boot/grub/grub.cfg required for booting. Re-run boot-update every time your available kernels/initrds or /etc/boot.conf configuration changes.

GRUB 0.97 (grub-legacy) Quick Start

If using sys-boot/grub-legacy-0.97, perform the following steps:

  • Partition disk using MBR partitions (GPT not supported)
  • Install kernel/initrd to /boot
# emerge sys-boot/boot-update
# emerge ">=sys-boot/grub-legacy-0.97-r11"
# grub-install-legacy /dev/sda

Due to an issue with grub-legacy, you may see the following message:

# grub-install-legacy /dev/sda
The file /boot/grub-legacy/stage1 not read correctly.

Should you receive this message, you will have to install grub-legacy from the grub shell. Assuming /boot is the partition /dev/sda1 and you want to install grub to the MBR, you would run the following:

# grub-legacy
root (hd0,0)
setup (hd0)
quit

When adjusting to fit your setup, remember 'root' is the location of your boot partition, 'setup' is where you want to install grub, and don't forget about grub's unique naming conventions for hard drives / partitions. For more information run:

# info grub-legacy

Ensure that /etc/fstab is correct, and edit /etc/boot.conf to reflect your installation. Ensure a generate grub-legacy setting in the boot section. Then run:

# boot-update

This will auto-generate the /boot/grub-legacy/grub.conf required for booting. Note that grub-legacy-0.97-r11 and later stores grub.conf in the /boot/grub-legacy directory.

Re-run boot-update every time your available kernels / initrds or /etc/boot.conf configuration changes.

Additional Information

Loop mounting is not currently supported by boot-update. Some text color options are also missing. Many Funtooers find a loop mounted iso of systemrescuecd or similar utility disk handy. This can be implemented by a simple bash script run after boot-update. Or you could make an aliases to run them both with one command line statement if you wish. Here is an example, change partition information and other options as necessary:

/home/<username>boot-fix: a simple automatic way to add loop mounts and color options to your grub.cfg
#!/bin/bash

# boot-fix

FILENAME=$(ls /opt/sysrcd/systemrescuecd*)

sed -i 's%set menu_color_highlight=white/light-blue%set menu_color_highlight=white/light-blue\
set color_normal=brown/black%' /boot/grub/grub.cfg

sed -i 's%set default%menuentry "SystemRescueCd (isoloop with backstore)" {\
	insmod part_gpt\
        insmod ext2\
        set root=(hostdisk//dev/sda,gpt4)\
        loopback loop (hd0,gpt4)'$FILENAME'\
        linux (loop)/isolinux/rescue64 setkmap=us backstore=alldev,/opt/sysrcd/sysrcd.bs docache isoloop='$FILENAME'\
        initrd (loop)/isolinux/initram.igz\
}\n\
menuentry "SystemRescueCd (isoloop no backstore)" {\
        insmod ext2\
        insmod part_gpt\
        set root=(hostdisk//dev/sda,gpt4)\
        loopback loop (hd0,gpt4)'$FILENAME'\
        linux (loop)/isolinux/rescue64 setkmap=us backstore=off docache isoloop='$FILENAME'\
        initrd (loop)/isolinux/initram.igz\
}\n\
set default%' /boot/grub/grub.cfg

This file must be executable and owned as root, run as root.