|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/bash
CROSS_COMPILER_PREFIX="arm-linux-gnueabi-"
BUSYBOX_URL="https://www.busybox.net/downloads/busybox-1.26.2.tar.bz2"
BUSYBOX_ARCHIVE="$(echo $BUSYBOX_URL | rev | cut -d'/' -f 1 | rev)"
BUSYBOX="$(echo $BUSYBOX_ARCHIVE | sed 's/\.tar.*$//g')"
NCPU=4
function fetch()
{
wget $BUSYBOX_URL
tar -xjvf $BUSYBOX_ARCHIVE
}
if [[ ! -d $BUSYBOX ]]; then
fetch
pushd $BUSYBOX > /dev/null
patch -p1 < ../busybox-android.patch
cp ../busybox-android.config .config
sed "s/CONFIG_CROSS_COMPILER_PREFIX=\".*\"\$/CONFIG_CROSS_COMPILER_PREFIX=\"$CROSS_COMPILER_PREFIX\"/g" -i .config
yes '' | make oldconfig
popd > /dev/null
rm $BUSYBOX_ARCHIVE
fi
pushd $BUSYBOX > /dev/null
make -j $((NCPU*2))
cp busybox ../
make clean
popd > /dev/null
|