You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+71-52Lines changed: 71 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,8 +32,9 @@ Modules write to a shared config dict that is accessible by other modules.
32
32
33
33
### base.core
34
34
35
-
*`build_dir` (/tmp/initramfs) Defines where the build will take place.
36
-
*`out_dir` (/tmp/initramfs_out) Defines where packed files will be placed.
35
+
*`tmpdir` (/tmp) Sets the temporary directory as the base for the build and out dir.
36
+
*`build_dir` (initramfs_build) If relative, it will be placed under `tmpdir`, defines the build directory.
37
+
*`out_dir` (initramfs_out) If relative, it will be placed under `tmpdir`, defines the output directory.
37
38
*`out_file` Sets the name of the output file, under `out_dir` unless a path is defined.
38
39
*`clean` (true) forces the build dir to be cleaned on each run.
39
40
*`hostonly` (true) Builds the initramfs for the current host, if disabled, validation is automatically disabled.
@@ -43,6 +44,57 @@ Modules write to a shared config dict that is accessible by other modules.
43
44
*`binaries` - A list used to define programs to be pulled into the initrams. `which` is used to find the path of added entries, and `lddtree` is used to resolve dependendies.
44
45
*`paths` - A list of directores to create in the `build_dir`. They do not need a leading `/`.
45
46
47
+
#### Copying files
48
+
49
+
Using the `dependencies` list will pull files into the initramfs using the same path on the host system.
50
+
51
+
```
52
+
dependencies = [ "/etc/ugrd/testfile" ]
53
+
```
54
+
55
+
#### Copying files to a different destination
56
+
57
+
To copy files to a different path:
58
+
59
+
```
60
+
[copies.my_key]
61
+
source = "/home/larry/.gnupg/pubkey.gpg"
62
+
destination = "/etc/ugrd/pub.gpg"
63
+
```
64
+
65
+
#### symlink creation
66
+
67
+
Symlinks are defined in the `symlinks` dict. Each entry must have a name, `source` and `target`:
68
+
69
+
```
70
+
[symlinks.pinentry]
71
+
source = "/usr/bin/pinentry-tty"
72
+
target = "/usr/bin/pinentry"
73
+
```
74
+
75
+
##### Device node creation
76
+
77
+
Device nodes can be created by defining them in the `nodes` dict using the following keys:
78
+
79
+
*`mode` (0o600) the device node, in octal.
80
+
*`path` (/dev/node name) the path to create the node at.
81
+
*`major` - Major value.
82
+
*`minor` - Minor value.
83
+
84
+
Example:
85
+
86
+
```
87
+
[nodes.console]
88
+
mode = 0o644
89
+
major = 5
90
+
minor = 1
91
+
```
92
+
93
+
Creates `/dev/console` with permissions `0o644`
94
+
95
+
> Using `mknod_cpio` from `ugrd.fs.cpio` will not create the device nodes in the build dir, but within the CPIO archive
96
+
97
+
46
98
### base.cmdline
47
99
48
100
If used, this module will override the `mount_root` function and attempt to mount the root based on the passed cmdline parameters.
@@ -111,15 +163,28 @@ Similarly `ugrd.kmod.novideo` `nonetwork`, and `nosound` exist to ignore video,
111
163
112
164
### Filesystem modules
113
165
166
+
`ugrd.fs.mounts` is the core of the filesystem module category and is included by default.
167
+
168
+
Additional modules include:
169
+
170
+
`ugrd.fs.btrfs` - Helps with multi-device BTRFS mounts, subvolume selection.
171
+
`ugrd.fs.fakeudev` - Makes 'fake' udev entries for DM devices.
172
+
`ugrd.fs.cpio` - Packs the build dir into a CPIO archive with PyCPIO.
173
+
`ugrd.fs.livecd` - Assists in livecd image creation.
174
+
`ugrd.fs.lvm` - Activates LVM mounts.
175
+
`ugrd.fs.mdraid` - For MDRAID mounts.
176
+
`ugrd.fs.resume` - Handles resume from hibernation.
177
+
`ugrd.fs.test_image` - Creates a test rootfs for automated testing.
178
+
179
+
#### ugrd.fs.mounts
180
+
114
181
`autodetect_root` (true) Set the root mount parameter based on the current root label or uuid.
115
182
`autodetect_root_dm` (true) Attempt to automatically configure virtual block devices such as LUKS/LVM/MDRAID.
116
183
`autodetect_root_luks` (true) Attempt to automatically configure LUKS mounts for the root device.
117
184
`autodetect_root_lvm` (true) Attempt to automatically configure LVM mounts for the root device.
118
185
`autodetect_root_mdraid` (true) Attempt to automatically configure MDRAID mounts for the root device.
119
186
`autodetect_init_mount'` (true) Automatically detect the mountpoint for the init binary, and add it to `late_mounts`.
120
187
121
-
#### ugrd.fs.mounts
122
-
123
188
`mounts`: A dictionary containing entries for mounts, with their associated config.
124
189
125
190
`mounts.root` is predefined to have a destination of `/target_rootfs` and defines the root filesystem mount, used by `switch_root`.
@@ -193,55 +258,9 @@ Importing this module will run `btrfs device scan` and pull btrfs modules.
193
258
*`root_subvol` - Set the desired root subvolume.
194
259
*`_base_mount_path` (/root_base) Sets where the subvolume selector mounts the base filesytem to scan for subvolumes.
195
260
196
-
#### symlink creation
197
-
198
-
Symlinks are defined in the `symlinks` dict. Each entry must have a name, `source` and `target`:
199
-
200
-
```
201
-
[symlinks.pinentry]
202
-
source = "/usr/bin/pinentry-tty"
203
-
target = "/usr/bin/pinentry"
204
-
```
261
+
#### ugrd.fs.resume
205
262
206
-
#### Copying files
207
-
208
-
Using the `dependencies` list will pull files into the initramfs using the same path on the host system.
209
-
210
-
```
211
-
dependencies = [ "/etc/ugrd/testfile" ]
212
-
```
213
-
214
-
#### Copying files to a different destination
215
-
216
-
To copy files to a different path:
217
-
218
-
```
219
-
[copies.my_key]
220
-
source = "/home/larry/.gnupg/pubkey.gpg"
221
-
destination = "/etc/ugrd/pub.gpg"
222
-
```
223
-
224
-
##### Device node creation
225
-
226
-
Device nodes can be created by defining them in the `nodes` dict using the following keys:
227
-
228
-
*`mode` (0o600) the device node, in octal.
229
-
*`path` (/dev/node name) the path to create the node at.
230
-
*`major` - Major value.
231
-
*`minor` - Minor value.
232
-
233
-
Example:
234
-
235
-
```
236
-
[nodes.console]
237
-
mode = 0o644
238
-
major = 5
239
-
minor = 1
240
-
```
241
-
242
-
Creates `/dev/console` with permissions `0o644`
243
-
244
-
> Using `mknod_cpio` from `ugrd.fs.cpio` will not create the device nodes in the build dir, but within the CPIO archive
263
+
When enabled, attempts to resume after hibernation if resume= is passed on the kernel command line.
0 commit comments