docs: sign local builds with mkosi -f genkey

It replaces mkosi.crt for local tests, without openssl or a
mkosi.local.conf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Job79andClaude Opus 5.5 committed 2026-11-23 18:28:04 +00:00
1 parent b978c189ae
commit 00daa97950
3 files changed
+3 -20

No files matched your search

-1
View File
@@ -1,4 +1,3 @@
mkosi.key mkosi.key
mkosi.output/ mkosi.output/
mkosi.cache/ mkosi.cache/
mkosi.local.conf
+1 -1
View File
@@ -66,6 +66,7 @@ CMD ["/sbin/init"]
END END
podman run -d --name mkosi --privileged --systemd=always -v <repo>:/repo \ podman run -d --name mkosi --privileged --systemd=always -v <repo>:/repo \
-v mkosi-cache:/root/.cache/mkosi -v mkosi-work:/var/tmp -w /repo mkosi-vm -v mkosi-cache:/root/.cache/mkosi -v mkosi-work:/var/tmp -w /repo mkosi-vm
podman exec mkosi mkosi -f genkey # Run this once. Don't commit mkosi.crt.
podman exec mkosi mkdir -p mkosi.cache podman exec mkosi mkdir -p mkosi.cache
podman exec -d -t mkosi sh -c 'mkosi -i -f \ podman exec -d -t mkosi sh -c 'mkosi -i -f \
--kernel-command-line-extra=console=ttyS0 vm -- -serial chardev:console \ --kernel-command-line-extra=console=ttyS0 vm -- -serial chardev:console \
@@ -73,7 +74,6 @@ podman exec -d -t mkosi sh -c 'mkosi -i -f \
podman exec mkosi mkosi ssh -- systemctl --failed podman exec mkosi mkosi ssh -- systemctl --failed
``` ```
- mkosi signs with the test key from [README.md](README.md#development).
- `mkosi -i` keeps the image with its packages installed in `mkosi.cache/`. - `mkosi -i` keeps the image with its packages installed in `mkosi.cache/`.
Rebuilds start from it and skip installing packages. Rebuilds start from it and skip installing packages.
- The volume `mkosi-work` keeps mkosi's workspace in /var/tmp off overlayfs. - The volume `mkosi-work` keeps mkosi's workspace in /var/tmp off overlayfs.
+2 -18
View File
@@ -35,27 +35,11 @@ itself up as at first boot.
## Development ## Development
Only CI has `mkosi.key`, so local builds sign with a test key:
```sh ```sh
openssl req -new -x509 -newkey rsa:2048 -nodes -subj /CN=test \ mkosi -f genkey # This replaces mkosi.crt for local tests. Don't commit it.
-keyout ~/test.key -out ~/test.crt mkosi build
``` ```
`mkosi.local.conf`:
```ini
[Validation]
SecureBootKey=~/test.key
SecureBootCertificate=~/test.crt
SignExpectedPcrKey=~/test.key
SignExpectedPcrCertificate=~/test.crt
VerityKey=~/test.key
VerityCertificate=~/test.crt
```
Then run `mkosi build`.
`mkosi.output/` then holds the disk image (`agentos_<version>.raw`) and the UKI `mkosi.output/` then holds the disk image (`agentos_<version>.raw`) and the UKI
and /usr partitions that make up an update. and /usr partitions that make up an update.