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