Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ jobs:
name: tools-${{ matrix.arch }}
path: mkosi.output/tools/${{ matrix.arch }}

- name: Restore tool binary permissions
run: |
# GitHub Actions artifact upload/download strips execute permissions.
# Restore +x on all tool binaries so they work inside the initramfs.
chmod +x mkosi.output/tools/${{ matrix.arch }}/usr/local/bin/*
chmod +x mkosi.output/tools/${{ matrix.arch }}/opt/cni/bin/*
Comment thread
jacobweinstock marked this conversation as resolved.

- name: Refresh apt cache
run: sudo apt-get update

Expand Down
4 changes: 1 addition & 3 deletions captain/cli/_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def _clean_version(cfg: Config, clog: StageLogger) -> None:
mkosi_output / "kernel" / kver / cfg.arch,
mkosi_output / "initramfs" / kver / cfg.arch,
mkosi_output / "iso" / kver / cfg.arch,
mkosi_output / "iso-staging" / kver / cfg.arch,
]

has_docker = shutil.which("docker") is not None
Expand Down Expand Up @@ -195,13 +194,12 @@ def _clean_all(cfg: Config, clog: StageLogger) -> None:
" /work/mkosi.output/kernel"
" /work/mkosi.output/tools"
" /work/mkosi.output/iso"
" /work/mkosi.output/iso-staging"
" /work/mkosi.cache",
Comment thread
jacobweinstock marked this conversation as resolved.
],
)
else:
# No Docker available — remove directly (may need sudo for root-owned mkosi files)
for pattern in ("image*", "initramfs", "kernel", "tools", "iso", "iso-staging"):
for pattern in ("image*", "initramfs", "kernel", "tools", "iso"):
for p in mkosi_output.glob(pattern):
Comment thread
jacobweinstock marked this conversation as resolved.
if p.is_dir():
shutil.rmtree(p, ignore_errors=True)
Expand Down
1 change: 0 additions & 1 deletion captain/cli/_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ def _build_iso_stage(cfg: Config) -> None:
isolog,
[
"/work/mkosi.output/iso",
"/work/mkosi.output/iso-staging",
"/work/out",
],
)
2 changes: 1 addition & 1 deletion captain/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@ def iso_output(self) -> Path:
@property
def iso_staging(self) -> Path:
"""Per-version, per-arch staging directory for assembling the ISO filesystem."""
return self.project_dir / "mkosi.output" / "iso-staging" / self.kernel_version / self.arch
return self.iso_output / "staging"
2 changes: 1 addition & 1 deletion captain/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def build(cfg: Config) -> None:

The ISO layout is::

iso-staging/{arch}/
iso/{version}/{arch}/staging/
├── boot/
│ ├── grub/
│ │ └── grub.cfg
Expand Down
12 changes: 12 additions & 0 deletions mkosi.finalize
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ if [[ -f "$BUILDROOT/init" ]]; then
echo " /init made executable"
fi

# Ensure tool binaries are executable.
# GitHub Actions artifact upload/download and some archive tools strip
# the execute bit. Re-apply +x to every tool directory so containerd,
# runc, nerdctl, and CNI plugins can actually run.
for dir in usr/local/bin opt/cni/bin; do
target="$BUILDROOT/$dir"
if [[ -d "$target" ]]; then
find "$target" -type f -exec chmod +x {} +
echo " +x restored on $dir/*"
fi
done

# ---------------------------------------------------------------------------
# Trim kernel modules not needed for provisioning.
# The kernel is built with a broad defconfig (modules as =m) so the full set
Expand Down