Skip to content
Merged
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
9 changes: 8 additions & 1 deletion mk/deps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@

ifeq ($(FORCE_LKL_BUILD),1)

$(LKL_LIB):
# Always re-invoke the build script so the sub-make inside it can detect
# source changes and perform an incremental rebuild of liblkl.a.
# The FORCE sentinel (a phony with no recipe) makes Make treat $(LKL_LIB)
# as always out of date, while the sub-make handles the actual incrementality.
.PHONY: _lkl_force
_lkl_force:

$(LKL_LIB): _lkl_force
@echo " BUILD lkl (from source)"
$(Q)./scripts/build-lkl.sh $(ARCH)

Expand Down
68 changes: 35 additions & 33 deletions scripts/build-lkl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,39 +84,41 @@ fi

# ---- Configure -----------------------------------------------------------

echo " CONFIG ARCH=lkl defconfig"
make -C "${LKL_SRC}" ARCH=lkl defconfig

# Enable features required by kbox (mirrors build-lkl.yml).
for opt in \
CONFIG_DEVTMPFS \
CONFIG_DEVTMPFS_MOUNT \
CONFIG_DEVPTS_FS \
CONFIG_DEBUG_INFO \
CONFIG_GDB_SCRIPTS \
CONFIG_SCHED_DEBUG \
CONFIG_PROC_SYSCTL \
CONFIG_PRINTK \
CONFIG_TRACEPOINTS \
CONFIG_FTRACE \
CONFIG_DEBUG_FS; do
"${LKL_SRC}/scripts/config" --file "${LKL_SRC}/.config" --enable "${opt}"
done

"${LKL_SRC}/scripts/config" --file "${LKL_SRC}/.config" \
--set-val CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT y

for opt in \
CONFIG_MODULES \
CONFIG_SOUND \
CONFIG_USB_SUPPORT \
CONFIG_INPUT \
CONFIG_NFS_FS \
CONFIG_CIFS; do
"${LKL_SRC}/scripts/config" --file "${LKL_SRC}/.config" --disable "${opt}"
done

make -C "${LKL_SRC}" ARCH=lkl olddefconfig
if [ ! -f "${LKL_SRC}/.config" ]; then
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 14, 2026

Choose a reason for hiding this comment

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

P2: Configuration enforcement now runs only on first-time setup, allowing stale or edited .config to bypass required kbox options on incremental builds.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/build-lkl.sh, line 87:

<comment>Configuration enforcement now runs only on first-time setup, allowing stale or edited `.config` to bypass required kbox options on incremental builds.</comment>

<file context>
@@ -84,39 +84,41 @@ fi
-done
-
-make -C "${LKL_SRC}" ARCH=lkl olddefconfig
+if [ ! -f "${LKL_SRC}/.config" ]; then
+    echo "  CONFIG  ARCH=lkl defconfig"
+    make -C "${LKL_SRC}" ARCH=lkl defconfig
</file context>
Fix with Cubic

echo " CONFIG ARCH=lkl defconfig"
make -C "${LKL_SRC}" ARCH=lkl defconfig

# Enable features required by kbox (mirrors build-lkl.yml).
for opt in \
CONFIG_DEVTMPFS \
CONFIG_DEVTMPFS_MOUNT \
CONFIG_DEVPTS_FS \
CONFIG_DEBUG_INFO \
CONFIG_GDB_SCRIPTS \
CONFIG_SCHED_DEBUG \
CONFIG_PROC_SYSCTL \
CONFIG_PRINTK \
CONFIG_TRACEPOINTS \
CONFIG_FTRACE \
CONFIG_DEBUG_FS; do
"${LKL_SRC}/scripts/config" --file "${LKL_SRC}/.config" --enable "${opt}"
done

"${LKL_SRC}/scripts/config" --file "${LKL_SRC}/.config" \
--set-val CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT y

for opt in \
CONFIG_MODULES \
CONFIG_SOUND \
CONFIG_USB_SUPPORT \
CONFIG_INPUT \
CONFIG_NFS_FS \
CONFIG_CIFS; do
"${LKL_SRC}/scripts/config" --file "${LKL_SRC}/.config" --disable "${opt}"
done

make -C "${LKL_SRC}" ARCH=lkl olddefconfig
fi

# ---- Build ---------------------------------------------------------------

Expand Down
Loading