2019-09-21 00:42:48 +02:00
|
|
|
# source this script in bash
|
2019-03-26 22:47:08 +01:00
|
|
|
|
|
|
|
source ${ANDROID_BUILD_TOP}/build/envsetup.sh
|
|
|
|
|
2019-09-21 00:42:48 +02:00
|
|
|
# See envsetup.sh for an example of using --dumpvars-mode to set shell variables.
|
|
|
|
eval "$(cd ${ANDROID_BUILD_TOP}; build/soong/soong_ui.bash --dumpvars-mode --vars="\
|
|
|
|
TARGET_ARCH \
|
|
|
|
TARGET_OUT \
|
|
|
|
TARGET_OUT_EXECUTABLES \
|
|
|
|
TARGET_OUT_DATA \
|
|
|
|
HOST_OS \
|
|
|
|
HOST_ARCH \
|
|
|
|
HOST_OUT \
|
|
|
|
")"
|
2019-03-26 22:47:08 +01:00
|
|
|
|
|
|
|
function prepare()
|
|
|
|
{
|
2019-09-21 00:42:48 +02:00
|
|
|
local BITS=$1
|
2019-03-26 22:47:08 +01:00
|
|
|
shift
|
|
|
|
|
2019-04-27 00:12:57 +02:00
|
|
|
BENCHMARKS=${TARGET_OUT_DATA}/benchmarktest
|
2019-03-26 22:47:08 +01:00
|
|
|
NATIVETEST=${TARGET_OUT_DATA}/nativetest
|
|
|
|
if [ "${BITS}" = 64 ]; then
|
2019-04-27 00:12:57 +02:00
|
|
|
BENCHMARKS=${BENCHMARKS}64
|
2019-03-26 22:47:08 +01:00
|
|
|
NATIVETEST=${NATIVETEST}64
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then
|
2019-09-21 00:42:48 +02:00
|
|
|
m -j MODULES-IN-bionic MODULES-IN-external-icu MODULES-IN-external-mksh ${TARGET_OUT}/etc/hosts "$@"
|
2019-03-26 22:47:08 +01:00
|
|
|
|
|
|
|
if [ ! -d /system ]; then
|
2019-09-21 00:42:48 +02:00
|
|
|
echo "Attempting to create /system"
|
|
|
|
sudo mkdir -p -m 0777 /system
|
|
|
|
mkdir -p -m 0777 /system/bin
|
|
|
|
mkdir -p -m 0777 /system/lib
|
|
|
|
mkdir -p -m 0777 /system/lib64
|
2019-03-26 22:47:08 +01:00
|
|
|
fi
|
|
|
|
(
|
2019-09-21 00:42:48 +02:00
|
|
|
function make_link() {
|
|
|
|
dir=$1
|
|
|
|
tgt=$2
|
|
|
|
name=`basename ${tgt}`
|
|
|
|
src=$dir/$name
|
|
|
|
if [ -e $tgt ]; then
|
|
|
|
ln -sfT `realpath ${tgt}` $src
|
|
|
|
fi
|
|
|
|
}
|
2019-03-26 22:47:08 +01:00
|
|
|
cd ${ANDROID_BUILD_TOP}
|
|
|
|
mkdir -p ${TARGET_OUT_DATA}/local/tmp
|
2019-04-27 00:12:57 +02:00
|
|
|
for i in ${TARGET_OUT}/bin/bootstrap/* ${TARGET_OUT}/bin/*; do
|
2019-09-21 00:42:48 +02:00
|
|
|
make_link /system/bin ${i}
|
2019-04-27 00:12:57 +02:00
|
|
|
done
|
2019-03-26 22:47:08 +01:00
|
|
|
ln -fs `realpath ${TARGET_OUT}/etc` /system/
|
2019-04-27 00:12:57 +02:00
|
|
|
for i in ${TARGET_OUT}/lib/bootstrap/* ${TARGET_OUT}/lib/*; do
|
2019-09-21 00:42:48 +02:00
|
|
|
make_link /system/lib ${i}
|
2019-04-27 00:12:57 +02:00
|
|
|
done
|
|
|
|
for i in ${TARGET_OUT}/lib64/bootstrap/* ${TARGET_OUT}/lib64/*; do
|
2019-09-21 00:42:48 +02:00
|
|
|
make_link /system/lib64 ${i}
|
2019-04-27 00:12:57 +02:00
|
|
|
done
|
2019-03-26 22:47:08 +01:00
|
|
|
)
|
|
|
|
fi
|
|
|
|
}
|