[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libreboot-dev] [PATCH] doc/gnulinux: write about separate partitions fo
From: |
fr33domlover |
Subject: |
[Libreboot-dev] [PATCH] doc/gnulinux: write about separate partitions for / and /boot |
Date: |
Tue, 19 May 2015 11:15:42 +0300 |
From: fr33domlover <address@hidden>
---
docs/gnulinux/dedicated_boot_partition.html | 175 ++++++++++++++++++++++++++++
docs/gnulinux/index.html | 1 +
2 files changed, 176 insertions(+)
create mode 100644 docs/gnulinux/dedicated_boot_partition.html
diff --git a/docs/gnulinux/dedicated_boot_partition.html
b/docs/gnulinux/dedicated_boot_partition.html
new file mode 100644
index 0000000..a662c63
--- /dev/null
+++ b/docs/gnulinux/dedicated_boot_partition.html
@@ -0,0 +1,175 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ <style type="text/css">
+ @import url('../css/main.css');
+ </style>
+
+ <title>Libreboot documentation: Dedicated /boot Partition</title>
+</head>
+
+<body>
+ <div class="section">
+ <h1 id="pagetop">How to adapt Libreboot and the OS to a
separate /boot partition</h1>
+ <h2>Introduction</h2>
+ <p>
+ Libreboot comes with its own GRUB configuration
file, stored
+ inside the flash chip together with Libreboot
itself. The
+ configuration can be changed, but it makes
several assumptions
+ by default:
+ </p>
+ <ul>
+ <li>The operating system kernek is in the first
partition</li>
+ <li>The filesystem root is in the first
partition</li>
+ <li>There are /vmlinuz and /initrd.img symlinks
in the first
+ partition, and the files they link to are
in that partition
+ too</li>
+ </ul>
+ <p>
+ If you have the file system root directory (/)
and the boot
+ directory containing the kernel (/boot) in the
same partition,
+ these assumptions are probably correct for you,
and the first
+ menu entry in GRUB will successfully boot the
OS. However,
+ sometimes /boot has its own separate partition,
in which case
+ some adaptation is required.
+ </p>
+ <p>
+ These instructions are written for GNU/Linux
and have been
+ tested on <a
href="http://trisquel.info">Trisquel</a> 7, but
+ they should work with other systems too.
+ </p>
+ <p>
+ The configuration presented below assumes the
following setup:
+ There are at least 2 partitions on the
harddrive. The first
+ partition, /dev/sda1, is the boot partition,
mounted to /boot.
+ The second partition, /dev/sda2, is the root
partition, mounted
+ to /. The boot partition is not encrypted. If
your case varies
+ from this, adapt the instructions to your needs.
+ </p>
+ <p>
+ <a href="#pagetop">Back to top of page.</a>
+ </p>
+ </div>
+
+ <div class="section">
+ <h2>Manual boot</h2>
+ <p>
+ An attempt to boot using the default GRUB menu
entry will
+ result with an error: /vmlinuz cannot be found.
That is because
+ this symlink is located in the root partition,
while GRUB is
+ looking for it in the boot partition. There is
another problem:
+ The symlink and the actual file aren't on the
same partition.
+ </p>
+ <p>
+ Booting is still possible manually, by typing
in the GRUB
+ commands directly. Then you can fix the GRUB
configuration and
+ the next boots will be automatic. Here is an
example (use tab
+ completion to get the long file names inserted
for you). When
+ GRUB loads, press c to get the command
prompt.<br/>
+ grub> <b>set root='ahci0,1'</b><br/>
+ grub> <b>linux
/vmlinuz-3.13.0-52-generic root=/dev/sda2 rw</b><br/>
+ grub> <b>initrd
/initrd.img-3.13.0-52-generic</b><br/>
+ grub> <b>boot</b><br/>
+ </p>
+ <p>
+ <a href="#pagetop">Back to top of page.</a>
+ </p>
+ </div>
+
+ <div class="section">
+ <h2>Fixing the GRUB configuration</h2>
+ <p>
+ First, follow the instructions <a
href="grub_cbfs.html">here</a>
+ to extract the GRUB configuration from from the
chip and place
+ it in a file <b>/grub/libreboot_grub.cfg</b>.
You need to
+ modify the commands for the first menu entry:
+ </p>
+ <ul>
+ <li>
+ Remove the part in which the
configuration searches for
+ libreboot_grub.cfg overriding
configuration, like the one
+ you are writing. This is important! If
these lines aren't
+ removed, the configuration will enter
an infinite loop of
+ loading itself (and you'll need to boot
from an external
+ live USB or similar to fix it).
+ </li>
+ <li>
+ In the <b>linux</b> command, change
<b>root=/dev/sda1</b>
+ to <b>root=/dev/sda2</b>. This is the
root partition, which
+ in our example is the second partition
on disk.
+ </li>
+ <li>
+ Change occurences of <b>/vmlinux</b> to
+ <b>/libreboot-vmlinuz</b>. The exact
name you use doesn't
+ matter, as long as you use it
consistently throughout the
+ process. So if you choose some other
name, remember it.
+ </li>
+ <li>
+ In the same manner, change occurences
of <b>/initrd.img</b>
+ to <b>/libreboot-initrd.img</b>.
+ </li>
+ </ul>
+ <p>
+ <a href="#pagetop">Back to top of page.</a>
+ </p>
+ </div>
+
+ <div class="section">
+ <h2>Creating symlinks</h2>
+ <p>
+ The new GRUB configuration we created will be using new
symlinks,
+ located in the boot partition rather than the root one.
Just like
+ the symlinks in the root partition, our symlinks need
to be updated
+ every time a new kernel version is installed.
+ </p>
+ <p>
+ First, just in case, here are the commands (in Bash)
for creating
+ the symlinks manually:<br/>
+ # <b>cd /boot</b><br/>
+ # <b>ln -s $(basename $(readlink /vmlinuz))
libreboot-vmlinuz</b><br/>
+ # <b>ln -s $(basename $(readlink /initrd.img))
libreboot-initrd.img</b><br/>
+ </p>
+ <p>
+ The symlink generation can be automated by placing a
script under
+ the <b>/etc/kernel/postinst.d</b> directory. It will be
executed
+ after each kernel upgrade. Here is an example
script:<br/>
+ <b>#!/bin/bash</b><br/>
+ <br/>
+ <b># Update kernel symlinks for use by libreboot's
GRUB</b><br/>
+ <br/>
+ <b>cd /boot</b><br/>
+ <b>mv -f libreboot-vmlinuz
libreboot-vmlinuz.old</b><br/>
+ <b>mv -f libreboot-initrd.ing
libreboot-initrd.img.old</b><br/>
+ <b>ln -s $(basename $(readlink /vmlinuz))
libreboot-vmlinuz</b><br/>
+ <b>ln -s $(basename $(readlink /initrd.img))
libreboot-initrd.img</b><br/>
+ </p>
+ <p>
+ Run the script and verify there are valid symlinks
under /boot.
+ Finally, reboot and verify that GRUB now successfuly
launches the
+ first menu entry and successfully boots the OS.
+ </p>
+ <p>
+ <a href="#pagetop">Back to top of page.</a>
+ </p>
+ </div>
+
+ <div class="section">
+
+ <p>
+ Copyright © 2015 Francis Rowe
<address@hidden><br/>
+ This document is released under the Creative Commons
Attribution-ShareAlike 4.0 International Public License and all future versions.
+ A copy of the license can be found at <a
href="../cc-by-sa-4.txt">../cc-by-sa-4.txt</a>.
+ </p>
+
+ <p>
+ This document is distributed in the hope that it will
be useful,
+ but WITHOUT ANY WARRANTY; without even the implied
warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See <a href="../cc-by-sa-4.txt">../cc-by-sa-4.txt</a> for more information.
+ </p>
+
+ </div>
+</body>
+</html>
diff --git a/docs/gnulinux/index.html b/docs/gnulinux/index.html
index 341681d..2d4f3ae 100644
--- a/docs/gnulinux/index.html
+++ b/docs/gnulinux/index.html
@@ -33,6 +33,7 @@
</ul>
</li>
<li><a
href="encrypted_trisquel.html">Installing Trisquel GNU/Linux-libre with full
disk encryption (including /boot)</a></li>
+ <li><a href="dedicated_boot_partition.html">How
to adapt the setup to work with /boot and / being in separate
partitions</a></li>
</ul>
</div>
--
1.9.1