1
0
mirror of https://github.com/gryf/mkinitramfs.git synced 2026-02-15 01:05:44 +01:00

Moved configuration to toml

This commit is contained in:
2025-06-27 10:54:16 +02:00
parent 84f93c519f
commit 7efac1607f
2 changed files with 127 additions and 63 deletions

View File

@@ -7,46 +7,40 @@ Usage
-----
- Create encrypted disk or partition using `cryptsetup`_
- Create ``~/.config/mkinitramfs/disks.json`` file with similar content to:
- Create ``~/.config/mkinitramfs.toml`` file with similar content to:
.. code:: json
.. code:: toml
{
"name": {
"uuid": "disk-uuid",
"key": "key-filename"
},
...
}
[name]
uuid = "disk-uuid"
key = "key-filename"
where every entry have disk name (**name** in this case), which have two
attributes - disk/partition UUID and key filename.
...
where every entry have disk name (**name** in this case), which have at least
two attributes - disk/partition UUID and key filename.
- Provide a key file for the disk/partition. Assumption is, that it is an
encrypted file using `ccrypt`_ instead of plain file or password protected
luks. Keys will be looked using provided path, i.e.
.. code:: json
.. code:: toml
{
"laptop": {
"uuid": "88b99002-028f-4744-94e7-45e4580e2ddd",
"key": "/full/path/to/the/laptop.key"
},
"desktop": {
"uuid": "23e31327-1411-491c-ab00-c36f74c441f1",
"key": "desktop.key"
},
"pendrive": {
"uuid": "1453a45e-ca3f-4d39-8fd7-a6a96873c25c",
"key": "../pendrive.key"
}
}
[laptop]
uuid = "88b99002-028f-4744-94e7-45e4580e2ddd"
key = "/full/path/to/the/laptop.key"
[desktop]
uuid = "23e31327-1411-491c-ab00-c36f74c441f1"
key = "desktop.key"
[pendrive]
uuid = "1453a45e-ca3f-4d39-8fd7-a6a96873c25c"
key = "../pendrive.key"
so yes - it is possible to use key file in absolute or relative paths. If no
key will be found, it's been looking for in path specified by
``--key-path | -k`` parameter, which by default is in
``$XDG_CONFIG_HOME/mkinitramfs/keys`` (usually in
``~/.config/mkinitramfs/keys``.
``$XDG_DATA_HOME/keys`` (usually it will be ``~/.local/share/keys``).
- Move ``mkinitramfs.py`` script to some location in your ``$PATH`` (like
``~/bin``)
- Invoke ``mkinitramfs.py`` script:
@@ -62,6 +56,33 @@ Usage
on ``/boot`` with appropriate links. Note, that old images (they have
``.old`` suffix in the filename) will be removed in that case.
Configuration
-------------
Other than key path and device UUID, configuration can hold additional options
similar to those passed via commandline. Consider following example:
.. code:: toml
[laptop]
uuid = "88b99002-028f-4744-94e7-45e4580e2ddd"
key_path = "/full/path/to/the/keys/dir"
key = "laptop.key"
yubikey = true
This will inform mkinitramfs script, that dropbear and yubikey features are
enabled. Also for network related configuration, there are last three options.
The complete list of supported options is listed below:
- ``copy_modules``
- ``no_key``
- ``key_path``
- ``key``
- ``disk_label``
- ``sdcard``
- ``yubikey``
Using key devices
-----------------