forked from meefik/busybox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed problem with loop mount; Updated bb-build script
- Loading branch information
Showing
251 changed files
with
123 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/bin/bash | ||
# BusyBox build tool | ||
# (C) 2014-2019 Anton Skshidlevsky <[email protected]>, GPLv3 | ||
# | ||
# Make custom patch: | ||
# diff -urN ../busybox-${BB_VERSION}.orig/ . > ../patches/${BB_VERSION}/${PATCH_NAME}.patch | ||
|
||
set -e | ||
|
||
MARCH="$1" | ||
INSTALL_DIR="$2" | ||
BB_VERSION="1.31.1" | ||
ANDROID_NATIVE_API_LEVEL="21" | ||
NCPU="$(grep -ci processor /proc/cpuinfo)" | ||
SOURCE_DIR="$(pwd)" | ||
BUILD_DIR="${SOURCE_DIR}/build" | ||
WOLFSSL_VERSION="3.13.0-stable" | ||
DEFCONFIG="android_ndk_defconfig" | ||
NDK="android-ndk-r15c" | ||
NDK_DIR="${BUILD_DIR}/${NDK}" | ||
SYSROOT="${NDK_DIR}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${MARCH}" | ||
[[ -n "${INSTALL_DIR}" ]] || INSTALL_DIR="${BUILD_DIR}/dist" | ||
|
||
case "$MARCH" in | ||
arm) | ||
TARGET_HOST="arm-linux-androideabi" | ||
PATH="${NDK_DIR}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:${PATH}" | ||
;; | ||
arm64) | ||
TARGET_HOST="aarch64-linux-android" | ||
PATH="${NDK_DIR}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin:${PATH}" | ||
;; | ||
x86) | ||
TARGET_HOST="i686-linux-android" | ||
PATH="${NDK_DIR}/toolchains/x86-4.9/prebuilt/linux-x86_64/bin:${PATH}" | ||
;; | ||
x86_64) | ||
TARGET_HOST="x86_64-linux-android" | ||
PATH="${NDK_DIR}/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin:${PATH}" | ||
;; | ||
*) | ||
echo "Usage: $0 <arm|arm64|x86|x86_64> [INSTALL_DIR]" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
export LD_LIBRARY_PATH="${SYSROOT}/usr/lib:${SYSROOT}/usr/lib64" | ||
export CFLAGS="-DANDROID -D__ANDROID__ -DSK_RELEASE -D__POSIX_VISIBLE=199209 -D__BSD_VISIBLE -fPIC -I${SYSROOT}/usr/include/${TARGET_HOST} -I${SYSROOT}/usr/include" | ||
export LDFLAGS="-L${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib64 -static --sysroot=${SYSROOT}" | ||
|
||
[[ -e "${BUILD_DIR}" ]] || mkdir -p "${BUILD_DIR}"; | ||
[[ -e "${INSTALL_DIR}/${MARCH}" ]] || mkdir -p "${INSTALL_DIR}/${MARCH}"; | ||
|
||
wget -c https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip -O "${BUILD_DIR}/${NDK}-linux-x86_64.zip" | ||
wget -c http://busybox.net/downloads/busybox-${BB_VERSION}.tar.bz2 -O "${BUILD_DIR}/busybox-${BB_VERSION}.tar.bz2" | ||
wget -c https://github.com/wolfSSL/wolfssl/archive/v${WOLFSSL_VERSION}.tar.gz -O "$BUILD_DIR/wolfssl-${WOLFSSL_VERSION}.tar.gz" | ||
|
||
if [[ ! -e "${BUILD_DIR}/${NDK}" ]] | ||
then | ||
unzip "${BUILD_DIR}/${NDK}-linux-x86_64.zip" -d "${BUILD_DIR}" | ||
fi | ||
|
||
[[ ! -e "${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}" ]] || rm -rf "${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}" | ||
tar xvzf "${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}.tar.gz" -C "${BUILD_DIR}" | ||
|
||
[[ ! -e "${BUILD_DIR}/busybox-${BB_VERSION}" ]] || rm -rf "${BUILD_DIR}/busybox-${BB_VERSION}" | ||
tar jvxf "${BUILD_DIR}/busybox-${BB_VERSION}.tar.bz2" -C "${BUILD_DIR}" | ||
cd "$BUILD_DIR/busybox-${BB_VERSION}" | ||
for p in $(ls ${SOURCE_DIR}/patches/${BB_VERSION}/*.patch) | ||
do | ||
patch -b -p0 < ${p} | ||
done | ||
|
||
cd "$BUILD_DIR/busybox-${BB_VERSION}" | ||
cp ${SOURCE_DIR}/patches/${BB_VERSION}/${DEFCONFIG} ./configs/${DEFCONFIG} | ||
sed -i "s|^CONFIG_CROSS_COMPILER_PREFIX=.*|CONFIG_CROSS_COMPILER_PREFIX=\"${TARGET_HOST}-\"|" ./configs/${DEFCONFIG} | ||
sed -i "s|^CONFIG_SYSROOT=.*|CONFIG_SYSROOT=\"${SYSROOT}\"|" ./configs/${DEFCONFIG} | ||
sed -i "s|^CONFIG_EXTRA_CFLAGS=.*|CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\"|" ./configs/${DEFCONFIG} | ||
sed -i "s|^CONFIG_EXTRA_LDFLAGS=.*|CONFIG_EXTRA_LDFLAGS=\"${LDFLAGS}\"|" ./configs/${DEFCONFIG} | ||
sed -i "s|^EXTRAVERSION =.*|EXTRAVERSION = -meefik|" ./Makefile | ||
make ${DEFCONFIG} | ||
|
||
cd "$BUILD_DIR/busybox-${BB_VERSION}" | ||
make -j${NCPU} | ||
make CONFIG_PREFIX="${INSTALL_DIR}/${MARCH}" install | ||
|
||
cd "${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}" | ||
./autogen.sh | ||
./configure --enable-static --enable-singlethreaded --disable-shared --host=${TARGET_HOST} | ||
make -j${NCPU} | ||
|
||
CC="${TARGET_HOST}-gcc" | ||
STRIP="${TARGET_HOST}-strip" | ||
$CC $CFLAGS $LDFLAGS -Os -Wall -I"${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}" -c "${SOURCE_DIR}/ssl_helper.c" -o "${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}/ssl_helper.o" | ||
$CC $CFLAGS $LDFLAGS "${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}/ssl_helper.o" "${BUILD_DIR}/wolfssl-${WOLFSSL_VERSION}/src/.libs/libwolfssl.a" -lm -o "${INSTALL_DIR}/${MARCH}/bin/ssl_helper" | ||
$STRIP -s "${INSTALL_DIR}/${MARCH}/bin/ssl_helper" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- ../busybox-1.31.1.orig/include/libbb.h 2019-06-10 13:50:53.000000000 +0300 | ||
+++ ./include/libbb.h 2019-11-08 12:33:36.523396529 +0300 | ||
@@ -2175,10 +2175,10 @@ | ||
# define VC_4 "/dev/tty4" | ||
# define VC_5 "/dev/tty5" | ||
# define VC_FORMAT "/dev/tty%d" | ||
-# define LOOP_FORMAT "/dev/loop%u" | ||
-# define LOOP_NAMESIZE (sizeof("/dev/loop") + sizeof(int)*3 + 1) | ||
-# define LOOP_NAME "/dev/loop" | ||
-# define FB_0 "/dev/fb0" | ||
+# define LOOP_FORMAT "/dev/block/loop%u" | ||
+# define LOOP_NAMESIZE (sizeof("/dev/block/loop") + sizeof(int)*3 + 1) | ||
+# define LOOP_NAME "/dev/block/loop" | ||
+# define FB_0 "/dev/graphics/fb0" | ||
#endif | ||
|
||
// storage helpers for mk*fs utilities |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.