public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-11 22:06 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-11 22:06 UTC (permalink / raw
  To: gentoo-commits

commit:     928a01e0408231a0e634c043dc0dd1f2f05f8ef0
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Tue Oct 11 22:05:47 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Tue Oct 11 22:05:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=928a01e0

GRUB 2 Guide: significantly enhance EFI section (nearly complete)

---
 docs/grub-2-guide.xml |  118 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 115 insertions(+), 3 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index e8c5b72..44daf5a 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -289,10 +289,122 @@ use it at all.
 </p>
 
 <p>
-TODO: grub image
+Next, you should add (or edit) an entry for the /boot partition into fstab and
+mount it:
+</p>
+
+<pre caption="fstab entry and mounting of /boot">
+# <i>cat /etc/fstab | grep efi-boot</i>
+LABEL=efi-boot   /boot   vfat   defaults   0 2
+# <i>mount /boot</i>
+</pre>
+
+<p>
+Next, you should copy GRUB 2 modules into /boot where they can be found by
+GRUB 2 during system boot:
+</p>
+
+<pre caption="Copying GRUB 2 modules into /boot (must be done everytime GRUB 2 is updated)">
+# <i>mkdir -p /boot/grub2</i>
+# <i>cp /lib/grub2/x86_64-efi/* /boot/grub2/</i>
+</pre>
+
+<p>
+The most crucial step is creating the GRUB 2 image (EFI application). This is
+accomplished using the <c>grub2-mkimage</c> command:
+</p>
+
+<pre caption="Creating GRUB 2 image (must be done everytime GRUB 2 is updated)">
+# <i>grub2-mkimage -p /grub2 -o /boot/grub2/grub.efi -O x86_64-efi part_msdos part_gpt fat</i>
+</pre>
+
+<table>
+<tr>
+<th colspan="2">grub2-mkimage options</th>
+<th>recommended value</th>
+<th>notes</th>
+</tr>
+
+<tr>
+<th>-p</th>
+<ti>where should GRUB 2 look for its modules and config?</ti>
+<ti><c>/grub2</c></ti>
+<ti><b>relative to the root of the
+partition where GRUB 2 EFI application is executed from</b></ti>
+</tr>
+
+<tr>
+<th>-o</th>
+<ti>where to store created image?</ti>
+<ti><c>/boot/grub2/grub.efi</c></ti>
+</tr>
+
+<tr>
+<th>-O</th>
+<ti>platform to create image for</ti>
+<ti><c>x86_64-efi</c></ti>
+<ti>replace with <c>i386-efi</c> on 32bit systems (old Intel Macs)</ti>
+</tr>
+
+<tr>
+<th>&lt;rest&gt;</th>
+<ti>modules from /lib/grub2/[platform] to statically link in</ti>
+<ti><c>part_msdos part_gpt fat</c></ti>
+<ti>you only need to specify modules that are needed to be able to load other
+modules from filesystem. You may drop <c>part_msdos</c> or <c>part_gpt</c> if
+you don't use such partitions. You may add <c>normal</c> for a decent GRUB 2
+shell available even in cases GRUB 2 cannot load other modules</ti>
+</tr>
+</table>
+
+<p>When GRUB 2 image (EFI application) is made, you have to tell your firmware
+to execute it upon boot. There are two ways to achieve this. If there is
+already a default bootloader on your EFI System Partition that you don't want
+to overwrite, you have to use the second. Otherwise you can use the first and
+we encourage you to do so, since it is simpler.
+</p>
+
+<pre caption="Subvariant 1: copying grub.efi into default location for EFI bootloader  (must be done everytime GRUB 2 is updated)">
+# <i>mkdir -p /boot/EFI/BOOT</i>
+# <i>cp /boot/grub2/grub.efi /boot/EFI/BOOT/BOOTX64.EFI</i>
+</pre>
 
-After you have prepared your GAGA, you can easily proceed with generating the
-configuration.
+<note>
+EFI 2 specification says that the default bootloader location is <c>[EFI System
+Partition]\EFI\BOOT\BOOTx64.EFI</c> for x86_64 hardware. (and
+<c>...\BOOTIA32.EFI</c> on 32bit systems) While FAT32 filesystems should be
+case-insesitive, it is recommended to use ALL-CAPS filenames in default
+bootloader path in order to be compatible with all vfat mount options.
+</note>
+
+<pre caption="Subvariant 2: use efibootmgr to tell firmware what to execute on boot">
+# <i>efibootmgr TODO TODO TODO</i>
+</pre>
+
+<warn>
+Executing <c>efibootmgr</c> on Macs is known to brick (destroy) your firmware!
+Various sources report that the <c>bless</c> command should be used instead.
+</warn>
+
+<p>
+Last, you should create a GRUB 2 environment file (where GRUB 2 stores
+persistent variables such number of the last booted item) as it is not created
+automatically:
+</p>
+
+<pre caption="Creating GRUB 2 environment file">
+# <i>grub2-editenv - create</i>
+</pre>
+
+<impo>
+When you update GRUB 2, be sure to execute all commands that are marked as
+such. Failure to do so would result in you using the previously installed GRUB
+version.
+</impo>
+
+<p>
+The last step is actually installing Linux kernel images into /boot, then you
+can easily proceed with generating the configuration.
 </p>
 
 </body>



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-11-02 12:30 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-11-02 12:30 UTC (permalink / raw
  To: gentoo-commits

commit:     ff02b8dff8d0132f1d355cf6164464a674a1a23e
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Wed Nov  2 10:18:03 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Wed Nov  2 10:18:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=ff02b8df

GRUB 2 Guide: note about bind-mounting /sys, thanks to Moritz, Ramin

---
 docs/grub-2-guide.xml |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index 42ab32b..100e6ed 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -426,6 +426,14 @@ command that probes your system for all the required data. Cooperating with
 <i>sys-boot/os-prober</i>, it detects even other OSes on all disks.
 </p>
 
+<impo>If you want to configure GRUB 2 from a chrooted environment (e.g. from the
+Gentoo LiveDVD) and you need os-prober functionality, you have to mount the sysfs
+from the live system:
+<pre caption="Bind-mounting sysfs">
+# <i>mount --rbind /sys /path/to/chroot/sys</i>
+</pre>
+</impo>
+
 <impo>
 If you updated from GRUB Legacy then your <path>/boot/grub/menu.lst</path>
 was converted to <path>/boot/grub2/grub.cfg</path> to ensure that your system



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-23 19:49 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-23 19:49 UTC (permalink / raw
  To: gentoo-commits

commit:     818b4b1d30cee0a2a16e7262ff1342bd50e052ef
Author:     Moritz Schlarb <mail <AT> moritz-schlarb <DOT> de>
AuthorDate: Sun Oct 23 19:48:23 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Sun Oct 23 19:48:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=818b4b1d

GRUB 2 Guide fixes by Moritz Schlarb

---
 docs/grub-2-guide.xml |   58 ++++++++++++++++++++++++------------------------
 1 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index b1cdd28..42ab32b 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -27,7 +27,7 @@ This guide shows you how to install and configure the GRUB 2 bootloader.
 <license/>
 
 <version>1</version>
-<date>2011-10-11</date>
+<date>2011-10-23</date>
 
 <chapter>
 <title>About</title>
@@ -62,30 +62,30 @@ Some examples of new features:
 <body>
 
 <p>
-Playing with bootloader always brings the danger of leaving your system in
-unbootable state. Fortunately no data is lost in most cases and recovery is not
+Playing with your bootloader always brings the danger of leaving your system in an
+unbootable state. Fortunately, no data is lost in most cases and recovery is not
 hard, but we recommend you to have a bootable CD, DVD or a USB flash disk with
 Linux around (<uri link="http://www.gentoo.org/main/en/where.xml">Gentoo
 LiveDVD</uri> or <uri link="http://www.sysresccd.org/">System Rescue CD</uri>
 will do) and to backup your current bootloader setup. If your current
-bootloader is GRUB legacy, following code sample may help you backing it up.
+bootloader is GRUB Legacy, the following code sample will help you backing it up.
 </p>
 
 <pre caption="Backing up GRUB">
-# <comment># copy grub modules and configuration</comment>
+# <comment># backup grub modules and configuration</comment>
 # <i>cp -a /boot/grub <keyword>/path/to/backup</keyword>/</i>
 # <comment># backup the MBR and GRUB stage 1.5</comment>
 # <i>dd if=<keyword>/dev/sda</keyword> of=<keyword>/path/to/backup</keyword>/first-sectors count=63</i>
 </pre>
 
 <note>
-Replace <c>/dev/sda</c> with device node of the disk you boot from (this is
-usually and the whole disk like <e>sda</e>, not a partition like sda1) and
-<c>/path/to/backup</c> with path to your favourite backup medium.
+Replace <c>/dev/sda</c> with the device node of the disk you boot from (this is
+usually the whole disk like <e>sda</e>, not a partition like <e>sda1</e>) and
+<c>/path/to/backup</c> with the path to your favourite backup medium.
 </note>
 
 <p>
-When something goes wrong, you can restore previous grub installation by
+When something goes wrong, you can restore the previous grub installation by
 booting some Linux live media and issuing following commands.
 </p>
 
@@ -99,14 +99,14 @@ booting some Linux live media and issuing following commands.
 </pre>
 
 <note>
-Replace <c>/dev/sda</c> with device node of the disk you boot from and
-<c>/path/to/backup</c> with path to the place where you've stored your backup.
+Replace <c>/dev/sda</c> with the device node of the disk you boot from and
+<c>/path/to/backup</c> with the path to the place where you've stored your backup.
 </note>
 
 <warn>
 Writing directly to disk sectors (even those that are outside of partitions
 in typical setup) is risky operation and will make your data <e>inaccessible</e>
-if you changed your parititon layout between backup and restore. Other slower
+if you changed your partition layout between backup and restore. Other slower
 and safer option would be chrooting into your Gentoo installation and
 re-installing bootloader - you can use <uri link="/doc/en/handbook/">Gentoo
 Handbook</uri> for that task.
@@ -129,11 +129,11 @@ should be set in /etc/make.conf.
 <p>Description of mostly used values for GRUB_PLATFORMS as of =sys-boot/grub-1.99:</p>
 
 <ol>
-<li>pc: normal BIOS pc</li>
-<li>efi-64: EFI systems, their latest 64b version</li>
+<li>pc: Normal BIOS PC</li>
+<li>efi-64: EFI systems, their latest 64-bit version</li>
 <li>coreboot: Coreboot replacement of BIOS</li>
-<li>qemu: support for QEMU booting</li>
-<li>yeelong: Support for MIPS loongson</li>
+<li>qemu: Support for QEMU booting</li>
+<li>yeeloong: Support for MIPS loongson</li>
 
 </ol>
 
@@ -237,7 +237,7 @@ Replace <c>/dev/sda</c> with the disk you want to have the EFI System Partition
 <c>/dev/sda1</c> with the partition designated for it in all following samples.
 </note>
 
-<pre caption="EFI System Partion on GPT disk as shown by gdisk">
+<pre caption="EFI System Partition on GPT disk as shown by gdisk">
 # <i>gdisk -l <keyword>/dev/sda</keyword></i>
 <comment>(...)</comment>
 
@@ -245,7 +245,7 @@ Number  Start (sector)    End (sector)  Size       Code  Name
 <ident>   1              34          411647   201.0 MiB   EF00  </ident>
 </pre>
 
-<pre caption="EFI System Partion on GPT disk as shown by parted">
+<pre caption="EFI System Partition on GPT disk as shown by parted">
 # <i>parted -l</i>
 <comment>(...)</comment>
 
@@ -258,7 +258,7 @@ In case the disk partition scheme is MBR (MS-DOS), the EFI System Partition shou
 have type <c>EF</c>. Create or re-type it, it should be at least 100 MiB large here, too.
 </p>
 
-<pre caption="EFI System Partion on MBR disk as shown by fdisk">
+<pre caption="EFI System Partition on MBR disk as shown by fdisk">
 # <i>fdisk -l <keyword>/dev/sda</keyword></i>
 <comment>(...)</comment>
 
@@ -343,7 +343,7 @@ partition where GRUB 2 EFI application is executed from</b></ti>
 <th>-O</th>
 <ti>platform to create image for</ti>
 <ti><c>x86_64-efi</c></ti>
-<ti>replace with <c>i386-efi</c> on 32bit systems (old Intel Macs)</ti>
+<ti>replace with <c>i386-efi</c> on 32-bit systems (old Intel Macs)</ti>
 </tr>
 
 <tr>
@@ -357,14 +357,14 @@ shell available even in cases GRUB 2 cannot load other modules</ti>
 </tr>
 </table>
 
-<p>When GRUB 2 image (EFI application) is made, you have to tell your firmware
+<p>When the GRUB 2 image (EFI application) is made, you have to tell your firmware
 to execute it upon boot. There are two ways to achieve this. If there is
 already a default bootloader on your EFI System Partition that you don't want
 to overwrite, you have to use the second. Otherwise you can use the first and
 we encourage you to do so, since it is simpler.
 </p>
 
-<pre caption="Subvariant 1: copying grub.efi into default location for EFI bootloader  (must be done everytime GRUB 2 is updated)">
+<pre caption="Subvariant 1: Copying grub.efi into default location for EFI bootloader (must be done everytime GRUB 2 is updated)">
 # <i>mkdir -p /boot/EFI/BOOT</i>
 # <i>cp /boot/grub2/grub.efi /boot/EFI/BOOT/BOOTX64.EFI</i>
 </pre>
@@ -373,11 +373,11 @@ we encourage you to do so, since it is simpler.
 EFI 2 specification says that the default bootloader location is <c>[EFI System
 Partition]\EFI\BOOT\BOOTx64.EFI</c> for x86_64 hardware. (and
 <c>...\BOOTIA32.EFI</c> on 32bit systems) While FAT32 filesystems should be
-case-insesitive, it is recommended to use ALL-CAPS filenames in default
+case-insensitive, it is recommended to use ALL-CAPS filenames in default
 bootloader path in order to be compatible with all vfat mount options.
 </note>
 
-<pre caption="Subvariant 2: use efibootmgr to tell firmware what to execute on boot">
+<pre caption="Subvariant 2: Use efibootmgr to tell firmware what to execute on boot">
 # <i>efibootmgr TODO TODO TODO</i>
 </pre>
 
@@ -387,8 +387,8 @@ Various sources report that the <c>bless</c> command should be used instead.
 </warn>
 
 <p>
-Last, you should create a GRUB 2 environment file (where GRUB 2 stores
-persistent variables such number of the last booted item) as it is not created
+Last, you should create a GRUB 2 environment file (where GRUB 2 stores persistent
+variables such as the number of the last booted item) as it is not created
 automatically:
 </p>
 
@@ -398,7 +398,7 @@ automatically:
 
 <impo>
 When you update GRUB 2, be sure to execute all commands that are marked as
-such. Failure to do so would result in you using the previously installed GRUB
+such. Failure to do so would result in you using (parts of) the previously installed GRUB
 version.
 </impo>
 
@@ -478,13 +478,13 @@ Remember to replace the <i>&lt;UUID&gt;</i> with your device UUID.
 <body>
 
 <p>
-GRUB 2 itself detects the LVM correctly, with no aditional setup required.
+GRUB 2 itself detects the LVM correctly, with no additional setup required.
 </p>
 
 <impo>
 If you placed your root and boot partitions inside LVM make sure that disk
 you plan to use as booting one has at least few MBs of space before first
-partition, because GRUB 2 needs more space to store lvm loader. In other
+partition, because GRUB 2 needs more space to store LVM loader. In other
 words: If you install it with not enough space it will just break your
 partition.
 </impo>



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-23 17:45 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-23 17:45 UTC (permalink / raw
  To: gentoo-commits

commit:     c11c4dad1768290129899dd93378d62d412546c2
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Sun Oct 23 17:44:13 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Sun Oct 23 17:44:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=c11c4dad

GRUB 2 Guide: typo

Thanks to Ramin Torabi

---
 docs/grub-2-guide.xml |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index 44daf5a..b1cdd28 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -440,7 +440,7 @@ GRUB Legacy files.
 </pre>
 
 <p>
-Tweaking the options is to be done in the <path>/etc/defaults/grub</path> file.
+Tweaking the options is to be done in the <path>/etc/default/grub</path> file.
 Simple text file configuration with description of some default values.
 All the options are described in grub2 info pages.
 </p>



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-11 22:06 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-11 22:06 UTC (permalink / raw
  To: gentoo-commits

commit:     20c017d62f87166fa100a27813de4d76c508c2c5
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Tue Oct 11 22:03:37 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Tue Oct 11 22:03:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=20c017d6

GRUB 2 Guide: nicer command listing colours

---
 docs/grub-2-guide.xml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index 935f111..e8c5b72 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -168,7 +168,7 @@ Installation of GRUB 2 is similar to installation of GRUB Legacy.
 </p>
 
 <pre caption="Installing GRUB 2 on /dev/sda">
-grub2-install --no-floppy <keyword>/dev/sda</keyword>
+# <i>grub2-install --no-floppy <keyword>/dev/sda</keyword></i>
 </pre>
 
 <impo>
@@ -324,7 +324,7 @@ GRUB Legacy files.
 </impo>
 
 <pre caption="Generating the GRUB 2 config">
-grub2-mkconfig -o /boot/grub2/grub.cfg
+# <i>grub2-mkconfig -o /boot/grub2/grub.cfg</i>
 </pre>
 
 <p>



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-11 19:35 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-11 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ca6e355e2770b49c1a6f227543c21c29ccf3407f
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Tue Oct 11 19:08:52 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Tue Oct 11 19:08:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=ca6e355e

GRUB 2 Guide: move section that mentions `grub2-install` where it chronologically belongs

---
 docs/grub-2-guide.xml |   51 +++++++++++++++++++++++++------------------------
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index 02fac52..a28bea3 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -151,6 +151,32 @@ easily render your system impossible to boot.
 </section>
 
 <section>
+<title>Variant A: Installing on a PC with BIOS and a MBR-Partitioned Disk</title>
+<body>
+
+<note>
+This variant requires that you have "pc" in your GDUB_PLATFORMS. Your hardware
+also needs to have a PC-BIOS or to emulate it.
+</note>
+
+<p>
+Installation of GRUB 2 is similar to installation of GRUB Legacy.
+</p>
+
+<pre caption="Installing GRUB 2 on /dev/sda">
+grub2-install --no-floppy <keyword>/dev/sda</keyword>
+</pre>
+
+<impo>
+If you get ANY errors during this step do not reboot your computer,
+but make sure it is fixed. Your computer won't boot if installation
+failed.
+</impo>
+
+</body>
+</section>
+
+<section>
 <title>Configuring GRUB 2</title>
 <body>
 
@@ -349,29 +375,4 @@ partition.
 </section>
 </chapter>
 
-<chapter>
-<title>Installation of GRUB 2</title>
-<section>
-<title>Installing on some MBR/GPT directly</title>
-<body>
-
-<p>
-Installation of GRUB 2 is similar to installation of GRUB Legacy.
-</p>
-
-<pre caption="Installing GRUB 2 on /dev/sda">
-grub2-install --no-floppy /dev/sda
-</pre>
-
-<impo>
-If you get ANY errors during this step do not reboot your computer,
-but make sure it is fixed. Your computer won't boot if installation
-failed.
-</impo>
-
-</body>
-</section>
-
-</chapter>
-
 </guide>



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-11 19:35 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-11 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     7774e7be933cc6498528d492a343083e1c4a14e1
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Tue Oct 11 18:55:35 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Tue Oct 11 18:55:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=7774e7be

GRUB 2 Guide: add section about backing up a bootloader

---
 docs/grub-2-guide.xml |   61 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index 8b587d6..02fac52 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -27,7 +27,7 @@ This guide shows you how to install and configure the GRUB 2 bootloader.
 <license/>
 
 <version>1</version>
-<date>2011-10-10</date>
+<date>2011-10-11</date>
 
 <chapter>
 <title>About</title>
@@ -56,6 +56,65 @@ Some examples of new features:
 
 <chapter>
 <title>Installation</title>
+
+<section>
+<title>Optional: Creating Backup of Existing GRUB Legacy Installation</title>
+<body>
+
+<p>
+Playing with bootloader always brings the danger of leaving your system in
+unbootable state. Fortunately no data is lost in most cases and recovery is not
+hard, but we recommend you to have a bootable CD, DVD or a USB flash disk with
+Linux around (<uri link="http://www.gentoo.org/main/en/where.xml">Gentoo
+LiveDVD</uri> or <uri link="http://www.sysresccd.org/">System Rescue CD</uri>
+will do) and to backup your current bootloader setup. If your current
+bootloader is GRUB legacy, following code sample may help you backing it up.
+</p>
+
+<pre caption="Backing up GRUB">
+# <comment># copy grub modules and configuration</comment>
+# <i>cp -a /boot/grub <keyword>/path/to/backup</keyword>/</i>
+# <comment># backup the MBR and GRUB stage 1.5</comment>
+# <i>dd if=<keyword>/dev/sda</keyword> of=<keyword>/path/to/backup</keyword>/first-sectors count=63</i>
+</pre>
+
+<note>
+Replace <c>/dev/sda</c> with device node of the disk you boot from (this is
+usually and the whole disk like <e>sda</e>, not a partition like sda1) and
+<c>/path/to/backup</c> with path to your favourite backup medium.
+</note>
+
+<p>
+When something goes wrong, you can restore previous grub installation by
+booting some Linux live media and issuing following commands.
+</p>
+
+<pre caption="Restoring GRUB from backup">
+# <comment># move old grub files out of the way</comment>
+# <i>mv /boot/grub /boot/grub.nonfunctional</i>
+# <comment># copy grub back to /boot</comment>
+# <i>cp -a <keyword>/path/to/backup</keyword>/grub /boot/</i>
+# <comment># replace MBR and next 62 sectors of sda with backed up copy (DANGEROUS!)</comment>
+# <i>dd if=<keyword>/path/to/backup</keyword>/first-sectors of=<keyword>/dev/sda</keyword> count=63</i>
+</pre>
+
+<note>
+Replace <c>/dev/sda</c> with device node of the disk you boot from and
+<c>/path/to/backup</c> with path to the place where you've stored your backup.
+</note>
+
+<warn>
+Writing directly to disk sectors (even those that are outside of partitions
+in typical setup) is risky operation and will make your data <e>inaccessible</e>
+if you changed your parititon layout between backup and restore. Other slower
+and safer option would be chrooting into your Gentoo installation and
+re-installing bootloader - you can use <uri link="/doc/en/handbook/">Gentoo
+Handbook</uri> for that task.
+</warn>
+
+</body>
+</section>
+
 <section>
 <title>Setting Useflags</title>
 <body>



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-11 19:35 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-11 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     721f29eb03e1d4f4fe88e09964ebe383cc0d27ea
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Tue Oct 11 19:14:35 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Tue Oct 11 19:14:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=721f29eb

GRUB 2 Guide: move 'Pre-Configuring GRUB 2 to use EFI' section where it chronologically belongs

---
 docs/grub-2-guide.xml |  128 ++++++++++++++++++++++++------------------------
 1 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index a28bea3..a0d1e8f 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -177,70 +177,7 @@ failed.
 </section>
 
 <section>
-<title>Configuring GRUB 2</title>
-<body>
-
-<impo>
-Gentoo installs all grub commands renamed to grub2. So if you read any other guide you
-should replace all grub mentions with grub2 <i>(grub-mkconfig -> grub2-mkconfig)</i>.
-</impo>
-
-<p>
-Compared to GRUB Legacy, GRUB 2 uses automatic generation to generate
-all the required entries for you to boot. This is handled by <i>grub2-mkconfig</i>
-command that probes your system for all the required data. Cooperating with
-<i>sys-boot/os-prober</i>, it detects even other OSes on all disks.
-</p>
-
-<impo>
-If you updated from GRUB Legacy then your <path>/boot/grub/menu.lst</path>
-was converted to <path>/boot/grub2/grub.cfg</path> to ensure that your system
-can boot even if you forget to generate the config. Never the less you should
-take time and migrate the configuration to be automatically generated, because
-next time GRUB 2 is installed it will use automatic generation and ignore
-GRUB Legacy files.
-</impo>
-
-<pre caption="Generating the GRUB 2 config">
-grub2-mkconfig -o /boot/grub2/grub.cfg
-</pre>
-
-<p>
-Tweaking the options is to be done in the <path>/etc/defaults/grub</path> file.
-Simple text file configuration with description of some default values.
-All the options are described in grub2 info pages.
-</p>
-
-<note>
-This file is created by Gentoo and if you find an interesting option not used
-in there just open a bugreport (possibly with a patch).
-</note>
-
-<p>
-Sometimes, if automatic detection of GRUB 2 does not suffice, the file <path>
-/etc/grub.d/40_custom</path> should be used to store custom entries. Full
-description how to configure such with examples can be found in grub2 info
-pages.
-</p>
-
-<pre caption="Custom menu entry">
-menuentry "My Shiny Gentoo Kernel" {
-	set root=(hd0,1)
-	search --no-floppy --fs-uuid --set &lt;UUID&gt;
-	linux /boot/gentookernel-5.3.2-generic root=UUID=&lt;UUID&gt;
-	initrd /boot/initrd.img-5.3.2
-}
-</pre>
-
-<warn>
-Remember to replace the <i>&lt;UUID&gt;</i> with your device UUID.
-</warn>
-
-</body>
-</section>
-
-<section>
-<title>Pre-Configuring GRUB 2 to use EFI</title>
+<title>Variant B: Pre-Configuring GRUB 2 to use EFI</title>
 <body>
 
 <p>
@@ -356,6 +293,69 @@ configuration.
 </section>
 
 <section>
+<title>Configuring GRUB 2</title>
+<body>
+
+<impo>
+Gentoo installs all grub commands renamed to grub2. So if you read any other guide you
+should replace all grub mentions with grub2 <i>(grub-mkconfig -> grub2-mkconfig)</i>.
+</impo>
+
+<p>
+Compared to GRUB Legacy, GRUB 2 uses automatic generation to generate
+all the required entries for you to boot. This is handled by <i>grub2-mkconfig</i>
+command that probes your system for all the required data. Cooperating with
+<i>sys-boot/os-prober</i>, it detects even other OSes on all disks.
+</p>
+
+<impo>
+If you updated from GRUB Legacy then your <path>/boot/grub/menu.lst</path>
+was converted to <path>/boot/grub2/grub.cfg</path> to ensure that your system
+can boot even if you forget to generate the config. Never the less you should
+take time and migrate the configuration to be automatically generated, because
+next time GRUB 2 is installed it will use automatic generation and ignore
+GRUB Legacy files.
+</impo>
+
+<pre caption="Generating the GRUB 2 config">
+grub2-mkconfig -o /boot/grub2/grub.cfg
+</pre>
+
+<p>
+Tweaking the options is to be done in the <path>/etc/defaults/grub</path> file.
+Simple text file configuration with description of some default values.
+All the options are described in grub2 info pages.
+</p>
+
+<note>
+This file is created by Gentoo and if you find an interesting option not used
+in there just open a bugreport (possibly with a patch).
+</note>
+
+<p>
+Sometimes, if automatic detection of GRUB 2 does not suffice, the file <path>
+/etc/grub.d/40_custom</path> should be used to store custom entries. Full
+description how to configure such with examples can be found in grub2 info
+pages.
+</p>
+
+<pre caption="Custom menu entry">
+menuentry "My Shiny Gentoo Kernel" {
+	set root=(hd0,1)
+	search --no-floppy --fs-uuid --set &lt;UUID&gt;
+	linux /boot/gentookernel-5.3.2-generic root=UUID=&lt;UUID&gt;
+	initrd /boot/initrd.img-5.3.2
+}
+</pre>
+
+<warn>
+Remember to replace the <i>&lt;UUID&gt;</i> with your device UUID.
+</warn>
+
+</body>
+</section>
+
+<section>
 <title>Configuring with LVM</title>
 <body>
 



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-11 19:35 Matěj Laitl
  0 siblings, 0 replies; 11+ messages in thread
From: Matěj Laitl @ 2011-10-11 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     9acebcb3e81dad662f6ada986c2dd9185fc8d181
Author:     Matěj Laitl <matej <AT> laitl <DOT> cz>
AuthorDate: Tue Oct 11 19:34:21 2011 +0000
Commit:     Matěj Laitl <matej <AT> laitl <DOT> cz>
CommitDate: Tue Oct 11 19:34:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=9acebcb3

GRUB 2 Guide: minor corrections, mention emerge command not to confuse user when she should emerge

---
 docs/grub-2-guide.xml |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index a0d1e8f..935f111 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -116,7 +116,7 @@ Handbook</uri> for that task.
 </section>
 
 <section>
-<title>Setting Useflags</title>
+<title>Setting Useflags and Emerging</title>
 <body>
 
 <p>
@@ -143,10 +143,14 @@ GRUB_PLATFORMS="pc"
 </note>
 
 <warn>
-One should be really carefull with custom-cflags IUSE, as some CFLAGS can
+One should be really careful with custom-cflags USE flag, as some CFLAGS can
 easily render your system impossible to boot.
 </warn>
 
+<pre caption="Emerging GRUB 2">
+# <i>emerge --ask --tree --verbose sys-boot/grub:2</i>
+</pre>
+
 </body>
 </section>
 
@@ -155,7 +159,7 @@ easily render your system impossible to boot.
 <body>
 
 <note>
-This variant requires that you have "pc" in your GDUB_PLATFORMS. Your hardware
+This variant requires that you have "pc" in your GRUB_PLATFORMS. Your hardware
 also needs to have a PC-BIOS or to emulate it.
 </note>
 
@@ -177,14 +181,14 @@ failed.
 </section>
 
 <section>
-<title>Variant B: Pre-Configuring GRUB 2 to use EFI</title>
+<title>Variant B: Installing GRUB 2 on Hardware That Supports EFI</title>
 <body>
 
 <p>
 Some newer PCs (and all Intel Macs) come with
 <uri link="http://en.wikipedia.org/wiki/Extensible_Firmware_Interface">EFI</uri>
 (UEFI to be correct) as a replacement for legacy
-and aging BIOS firmware. EFI usually can emulate BIOS environment for OS, but
+and ageing BIOS firmware. EFI usually can emulate BIOS environment for OS, but
 that also hides some unique features of EFI such as faster boot times, support
 for GPT partition tables, etc. EFI firmware comes in two flavours - 32bit and
 64bit and unless you have early Intel-based Mac with 32bit processor, your
@@ -208,7 +212,7 @@ or 3.0 in order to successfully boot.
 <p>
 One big difference between BIOS and EFI is that EFI is able to read partition
 tables (both MBR and GPT formats should be supported) and to read from a specially
-labeled FAT32 partition called <b>EFI System Partition</b>. During bootup, EFI
+labelled FAT32 partition called <b>EFI System Partition</b>. During bootup, EFI
 firmware can execute <e>EFI applications</e> stored in files in EFI System
 Partition. One special EFI application is a bootloader. You may use the EFI
 System Partition as your <c>/boot</c> partition if you don't mind limitations
@@ -285,7 +289,9 @@ use it at all.
 </p>
 
 <p>
-After you have prepared your HDDs, you can easily proceed with generating the
+TODO: grub image
+
+After you have prepared your GAGA, you can easily proceed with generating the
 configuration.
 </p>
 



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-10-11  7:45 Tomas Chvatal
  0 siblings, 0 replies; 11+ messages in thread
From: Tomas Chvatal @ 2011-10-11  7:45 UTC (permalink / raw
  To: gentoo-commits

commit:     6921df945ce504e7a39c16501618692d8dafa02b
Author:     Tomas Chvatal <tchvatal <AT> suse <DOT> cz>
AuthorDate: Tue Oct 11 07:42:49 2011 +0000
Commit:     Tomas Chvatal <scarabeus <AT> gentoo <DOT> org>
CommitDate: Tue Oct 11 07:43:49 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=6921df94

Update guide. Patch from Moritz Schlarb.

---
 docs/grub-2-guide.xml |   97 +++++++++++++++++++++++++------------------------
 1 files changed, 50 insertions(+), 47 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
index ca0bc89..8b587d6 100644
--- a/docs/grub-2-guide.xml
+++ b/docs/grub-2-guide.xml
@@ -10,12 +10,16 @@
     <mail link="matej@laitl.cz">Matěj Laitl</mail>
 </author>
 
+<author title="Editor">
+    <mail link="mail@moritz-schlarb.de">Moritz Schlarb</mail>
+</author>
+
 <author title="Author">
     <mail link="scarabeus"/>
 </author>
 
 <abstract>
-This guide shows you how to install and configure GRUB 2 bootloader.
+This guide shows you how to install and configure the GRUB 2 bootloader.
 </abstract>
 
 <!-- The  content of this document is licensed under the CC-BY-SA license -->
@@ -23,7 +27,7 @@ This guide shows you how to install and configure GRUB 2 bootloader.
 <license/>
 
 <version>1</version>
-<date>2011-08-26</date>
+<date>2011-10-10</date>
 
 <chapter>
 <title>About</title>
@@ -32,7 +36,7 @@ This guide shows you how to install and configure GRUB 2 bootloader.
 
 <p>
 GRUB 2 is next generation bootloader that brings many long awaited features
-that were not availible in Grub Legacy (0.9*).
+that were not available in GRUB Legacy (0.9*).
 </p>
 
 <p>
@@ -57,9 +61,9 @@ Some examples of new features:
 <body>
 
 <p>
-By default grub tries to detect the desired platform during configure from your
+By default, GRUB 2 tries to detect the desired platform during configure from your
 toolchain and CPU. If you want support for other platforms or just don't want
-to use the autodetection you should use GRUB_PLATFORMS use expand. This variable
+to use the autodetection, you should use GRUB_PLATFORMS use expand. This variable
 should be set in /etc/make.conf.
 </p>
 
@@ -88,31 +92,31 @@ easily render your system impossible to boot.
 </section>
 
 <section>
-<title>Configuring GRUB</title>
+<title>Configuring GRUB 2</title>
 <body>
 
 <impo>
-Gentoo installs grub renamed to grub2. So if you read any other guide you
+Gentoo installs all grub commands renamed to grub2. So if you read any other guide you
 should replace all grub mentions with grub2 <i>(grub-mkconfig -> grub2-mkconfig)</i>.
 </impo>
 
 <p>
-Compared to grub-legacy current grub uses automatic generation to generate
+Compared to GRUB Legacy, GRUB 2 uses automatic generation to generate
 all the required entries for you to boot. This is handled by <i>grub2-mkconfig</i>
 command that probes your system for all the required data. Cooperating with
-<i>sys-boot/os-prober</i> it detects even other OSes on all disks.
+<i>sys-boot/os-prober</i>, it detects even other OSes on all disks.
 </p>
 
 <impo>
-If you updated from grub-legacy then your <path>/boot/grub/menu.lst</path>
-Was converted to <path>/boot/grub2/grub.cfg</path> to ensure that your system
+If you updated from GRUB Legacy then your <path>/boot/grub/menu.lst</path>
+was converted to <path>/boot/grub2/grub.cfg</path> to ensure that your system
 can boot even if you forget to generate the config. Never the less you should
 take time and migrate the configuration to be automatically generated, because
-next time grub2 is installed it will use automatic generation and ignore
-grub-legacy files.
+next time GRUB 2 is installed it will use automatic generation and ignore
+GRUB Legacy files.
 </impo>
 
-<pre caption="Generating the grub2 config">
+<pre caption="Generating the GRUB 2 config">
 grub2-mkconfig -o /boot/grub2/grub.cfg
 </pre>
 
@@ -123,14 +127,14 @@ All the options are described in grub2 info pages.
 </p>
 
 <note>
-This file is created by Gentoo and if you find interesting option not used
-in there just open bugreport (possibly with a patch).
+This file is created by Gentoo and if you find an interesting option not used
+in there just open a bugreport (possibly with a patch).
 </note>
 
 <p>
-Sometimes if automatic detection of grub does not suffice the file <path>
-/etc/grub.d/40_custom</path> should be used to store custom finder. Full
-description how to configure such with example can be find in grub2 info
+Sometimes, if automatic detection of GRUB 2 does not suffice, the file <path>
+/etc/grub.d/40_custom</path> should be used to store custom entries. Full
+description how to configure such with examples can be found in grub2 info
 pages.
 </p>
 
@@ -151,16 +155,16 @@ Remember to replace the <i>&lt;UUID&gt;</i> with your device UUID.
 </section>
 
 <section>
-<title>Pre-Configuring GRUB to use EFI</title>
+<title>Pre-Configuring GRUB 2 to use EFI</title>
 <body>
 
 <p>
 Some newer PCs (and all Intel Macs) come with
 <uri link="http://en.wikipedia.org/wiki/Extensible_Firmware_Interface">EFI</uri>
-(UEFI to be correct) as a replacement for lagacy
+(UEFI to be correct) as a replacement for legacy
 and aging BIOS firmware. EFI usually can emulate BIOS environment for OS, but
 that also hides some unique features of EFI such as faster boot times, support
-for GPT partition tables etc. EFI firmware comes in two flavours - 32bit and
+for GPT partition tables, etc. EFI firmware comes in two flavours - 32bit and
 64bit and unless you have early Intel-based Mac with 32bit processor, your
 firmware will be likely 64bit. Please note that unlike in user-space, <b>64bit
 EFI firmware cannot run 32bit EFI bootloader.</b> This section will guide you
@@ -181,20 +185,20 @@ or 3.0 in order to successfully boot.
 
 <p>
 One big difference between BIOS and EFI is that EFI is able to read partition
-table (both MBR and GPT formats should be supported) and to read from specially
-labelled FAT32 partition called <b>EFI System Partition</b>. During bootup, EFI
-fimrmware can execute <e>EFI applications</e> stored in files in EFI System
+tables (both MBR and GPT formats should be supported) and to read from a specially
+labeled FAT32 partition called <b>EFI System Partition</b>. During bootup, EFI
+firmware can execute <e>EFI applications</e> stored in files in EFI System
 Partition. One special EFI application is a bootloader. You may use the EFI
 System Partition as your <c>/boot</c> partition if you don't mind limitations
-of FAT32 filesystem such as no support for symlinks and per-file owner and
+of the FAT32 filesystem such as no support for symlinks and per-file owner and
 permissions. The rest of this section assumes that you use <c>/boot</c> for
 mounting EFI System Partition.
 </p>
 
 <p>
-If you don't already have EFI System Partition, let's create one. The procedure is
-different for GPT and MBR-formatted disks. The partition need not be the first
-one on disk as in our examples. In case it is GPT-partitioned you'll need one
+If you don't already have an EFI System Partition, let's create one. The procedure is
+different for GPT and MBR-formatted disks. The partition does not need to be the first
+one on the disk as in our examples. In case it is GPT-partitioned you'll need one
 of the <c>gdisk</c> (CLI, sys-apps/gptfdisk), <c>parted</c> (CLI,
 sys-block/parted) or <c>gparted</c> (GUI, sys-block/gparted) partitioning
 tools; <c>fdisk</c>, <c>cfdisk</c> and <c>sfdisk</c> do not currently support
@@ -203,8 +207,8 @@ GPT. In the GPT case, create a partition at least 100 MiB in size with
 </p>
 
 <note>
-Replace <c>/dev/sda</c> with disk you want to have EFI System Partition on and
-<c>/dev/sda1</c> with partition designated for it in all following samples.
+Replace <c>/dev/sda</c> with the disk you want to have the EFI System Partition on and
+<c>/dev/sda1</c> with the partition designated for it in all following samples.
 </note>
 
 <pre caption="EFI System Partion on GPT disk as shown by gdisk">
@@ -220,13 +224,12 @@ Number  Start (sector)    End (sector)  Size       Code  Name
 <comment>(...)</comment>
 
 Number  Start   End     Size    File system  Name  Flags
-<ident> 1      17.4kB  211MB   211MB   fat32              boot</ident> <comment># you may have File system field empty</comment>
+<ident> 1      17.4kB  211MB   211MB   fat32              boot</ident> <comment># the File system field may be empty</comment>
 </pre>
 
 <p>
-In case the disk partition scheme is MBR (MS-DOS), EFI System Partition should
-have type <c>EF</c>. Create or re-type it, again it should be at least 100 MiB
-large.
+In case the disk partition scheme is MBR (MS-DOS), the EFI System Partition should
+have type <c>EF</c>. Create or re-type it, it should be at least 100 MiB large here, too.
 </p>
 
 <pre caption="EFI System Partion on MBR disk as shown by fdisk">
@@ -238,7 +241,7 @@ large.
 </pre>
 
 <p>
-Next create FAT32 filesystem on it if you already haven't done so. From now on,
+Next, create a FAT32 filesystem on it if you already haven't done so. From now on,
 procedure is the same for both GPT and MBR-formatted disks. Program
 <c>mkdosfs</c> is from package <c>sys-fs/dosfstools</c>.
 </p>
@@ -249,18 +252,18 @@ mkdosfs 3.0.9 (31 Jan 2010)
 </pre>
 
 <warn>
-This command erases everything that previously was on <c>/dev/sda1</c>.
+This command erases everything that was previously on <c>/dev/sda1</c>.
 </warn>
 
 <p>
 The <c>-F 32</c> option tells mkdosfs to create FAT32 filesystem and <c>-n
-efi-boot</c> option tells mkdosfs to set partition label to <c>efi-boot</c>.
-You may use atrbitrary string up to 11 characters long for label or you may not
+efi-boot</c> option tells mkdosfs to set the partition label to <c>efi-boot</c>.
+You may use arbitrary string up to 11 characters long as label or you may not
 use it at all.
 </p>
 
 <p>
-After you prepared your HDDs you can easily proceed with generating the
+After you have prepared your HDDs, you can easily proceed with generating the
 configuration.
 </p>
 
@@ -272,14 +275,14 @@ configuration.
 <body>
 
 <p>
-Grub2 itself detects the LVM correctly, with no aditional setup required.
+GRUB 2 itself detects the LVM correctly, with no aditional setup required.
 </p>
 
 <impo>
 If you placed your root and boot partitions inside LVM make sure that disk
 you plan to use as booting one has at least few MBs of space before first
-partition, because grub2 needs more space to store lvm loader. In other
-words if you install it with not enough space it will just break your
+partition, because GRUB 2 needs more space to store lvm loader. In other
+words: If you install it with not enough space it will just break your
 partition.
 </impo>
 
@@ -288,23 +291,23 @@ partition.
 </chapter>
 
 <chapter>
-<title>Installation of grub2</title>
+<title>Installation of GRUB 2</title>
 <section>
 <title>Installing on some MBR/GPT directly</title>
 <body>
 
 <p>
-Installation of grub2 is similar to installation of grub-legacy.
+Installation of GRUB 2 is similar to installation of GRUB Legacy.
 </p>
 
-<pre caption="Installing grub2 on /dev/sda">
+<pre caption="Installing GRUB 2 on /dev/sda">
 grub2-install --no-floppy /dev/sda
 </pre>
 
 <impo>
 If you get ANY errors during this step do not reboot your computer,
 but make sure it is fixed. Your computer won't boot if installation
-fail.
+failed.
 </impo>
 
 </body>



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [gentoo-commits] dev/scarabeus:master commit in: docs/
@ 2011-09-30 12:13 Tomas Chvatal
  0 siblings, 0 replies; 11+ messages in thread
From: Tomas Chvatal @ 2011-09-30 12:13 UTC (permalink / raw
  To: gentoo-commits

commit:     5abf098f57d8a974a663384c4c755cefbab290f2
Author:     Tomas Chvatal <tchvatal <AT> suse <DOT> cz>
AuthorDate: Fri Sep 30 12:12:41 2011 +0000
Commit:     Tomas Chvatal <scarabeus <AT> gentoo <DOT> org>
CommitDate: Fri Sep 30 12:12:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/scarabeus.git;a=commit;h=5abf098f

Add grub2 xml guide.

---
 docs/grub-2-guide.xml |  315 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 315 insertions(+), 0 deletions(-)

diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml
new file mode 100644
index 0000000..ca0bc89
--- /dev/null
+++ b/docs/grub-2-guide.xml
@@ -0,0 +1,315 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Header: $ -->
+
+<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
+
+<guide disclaimer="draft" link="/doc/en/grub-2-guide.xml" lang="en">
+<title>GRUB 2 Guide</title>
+
+<author title="Author">
+    <mail link="matej@laitl.cz">Matěj Laitl</mail>
+</author>
+
+<author title="Author">
+    <mail link="scarabeus"/>
+</author>
+
+<abstract>
+This guide shows you how to install and configure GRUB 2 bootloader.
+</abstract>
+
+<!-- The  content of this document is licensed under the CC-BY-SA license -->
+<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
+<license/>
+
+<version>1</version>
+<date>2011-08-26</date>
+
+<chapter>
+<title>About</title>
+<section>
+<body>
+
+<p>
+GRUB 2 is next generation bootloader that brings many long awaited features
+that were not availible in Grub Legacy (0.9*).
+</p>
+
+<p>
+Some examples of new features:
+</p>
+
+<ul>
+<li>Booting from boot partition stored on LVM</li>
+<li>Booting from encrypted boot partition</li>
+<li>Booting from UEFI</li>
+<li>Support for native screen resolution and theming</li>
+</ul>
+
+</body>
+</section>
+</chapter>
+
+<chapter>
+<title>Installation</title>
+<section>
+<title>Setting Useflags</title>
+<body>
+
+<p>
+By default grub tries to detect the desired platform during configure from your
+toolchain and CPU. If you want support for other platforms or just don't want
+to use the autodetection you should use GRUB_PLATFORMS use expand. This variable
+should be set in /etc/make.conf.
+</p>
+
+<p>Description of mostly used values for GRUB_PLATFORMS as of =sys-boot/grub-1.99:</p>
+
+<ol>
+<li>pc: normal BIOS pc</li>
+<li>efi-64: EFI systems, their latest 64b version</li>
+<li>coreboot: Coreboot replacement of BIOS</li>
+<li>qemu: support for QEMU booting</li>
+<li>yeelong: Support for MIPS loongson</li>
+
+</ol>
+
+<note>
+Most users should just rely on platform detection or just use
+GRUB_PLATFORMS="pc"
+</note>
+
+<warn>
+One should be really carefull with custom-cflags IUSE, as some CFLAGS can
+easily render your system impossible to boot.
+</warn>
+
+</body>
+</section>
+
+<section>
+<title>Configuring GRUB</title>
+<body>
+
+<impo>
+Gentoo installs grub renamed to grub2. So if you read any other guide you
+should replace all grub mentions with grub2 <i>(grub-mkconfig -> grub2-mkconfig)</i>.
+</impo>
+
+<p>
+Compared to grub-legacy current grub uses automatic generation to generate
+all the required entries for you to boot. This is handled by <i>grub2-mkconfig</i>
+command that probes your system for all the required data. Cooperating with
+<i>sys-boot/os-prober</i> it detects even other OSes on all disks.
+</p>
+
+<impo>
+If you updated from grub-legacy then your <path>/boot/grub/menu.lst</path>
+Was converted to <path>/boot/grub2/grub.cfg</path> to ensure that your system
+can boot even if you forget to generate the config. Never the less you should
+take time and migrate the configuration to be automatically generated, because
+next time grub2 is installed it will use automatic generation and ignore
+grub-legacy files.
+</impo>
+
+<pre caption="Generating the grub2 config">
+grub2-mkconfig -o /boot/grub2/grub.cfg
+</pre>
+
+<p>
+Tweaking the options is to be done in the <path>/etc/defaults/grub</path> file.
+Simple text file configuration with description of some default values.
+All the options are described in grub2 info pages.
+</p>
+
+<note>
+This file is created by Gentoo and if you find interesting option not used
+in there just open bugreport (possibly with a patch).
+</note>
+
+<p>
+Sometimes if automatic detection of grub does not suffice the file <path>
+/etc/grub.d/40_custom</path> should be used to store custom finder. Full
+description how to configure such with example can be find in grub2 info
+pages.
+</p>
+
+<pre caption="Custom menu entry">
+menuentry "My Shiny Gentoo Kernel" {
+	set root=(hd0,1)
+	search --no-floppy --fs-uuid --set &lt;UUID&gt;
+	linux /boot/gentookernel-5.3.2-generic root=UUID=&lt;UUID&gt;
+	initrd /boot/initrd.img-5.3.2
+}
+</pre>
+
+<warn>
+Remember to replace the <i>&lt;UUID&gt;</i> with your device UUID.
+</warn>
+
+</body>
+</section>
+
+<section>
+<title>Pre-Configuring GRUB to use EFI</title>
+<body>
+
+<p>
+Some newer PCs (and all Intel Macs) come with
+<uri link="http://en.wikipedia.org/wiki/Extensible_Firmware_Interface">EFI</uri>
+(UEFI to be correct) as a replacement for lagacy
+and aging BIOS firmware. EFI usually can emulate BIOS environment for OS, but
+that also hides some unique features of EFI such as faster boot times, support
+for GPT partition tables etc. EFI firmware comes in two flavours - 32bit and
+64bit and unless you have early Intel-based Mac with 32bit processor, your
+firmware will be likely 64bit. Please note that unlike in user-space, <b>64bit
+EFI firmware cannot run 32bit EFI bootloader.</b> This section will guide you
+through installing GRUB 2 on such EFI-capable boards; it assumes that your
+firmware adheres to UEFI 2.0 standard or newer (virtually every PC with EFI
+support; Intel Macs do not entirely conform to the specification and may need
+special treatment in some places)
+</p>
+
+<p>First thing you need is EFI-enabled Linux kernel with
+<c>CONFIG_EFI</c> and <c>CONFIG_EFI_PARTITION</c> options enabled,
+<c>CONFIG_FB_EFI</c> and <c>CONFIG_EFI_VARS</c> being optional but recommended.
+Some platforms (namely many boards designed for <e>Intel Sandy Bridge</e>
+processor generation) have <uri link="https://lkml.org/lkml/2011/5/19/377">
+buggy EFI implementations</uri> and require at least kernel versions 2.6.39.1
+or 3.0 in order to successfully boot.
+</p>
+
+<p>
+One big difference between BIOS and EFI is that EFI is able to read partition
+table (both MBR and GPT formats should be supported) and to read from specially
+labelled FAT32 partition called <b>EFI System Partition</b>. During bootup, EFI
+fimrmware can execute <e>EFI applications</e> stored in files in EFI System
+Partition. One special EFI application is a bootloader. You may use the EFI
+System Partition as your <c>/boot</c> partition if you don't mind limitations
+of FAT32 filesystem such as no support for symlinks and per-file owner and
+permissions. The rest of this section assumes that you use <c>/boot</c> for
+mounting EFI System Partition.
+</p>
+
+<p>
+If you don't already have EFI System Partition, let's create one. The procedure is
+different for GPT and MBR-formatted disks. The partition need not be the first
+one on disk as in our examples. In case it is GPT-partitioned you'll need one
+of the <c>gdisk</c> (CLI, sys-apps/gptfdisk), <c>parted</c> (CLI,
+sys-block/parted) or <c>gparted</c> (GUI, sys-block/gparted) partitioning
+tools; <c>fdisk</c>, <c>cfdisk</c> and <c>sfdisk</c> do not currently support
+GPT. In the GPT case, create a partition at least 100 MiB in size with
+<c>boot</c> flag (shown by (g)parted) or <c>EF00</c> Code (shown by gdisk).
+</p>
+
+<note>
+Replace <c>/dev/sda</c> with disk you want to have EFI System Partition on and
+<c>/dev/sda1</c> with partition designated for it in all following samples.
+</note>
+
+<pre caption="EFI System Partion on GPT disk as shown by gdisk">
+# <i>gdisk -l <keyword>/dev/sda</keyword></i>
+<comment>(...)</comment>
+
+Number  Start (sector)    End (sector)  Size       Code  Name
+<ident>   1              34          411647   201.0 MiB   EF00  </ident>
+</pre>
+
+<pre caption="EFI System Partion on GPT disk as shown by parted">
+# <i>parted -l</i>
+<comment>(...)</comment>
+
+Number  Start   End     Size    File system  Name  Flags
+<ident> 1      17.4kB  211MB   211MB   fat32              boot</ident> <comment># you may have File system field empty</comment>
+</pre>
+
+<p>
+In case the disk partition scheme is MBR (MS-DOS), EFI System Partition should
+have type <c>EF</c>. Create or re-type it, again it should be at least 100 MiB
+large.
+</p>
+
+<pre caption="EFI System Partion on MBR disk as shown by fdisk">
+# <i>fdisk -l <keyword>/dev/sda</keyword></i>
+<comment>(...)</comment>
+
+   Device Boot      Start         End      Blocks   Id  System
+<ident>/dev/sda1            2048      206847      102400   ef  EFI (FAT-12/16/32)</ident>
+</pre>
+
+<p>
+Next create FAT32 filesystem on it if you already haven't done so. From now on,
+procedure is the same for both GPT and MBR-formatted disks. Program
+<c>mkdosfs</c> is from package <c>sys-fs/dosfstools</c>.
+</p>
+
+<pre caption="Creating FAT32 filesystem on EFI System Partition">
+# <i>mkdosfs -F 32 -n efi-boot <keyword>/dev/sda1</keyword></i>
+mkdosfs 3.0.9 (31 Jan 2010)
+</pre>
+
+<warn>
+This command erases everything that previously was on <c>/dev/sda1</c>.
+</warn>
+
+<p>
+The <c>-F 32</c> option tells mkdosfs to create FAT32 filesystem and <c>-n
+efi-boot</c> option tells mkdosfs to set partition label to <c>efi-boot</c>.
+You may use atrbitrary string up to 11 characters long for label or you may not
+use it at all.
+</p>
+
+<p>
+After you prepared your HDDs you can easily proceed with generating the
+configuration.
+</p>
+
+</body>
+</section>
+
+<section>
+<title>Configuring with LVM</title>
+<body>
+
+<p>
+Grub2 itself detects the LVM correctly, with no aditional setup required.
+</p>
+
+<impo>
+If you placed your root and boot partitions inside LVM make sure that disk
+you plan to use as booting one has at least few MBs of space before first
+partition, because grub2 needs more space to store lvm loader. In other
+words if you install it with not enough space it will just break your
+partition.
+</impo>
+
+</body>
+</section>
+</chapter>
+
+<chapter>
+<title>Installation of grub2</title>
+<section>
+<title>Installing on some MBR/GPT directly</title>
+<body>
+
+<p>
+Installation of grub2 is similar to installation of grub-legacy.
+</p>
+
+<pre caption="Installing grub2 on /dev/sda">
+grub2-install --no-floppy /dev/sda
+</pre>
+
+<impo>
+If you get ANY errors during this step do not reboot your computer,
+but make sure it is fixed. Your computer won't boot if installation
+fail.
+</impo>
+
+</body>
+</section>
+
+</chapter>
+
+</guide>



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-11-02 12:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-11 22:06 [gentoo-commits] dev/scarabeus:master commit in: docs/ Matěj Laitl
  -- strict thread matches above, loose matches on Subject: below --
2011-11-02 12:30 Matěj Laitl
2011-10-23 19:49 Matěj Laitl
2011-10-23 17:45 Matěj Laitl
2011-10-11 22:06 Matěj Laitl
2011-10-11 19:35 Matěj Laitl
2011-10-11 19:35 Matěj Laitl
2011-10-11 19:35 Matěj Laitl
2011-10-11 19:35 Matěj Laitl
2011-10-11  7:45 Tomas Chvatal
2011-09-30 12:13 Tomas Chvatal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox