aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-21 00:49:53 -0600
committerCraig Jennings <c@cjennings.net>2026-01-21 00:49:53 -0600
commit9ad87d1805174c9dc7ea92131bdce9c859614b57 (patch)
tree827480f3bfdaa923fdced4e67fd63d37b587b04a /build.sh
parentcb6d684aff1f2321c56c5b1de6c4da539e3a7a64 (diff)
downloadarchangel-9ad87d1805174c9dc7ea92131bdce9c859614b57.tar.gz
archangel-9ad87d1805174c9dc7ea92131bdce9c859614b57.zip
Restore file ownership after build and rename todo.org
- Add chown step to build.sh to restore ownership to invoking user after mkarchiso completes (fixes root-owned out/work/profile dirs) - Rename TODO.org to todo.org (lowercase) - Add todo item for post-install reboot countdown timer
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 0593559..337564f 100755
--- a/build.sh
+++ b/build.sh
@@ -454,6 +454,13 @@ chmod +x "$PROFILE_DIR/airootfs/usr/local/bin/"*
info "Building ISO (this will take a while)..."
mkarchiso -v -w "$WORK_DIR" -o "$OUT_DIR" "$PROFILE_DIR"
+# Restore ownership to the user who invoked sudo
+# mkarchiso runs as root and creates root-owned files
+if [[ -n "$SUDO_USER" ]]; then
+ info "Restoring ownership to $SUDO_USER..."
+ chown -R "$SUDO_USER:$SUDO_USER" "$OUT_DIR" "$WORK_DIR" "$PROFILE_DIR" 2>/dev/null || true
+fi
+
# Report results
ISO_FILE=$(ls -t "$OUT_DIR"/*.iso 2>/dev/null | head -1)
if [[ -f "$ISO_FILE" ]]; then