aboutsummaryrefslogtreecommitdiff
path: root/barebones.mdwn
blob: b66cbcb80d0c51c07b469c239544e5f146584f96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[[!meta title="Bootless: barebones approach"]]

This tutorial helps you to build a Grub USB stick to boot your operating systems.

Create basic folder structure
-----------------------------

    mkdir -p /tmp/bootless/{grub,custom}
    wget https://git.fluxo.info/bootless/plain/templates/grub.cfg   -O /tmp/bootless/grub/grub.cfg
    wget https://git.fluxo.info/bootless/plain/templates/custom.cfg -O /tmp/bootless/grub/custom.cfg

Edit the config files
---------------------

Please check and customized the downloaded configuration above. The defaults allows you to load into Grub
and boot your OS using the grub shell.

Example: Full Disk Encryption
-----------------------------

Here is an example of a Full Disk Encryption with an entry loaded into `custom.cfg`:

    menuentry darkstar {
      # Loads luks and lvm modules so you can access kernel
      # and initrd from inside your encrypted OS!
      insmod luks
      insmod lvm

      # This opens the encrypted volume /dev/mapper/darkstar-root
      # and sets it as the root in the grub shell.
      cryptomount lvm/darkstar-root
      set         root=(crypto0)

      # This loads the kernel and initramfs
      echo        "Loading ${volume}..."
      linux       /boot/vmlinuz-3.16.0-4-amd64 root=/dev/mapper/root cryptopts=target=root,source=/dev/mapper/darkstar-root ro quiet
      echo        'Loading initial ramdisk ...'
      initrd      /boot/initrd.img-3.16.0-4-amd64
    }

Example: boot with images loaded into the USB stick
---------------------------------------------------

You may also place custom images into the USB stick -- with the drawback to have to keep them up-to-date:

    cp -r /boot /tmp/bootless/custom/debian

    menuentry darkstar {
      # This loads the kernel and initramfs using images preloaded into the USB stick.
      echo        "Loading ${volume}..."
      linux       /boot/custom/debian/vmlinuz-3.16.0-4-amd64 root=/dev/mapper/root cryptopts=target=root,source=/dev/mapper/darkstar-root ro quiet
      echo        'Loading initial ramdisk ...'
      initrd      /boot/custom/debian/initrd.img-3.16.0-4-amd64
    }