File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
layers/meta-kernel-modules-block/recipes-core/images Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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
2843IMAGE_PREPROCESS_COMMAND += "remove_unnecessary_files;"
You can’t perform that action at this time.
0 commit comments