BuildSystem: Write my own disk image perm updater

If user's bash does not have bultin stat, updating image perms was
terribly slow. This patch adds a simple c program that does the job
without exec overhead
This commit is contained in:
2026-01-10 17:50:28 +02:00
parent d33a8eac9c
commit 78cd054d59
5 changed files with 87 additions and 35 deletions

View File

@@ -42,9 +42,17 @@ build_toolchain () {
$BANAN_TOOLCHAIN_DIR/build.sh
}
build_tools() {
perm_tool="$BANAN_TOOLS_DIR/update-image-perms"
if [ ! -f "$perm_tool" ] || [ "$perm_tool" -ot "$perm_tool.c" ]; then
gcc -O2 -Wall -Wextra -Werror -o "$perm_tool" "$perm_tool.c" || exit 1
fi
}
create_image () {
build_target all
build_target install
build_tools
$BANAN_SCRIPT_DIR/image.sh "$1"
}