From 8507c6adf8a3af268b8a7493339be253abb35c71 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Mon, 08 Jun 2015 20:52:46 -0400 Subject: docs/gnulinux/grub_cbfs.html: split GRUB config guides to new doc --- (limited to 'docs/gnulinux') diff --git a/docs/gnulinux/grub_cbfs.html b/docs/gnulinux/grub_cbfs.html index 1813629..82cbc4b 100644 --- a/docs/gnulinux/grub_cbfs.html +++ b/docs/gnulinux/grub_cbfs.html @@ -8,12 +8,12 @@ @import url('../css/main.css'); - Libreboot documentation: GRUB menu + How to replace the default GRUB configuration file on a libreboot system
-

How to change your default GRUB menu

+

How to replace the default GRUB configuration file on a libreboot system

Libreboot uses the GRUB payload by default, which means that the GRUB configuration file @@ -63,13 +63,6 @@

  • Re-use the currently flashed ROM image
  • Extract grubtest from the ROM image -
  • - Example modifications for grubtest.cfg - -
  • Re-insert the modified grubtest.cfg into the ROM image
  • Test it!
  • Final steps
  • @@ -145,6 +138,11 @@

    + This is all well and good, but what should you actually put in your GRUB configuration file? + Read grub_config.html for more information. +

    + +

    Back to top of page.

    @@ -286,7 +284,12 @@

    - Now you have a grubtest.cfg in the cbfstool directory. Edit it however you wish. + Now you have a grubtest.cfg in the cbfstool directory. +

    + +

    + This is all well and good, but what should you actually put in your GRUB configuration file? + Read grub_config.html for more information.

    @@ -296,116 +299,14 @@

    -

    Example modifications for grubtest.cfg

    - -

    - These are some common examples of ways in which the grubtest.cfg file can be modified. -

    - - -
    -

    Trisquel GNU/Linux-libre

    - -

    - As an example, on my test system in /boot/grub/grub.cfg (on the HDD/SSD) I see for the main menu entry: -

    -
      -
    • linux /boot/vmlinuz-3.15.1-gnu.nonpae root=UUID=3a008e14-4871-497b-95e5-fb180f277951 ro crashkernel=384M-2G:64M,2G-:128M quiet splash $vt_handoff
    • -
    • initrd /boot/initrd.img-3.15.1-gnu.nonpae
    • -
    - -

    - ro, quiet, splash, crashkernel=384M-2G:64M,2G-:128M and - $vt_handoff can be safely ignored. -

    - -

    - I use this to get my partition layout:
    - $ lsblk -

    - -

    - In my case, I have no /boot partition, instead /boot is on the same partition as / on sda1. - Yours might be different. In GRUB terms, sda means ahci0. 1 means msdos1, or gpt1, depending - on whether I am using MBR or GPT partitioning. Thus, /dev/sda1 is GRUB is (ahci0,msdos1) or - (ahci0,gpt1). In my case, I use MBR partitioning so it's (ahci0,msdos1). - 'msdos' is a GRUB name simply because this partitioning type is traditionally used by MS-DOS. - It doesn't mean that you have a proprietary OS. -

    - -

    - Trisquel doesn't keep the filenames of kernels consistent, instead it keeps old kernels and - new kernel updates are provided with the version in the filename. This can make GRUB payload - a bit tricky. Fortunately, there are symlinks /vmlinuz and /initrd.img - so if your /boot and / are on the same partition, you can set GRUB to boot from that. - These are also updated automatically when installing kernel updates from your distributions - apt-get repositories. - - Note: when using jxself kernel releases, - these are not updated at all and you have to update them manually. - -

    - -

    - For the GRUB payload grubtest.cfg (in the 'Load Operating System' menu entry), we therefore have (in this example):
    - set root='ahci0,msdos1'
    - linux /vmlinuz root=UUID=3a008e14-4871-497b-95e5-fb180f277951
    - initrd /initrd.img -

    - -

    - Optionally, you can convert the UUID to its real device name, for example /dev/sda1 in this case. - sdX naming isn't very reliable, though, which is why UUID is used for most distributions. -

    - -

    - Alternatively, if your /boot is on a separate partition then you cannot rely on the /vmlinuz and /initrd.img symlinks. - Instead, go into /boot and create your own symlinks (update them manually when you install a new kernel update).
    - $ sudo -s
    - # cd /boot/
    - # rm -Rf vmlinuz initrd.img
    - # ln -s kernel ksym
    - # ln -s initrd isym
    - # exit -

    - -

    - Replace the underlined kernel and initrd filenames above with the actual filenames, of course. -

    - -

    - Then your grubtest.cfg menu entry (for payload) becomes like that, for example if / was on sda2 and /boot was on sda1:
    - set root='ahci0,msdos1'
    - linux /ksym root=/dev/sda2
    - initrd /isym -

    - -

    - There are lots of possible variations so please try to adapt. -

    - -
    - -
    -

    Parabola GNU/Linux-libre

    - -

    - You can basically adapt the above. Note however that Parabola does not keep old kernels still installed, and the file names - are always consistent, so you don't need to boot from symlinks, you can just use the real thing directly. -

    -
    - -

    - Back to top of page. -

    - -
    - -

    Re-insert the modified grubtest.cfg into the ROM image

    + So you've created your configuration. Now, how do you use it? +

    + +

    Delete the grubtest.cfg that remained inside the ROM:
    $ ./cbfstool libreboot.rom remove -n grubtest.cfg

    diff --git a/docs/gnulinux/grub_config.html b/docs/gnulinux/grub_config.html new file mode 100644 index 0000000..2891ebc --- /dev/null +++ b/docs/gnulinux/grub_config.html @@ -0,0 +1,160 @@ + + + + + + + + + Writing a GRUB configuration file + + + +
    +

    Writing a GRUB configuration file

    + +

    + Back to index +

    +
    + + + +
    +

    Example modifications for grubtest.cfg

    + +

    + These are some common examples of ways in which the grubtest.cfg file can be modified. +

    + + +
    +

    Trisquel GNU/Linux-libre

    + +

    + As an example, on my test system in /boot/grub/grub.cfg (on the HDD/SSD) I see for the main menu entry: +

    +
      +
    • linux /boot/vmlinuz-3.15.1-gnu.nonpae root=UUID=3a008e14-4871-497b-95e5-fb180f277951 ro crashkernel=384M-2G:64M,2G-:128M quiet splash $vt_handoff
    • +
    • initrd /boot/initrd.img-3.15.1-gnu.nonpae
    • +
    + +

    + ro, quiet, splash, crashkernel=384M-2G:64M,2G-:128M and + $vt_handoff can be safely ignored. +

    + +

    + I use this to get my partition layout:
    + $ lsblk +

    + +

    + In my case, I have no /boot partition, instead /boot is on the same partition as / on sda1. + Yours might be different. In GRUB terms, sda means ahci0. 1 means msdos1, or gpt1, depending + on whether I am using MBR or GPT partitioning. Thus, /dev/sda1 is GRUB is (ahci0,msdos1) or + (ahci0,gpt1). In my case, I use MBR partitioning so it's (ahci0,msdos1). + 'msdos' is a GRUB name simply because this partitioning type is traditionally used by MS-DOS. + It doesn't mean that you have a proprietary OS. +

    + +

    + Trisquel doesn't keep the filenames of kernels consistent, instead it keeps old kernels and + new kernel updates are provided with the version in the filename. This can make GRUB payload + a bit tricky. Fortunately, there are symlinks /vmlinuz and /initrd.img + so if your /boot and / are on the same partition, you can set GRUB to boot from that. + These are also updated automatically when installing kernel updates from your distributions + apt-get repositories. + + Note: when using jxself kernel releases, + these are not updated at all and you have to update them manually. + +

    + +

    + For the GRUB payload grubtest.cfg (in the 'Load Operating System' menu entry), we therefore have (in this example):
    + set root='ahci0,msdos1'
    + linux /vmlinuz root=UUID=3a008e14-4871-497b-95e5-fb180f277951
    + initrd /initrd.img +

    + +

    + Optionally, you can convert the UUID to its real device name, for example /dev/sda1 in this case. + sdX naming isn't very reliable, though, which is why UUID is used for most distributions. +

    + +

    + Alternatively, if your /boot is on a separate partition then you cannot rely on the /vmlinuz and /initrd.img symlinks. + Instead, go into /boot and create your own symlinks (update them manually when you install a new kernel update).
    + $ sudo -s
    + # cd /boot/
    + # rm -Rf vmlinuz initrd.img
    + # ln -s kernel ksym
    + # ln -s initrd isym
    + # exit +

    + +

    + Replace the underlined kernel and initrd filenames above with the actual filenames, of course. +

    + +

    + Then your grubtest.cfg menu entry (for payload) becomes like that, for example if / was on sda2 and /boot was on sda1:
    + set root='ahci0,msdos1'
    + linux /ksym root=/dev/sda2
    + initrd /isym +

    + +

    + There are lots of possible variations so please try to adapt. +

    + +
    + +
    +

    Parabola GNU/Linux-libre

    + +

    + You can basically adapt the above. Note however that Parabola does not keep old kernels still installed, and the file names + are always consistent, so you don't need to boot from symlinks, you can just use the real thing directly. +

    +
    + +

    + Back to top of page. +

    + +
    + +
    + +

    + Copyright © 2014, 2015 Francis Rowe <info@gluglug.org.uk>
    + 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 ../cc-by-sa-4.txt. +

    + +

    + 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 ../cc-by-sa-4.txt for more information. +

    + +
    + + + diff --git a/docs/gnulinux/index.html b/docs/gnulinux/index.html index 341681d..7c420f6 100644 --- a/docs/gnulinux/index.html +++ b/docs/gnulinux/index.html @@ -24,8 +24,13 @@ Back to previous index.