Skip to content

Commit 14f2251

Browse files
authored
Strip modules (#117)
1 parent 550fe88 commit 14f2251

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

hack/build/build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ rm -rf "${ADDONS_OUTPUT_PATH}"
1515
rm -rf "${ADDONS_SQUASHFS_PATH}"
1616
rm -rf "${METADATA_PATH}"
1717

18-
make -C "${KERNEL_OBJ}" ARCH="${TARGET_ARCH_KERNEL}" -j"${KERNEL_BUILD_JOBS}" "${CROSS_COMPILE_MAKE}" INSTALL_MOD_PATH="${MODULES_INSTALL_PATH}" modules_install
18+
make -C "${KERNEL_OBJ}" ARCH="${TARGET_ARCH_KERNEL}" -j"${KERNEL_BUILD_JOBS}" "${CROSS_COMPILE_MAKE}" INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH="${MODULES_INSTALL_PATH}" modules_install
1919
KERNEL_MODULES_VER="$(ls "${MODULES_INSTALL_PATH}/lib/modules")"
2020

2121
mkdir -p "${ADDONS_OUTPUT_PATH}"
@@ -34,6 +34,16 @@ mksquashfs "${ADDONS_OUTPUT_PATH}" "${ADDONS_SQUASHFS_PATH}" -all-root
3434

3535
SQUASH_SIZE=$(stat -c %s "${ADDONS_SQUASHFS_PATH}")
3636

37+
# Host kernel size matters less, but we still don't want it to massively balloon all of a sudden.
38+
case "$KERNEL_FLAVOR" in
39+
host*)
40+
if [ "${SQUASH_SIZE}" -gt 419430400 ]; then
41+
echo "ERROR: squashfs is >400MB in size (${SQUASH_SIZE} bytes) which is undesirable for the 'host' kernel, validate kconfig options!" >&2
42+
exit 1
43+
fi
44+
;;
45+
esac
46+
3747
# Generally we want to keep zone kernels small, because large kernels -> longer pull times -> increased zone cold boot times.
3848
# We don't really care how big the host kernel is.
3949
# Nvidia kernels have chonker firmwares, even compressed (like 200MB total size), so not much we can really do there.

0 commit comments

Comments
 (0)