2023-07-01 15:45:03 +00:00
|
|
|
#!/bin/bash
|
2023-06-30 20:18:10 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2023-present Fewtarius
|
|
|
|
|
|
|
|
###
|
|
|
|
### Provision a container containing linaro toolchains
|
|
|
|
### and use it to build the OGU kernel and u-boot.
|
|
|
|
###
|
|
|
|
|
|
|
|
###
|
2023-07-01 15:45:03 +00:00
|
|
|
### Export SCRIPTS="mkkernel mkuboot" or the default will
|
2023-06-30 20:18:10 +00:00
|
|
|
### only build u-boot.
|
|
|
|
###
|
|
|
|
|
2023-07-01 15:45:03 +00:00
|
|
|
SCRIPTS="${SCRIPTS:-mkuboot}"
|
2023-06-30 20:18:10 +00:00
|
|
|
CONTAINER="linaro:latest"
|
|
|
|
|
|
|
|
echo "Provisioning container..."
|
|
|
|
docker build -t "${CONTAINER}" .
|
|
|
|
|
2023-07-01 15:45:03 +00:00
|
|
|
for SCRIPT in ${SCRIPTS}
|
2023-06-30 20:18:10 +00:00
|
|
|
do
|
2023-07-01 15:45:03 +00:00
|
|
|
echo "Executing ${SCRIPT}..."
|
|
|
|
docker run -it --rm --user $(id -u):$(id -g) -v $(pwd):/work -w /work ${CONTAINER} /work/${SCRIPT}
|
|
|
|
|
|
|
|
if [[ "${SCRIPT}" =~ mkuboot ]] && \
|
|
|
|
[ -e "u-boot/sd_fuse/u-boot.bin" ]
|
|
|
|
then
|
|
|
|
echo "Copying u-boot binary..."
|
|
|
|
cp u-boot/sd_fuse/u-boot.bin ../projects/Amlogic/packages/u-boot/bin/S922X/u-boot.bin
|
|
|
|
fi
|
2023-06-30 20:18:10 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
|