Skip to content
Merged
Show file tree
Hide file tree
Changes from 134 commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
8ea8fa3
wip: gcp: echo gcloud commands for image creation
ilyaluk Oct 21, 2025
d441a5f
wip: use tdx-init dev branch, fix disk mount and support luks resize
ilyaluk Oct 21, 2025
92e4bc8
bob-l2: initial commit
ilyaluk Oct 1, 2025
095efe5
bob-l2: implement fetch-metadata service
ilyaluk Oct 23, 2025
78a0309
bob-l2: wip on firewall
ilyaluk Oct 28, 2025
ad0b911
bob-l2: metadata -> vault
ilyaluk Nov 3, 2025
7b4606e
fix p2p port
ilyaluk Nov 4, 2025
a0e711e
wip: other tx-init branch
ilyaluk Nov 13, 2025
2f22972
bob-common: bump tdx-init version
ilyaluk Nov 13, 2025
14fcc2e
bob-l1: include trixie-backports for rust 1.89
ilyaluk Nov 13, 2025
b21e753
bob-l1: bump lighthouse to 8.0.0
ilyaluk Nov 13, 2025
a6dd9b5
bob-l1: move readme, clarify image measurements
ilyaluk Nov 13, 2025
ef5dd27
Drop empty fluentbit filter events
alexhulbert Nov 25, 2025
2cf8e72
update commit
ilyaluk Nov 25, 2025
9a5ef12
Allow installing packages from debian backports
alexhulbert Nov 26, 2025
db80a99
Remove old static backports config and update archive timestamp
alexhulbert Nov 26, 2025
1ac8145
set image ids and versions
ilyaluk Nov 27, 2025
9780ccf
add unpack_image.sh script
ilyaluk Nov 27, 2025
b9b388d
Switch from fluent-build to custom log-delay code
alexhulbert Nov 28, 2025
89c4333
Simplify reproducible lighthouse v8 build process
alexhulbert Dec 1, 2025
d8b6fe0
Change commit hash length in filenames to 6 chars
alexhulbert Dec 1, 2025
d98c32c
Merge pull request #43 from flashbots/ilya/bob-l1-updates
alexhulbert Dec 1, 2025
2b44885
Support multiple copies of the repo on one machine
alexhulbert Dec 2, 2025
a66b144
Use /usr/bin/env bash rather than /bin/bash
ameba23 Dec 2, 2025
8422731
Add shell.nix file installing lima
ameba23 Dec 2, 2025
ae708f1
Fix unbound variable in build_rust_package
ilyaluk Dec 2, 2025
c9d9bd8
Fix delay-pipe commit
ilyaluk Dec 2, 2025
a1a8c35
Merge pull request #55 from flashbots/bob-custom-log-delay
alexhulbert Dec 3, 2025
f4cfb2b
Merge pull request #56 from flashbots/lighthouse-8-simplify
alexhulbert Dec 3, 2025
3c06fc0
Use default mirror uri, not empty file
alexhulbert Dec 3, 2025
af54462
Rm shell.nix following review
ameba23 Dec 3, 2025
ada5d23
Merge branch 'main' into dyn-backports-bob-l1
alexhulbert Dec 3, 2025
ba205c9
Merge pull request #51 from flashbots/dyn-backports-bob-l1
alexhulbert Dec 3, 2025
9943346
Merge pull request #59 from flashbots/peg/nixos-fixes
alexhulbert Dec 3, 2025
1118f75
Print warning if old VM is found
alexhulbert Dec 3, 2025
ca29892
Merge pull request #57 from flashbots/multi-lima
alexhulbert Dec 3, 2025
ef25ae4
Normalize u/o permissions to prevent umask issues
alexhulbert Dec 5, 2025
3196a41
Merge pull request #61 from flashbots/fix-umask-main
alexhulbert Dec 12, 2025
66c869a
Update docs
niccoloraspa Dec 30, 2025
c15f021
Merge pull request #66 from flashbots/feat/update-docs
niccoloraspa Dec 31, 2025
b8e6cc7
Fix logrotate issue
alexhulbert Jan 7, 2026
f1834be
Create symlinks to the latest built files in build/
alexhulbert Jan 7, 2026
56df867
Initial Bob GCP draft
alexhulbert Jan 8, 2026
2fe4b87
Merge pull request #68 from flashbots/fix-logrotate
niccoloraspa Jan 9, 2026
fb78032
Fix remaining gcp issues
alexhulbert Jan 12, 2026
7c1f85a
Add azure profile back in and update to latest dstack-mr-gcp
alexhulbert Jan 12, 2026
d77fd9c
Switch to normalized ubuntu kernel config
alexhulbert Jan 12, 2026
d83a4bb
Add reboot command via systemd
niccoloraspa Jan 13, 2026
9cc0a9e
Restore original base/debloat-systemd.sh
niccoloraspa Jan 13, 2026
edc913c
Rename file
niccoloraspa Jan 13, 2026
b18f197
Simplify reboot script
niccoloraspa Jan 13, 2026
544f391
Update 99-searcher
niccoloraspa Jan 13, 2026
3705752
Unmask additional services needed, add logs to reboot
niccoloraspa Jan 13, 2026
0e16130
Add ctrl-alt-del.target
niccoloraspa Jan 13, 2026
910a606
Don't send logs to file
niccoloraspa Jan 13, 2026
98b2c6e
Merge pull request #72 from flashbots/feat/add-reboot
niccoloraspa Jan 13, 2026
8d36cb8
chore: update the readme with the reboot feature (#73)
MoeMahhouk Jan 14, 2026
2da87b1
Force restart in maintenance mode
niccoloraspa Jan 15, 2026
21065f8
Move checks to reboot script
niccoloraspa Jan 15, 2026
ebe284a
Add check to prevent moving to production while reboot is in progress
niccoloraspa Jan 15, 2026
aa5f9a4
Add echo message when timer expires
niccoloraspa Jan 15, 2026
bb14c6a
Prettify output
niccoloraspa Jan 15, 2026
ffe1de2
Use shared lock
niccoloraspa Jan 16, 2026
d17ff97
Merge pull request #75 from flashbots/fix/reboot-command
niccoloraspa Jan 16, 2026
8bddead
Merge pull request #70 from flashbots/ah/bob-gcp
alexhulbert Jan 17, 2026
b1913ef
Merge pull request #69 from flashbots/ah/build-symlink
alexhulbert Jan 20, 2026
26a58f7
Merge branch 'main' into ilya/wip-l2-bob
alexhulbert Jan 20, 2026
bccec76
Remove test code from wip bob l2 branch
alexhulbert Jan 20, 2026
3200b5a
Fixes for fresh installs of this repo
alexhulbert Jan 20, 2026
2f06cd6
Defense in depth against systemd emergency mode
alexhulbert Jan 21, 2026
7c1608d
chore: update delay-pipe repo to use the log truncation fix (#80)
MoeMahhouk Jan 22, 2026
f79cf13
Configure tdx-init disk-glob via postinst scripts
alexhulbert Jan 22, 2026
b9173bd
Merge pull request #79 from flashbots/ah/emergency-conflict
alexhulbert Jan 23, 2026
87dc383
Merge pull request #81 from flashbots/ah/tdx-init-disk-glob
alexhulbert Jan 26, 2026
a992fa8
chore: extract common toggle logic for both l1 & l2
MoeMahhouk Jan 27, 2026
5291bf8
chore: fix bob-l2 image build
astarinmymind Jan 30, 2026
de16acd
aAdd build CI
niccoloraspa Jan 30, 2026
f645de6
fix permissions
niccoloraspa Jan 30, 2026
84f3a23
add new line
niccoloraspa Jan 30, 2026
60f4f65
Delete disk-glob
alexhulbert Jan 31, 2026
5d949a0
Merge pull request #89 from flashbots/moe/fix-image-build
alexhulbert Jan 31, 2026
1629e2d
Merge branch 'main' of github.com:flashbots/flashbots-images into ily…
alexhulbert Jan 31, 2026
c4e9e16
Switch to new tdx-init version and remove manual disk globs
alexhulbert Jan 31, 2026
c9a82a4
Remove redundant dns configuration
alexhulbert Jan 31, 2026
3975d82
Unify chrony into base branch (prefer gcp internal when available)
alexhulbert Jan 31, 2026
0d5110a
Clean up kernel snippets
alexhulbert Jan 31, 2026
20dcf43
chore: adjust firewall rules for the flashbox l2 image (#83)
MoeMahhouk Feb 2, 2026
01c7dc0
Merge remote-tracking branch 'origin/ilya/wip-l2-bob' into moe/refact…
MoeMahhouk Feb 2, 2026
cb7d99e
chore: refactoring and refinements
MoeMahhouk Feb 2, 2026
30511b5
Merge pull request #85 from flashbots/moe/refactor-toggle
alexhulbert Feb 2, 2026
f9958dc
Merge pull request #78 from flashbots/ah/setup-fixes
alexhulbert Feb 2, 2026
6a8bf4a
Better automatic handling of the flashbox-l2 qemu dev config
alexhulbert Feb 3, 2026
054adc1
move debian-archive-keyring to nix
niccoloraspa Feb 3, 2026
a4e815a
Revert "move debian-archive-keyring to nix"
niccoloraspa Feb 3, 2026
5b55c79
Remove always()
niccoloraspa Feb 3, 2026
5e3771f
Merge pull request #76 from flashbots/ilya/wip-l2-bob
alexhulbert Feb 4, 2026
5a0f6f5
feat: input only proxy integration (#88)
MoeMahhouk Feb 4, 2026
10c1d4f
Remove unused files
alexhulbert Feb 4, 2026
73884c6
Switch to more idiomatic mathod of enabling systemd services
alexhulbert Feb 5, 2026
4a5f9ba
Switch from mtools/etc to systemd-repart for cleaner GCP tar.gz creation
alexhulbert Feb 5, 2026
016926c
Merge branch 'main' of github.com:flashbots/flashbots-images into ah/…
alexhulbert Feb 5, 2026
15a1266
Simplify base module and networking configuration
alexhulbert Feb 6, 2026
9856bdf
Encrypt external DNS traffic / standardize Resolved/Networkd configur…
alexhulbert Feb 6, 2026
db7d94c
Fix lighthouse build cache issues
alexhulbert Feb 10, 2026
7fb00db
Update mkosi
alexhulbert Feb 12, 2026
cf40c33
Move base scripts to mkosi.*.d dirs
alexhulbert Feb 12, 2026
45a4c02
Merge pull request #94 from flashbots/ah/buildcache-fix
alexhulbert Feb 12, 2026
3b79677
refactor validate in python
niccoloraspa Feb 12, 2026
d3b1274
Merge pull request #90 from flashbots/feat/add-ci
niccoloraspa Feb 12, 2026
f28bb73
remove docker support
niccoloraspa Feb 12, 2026
8375721
Merge pull request #95 from flashbots/feat/remove-docker-support
niccoloraspa Feb 12, 2026
7d373b1
Remove hacky nix packages, update to latest mkosi
alexhulbert Feb 18, 2026
83a1456
Debian-archive-keyring is no longer needed from host
alexhulbert Feb 18, 2026
fe4af99
Compatibility with L2 branch build scripts
alexhulbert Feb 19, 2026
41a5042
Add folder for custom gitignored developer files
alexhulbert Feb 3, 2026
bf3ab5b
Add custom dev directory for postinst files using new glob exprs
alexhulbert Feb 20, 2026
51f1a42
Use systemd conditional param to remove need for if statement
alexhulbert Feb 20, 2026
87a71af
Backport misc. fixes from L2 branch
alexhulbert Feb 20, 2026
6e6806b
Update for compatibility with latest lima version
alexhulbert Feb 26, 2026
4c8ad8b
Fixes for mkosi unshare namespace and mount permissions
alexhulbert Feb 26, 2026
1f2f72f
Add ability to bypass lima and update readme to reflect changes
alexhulbert Feb 26, 2026
a61bdf1
Only start azure provisioning service once tpm is ready
alexhulbert Feb 26, 2026
2a715b5
Add set hostname scripts
alexhulbert Feb 26, 2026
a7cc705
Misc cleanup from the last few commits
alexhulbert Feb 26, 2026
8e502ad
Add build dir symlink logic back in
alexhulbert Feb 26, 2026
faa41e0
Fix issues with network configuration
alexhulbert Mar 2, 2026
f9c73b9
Review comments
alexhulbert Mar 3, 2026
00a9f53
Simplify network config to use DHCP-provided DNS for internal domains
alexhulbert Mar 3, 2026
d4d2ed8
Authenticate NTP traffic but refine with hypervisor
alexhulbert Mar 6, 2026
f4e220a
Allow encrypted NTP traffic thru firewall
alexhulbert Mar 6, 2026
f5f5779
Remove systemd-tmpfiles from debloat script
alexhulbert Mar 6, 2026
cb04ff8
Merge branch 'main' of github.com:flashbots/flashbots-images into ah/…
alexhulbert Mar 6, 2026
41c565b
chore: update simmulator rpc and ws ports (#103)
MoeMahhouk Mar 6, 2026
88a572d
Merge pull request #92 from flashbots/ah/merge-prepare
alexhulbert Mar 6, 2026
7612235
feat: add top level if/else
fkondej Feb 13, 2026
d8ceeab
feat: move KERNEL_VERSION_DEBIAN into mkosi.conf
fkondej Feb 13, 2026
8b5cc59
feat: refactor kernel snippet collection into shared array
fkondej Feb 16, 2026
2510bd7
feat: add patch paths collection and include patch contents in cache key
fkondej Feb 16, 2026
f264f5b
feat: add reusable apply patches
fkondej Feb 16, 2026
8ce6810
feat: calculate cache hash and pull base kernel from debian source
fkondej Feb 16, 2026
6c74625
feat: build kernel from debian source
fkondej Feb 16, 2026
20dd3a3
feat: use debian kernel for buildernet VM and improvements to build s…
fkondej Feb 17, 2026
2a1e37a
chore: add indentation in GitHub path of kernel build script
fkondej Feb 17, 2026
fa34f26
chore: cleanup
fkondej Feb 17, 2026
daba3c7
feat: use Debian kernel source only
fkondej Feb 19, 2026
3df08e0
feat: remove inlined CONFIG_MODULES from build script
fkondej Feb 19, 2026
3ea8a9a
feat: add FLAVOR to kernel version and include LOCALVERSION in cache …
fkondej Feb 19, 2026
e681434
feat: build and install kernel as .deb package
fkondej Feb 19, 2026
c8df620
feat: kernel: auto-discover config fragments and patches from directo…
fkondej Feb 20, 2026
302a9a6
chore: remove unused ubuntu.config kernel config snippet
fkondej Feb 20, 2026
e62f51d
chore: address several PR review comments
fkondej Mar 4, 2026
4ac5c79
re-add python3
fkondej Mar 5, 2026
24eb27d
feat: upgrade kernel to 6.18 LTS, move Mirror to per-image configs
fkondej Mar 6, 2026
a0f78df
fix: pick non dbg .deb
fkondej Mar 6, 2026
832bb7e
feat: use correct DEB_BUILD_PROFILES for make bindeb-pkg
fkondej Mar 6, 2026
8e563aa
feat: fail on duplicate kernel config fragment filename
fkondej Mar 6, 2026
bd02658
feat: user FLAVOR var instead of hardcoded cloud
fkondej Mar 6, 2026
51ec522
feat: read Mirror and Release from mkosi config
fkondej Mar 6, 2026
66750c5
chore: move buildernet kernel config fragments to shared kernel/confi…
fkondej Mar 6, 2026
71e5928
use snapshot in kernel cache hash
fkondej Mar 9, 2026
38830c2
feat: move kernel build script to mkosi.build.d dir
fkondej Mar 9, 2026
41da963
Bump lighthouse version to 8.1.2
pablin-10 Mar 9, 2026
cdabff6
Adjust cargo build profile after lighthouse "reproducible" profile de…
pablin-10 Mar 9, 2026
e45c4ec
Using filling SOURCE_DATE_EPOCH to avoid potential non-determinism
pablin-10 Mar 9, 2026
6baee6c
feat: set BuildScripts to glob
fkondej Mar 10, 2026
427f4f3
feat: build kernel in kernel-build/ subdir to isolate artifacts
fkondej Mar 10, 2026
0db7c99
feat: internalize kernel FLAVOR and LOCALVERSION env vars
fkondej Mar 10, 2026
555bf10
feat: simplify kernel cashe hash logic
fkondej Mar 10, 2026
f50737a
feat: use nullglob in kernel build script
fkondej Mar 10, 2026
6c876e3
fix: set default file to latest.efi
0x416e746f6e Mar 11, 2026
e2579e0
Update GCP measurements export command in Makefile
niccoloraspa Mar 11, 2026
1849000
Merge pull request #109 from flashbots/fix/use-default-file
0x416e746f6e Mar 11, 2026
e16af8c
Merge pull request #106 from flashbots/bump_lighthouse_to_8_1_2
niccoloraspa Mar 11, 2026
8e0c26b
Merge pull request #97 from flashbots/fryd/kernel-debian-source
alexhulbert Mar 12, 2026
1396afd
Directory Restructure
alexhulbert Mar 12, 2026
f0219c6
Merge pull request #113 from flashbots/ah/restructure
alexhulbert Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

130 changes: 130 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# GitHub Actions workflow for building mkosi images using Nix.
#
# Triggers on:
# - Pushes to main branch: Builds all images (bob-l1, bob-l2) in parallel
#
# - Manual dispatch: Allows specifying:
# - Branch to build from (default: main)
# - Images to build (default: bob-l1)
# - "all" → builds bob-l1 and bob-l2
# - "bob-l1" → builds only bob-l1
# - "bob-l2" → builds only bob-l2
# - "bob-l1,bob-l2" → builds both

name: Build mkosi images

on:
push:
branches:
- main
workflow_dispatch:
inputs:
branch:
description: 'Branch to build'
required: false
default: 'main'
type: string
images:
description: 'Images to build (comma-separated: bob-l1,bob-l2 or "all")'
required: false
default: 'bob-l1'
type: string

jobs:
validate:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Validate images
id: set-matrix
shell: python3 {0}
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_IMAGES: ${{ inputs.images }}
run: |
import json
import os
import sys

VALID_IMAGES = ["bob-l1", "bob-l2"]

event = os.environ["EVENT_NAME"]
requested = os.environ.get("INPUT_IMAGES", "all").strip()

if event == "workflow_dispatch" and requested != "all":
images = [img.strip() for img in requested.split(",") if img.strip()]
invalid = [img for img in images if img not in VALID_IMAGES]

if invalid:
print(f"❌ Error: Invalid image(s): {', '.join(invalid)}")
print(f"Valid images are: {', '.join(VALID_IMAGES)}")
sys.exit(1)
else:
images = VALID_IMAGES

matrix = json.dumps(images)
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"matrix={matrix}\n")

print(f"✓ Building images: {matrix}")

build:
needs: validate
strategy:
fail-fast: false
matrix:
image: ${{ fromJSON(needs.validate.outputs.matrix) }}

name: build ${{ matrix.image }} image
runs-on: warp-ubuntu-latest-x64-32x
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.branch || github.ref }}

- name: Install tools
run: |
sudo apt-get update && sudo apt-get install -y debian-archive-keyring

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
experimental-features = nix-command flakes

- name: Enable user namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Build ${{ matrix.image }} image
run: |
umask 022
nix develop --command mkosi --force -I ${{ matrix.image }}.conf --image-id=${{ matrix.image }}

- name: Fix permissions
run: |
sudo chown -R $(id -u):$(id -g) build/

- name: Show build artifacts
run: |
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📦 Image: ${{ matrix.image }}"
echo "🔖 Commit: ${{ github.sha }}"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

if [ -d "build" ]; then
echo ""
# Show only filename and size for matching files
ls -lh build/ | grep -E "${{ matrix.image }}" | awk '{print $9, "(" $5 ")"}'
else
echo "⚠️ Build directory not found"
fi

- name: Generate SHA256 checksums
run: |
cd build/
TIMESTAMP=$(git show -s --format=%ct HEAD)
SHORT_SHA="${GITHUB_SHA::8}"
CHECKSUM_FILE="${{ matrix.image }}_${TIMESTAMP}_${SHORT_SHA}.sha256"
sha256sum ${{ matrix.image }}_* > "$CHECKSUM_FILE"
cat "$CHECKSUM_FILE"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
build.*/
mkosi/
env.json
mkosi.packages/
Expand All @@ -8,4 +9,7 @@ mkosi.builddir/
.claudesync/
.claudeignore
tmp/
.temp
NvVars
.vscode
.bypass-lima
55 changes: 35 additions & 20 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This comprehensive guide covers everything you need to know about developing wit
- [Freezing to Debian Archive Snapshots](#freezing-to-debian-archive-snapshots)
- [Testing for Reproducibility](#testing-for-reproducibility)
- [Creating Debian Packages](#creating-debian-packages)
- [Custom Developer Files](#custom-developer-files)
- [Debugging and Troubleshooting](#debugging-and-troubleshooting)

## Project Structure
Expand All @@ -27,6 +28,7 @@ flashboxes/
│ └── debloat*.sh # System cleanup scripts
├── bob-common/ # TEE Searcher common image
├── bob-l1/ # L1 TEE Searcher sandbox image
├── bob-l2/ # L2 TEE Searcher sandbox image
├── buildernet/ # BuilderNet
├── tdx-dummy/ # TDX test environment
├── kernel/ # Kernel configuration
Expand Down Expand Up @@ -275,8 +277,8 @@ systemd services are the primary way to run applications in Flashboxes. Here's h
```ini
[Unit]
Description=My Application
After=network.target network-setup.service
Requires=network-setup.service
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
Expand Down Expand Up @@ -353,8 +355,8 @@ Conflicts=apache2.service
```ini
[Unit]
# Network is available
After=network.target network-setup.service
Requires=network-setup.service
After=network-online.target
Wants=network-online.target

# Persistent storage is mounted
After=persistent-mount.service
Expand All @@ -364,24 +366,14 @@ Requires=persistent-mount.service
After=basic.target
```

### Enabling Services
### Enabling Packaged Services

**In `mkosi.postinst` script**:
```bash
#!/bin/bash
set -euxo pipefail

# Enable service
mkosi-chroot systemctl enable myapp.service
To enable a service installed with a Debian package, add the following to your `mkosi.postinst` script:

# Create symlink for minimal.target
mkdir -p "$BUILDROOT/etc/systemd/system/minimal.target.wants"
ln -sf "/etc/systemd/system/myapp.service" \
"$BUILDROOT/etc/systemd/system/minimal.target.wants/"
```bash
mkosi-chroot systemctl add-wants minimal.target myapp.service
```

For comprehensive systemd options, see: [systemd Service Documentation](https://www.freedesktop.org/software/systemd/man/systemd.service.html)

## Extending Built-in systemd Services

Sometimes you need to modify existing systemd services rather than creating new ones.
Expand Down Expand Up @@ -542,8 +534,7 @@ chown myapp:myapp /etc/myapp/config.conf
chmod 600 /etc/myapp/config.conf

# Enable systemd service
systemctl enable myapp.service || true
systemctl start myapp.service || true
mkosi-chroot systemctl add-wants minimal.target myapp.service || true

exit 0
```
Expand Down Expand Up @@ -635,6 +626,30 @@ For systems without systemd v250+ or where Nix installation isn't feasible, you
> Replace "btrfs" with your chosen storage driver
5. Run the desired `mkosi` command inside the shell Podman environment

## Custom Developer Files

When building with the `devtools` profile, you can add your own custom files to the image without committing them to git. This is useful for adding personal SSH keys, configuration files, or debugging tools during development.

### Adding Custom Files

Place files in `mkosi.profiles/devtools/custom/` mirroring the filesystem structure you want:

```bash
# Add your SSH authorized keys
mkdir -p mkosi.profiles/devtools/custom/root/.ssh
cp ~/.ssh/id_rsa.pub mkosi.profiles/devtools/custom/root/.ssh/authorized_keys

# Add a custom configuration file
mkdir -p mkosi.profiles/devtools/custom/etc
echo "my_setting=value" > mkosi.profiles/devtools/custom/etc/myconfig.conf

# Add a debugging script
mkdir -p mkosi.profiles/devtools/custom/usr/local/bin
cp my-debug-script.sh mkosi.profiles/devtools/custom/usr/local/bin/
```

Files placed here will be copied into the image (like any other `ExtraTrees` directory) but will be ignored by git, so they won't be accidentally committed.

## Debugging and Troubleshooting

### mkosi Debugging
Expand Down
22 changes: 0 additions & 22 deletions Dockerfile

This file was deleted.

39 changes: 15 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DEFAULT_GOAL := help

VERSION := $(shell git describe --tags --always --dirty="-dev")
SHELL := /bin/bash
SHELL := /usr/bin/env bash
WRAPPER := scripts/env_wrapper.sh

##@ Help
Expand All @@ -24,50 +24,41 @@ ifndef IMAGE
$(error IMAGE is not set. Please specify IMAGE=<image> when running make build or make build-dev)
endif

.PHONY: all build build-dev setup measure clean check-perms check-module
.PHONY: all build build-dev setup measure clean check-module

# Default target
all: build

# Ensure repo was cloned with correct permissions
check-perms: ## Check repository permissions
@scripts/check_perms.sh

# Setup dependencies (Linux only)
setup: ## Install dependencies (Linux only)
@scripts/setup_deps.sh

# Build module
build: check-perms setup ## Build the specified module
$(WRAPPER) mkosi --force -I $(IMAGE).conf
build: setup ## Build the specified module
$(WRAPPER) mkosi --force --image-id $(IMAGE) --include=$(IMAGE).conf

# Build module with devtools profile
build-dev: check-perms setup ## Build module with development tools
$(WRAPPER) mkosi --force --profile=devtools -I $(IMAGE).conf
build-dev: setup ## Build module with development tools
$(WRAPPER) mkosi --force --image-id $(IMAGE)-dev --profile=devtools --include=$(IMAGE).conf

##@ Utilities

measure: ## Export TDX measurements for the built EFI file
@if [ ! -f build/tdx-debian.efi ]; then \
echo "Error: build/tdx-debian.efi not found. Run 'make build' first."; \
exit 1; \
fi
@$(WRAPPER) measured-boot build/tdx-debian.efi build/measurements.json --direct-uki
@$(WRAPPER) measured-boot $(FILE) build/measurements.json --direct-uki
echo "Measurements exported to build/measurements.json"

measure-gcp: ## Export TDX measurements for GCP
@if [ ! -f build/tdx-debian.efi ]; then \
echo "Error: build/tdx-debian.efi not found. Run 'make build' first."; \
exit 1; \
fi
@$(WRAPPER) dstack-mr -uki build/tdx-debian.efi -json > build/gcp_measurements.json
@$(WRAPPER) dstack-mr -uki $(FILE) -json > build/gcp_measurements.json
echo "GCP Measurements exported to build/gcp_measurements.json"

# Clean build artifacts
clean: ## Remove cache and build artifacts
rm -rf build/ mkosi.builddir/ mkosi.cache/ lima-nix/
@if command -v limactl >/dev/null 2>&1 && limactl list | grep -q '^tee-builder'; then \
echo "Stopping and deleting lima VM 'tee-builder'..."; \
limactl stop tee-builder || true; \
limactl delete tee-builder || true; \
@REPO_DIR="$$(pwd)"; \
REPO_HASH="$$(echo -n "$$REPO_DIR" | sha256sum | cut -c1-8)"; \
LIMA_VM="tee-builder-$$REPO_HASH"; \
if command -v limactl >/dev/null 2>&1 && limactl list | grep -q "^$$LIMA_VM"; then \
echo "Stopping and deleting Lima VM '$$LIMA_VM'..."; \
limactl stop "$$LIMA_VM" || true; \
limactl delete "$$LIMA_VM" || true; \
fi
Loading