Skip to content

Commit deb7fa5

Browse files
committed
Improve and document local build workflow
1 parent 63237f6 commit deb7fa5

File tree

7 files changed

+56
-3
lines changed

7 files changed

+56
-3
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.cache
2+
/out
3+
/mkosi.tools
4+
/cosign
5+
/syft
6+
/syft*.tar.gz

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
build:
2+
mkosi
3+
4+
clean:
5+
rm -rf out
6+
7+
download:
8+
wget -O cosign-linux-amd64 https://github.com/sigstore/cosign/releases/download/v2.5.3/cosign-linux-amd64
9+
wget -O syft-linux-amd64.tar.gz https://github.com/anchore/syft/releases/download/v1.32.0/syft_1.32.0_linux_amd64.tar.gz
10+
11+
verify: SHA256SUMS
12+
sha256sum -c SHA256SUMS
13+
14+
syft:
15+
tar xzf syft-linux-amd64.tar.gz syft
16+
17+
cosign:
18+
mv cosign-linux-amd64 cosign
19+
20+
bootstrap: cosign syft
21+
SKIP_SYFT=1 mkosi
22+
23+
mkosi.tools:
24+
rm -rf mkosi.tools
25+
version="$$(mkosi summary --json | jq .Images[0].ImageVersion -r)"; mkdir mkosi.tools ; tar -xf out/mangos.tools_$${version}.tar.zst --zstd -C mkosi.tools
26+
27+
.PHONY: mkosi.tools

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,19 @@ mkosi uses a lot of different tools to do its job. By default
44
it will use the tools available on the host, but for a more
55
consistent build process, it's better to build a tools bundle
66
and use that instead.
7+
8+
## Build instructions
9+
10+
To build this locally, run:
11+
12+
```
13+
make download verify bootstrap mkosi.tools clean build mkosi.tools
14+
```
15+
16+
1. `make download`: Downloads cosign and syft
17+
2. `make verify`: Verifies cosign and syft against known checksums
18+
3. `make bootstrap`: Builds tools tarball in bootstrap mode
19+
4. `make mkosi.tools`: Extracts the built tools into mkosi.tools
20+
5. `make clean`: Cleans up the build artifacts
21+
6. `make build`: Performs a regular, full build
22+
7. `make mkosi.tools`: Replaces `mkosi.tools` from step 4 with the fully built version

SHA256SUMS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
783b5d6c74105401c63946c68d9b2a4e1aab3c8abce043e06b8510b02b623ec9 cosign-linux-amd64
2+
d6400b579fa84dd383573b1d1ff6f081a37fc64d3ffaafdfdda95c4325f204be syft-linux-amd64.tar.gz

mkosi.conf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Config]
2-
Profiles=debug,misc,package-manager,runtime
2+
Profiles=debug,misc,package-manager,runtime,cosign,syft
33

44
[Include]
55
Include=mkosi-tools
@@ -21,8 +21,6 @@ Distribution=ubuntu
2121
Release=noble
2222

2323
[Content]
24-
ExtraTrees=cosign:/usr/bin/cosign
25-
syft:/usr/bin/syft
2624
Packages=binutils
2725
wget
2826
unzip

mkosi.profiles/cosign/mkosi.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Content]
2+
ExtraTrees=%D/cosign:/usr/bin/cosign

mkosi.profiles/syft/mkosi.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Content]
2+
ExtraTrees=%D/syft:/usr/bin/syft

0 commit comments

Comments
 (0)