airgap/scripts/fetch

29 lines
751 B
Plaintext
Raw Normal View History

#!/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?}
[[ -f ~/.gitconfig ]] || \
printf "[color]\nui=auto\n[user]\nemail=build@local\nname=Build User" \
> ~/.gitconfig
mkdir -p "$build_dir"
[ "$(ls -A $build_dir)" ] && exit 0
git clone "$buildroot_repo" "$buildroot_dir"
git -C "$buildroot_dir" checkout "$buildroot_ref"
cd "$buildroot_dir"
make "airgap_${TARGET}_defconfig"
make source
2020-06-29 22:55:34 +00:00
git clone "$heads_repo" "$heads_dir"
git -C "$heads_dir" checkout "$heads_ref"