Enhance build script to enforce BusyBox shared library profile and conditionally strip binaries. Added warnings for missing config script and updated output messages for built binaries.

This commit is contained in:
2026-04-07 11:05:16 +03:00
parent 4f93c26450
commit 1d17d11a5d

View File

@@ -62,6 +62,19 @@ if [ ! -f ".config" ]; then
make defconfig make defconfig
fi fi
# Force BusyBox shared library build profile.
if [ -x "./scripts/config" ]; then
./scripts/config \
-e BUILD_LIBBUSYBOX \
-e FEATURE_SHARED_BUSYBOX \
-e FEATURE_INDIVIDUAL \
-d STATIC \
-d PIE \
-d FEATURE_LIBBUSYBOX_STATIC
else
echo "WARNING: scripts/config not found; shared library profile not enforced." >&2
fi
make oldconfig make oldconfig
make -j"${JOBS}" \ make -j"${JOBS}" \
CROSS_COMPILE="${TOOLCHAIN_PREFIX}-" \ CROSS_COMPILE="${TOOLCHAIN_PREFIX}-" \
@@ -71,8 +84,14 @@ make -j"${JOBS}" \
EXTRA_LDFLAGS="--sysroot=${SYSROOT}" EXTRA_LDFLAGS="--sysroot=${SYSROOT}"
make CONFIG_PREFIX="${INSTALL_DIR}" install make CONFIG_PREFIX="${INSTALL_DIR}" install
if [ -f "busybox" ]; then
"${STRIP_BIN}" busybox "${STRIP_BIN}" busybox
fi
if [ -f "libbusybox.so" ]; then
"${STRIP_BIN}" libbusybox.so
fi
echo "Build completed successfully." echo "Build completed successfully."
echo "Binary: ${BUSYBOX_DIR}/busybox" echo "Binary: ${BUSYBOX_DIR}/busybox"
echo "Shared library: ${BUSYBOX_DIR}/libbusybox.so"
echo "Installed to: ${INSTALL_DIR}" echo "Installed to: ${INSTALL_DIR}"