mkosi genkey won't replace mkosi.crt, and the key options on the command line miss the PCR and verity keys. mkosi already pulls in zstd and qemu-img, so the workflow doesn't install them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b5aa2d7a59
commit
6a32e00431
3 files changed
+19
-8
No files matched your search
@@ -26,7 +26,7 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- name: Install tools
|
- name: Install tools
|
||||||
run: dnf install -yq mkosi git-core zstd qemu-img
|
run: dnf install -yq mkosi git-core
|
||||||
# Check out fetches the commit with git, because the job image has no
|
# Check out fetches the commit with git, because the job image has no
|
||||||
# Node.js for actions/checkout.
|
# Node.js for actions/checkout.
|
||||||
- name: Check out
|
- name: Check out
|
||||||
|
|||||||
@@ -72,10 +72,8 @@ podman exec -d -t mkosi sh -c 'mkosi -i -f --kernel-command-line-extra="\
|
|||||||
-serial chardev:console > mkosi.output/vm.log 2>&1'
|
-serial chardev:console > mkosi.output/vm.log 2>&1'
|
||||||
```
|
```
|
||||||
|
|
||||||
- Only CI has `mkosi.key`. For a test key, make one as in
|
- mkosi signs with the test key of `mkosi.local.conf`
|
||||||
[README.md](README.md#development) and point mkosi.local.conf at it:
|
([README.md](README.md#development)), with paths as the container sees them.
|
||||||
`SecureBootKey=`, `SignExpectedPcrKey=` and `VerityKey=`, and their
|
|
||||||
`*Certificate=`, in `[Validation]`.
|
|
||||||
- To register the test VM, register on the host with
|
- To register the test VM, register on the host with
|
||||||
`gitea-runner register --no-interactive --instance <url> --token <token>`
|
`gitea-runner register --no-interactive --instance <url> --token <token>`
|
||||||
and pass the `.runner` it writes as a tmpfiles.extra credential:
|
and pass the `.runner` it writes as a tmpfiles.extra credential:
|
||||||
|
|||||||
@@ -38,15 +38,28 @@ at first boot.
|
|||||||
## Development
|
## Development
|
||||||
|
|
||||||
`mkosi build` signs with `mkosi.key`, the private key of `mkosi.crt`, which
|
`mkosi build` signs with `mkosi.key`, the private key of `mkosi.crt`, which
|
||||||
only CI has (the `SECUREBOOT_KEY` secret). Local builds sign with a test key
|
only CI has (the `SECUREBOOT_KEY` secret). `mkosi genkey` won't replace
|
||||||
instead:
|
`mkosi.crt`, so local builds sign with a test key. Make one:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
openssl req -new -x509 -newkey rsa:2048 -nodes -subj /CN=test \
|
openssl req -new -x509 -newkey rsa:2048 -nodes -subj /CN=test \
|
||||||
-keyout ~/test.key -out ~/test.crt
|
-keyout ~/test.key -out ~/test.crt
|
||||||
mkosi --secure-boot-key ~/test.key --secure-boot-certificate ~/test.crt build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
and point `mkosi.local.conf` at it, which mkosi reads and git ignores:
|
||||||
|
|
||||||
|
```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 (`runneros_<version>.raw`) and the
|
`mkosi.output/` then holds the disk image (`runneros_<version>.raw`) and the
|
||||||
UKI and /usr partitions that make up an update. To boot a test VM, see
|
UKI and /usr partitions that make up an update. To boot a test VM, see
|
||||||
[AGENTS.md](AGENTS.md#testing).
|
[AGENTS.md](AGENTS.md#testing).
|
||||||
Reference in new issue
Block a user