Skip to content

Instantly share code, notes, and snippets.

@hed0rah
Created June 14, 2026 08:21
Show Gist options
  • Select an option

  • Save hed0rah/a9beb90549d92c13b595bc1f6d4b453e to your computer and use it in GitHub Desktop.

Select an option

Save hed0rah/a9beb90549d92c13b595bc1f6d4b453e to your computer and use it in GitHub Desktop.
stripped busybox
#!/usr/bin/env bash
set -euo pipefail
CR=$'\r'
openssl s_client -connect busybox.net:443 -quiet 2>/dev/null <<EOF | sed '1,/^\r$/d' > busybox-1.38.0.tar.bz2
GET /downloads/busybox-1.38.0.tar.bz2 HTTP/1.1${CR}
Host: busybox.net${CR}
Connection: close${CR}
${CR}
EOF
tar -xjf busybox-1.38.0.tar.bz2
cd busybox-1.38.0
make allnoconfig
for applet in ASH SH_IS_ASH LS CAT ECHO PWD; do
sed -i "s/# CONFIG_$applet is not set/CONFIG_$applet=y/" .config
done
sed -i 's/# CONFIG_STATIC is not set/CONFIG_STATIC=y/' .config
sed -i 's/# CONFIG_STRIP is not set/CONFIG_STRIP=y/' .config
sed -i 's/# CONFIG_BUILD_OPTIMIZED_FOR_SIZE is not set/CONFIG_BUILD_OPTIMIZED_FOR_SIZE=y/' .config
make silentoldconfig
make -j"$(nproc)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment