Skip to content
Draft
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
2 changes: 1 addition & 1 deletion images/flashbox-l1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Include=modules/flashbox/observability/mkosi.conf
Profiles=azure,gcp

[Distribution]
Snapshot=20260430T025253Z
Snapshot=20260728T082537Z
2 changes: 1 addition & 1 deletion images/flashbox-l2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Include=modules/flashbox/flashbox-l2/mkosi.conf
Profiles=gcp

[Distribution]
Snapshot=20260430T025253Z
Snapshot=20260728T082537Z
2 changes: 1 addition & 1 deletion images/l2-op-rbuilder-bproxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Profiles=gcp

[Distribution]
Snapshot=20260430T025253Z
Snapshot=20260728T082537Z

[Include]
Include=shared/mkosi.conf
Expand Down
2 changes: 1 addition & 1 deletion images/l2-op-rbuilder.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Profiles=gcp

[Distribution]
Snapshot=20260430T025253Z
Snapshot=20260728T082537Z

[Include]
Include=shared/mkosi.conf
Expand Down
2 changes: 1 addition & 1 deletion images/l2-simulator.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Profiles=gcp

[Distribution]
Snapshot=20260430T025253Z
Snapshot=20260728T082537Z

[Include]
Include=shared/mkosi.conf
Expand Down
5 changes: 5 additions & 0 deletions shared/mkosi.apt.conf

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for a different issue emerged while building the image locally freezing at random times during the process. This fixed it

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Trim apt download volume and tolerate transient failures — index fetches
# go through lima's user-mode network and are written to mkosi.cache over
# the reverse-sshfs mount, so every megabyte counts.
Acquire::Languages "none";
Acquire::Retries "3";
12 changes: 9 additions & 3 deletions shared/mkosi.build.d/10-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ set -euxo pipefail
shopt -s inherit_errexit # propagate errexit to $() subshells
shopt -s nullglob # non-matching globs expand to nothing

# KERNEL_VERSION must be set (Debian major.minor, e.g. "6.16").
# KERNEL_VERSION must be set (Debian major.minor, e.g. "7.1").
# Must match a linux-source package available in the pinned snapshot mirror.
# KERNEL_APT_SUITE selects the suite the package is installed from
# (default: <release>-backports; set to "sid" when the wanted point release
# has not been built for backports yet).
if [[ -z "${KERNEL_VERSION:-}" ]]; then
echo "ERROR: KERNEL_VERSION is not set. Set it in mkosi.conf Environment= (e.g. KERNEL_VERSION=6.16)" >&2
echo "ERROR: KERNEL_VERSION is not set. Set it in mkosi.conf Environment= (e.g. KERNEL_VERSION=7.1)" >&2
exit 1
fi

# Read distribution info from mkosi config JSON
snapshot=$(jq -r '.Snapshot' "$MKOSI_CONFIG")
release=$(jq -re '.Release' "$MKOSI_CONFIG")
kernel_suite="${KERNEL_APT_SUITE:-${release}-backports}"
echo "Snapshot: $snapshot"
echo "Release: $release"
echo "Kernel apt suite: $kernel_suite"

# Auto-discover config fragments from registered directories
# KERNEL_CONFIG_SNIPPETS is processed first, then KERNEL_CONFIG_SNIPPETS_* in alphabetical order
Expand Down Expand Up @@ -45,6 +50,7 @@ cache_hash=$(
{ echo "KERNEL_VERSION=${KERNEL_VERSION}"; \
echo "LOCALVERSION=${LOCALVERSION}"; \
echo "SNAPSHOT=${snapshot}"; \
echo "SUITE=${kernel_suite}"; \
cat -- "${config_paths[@]}" "${patch_paths[@]}"; } \
| sha256sum | cut -d' ' -f1 | cut -c1-12
)
Expand Down Expand Up @@ -73,7 +79,7 @@ else
kernel_src_dir="${BUILDROOT}${chroot_kernel_src_dir}"
kconfig_dir="${BUILDROOT}${chroot_kconfig_dir}"

apt-get -y install "linux-source-${KERNEL_VERSION}/${release}-backports" --install-recommends
apt-get -y install "linux-source-${KERNEL_VERSION}/${kernel_suite}" --install-recommends

source_tarball="${BUILDROOT}/usr/src/linux-source-${KERNEL_VERSION}.tar.xz"
if [[ ! -f "${source_tarball}" ]]; then
Expand Down
5 changes: 4 additions & 1 deletion shared/mkosi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ Release=trixie
[Build]
PackageCacheDirectory=mkosi.cache
SandboxTrees=mkosi.builddir/mkosi.sources:/etc/apt/sources.list.d/mkosi.sources
Environment=KERNEL_VERSION=6.19
shared/mkosi.pref:/etc/apt/preferences.d/mkosi.pref
shared/mkosi.apt.conf:/etc/apt/apt.conf.d/99mkosi.conf
Environment=KERNEL_VERSION=7.1
KERNEL_APT_SUITE=sid
KERNEL_CONFIG_SNIPPETS=shared/kernel/config.d
KERNEL_PATCHES=shared/kernel/patches
WithNetwork=true
Expand Down
6 changes: 6 additions & 0 deletions shared/mkosi.pref
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Pin sid below the release suites so it is never used for dependency
# resolution unless a package is explicitly requested from it
# (e.g. linux-source via KERNEL_APT_SUITE=sid in 10-kernel.sh).
Package: *
Pin: release n=sid
Pin-Priority: 100
8 changes: 8 additions & 0 deletions shared/mkosi.sync.d/10-setup-apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ URIs: $MIRROR
Suites: ${RELEASE} ${RELEASE}-backports
Components: main
Trusted: yes

# deb only (no deb-src): sid is used solely to fetch the linux-source
# binary package, and its Sources index alone is ~12 MB per apt update.
Types: deb
URIs: $MIRROR
Suites: sid
Components: main
Trusted: yes
EOF