Skip to content

Commit 03978b2

Browse files
committed
created module categories for filesystem and kmods, updated examples and docs
Signed-off-by: Zen <[email protected]>
1 parent 8901832 commit 03978b2

21 files changed

+64
-61
lines changed

config_example.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# This config will decrypt the LUKS volume with uuid "fdf442da-0574-4531-98c7-55227a041f1d", mapping it to "/dev/mapper/root"
22
# It will attempt to mount the btrfs volume with label "rootfs" to /mnt/root
33
# It will pull all current kernel modules from lspci -k results
4-
# The "ugrd.base.kmod_nvme" module will be used to load the nvme module if it's not detected in lsmod
54
# The "ugrd.base.cpio" module will pack the initramfs into a cpio archive
65

76
modules = [
87
"ugrd.base.base",
9-
"ugrd.base.kmod",
10-
"ugrd.base.kmod_nvme",
11-
"ugrd.base.kmod_nosound",
12-
"ugrd.base.kmod_novideo",
8+
"ugrd.kmod.kmod",
9+
"ugrd.kmod.nosound",
10+
"ugrd.kmod.novideo",
1311
"ugrd.crypto.cryptsetup",
14-
"ugrd.base.btrfs",
12+
"ugrd.fs.btrfs",
1513
"ugrd.base.cpio",
1614
]
1715

config_raid_crypt_serial.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ modules = [
99
"ugrd.base.console",
1010
"ugrd.crypto.gpg",
1111
"ugrd.crypto.cryptsetup",
12-
"ugrd.base.btrfs"
12+
"ugrd.fs.btrfs"
1313
]
1414

1515
# Set the key type for all cryptsetup keys

config_subvol.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# This config will decrypt the colume fdf442da-0574-4531-98c7-55227a041f1d, mapping it to "/dev/mapper/root"
22
# It will attempt to mount the btrfs subvolume "gento" from the devive with label "rootfs" to /root
33
# It will pull all current kernel modules from the active kernel version
4+
# The kmod.novideo and kmod.nosound modules are pulled to help minmize pulled modules
45

56

67
modules = [
78
"ugrd.base.base",
8-
"ugrd.base.kmod",
9+
"ugrd.kmod.kmod",
10+
"ugrd.kmod.novideo",
11+
"ugrd.kmod.nosound",
912
"ugrd.crypto.cryptsetup",
1013
"ugrd.base.btrfs",
1114
]
1215

1316
# Optionally supply a kernel version
1417
#kernel_version = "6.1.53-gentoo-dist"
18+
kmod_autodetect_lsmod = true
1519

1620
[root_mount]
1721
options = "subvol=gentoo"

config_vm.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This config will decrypt the volume with UUID "38a5c4d2-f5af-404a-a663-d789e443a40c", mapping it to /dev/mapper/root
2-
# It will pull kmods required by btrfs, since it is an included module, and virtio_blk which is part of kmod_vm.
2+
# It will pull kmods required by btrfs, since it is an included module, and virtio_blk which is part of kmod.vm.
33
# The kernel version is set to 6.1.57-gentoo-custom
44
# The root filesystem has the label "rootfs", and is mounted at /mnt/rootfs
55

66
modules = [
77
"ugrd.base.base",
8-
"ugrd.base.kmod",
9-
"ugrd.base.kmod_vm",
8+
"ugrd.kmod.kmod",
9+
"ugrd.kmod.vm",
1010
"ugrd.crypto.cryptsetup",
1111
"ugrd.base.btrfs"
1212
]

config_yubikey.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77

88
modules = [
99
"ugrd.base.base",
10-
"ugrd.base.kmod",
11-
"ugrd.base.kmod_usb",
12-
"ugrd.base.kmod_nvme",
13-
"ugrd.base.kmod_fat",
10+
"ugrd.kmod.kmod",
11+
"ugrd.kmod.usb",
12+
"ugrd.kmod.nvme",
1413
"ugrd.crypto.cryptsetup",
15-
"ugrd.base.btrfs",
16-
"ugrd.base.console",
17-
"ugrd.crypto.gpg",
14+
"ugrd.fs.btrfs",
1815
"ugrd.crypto.smartcard",
1916
"ugrd.base.cpio"
2017
]

readme.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,6 @@ These are set at the global level and are not associated with an individual moun
125125
* `mount_wait` (false) waits for user input before attenmpting to mount the generated fstab at `init_main`.
126126
* `mount_timeout` timeout for `mount_wait` to automatically continue.
127127

