anbox-modules/scripts/build-against-kernel.sh

36 lines
479 B
Bash
Raw Normal View History

#!/bin/bash
set -ex
KVER=${1:-master}
2019-07-04 17:54:57 +08:00
CC=${2:-gcc}
src_dir="../linux-${KVER}"
if [ "${KVER}" = "master" ]; then
archive=master.tar.gz
else
archive="v${KVER}.tar.gz"
fi
if [ ! -d "${src_dir}" ]; then
wget -O - "https://github.com/torvalds/linux/archive/${archive}" | tar -C ../ -xz
fi
(
cd "$src_dir" || exit 1
make allmodconfig
make prepare
make scripts
)
(
cd ashmem || exit 1
make KERNEL_SRC="../${src_dir}"
)
(
cd binder || exit 1
make KERNEL_SRC="../${src_dir}"
)