From c101b68416e398f9bcdf1afb75c2e8ab610d24bc Mon Sep 17 00:00:00 2001 From: AI Dev Date: Sun, 27 Sep 2026 05:58:13 +0000 Subject: [PATCH] rootfs: drop the kmod-only module indexes when there is no kmod master's hi3516cv6xx_lite rootfs is 5124KB of a 5120KB cap (nightly run 36259587684, and every PR since). depmod writes a binary index beside every text one (modules.*.bin) plus modules.builtin.modinfo, all for kmod. Every board here runs busybox modprobe, which reads modules.dep, modules.alias, modules.symbols and modules.builtin as text and never opens the rest, and no defconfig selects kmod. rootfs_script.sh now removes them when the image has no kmod binary. On the published 2026-09-25 hi3516cv6xx lite image (libatomic already removed, as #2480 does; rebuilt xz/1M/bcj as the build does) that is 52KB uncompressed and 12,228 bytes of squashfs against a 4KB overrun. Every other board that ships modules shrinks too. On a lab hi3516dv100, with a copy of /lib/modules/$(uname -r) minus these files bind-mounted over the real one: `rmmod vfat fat; modprobe vfat` loads both, so dependencies resolve from the text modules.dep; and a full load_hisilicon -r / -i cycle loads all 30 modules and the streamer starts. --- general/scripts/rootfs_script.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/general/scripts/rootfs_script.sh b/general/scripts/rootfs_script.sh index d99501e51..3a90465e3 100755 --- a/general/scripts/rootfs_script.sh +++ b/general/scripts/rootfs_script.sh @@ -35,6 +35,15 @@ if grep -q "USES_MUSL=y" ${BR2_CONFIG}; then done fi +# depmod writes a binary index beside every text one, plus +# modules.builtin.modinfo, for kmod. Every board here runs busybox modprobe, +# which reads modules.dep, modules.alias, modules.symbols and modules.builtin as +# text and never opens the rest: 52KB on hi3516cv6xx, 12KB of squashfs, enough +# to bring its lite board back under the cap. Kept wherever kmod is installed. +if [ -z "$(find ${TARGET_DIR}/bin ${TARGET_DIR}/sbin ${TARGET_DIR}/usr/bin ${TARGET_DIR}/usr/sbin -name kmod -type f 2>/dev/null)" ]; then + rm -f ${TARGET_DIR}/lib/modules/*/modules.*.bin ${TARGET_DIR}/lib/modules/*/modules.builtin.modinfo +fi + LIST="${BR2_EXTERNAL_GENERAL_PATH}/scripts/excludes/${OPENIPC_SOC_MODEL}_${OPENIPC_VARIANT}.list" if [ -f "${LIST}" ]; then # These lists name files by hand, so they go stale in one direction without