diff --git a/build-uboot.sh b/build-uboot.sh index a27951f..01c0fcb 100755 --- a/build-uboot.sh +++ b/build-uboot.sh @@ -5,14 +5,8 @@ set -e . ./config +./patch-uboot.sh cd u-boot -if [ ! -f .patched ]; then - for x in ../patches/uboot/*.patch; do - printf 'Applying patch %s ...\n' "${x##*/}" - patch -p1 < "${x}" - done - : > .patched -fi cat configs/rpi_4_defconfig ../u-boot.config > configs/yellow_defconfig make yellow_defconfig CROSS_COMPILE=${target}- make diff --git a/patch-uboot.sh b/patch-uboot.sh new file mode 100755 index 0000000..467e50e --- /dev/null +++ b/patch-uboot.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +if [ -f u-boot/.patched ]; then + exit 0 +fi + +rc=0 +cd u-boot || exit +for x in ../patches/uboot/*.patch; do + [ -f "${x}" ] || continue + printf 'Applying patch %s ...\n' "${x##*/}" + patch -p1 < "${x}" || rc=$? +done +if [ $rc -eq 0 ]; then + : > .patched +fi diff --git a/podman-build.sh b/podman-build.sh index ebe298e..5c6f34a 100755 --- a/podman-build.sh +++ b/podman-build.sh @@ -20,6 +20,8 @@ cid=$(podman run \ python -c 'from signal import *;signal(SIGTERM, lambda x, y: None);pause()' ) +./patch-uboot.sh + podman exec -it ${cid} ./build-all.sh "${target}" podman stop ${cid}