From 72f6646fb5229f1a70192e0a6eea224b424c914e Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 23 Jul 2024 13:22:39 +0200 Subject: [PATCH] Adjust user/group ownership post-build. --- raspberrypi/toaster | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/raspberrypi/toaster b/raspberrypi/toaster index f85dca5..2da0faf 100755 --- a/raspberrypi/toaster +++ b/raspberrypi/toaster @@ -91,5 +91,12 @@ zerofree "/dev/mapper/${loop}p2" kpartx -dsv "$out" rmdir "$MNT" +# Adjust metadata: instead of leaving generated files owned by root:root, use +# the current directory's uid and gid. +echo "🍞 Adjusting metadata" +uid=$(stat -c '%u' .) +gid=$(stat -c '%u' .) +chown "$uid:$gid" "$out" + echo "🍞 Toasted!" echo " → $out"