aboutsummaryrefslogtreecommitdiff
path: root/templates/custom.cfg
blob: 088ac0c69d93fa7ff09fded0aa2f928e241392af (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# Menu appearance
#
set menu_color_normal=white/blue
set menu_color_highlight=yellow/red

#
# Example: Darkstar with preloaded images:
#
# - Images stored in the USB stick.
# - Place your images under custom/debian/images.
#
menuentry 'Example: Darkstar using preloaded images' {
  # 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
}

#
# Example: Darkstar with preloaded images and bootimg function:
#
# - Images stored in the USB stick.
# - Place your images under custom/debian/images.
# - Boots using bootimg function.
#
menuentry 'Example: Darkstar using preloaded images and bootimg function' {
  set     volume=/dev/sda5
  set     version=3.16.0-4-amd64
  set     target=sda5_crypt
  set     rootfs=darkstar--vg-root
  set     distro=debian
  bootimg ${volume} ${version} ${source} ${target} ${distro}
}

#
# Example: Darkstar with Full Disk Encryption:
#
# - Images are loaded directly from encrypted partition.
#
menuentry 'Example: Darkstar usin Full Disk Encryption' {
  # 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: Darkstar with Full Disk Encryption and bootfde function:
#
# - Images are loaded directly from encrypted partition.
# - Boots using bootfde function.
#
menuentry 'Example: Darkstar usin Full Disk Encryption and bootfe function' {
  set     volume=darkstar
  set     version=3.16.0-4-amd64
  bootfde ${volume} ${version}
}

#
# Example: Debian Jessie default whole encrypted install with preloaded images:
#
# - Boots a Debian system that was installed using LVM atop LUKS (default crypt install).
# - Images stored in the USB stick.
# - Place your images under custom/debian/images.
# - Boots using bootimg function.
#
menuentry 'Custom: Jessie with pre-loaded images' {
  set     volume=UUID=00000000-0000-0000-0000-000000000000
  set     version=3.16.0-4-amd64
  set     target=sda5_crypt
  set     rootfs=jessie--vg-root
  set     distro=debian
  bootimg ${volume} ${version} ${target} ${rootfs} ${distro}
}

#
# Example: Debian Jessie default whole encrypted install with Full Disk Encryption:
#
# - Boots a Debian system that was installed using LVM atop LUKS (default crypt install).
# - Images are loaded directly from encrypted partition.
#
menuentry 'Custom: Jessie with Full Disk Encryption' {
  set     volume=00000000000000000000000000000000
  set     uuid=00000000-0000-0000-0000-000000000000
  set     version=3.16.0-4-amd64
  set     target=sda5_crypt
  set     rootfs=jessie--vg-root

  # Loads luks module you can access kernel and initrd from
  # the inside your encrypted OS!
  insmod luks

  # This opens the encrypted volume /dev/mapper/darkstar-root
  # and sets it as the root in the grub shell.
  cryptomount -u ${volume}

  # Load the LVM module just after loading the encrypted volume
  # so Grub can detect volumes that are inside it.
  insmod lvm
  set         root=lvm/${rootfs}

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