From 94fd5d1ce919102913db3c730daa0c18bcdf1c5e Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 16:07:45 +0000 Subject: [PATCH 1/9] 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. From 34be2ef89f5b738a16959a75600e37a53ee55ba5 Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:01:03 +0000 Subject: [PATCH 2/9] 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 }}" From 3793cb0f3136d7cde2ab94faefde00802c051937 Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:05:15 +0000 Subject: [PATCH 3/9] 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 }} From e0cd5db5c59e0ba231e1fe8354a4fc69b94cc10c Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:27:43 +0000 Subject: [PATCH 4/9] 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 From 0a68a046ef20da8b8c1603176b84fbef544003a6 Mon Sep 17 00:00:00 2001 From: Job Date: Sun, 22 Nov 2026 17:40:59 +0000 Subject: [PATCH 5/9] 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 }} From b978c189aeb699c1ad4e0ed2f8e9602c79b85f77 Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 23 Nov 2026 18:25:38 +0000 Subject: [PATCH 6/9] docs: shorter comments Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 5 +---- AGENTS.md | 3 +-- README.md | 6 ++---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 1fcec9c..9f2e715 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -19,16 +19,13 @@ 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, which needs no Node.js and no - # action from GitHub. gitea-runner 6 removed builtin:checkout. + # gitea-runner 6 removed builtin:checkout. - name: Check out env: AUTH: "Authorization: token ${{ gitea.token }}" diff --git a/AGENTS.md b/AGENTS.md index 4fe5530..d3dc573 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -73,8 +73,7 @@ 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 signs with the test key from [README.md](README.md#development). - `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 92d8379..5ff6b30 100644 --- a/README.md +++ b/README.md @@ -35,16 +35,14 @@ 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: +Only CI has `mkosi.key`, so local builds sign with a test key: ```sh 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: +`mkosi.local.conf`: ```ini [Validation] From 00daa979502124d8f85b810d18e78871ec43200b Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 23 Nov 2026 18:28:04 +0000 Subject: [PATCH 7/9] 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 --- .gitignore | 1 - AGENTS.md | 2 +- README.md | 20 ++------------------ 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 7654f12..931bdcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ mkosi.key mkosi.output/ mkosi.cache/ -mkosi.local.conf diff --git a/AGENTS.md b/AGENTS.md index d3dc573..24da7e1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,6 +66,7 @@ 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 -f genkey # Run this once. Don't commit mkosi.crt. 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 \ @@ -73,7 +74,6 @@ podman exec -d -t mkosi sh -c 'mkosi -i -f \ 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/`. 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 5ff6b30..61685f0 100644 --- a/README.md +++ b/README.md @@ -35,27 +35,11 @@ itself up as at first boot. ## Development -Only CI has `mkosi.key`, so local builds sign with a test key: - ```sh -openssl req -new -x509 -newkey rsa:2048 -nodes -subj /CN=test \ - -keyout ~/test.key -out ~/test.crt +mkosi -f genkey # This replaces mkosi.crt for local tests. Don't commit it. +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_.raw`) and the UKI and /usr partitions that make up an update. From e39df872b3bd1a411745e7ce16c2a4bb4a25f8bf Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 23 Nov 2026 18:30:41 +0000 Subject: [PATCH 8/9] fix: check out with one git clone agentos is public, so the clone needs no token. The job image has git. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index 9f2e715..eaf700e 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -20,20 +20,12 @@ jobs: os: runs-on: linux permissions: - contents: read packages: write steps: - name: Install tools - run: dnf install -yq mkosi git-core - # gitea-runner 6 removed builtin:checkout. + run: dnf install -yq mkosi - 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 + run: git clone -q --depth 1 -b ${{ gitea.ref_name }} ${{ gitea.server_url }}/${{ gitea.repository }} . - name: Build env: KEY: ${{ secrets.SECUREBOOT_KEY }} From ac3df75728f336037f7dd5410b4724eee20cf836 Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 23 Nov 2026 18:32:37 +0000 Subject: [PATCH 9/9] fix: check out with actions/checkout The job image has Node.js 26, so the standard action works. Co-Authored-By: Claude Opus 5.5 --- .gitea/workflows/os.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/os.yml b/.gitea/workflows/os.yml index eaf700e..662dc60 100644 --- a/.gitea/workflows/os.yml +++ b/.gitea/workflows/os.yml @@ -20,12 +20,13 @@ jobs: os: runs-on: linux permissions: + contents: read packages: write steps: - name: Install tools run: dnf install -yq mkosi - name: Check out - run: git clone -q --depth 1 -b ${{ gitea.ref_name }} ${{ gitea.server_url }}/${{ gitea.repository }} . + uses: actions/checkout@v7 - name: Build env: KEY: ${{ secrets.SECUREBOOT_KEY }}