diff --git a/Dockerfile b/Dockerfile index c012c5a..872683e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN apt-get update && \ make \ git \ bc \ + bzip2 \ bison \ flex \ python-dev \ diff --git a/build-boot-rpi b/build-boot-rpi index 5e03f5c..1a803d7 100755 --- a/build-boot-rpi +++ b/build-boot-rpi @@ -12,7 +12,7 @@ TMP=$(mktemp -d tmp.XXXXXX) cd "${TMP}" build-image tmp.img -build-u_boot u-boot "${DEFCONFIG}" "${TUPLE}" +build-u_boot "${DEFCONFIG}" "${TUPLE}" # Write Raspberry Pi boot config cat << EOF > config.txt diff --git a/build-boot-sunxi b/build-boot-sunxi index 2f07682..25072f3 100755 --- a/build-boot-sunxi +++ b/build-boot-sunxi @@ -12,7 +12,7 @@ TMP=$(mktemp -d tmp.XXXXXX) cd "${TMP}" build-image tmp.img -build-u_boot u-boot "${DEFCONFIG}" "${TUPLE}" +build-u_boot "${DEFCONFIG}" "${TUPLE}" # Copy U-Boot to 8192 bytes from start dd if=u-boot/u-boot-sunxi-with-spl.bin of=tmp.img bs=1K seek=8 diff --git a/build-u_boot b/build-u_boot index 561895a..2bd0516 100755 --- a/build-u_boot +++ b/build-u_boot @@ -1,27 +1,42 @@ #!/bin/sh # Download and build latest version of U-Boot -UBOOTDIR="${1}" # For example "u-boot" -DEFCONFIG="${2}" # For example "rpi_3_defconfig" -TUPLE="${3}" # For example "aarch64-linux-gnu" +DEFCONFIG="${1}" # For example "rpi_3_defconfig" +TUPLE="${2}" # For example "aarch64-linux-gnu" + +TARBALL="${U_BOOT_TARBALL}" +GIT_REV="${U_BOOT_GIT_REV}" +GIT_URL="${U_BOOT_GIT_URL:-git://git.denx.de/u-boot.git}" set -e -# U-Boot version to build -VERSION=$(git ls-remote --tags --refs "git://git.denx.de/u-boot.git" "v????.??" | \ - cut -f 2 | \ - grep -o "v....\..." | \ - tail -n 1) +if [ ! -s "${TARBALL}" ] +then + if [ -z "${GIT_REV}" ] + then + # U-Boot version to build + GIT_REV=$(git ls-remote --tags \ + --refs \ + "${GIT_URL}" \ + "v????.??" | \ + cut -f 2 | \ + grep -o "v....\..." | \ + tail -n 1) + fi -# Download U-Boot -git clone --branch "$VERSION" \ - --depth 1 \ - --reference-if-able "/mnt/git-cache/u-boot.git" \ - --dissociate \ - "git://git.denx.de/u-boot.git" "${UBOOTDIR}" + # Download U-Boot + git clone --branch "${GIT_REV}" \ + --depth 1 \ + "${GIT_URL}" u-boot +else + # Extract U-Boot + tar -xf "${TARBALL}" + + mv u-boot-????.?? u-boot +fi # Step into U-Boot directory -cd "${UBOOTDIR}" +cd u-boot # Setup ARCH case "${TUPLE}" in diff --git a/dockerfiles/Dockerfile.arm32v7 b/dockerfiles/Dockerfile.arm32v7 index e5faa8b..be5ff88 100644 --- a/dockerfiles/Dockerfile.arm32v7 +++ b/dockerfiles/Dockerfile.arm32v7 @@ -12,6 +12,7 @@ RUN apt-get update && \ make \ git \ bc \ + bzip2 \ bison \ flex \ python-dev \ diff --git a/dockerfiles/Dockerfile.arm32v7-on-amd64 b/dockerfiles/Dockerfile.arm32v7-on-amd64 index b5f8e0d..319f12f 100644 --- a/dockerfiles/Dockerfile.arm32v7-on-amd64 +++ b/dockerfiles/Dockerfile.arm32v7-on-amd64 @@ -22,6 +22,7 @@ RUN apt-get update && \ make \ git \ bc \ + bzip2 \ bison \ flex \ python-dev \ diff --git a/dockerfiles/Dockerfile.arm64v8 b/dockerfiles/Dockerfile.arm64v8 index 08ef450..776e90a 100644 --- a/dockerfiles/Dockerfile.arm64v8 +++ b/dockerfiles/Dockerfile.arm64v8 @@ -12,6 +12,7 @@ RUN apt-get update && \ make \ git \ bc \ + bzip2 \ bison \ flex \ python-dev \ diff --git a/dockerfiles/Dockerfile.arm64v8-on-amd64 b/dockerfiles/Dockerfile.arm64v8-on-amd64 index cc458ae..80413e2 100644 --- a/dockerfiles/Dockerfile.arm64v8-on-amd64 +++ b/dockerfiles/Dockerfile.arm64v8-on-amd64 @@ -22,6 +22,7 @@ RUN apt-get update && \ make \ git \ bc \ + bzip2 \ bison \ flex \ python-dev \ diff --git a/rebuild-boots b/rebuild-boots index dcace71..3c5281b 100755 --- a/rebuild-boots +++ b/rebuild-boots @@ -2,19 +2,20 @@ # Rebuilds boot images ARTIFACTS_DIR=${DEBIMG_ARTIFACTS_DIR:-/tmp/debimg/artifacts} -GIT_CACHE_DIR=${DEBIMG_GIT_CACHE_DIR:-/tmp/debimg/git-cache} +CACHE_DIR=${DEBIMG_CACHE_DIR:-/tmp/debimg/cache} docker build -t debimg . mkdir -p /tmp/debimg/artifacts || exit -mkdir -p /tmp/debimg/git-cache || exit +mkdir -p /tmp/debimg/cache || exit IFS=, grep -vE "^#|^\s*$" boards.csv | while read BOARD_ID MODEL MAKE CHIP DEFCONFIG TUPLE TYPE DTB _ do docker run --rm \ -v "${ARTIFACTS_DIR}":/artifacts \ - -v "${GIT_CACHE_DIR}":/mnt/git-cache \ + -v "${CACHE_DIR}":/mnt/cache:ro \ + -e U_BOOT_TARBALL=/mnt/cache/u-boot-latest.tar.bz2 \ debimg \ build-boot-"${TYPE}" /artifacts/boot-"${BOARD_ID}" "${DEFCONFIG}" "${TUPLE}" done