Skip to content

Commit 709bc44

Browse files
committed
fix(vm): fix CI kernel build failures
- Add cpio to build dependencies (required by CONFIG_IKHEADERS) - Disable CONFIG_IKHEADERS in kconfig fragment (not needed in VM) - Add pip fallback for pyelftools when apt package isn't importable - Add python3-pip to apt dependencies
1 parent 44f67ac commit 709bc44

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

crates/openshell-vm/runtime/kernel/openshell.kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ CONFIG_CGROUP_CPUACCT=y
116116
CONFIG_CGROUP_PIDS=y
117117
CONFIG_MEMCG=y
118118

119+
# ── Disable kernel headers archive (avoids cpio issues in CI) ──────────
120+
# CONFIG_IKHEADERS is not set
121+
119122
# ── Security features required by the sandbox runtime ───────────────────
120123
CONFIG_SECURITY_LANDLOCK=y
121124
CONFIG_SECCOMP_FILTER=y

tasks/scripts/vm/build-libkrun.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ install_deps() {
6666

6767
if command -v apt-get &>/dev/null; then
6868
# Debian/Ubuntu
69-
DEPS="build-essential git python3 python3-pyelftools flex bison libelf-dev libssl-dev bc curl libclang-dev"
69+
DEPS="build-essential git python3 python3-pip python3-pyelftools flex bison libelf-dev libssl-dev bc curl libclang-dev cpio"
7070
MISSING=""
7171
for dep in $DEPS; do
7272
if ! dpkg -s "$dep" &>/dev/null; then
@@ -83,14 +83,22 @@ install_deps() {
8383

8484
elif command -v dnf &>/dev/null; then
8585
# Fedora/RHEL
86-
DEPS="make git python3 python3-pyelftools gcc flex bison elfutils-libelf-devel openssl-devel bc glibc-static curl clang-devel"
86+
DEPS="make git python3 python3-pyelftools gcc flex bison elfutils-libelf-devel openssl-devel bc glibc-static curl clang-devel cpio"
8787
echo " Installing dependencies via dnf..."
8888
$SUDO dnf install -y $DEPS
8989

9090
else
9191
echo "Warning: Unknown package manager. Please install manually:" >&2
9292
echo " build-essential git python3 python3-pyelftools flex bison" >&2
93-
echo " libelf-dev libssl-dev bc curl" >&2
93+
echo " libelf-dev libssl-dev bc curl cpio" >&2
94+
fi
95+
96+
# Ensure pyelftools is importable by the Python that will run bin2cbundle.py.
97+
# The apt package may install to a different Python than the default python3.
98+
if ! python3 -c "import elftools" &>/dev/null; then
99+
echo " pyelftools not importable, installing via pip..."
100+
python3 -m pip install --break-system-packages pyelftools 2>/dev/null || \
101+
python3 -m pip install pyelftools || true
94102
fi
95103
}
96104

0 commit comments

Comments
 (0)