[PATCH] scripts: genenv: make the temporary directory writable
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Sep 21 02:36:41 PDT 2026
genenv copies the environment directories it is given into a temporary
directory next to its output and removes that directory again when it is
done. The copy is made with cp, which preserves the mode of what it copied,
so building from a read-only source tree, e.g. a Nix store path leaves a
temporary directory nothing can be deleted from:
rm: cannot remove '.../defaultenv-qemu_fw_cfg.bbenv.genenv.tmp/boot/qemu_fw_cfg': Permission denied
make[7]: *** [scripts/Makefile.env:41: common/boards/qemu/defaultenv-qemu_fw_cfg.bbenv] Error 1
and the build fails. The same modes also stop the find that prunes stray
editor backups a few lines further down from doing anything.
Make the copies writable before either runs. Their modes are of no interest
to anything: bareboxenv packs the files into an environment image that
carries its own.
Assisted-by: Claude:opus-5
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
scripts/genenv | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/genenv b/scripts/genenv
index b630e995cb9b..668f681ab9c3 100755
--- a/scripts/genenv
+++ b/scripts/genenv
@@ -42,6 +42,8 @@ for i in $*; do
fi
done
+chmod -R u+w "$tempdir"
+
find $tempdir -name '.svn' -o -name '*~' -delete
scripts/bareboxenv -s $tempdir ${tmpfile}
--
2.47.3
More information about the barebox
mailing list