128-
#### base.kmod
129-
130-
This module is used to embed kernel modules into the initramfs.
131-
132-
Modules can use `_kmod_depend` to add required modules. Simply using the `ugrd.crypto.cryptsetup` module, for example, will try to add the `dm_crypt` kmod.
133-
134-
The following parameters can be used to change the kernel module pulling and initializing behavior:
135-
136-
* `kernel_version` (uname -r) is used to specify the kernel version to pull modules for, should be a directory under `/lib/modules/<kernel_version>`.
137-
* `kmod_init` is used to specify kernel modules to load at boot. If set, ONLY these modules will be loaded with modprobe.
138-
* `kmod_autodetect_lspci` (false) if set to `true`, will populate `kernel_modules` with modules listed in `lspci -k`.
139-
* `kmod_autodetect_lsmod` (false) if set to `true`, will populate `kernel_modules` with modules listed in `lsmod`.
140-
* `kernel_modules` is used to define a list of kernel module names to pull into the initramfs. These modules will not be `modprobe`'d automatically if `kmod_init` is also set.
141-
* `kmod_ignore` is used to specify kernel modules to ignore. If a module depends on one of these, it will throw an error and drop it from being included.
142-
* `kmod_ignore_softdeps` (false) ignore softdeps when checking kernel module dependencies.
143-
* `_kmod_depend` is meant to be used within modules, specifies kernel modules which should be added to `kmod_init` when that `ugrd` module is imported.
144-
145-
##### Kernel module helpers
146-
147-
Some helper modules have been created to make importing required kernel modules easier.
148-
149-
`base.ugrd.kmod_nvme`, `kmod_usb`, and `kmod_fat` can be used to load modules for NVME's, USB storage, and the FAT file system respectively.
150-
151-
Similarly `base.ugrd.kmod_novideo` and `kmod_nosound` exist to ignore video and sound devices that may appear when autodetecting modules.
152-
153128
#### base.console
154129

155130
This module creates an agetty session. This is used by the `ugrd.crypto.gpg` module so the tty can be used for input and output.
@@ -195,7 +170,36 @@ The following parameters can be set to alter CPIO functionality:
195170
* `cpio_list_name` (cpio.list) can be used to change the filename of the CPIO list for `gen_init_cpio`.
196171
* `_gen_init_cpio_path` The path to this tool can be specified. If not, it is included and will be built at runtime if needed.
197172

198-
#### base.btrfs
173+
### Kernel modules
174+
175+
`ugrd.kmod.kmod` is the core of the kernel module loading..
176+
177+
> Modules can use `_kmod_depend` to add required modules. Simply using the `ugrd.crypto.cryptsetup` module, for example, will try to add the `dm_crypt` kmod.
178+
179+
#### ugrd.kmod.kmod confugration parameters
180+
181+
The following parameters can be used to change the kernel module pulling and initializing behavior:
182+
183+
* `kernel_version` (uname -r) is used to specify the kernel version to pull modules for, should be a directory under `/lib/modules/<kernel_version>`.
184+
* `kmod_init` is used to specify kernel modules to load at boot. If set, ONLY these modules will be loaded with modprobe.
185+
* `kmod_autodetect_lspci` (false) if set to `true`, will populate `kernel_modules` with modules listed in `lspci -k`.
186+
* `kmod_autodetect_lsmod` (false) if set to `true`, will populate `kernel_modules` with modules listed in `lsmod`.
187+
* `kernel_modules` is used to define a list of kernel module names to pull into the initramfs. These modules will not be `modprobe`'d automatically if `kmod_init` is also set.
188+
* `kmod_ignore` is used to specify kernel modules to ignore. If a module depends on one of these, it will throw an error and drop it from being included.
189+
* `kmod_ignore_softdeps` (false) ignore softdeps when checking kernel module dependencies.
190+
* `_kmod_depend` is meant to be used within modules, specifies kernel modules which should be added to `kmod_init` when that `ugrd` module is imported.
191+
192+
#### Kernel module helpers
193+
194+
Some helper modules have been created to make importing required kernel modules easier.
195+
196+
`base.ugrd.kmod_nvme`, `kmod_usb`, and `kmod_fat` can be used to load modules for NVME's, USB storage, and the FAT file system respectively.
197+
198+
Similarly `base.ugrd.kmod_novideo` and `kmod_nosound` exist to ignore video and sound devices that may appear when autodetecting modules.
199+
200+
### Filesystem modules
201+
202+
#### fs.btrfs
199203

200204
Importing this module will run `btrfs device scan` and pull btrfs modules. No config is required.
201205

ugrd/base/kmod_fat.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

ugrd/base/kmod_nvme.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

ugrd/base/kmod_vm.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)