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

36 lines
589 B
Bash
Raw Permalink 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
2019-07-04 18:02:11 +08:00
make allmodconfig CC=${CC} HOSTCC=${CC}
make prepare CC=${CC} HOSTCC=${CC}
make scripts CC=${CC} HOSTCC=${CC}
)
(
cd ashmem || exit 1
2019-07-04 18:02:11 +08:00
make KERNEL_SRC="../${src_dir}" CC=${CC} HOSTCC=${CC}
)
(
cd binder || exit 1
2019-07-04 18:02:11 +08:00
make KERNEL_SRC="../${src_dir}" CC=${CC} HOSTCC=${CC}
)