Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 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 Down Expand Up @@ -635,6 +636,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
4 changes: 4 additions & 0 deletions mkosi.profiles/devtools/custom/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory except .gitkeep and .gitignore
*
!.gitkeep
!.gitignore
Empty file.
1 change: 1 addition & 0 deletions mkosi.profiles/devtools/mkosi.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Content]
ExtraTrees=mkosi.extra
custom

Packages=adjtimex
apt
Expand Down
3 changes: 3 additions & 0 deletions mkosi.profiles/devtools/mkosi.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ HASH=$(mkosi-chroot openssl passwd -6 -salt salt "$PASSWORD")
mkosi-chroot passwd -u root
mkosi-chroot usermod -p "$HASH" root

# Remove git files in custom/ folder
mkosi-chroot rm /.gitignore /.gitkeep || true

if [ -f "$BUILDROOT/etc/default/dropbear" ]; then
# Remove -s, -w, -g flags from dropbear args
sed -i '/^DROPBEAR_EXTRA_ARGS=/s/-[swg] \?//g' "$BUILDROOT/etc/default/dropbear"
Expand Down