Improve buildroot builder

Improve buildroot builder

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
2021-08-08 22:09:24 +02:00
parent cb5ab9f914
commit b5a73bef22
4 changed files with 36 additions and 4 deletions

View File

@ -5,9 +5,39 @@ set -o pipefail
ROOT=${PWD}
usage() { echo "Usage: $0 -c <config-path> -v <version>" 1>&2; exit 1; }
REPO_URL="https://github.com/buildroot/buildroot.git"
git clone "$REPO_URL" --recurse-submodules --remote-submodules --depth=1 --branch=2021.08-rc1
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"
cd buildroot
cp /dockcross/buildroot.config .config
git checkout "$REV"
cp "$CONFIG_PATH" .config
make