2020-06-15 08:08:20 +00:00
|
|
|
#!/bin/bash
|
|
|
|
[ -f /.dockerenv ] || { echo "please run in supplied container"; exit 1; }
|
|
|
|
set -e; source environment
|
|
|
|
|
|
|
|
build_dir="${BUILD_DIR?}"
|
|
|
|
buildroot_dir="${build_dir}/buildroot"
|
|
|
|
buildroot_repo="${BUILDROOT_REPO?}"
|
|
|
|
buildroot_ref=${BUILDROOT_REF?}
|
2020-06-29 22:55:34 +00:00
|
|
|
heads_dir="${build_dir}/heads"
|
|
|
|
heads_repo="${HEADS_REPO?}"
|
|
|
|
heads_ref=${HEADS_REF?}
|
2020-06-15 08:08:20 +00:00
|
|
|
|
|
|
|
[[ -f ~/.gitconfig ]] || \
|
|
|
|
printf "[color]\nui=auto\n[user]\nemail=build@local\nname=Build User" \
|
|
|
|
> ~/.gitconfig
|
|
|
|
|
|
|
|
mkdir -p "$build_dir"
|
2020-06-17 03:29:26 +00:00
|
|
|
|
2020-07-07 21:13:18 +00:00
|
|
|
[ "$(ls -A "${buildroot_dir}")" ] \
|
|
|
|
|| git clone "$buildroot_repo" "$buildroot_dir"
|
2020-06-15 08:08:20 +00:00
|
|
|
git -C "$buildroot_dir" checkout "$buildroot_ref"
|
2020-06-15 17:21:28 +00:00
|
|
|
cd "$buildroot_dir"
|
2020-06-17 03:29:26 +00:00
|
|
|
make "airgap_${TARGET}_defconfig"
|
2020-06-15 17:21:28 +00:00
|
|
|
make source
|
2020-06-29 22:55:34 +00:00
|
|
|
|
2020-07-07 21:13:18 +00:00
|
|
|
[ "$(ls -A "${heads_dir}")" ] \
|
|
|
|
|| git clone "$heads_repo" "$heads_dir"
|
2020-06-29 22:55:34 +00:00
|
|
|
git -C "$heads_dir" checkout "$heads_ref"
|
2020-07-07 21:13:18 +00:00
|
|
|
[ "$TARGET" == "librem13v4" ] \
|
|
|
|
&& (cd "$heads_dir/blobs/librem_kbl" && ./get_blobs.sh)
|