Skip to content

Commit ccda114

Browse files
committed
[TEST - REMOVE] Pack only one module for easier development
Signed-off-by: Alex Gonzalez <alexg@balena.io>
1 parent ca5614d commit ccda114

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

layers/meta-kernel-modules-block/recipes-core/images/balena-kernel-modules-block.bb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ remove_unnecessary_files() {
2323

2424
# Remove run directory
2525
rm -rf ${IMAGE_ROOTFS}/run
26+
27+
# DEBUG: Keep only a single harmless module (btrfs) to test overlay mechanism
28+
# This helps isolate whether boot failure is due to overlay or module contents
29+
modulesdir="${IMAGE_ROOTFS}/usr/lib/modules"
30+
if [ -d "${modulesdir}" ]; then
31+
# Find and keep only btrfs.ko (unlikely to auto-load, harmless)
32+
find "${modulesdir}" -name "*.ko*" ! -name "btrfs.ko*" -delete
33+
# Remove empty directories
34+
find "${modulesdir}" -type d -empty -delete
35+
# Regenerate modules.dep for the single module
36+
kernelver=$(ls "${modulesdir}" | head -1)
37+
if [ -n "${kernelver}" ]; then
38+
depmod -b "${IMAGE_ROOTFS}/usr" "${kernelver}" || true
39+
fi
40+
fi
2641
}
2742

2843
IMAGE_PREPROCESS_COMMAND += "remove_unnecessary_files;"

0 commit comments

Comments
 (0)