From 1d17d11a5dd97235c64400f5616f67af1dfd43d2 Mon Sep 17 00:00:00 2001 From: Egor Tsyganchuk Date: Tue, 7 Apr 2026 11:05:16 +0300 Subject: [PATCH] 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. --- build.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 4bf5418..b389e2b 100755 --- a/build.sh +++ b/build.sh @@ -62,6 +62,19 @@ if [ ! -f ".config" ]; then make defconfig 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 -j"${JOBS}" \ CROSS_COMPILE="${TOOLCHAIN_PREFIX}-" \ @@ -71,8 +84,14 @@ make -j"${JOBS}" \ EXTRA_LDFLAGS="--sysroot=${SYSROOT}" make CONFIG_PREFIX="${INSTALL_DIR}" install -"${STRIP_BIN}" busybox +if [ -f "busybox" ]; then + "${STRIP_BIN}" busybox +fi +if [ -f "libbusybox.so" ]; then + "${STRIP_BIN}" libbusybox.so +fi echo "Build completed successfully." echo "Binary: ${BUSYBOX_DIR}/busybox" +echo "Shared library: ${BUSYBOX_DIR}/libbusybox.so" echo "Installed to: ${INSTALL_DIR}"