uboot: Apply patches outside container

When running inside a rootless Podman container on a SELinux-enabled
host, the `patch` command fails because it cannot copy SELinux labels
from the original file to the patched file.  This only happens patching
files that are located in a bind mount.
This commit is contained in:
2023-02-13 21:21:05 -06:00
parent 025b7c6115
commit b9696ab003
3 changed files with 20 additions and 7 deletions

17
patch-uboot.sh Executable file
View File

@@ -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