2021-08-08 03:52:31 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
ROOT=${PWD}
|
|
|
|
|
2021-08-08 22:09:24 +02:00
|
|
|
usage() { echo "Usage: $0 -c <config-path> -v <version>" 1>&2; exit 1; }
|
|
|
|
|
2021-08-08 03:52:31 +02:00
|
|
|
REPO_URL="https://github.com/buildroot/buildroot.git"
|
|
|
|
|
2021-08-08 22:09:24 +02:00
|
|
|
CONFIG_PATH=""
|
|
|
|
REV="2021.08-rc1"
|
|
|
|
while getopts "c:v:" o; do
|
|
|
|
case "${o}" in
|
|
|
|
c)
|
|
|
|
CONFIG_PATH=$(readlink -f ${OPTARG})
|
|
|
|
;;
|
|
|
|
v)
|
|
|
|
REV=${OPTARG}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $((OPTIND-1))
|
|
|
|
|
|
|
|
if [ -z ${CONFIG_PATH} ] || [ ! -f ${CONFIG_PATH} ]; then
|
|
|
|
echo "ERROR: Missing config path (-c)."
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z ${REV} ]; then
|
|
|
|
echo "WARNING: No version selected, use default version: $REV (-v)."
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
git clone "$REPO_URL" --recurse-submodules --remote-submodules #--branch="$REV"
|
2021-08-08 03:52:31 +02:00
|
|
|
cd buildroot
|
2021-08-08 22:09:24 +02:00
|
|
|
git checkout "$REV"
|
|
|
|
cp "$CONFIG_PATH" .config
|
2021-08-08 03:52:31 +02:00
|
|
|
make
|