From 94fd5d1ce919102913db3c730daa0c18bcdf1c5e Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 16:07:45 +0000 Subject: [PATCH 1/5] fix: check out with git, sign local builds with a test key gitea-runner 6 has no builtin:checkout, and plain Fedora has no Node.js for actions/checkout, so the workflow fetches the commit with git. Setting permissions: keeps read access for that and asks for package writes. mkosi genkey won't replace mkosi.crt, so the docs now sign local builds with a test key in mkosi.local.conf, which also covers the PCR and verity keys. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 15 ++++++++++++++- .gitignore | 1 + AGENTS.md | 3 ++- README.md | 22 ++++++++++++++++++++-- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 168faf0..651008d 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -19,11 +19,24 @@ on: jobs: os: runs-on: linux + # permissions lets gitea.token check out the repository and publish the + # package. + permissions: + contents: read + packages: write steps: - name: Install tools run: dnf install -yq mkosi git-core + # Check out fetches the commit with git, because the job image has no + # Node.js for actions/checkout. - name: Check out - uses: builtin:checkout + env: + AUTH: "Authorization: token ${{ gitea.token }}" + run: | + git init -q + git -c http.extraHeader="$AUTH" fetch -q --depth 1 \ + "${{ gitea.server_url }}/${{ gitea.repository }}" "${{ gitea.sha }}" + git checkout -q FETCH_HEAD - name: Build env: KEY: ${{ secrets.SECUREBOOT_KEY }} diff --git a/.gitignore b/.gitignore index 931bdcd..7654f12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ mkosi.key mkosi.output/ mkosi.cache/ +mkosi.local.conf diff --git a/AGENTS.md b/AGENTS.md index 3dfbc82..4fe5530 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,7 +66,6 @@ CMD ["/sbin/init"] END podman run -d --name mkosi --privileged --systemd=always -v :/repo \ -v mkosi-cache:/root/.cache/mkosi -v mkosi-work:/var/tmp -w /repo mkosi-vm -podman exec mkosi mkosi genkey # Run this once, if there is no mkosi.key. podman exec mkosi mkdir -p mkosi.cache podman exec -d -t mkosi sh -c 'mkosi -i -f \ --kernel-command-line-extra=console=ttyS0 vm -- -serial chardev:console \ @@ -74,6 +73,8 @@ podman exec -d -t mkosi sh -c 'mkosi -i -f \ podman exec mkosi mkosi ssh -- systemctl --failed ``` +- mkosi signs with the test key of `mkosi.local.conf` + ([README.md](README.md#development)), with paths as the container sees them. - `mkosi -i` keeps the image with its packages installed in `mkosi.cache/`. Rebuilds start from it and skip installing packages. - The volume `mkosi-work` keeps mkosi's workspace in /var/tmp off overlayfs. diff --git a/README.md b/README.md index aea64f5..92d8379 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,29 @@ itself up as at first boot. ## Development +`mkosi build` signs with `mkosi.key`, the private key of `mkosi.crt`, which +only CI has (the `SECUREBOOT_KEY` secret). `mkosi genkey` won't replace +`mkosi.crt`, so local builds sign with a test key. Make one: + ```sh -mkosi genkey # This is for local tests. CI uses the SECUREBOOT_KEY secret. -mkosi build +openssl req -new -x509 -newkey rsa:2048 -nodes -subj /CN=test \ + -keyout ~/test.key -out ~/test.crt ``` +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 (`agentos_.raw`) and the UKI and /usr partitions that make up an update. -- 2.54.1 From 34be2ef89f5b738a16959a75600e37a53ee55ba5 Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:01:03 +0000 Subject: [PATCH 2/5] docs: say that gitea-runner 6 removed builtin:checkout Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 651008d..418cfcf 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -27,8 +27,8 @@ jobs: steps: - name: Install tools run: dnf install -yq mkosi git-core - # Check out fetches the commit with git, because the job image has no - # Node.js for actions/checkout. + # Check out fetches the commit with git. gitea-runner 6 removed + # builtin:checkout, and the job image has no Node.js for actions/checkout. - name: Check out env: AUTH: "Authorization: token ${{ gitea.token }}" -- 2.54.1 From 3793cb0f3136d7cde2ab94faefde00802c051937 Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:05:15 +0000 Subject: [PATCH 3/5] fix: check out with actions/checkout gitea-runner 6 removed builtin:checkout. With Node.js in the job, actions/checkout works. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 418cfcf..4022612 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -25,18 +25,11 @@ jobs: contents: read packages: write steps: + # Install tools adds Node.js for actions/checkout. - name: Install tools - run: dnf install -yq mkosi git-core - # Check out fetches the commit with git. gitea-runner 6 removed - # builtin:checkout, and the job image has no Node.js for actions/checkout. + run: dnf install -yq mkosi git-core nodejs - name: Check out - env: - AUTH: "Authorization: token ${{ gitea.token }}" - run: | - git init -q - git -c http.extraHeader="$AUTH" fetch -q --depth 1 \ - "${{ gitea.server_url }}/${{ gitea.repository }}" "${{ gitea.sha }}" - git checkout -q FETCH_HEAD + uses: actions/checkout@v4 - name: Build env: KEY: ${{ secrets.SECUREBOOT_KEY }} -- 2.54.1 From e0cd5db5c59e0ba231e1fe8354a4fc69b94cc10c Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:27:43 +0000 Subject: [PATCH 4/5] fix: use Node.js 26 for actions/checkout Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 4022612..871edf0 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -27,7 +27,7 @@ jobs: steps: # Install tools adds Node.js for actions/checkout. - name: Install tools - run: dnf install -yq mkosi git-core nodejs + run: dnf install -yq mkosi git-core nodejs26 - name: Check out uses: actions/checkout@v4 - name: Build -- 2.54.1 From 0a68a046ef20da8b8c1603176b84fbef544003a6 Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:40:59 +0000 Subject: [PATCH 5/5] fix: check out with git again actions/checkout needs Node.js in every job and fetches the action from GitHub. Four lines of git need neither. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 871edf0..1fcec9c 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -25,11 +25,18 @@ jobs: contents: read packages: write steps: - # Install tools adds Node.js for actions/checkout. - name: Install tools - run: dnf install -yq mkosi git-core nodejs26 + run: dnf install -yq mkosi git-core + # Check out fetches the commit with git, which needs no Node.js and no + # action from GitHub. gitea-runner 6 removed builtin:checkout. - name: Check out - uses: actions/checkout@v4 + env: + AUTH: "Authorization: token ${{ gitea.token }}" + run: | + git init -q + git -c http.extraHeader="$AUTH" fetch -q --depth 1 \ + "${{ gitea.server_url }}/${{ gitea.repository }}" "${{ gitea.sha }}" + git checkout -q FETCH_HEAD - name: Build env: KEY: ${{ secrets.SECUREBOOT_KEY }} -- 2.54.1