From 49dd09ef6e07eb72f7e2e723f3becaf2b87ec4aa Mon Sep 17 00:00:00 2001 From: "Luis Guzman (AppDevForAll)" Date: Mon, 31 Aug 2026 00:34:38 -0600 Subject: [PATCH 1/5] ADFA-5334 fix(rootfs-builder): mark build-iiab-rootfs.sh executable CI ran 'sudo ./tools/rootfs-builder/build-iiab-rootfs.sh' and failed with 'command not found' because the script was tracked 100644 (no +x). Its siblings (make-debian-base.sh, iiab_tree_hash.py) are 100755; this one lost the bit on a Windows checkout (core.filemode=false). Set the git mode to 100755 so the checked-out script is executable on the runner. --- tools/rootfs-builder/build-iiab-rootfs.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/rootfs-builder/build-iiab-rootfs.sh diff --git a/tools/rootfs-builder/build-iiab-rootfs.sh b/tools/rootfs-builder/build-iiab-rootfs.sh old mode 100644 new mode 100755 From 565e9384ba63a22e0997a239e6b0491a1673682b Mon Sep 17 00:00:00 2001 From: "Luis Guzman (AppDevForAll)" Date: Mon, 31 Aug 2026 00:36:03 -0600 Subject: [PATCH 2/5] ADFA-5334 fix(ci): invoke the builder via 'sudo bash' (not depend on exec bit) Belt-and-suspenders with the +x fix: running the script through bash makes the CI step immune to the executable bit being dropped again on a Windows checkout (core.filemode=false). The builder's own self-dispatch already uses 'bash $SELF', so only the top-level workflow call needed this. --- .github/workflows/bake-rootfs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bake-rootfs.yml b/.github/workflows/bake-rootfs.yml index c99c8163a..afedcaad1 100644 --- a/.github/workflows/bake-rootfs.yml +++ b/.github/workflows/bake-rootfs.yml @@ -105,7 +105,7 @@ jobs: - name: Build all tiers for ${{ matrix.arch }} run: | - sudo ./tools/rootfs-builder/build-iiab-rootfs.sh \ + sudo bash ./tools/rootfs-builder/build-iiab-rootfs.sh \ --all-tier --arch "${{ matrix.arch }}" \ --publish-url "$ROOTFS_PUBLIC_BASE" --reset-mirrors # the builder runs as root; hand dist/ back to the runner so the upload step can read it From a0b6f6149bf014801bd6715cda40a85fd122b9b7 Mon Sep 17 00:00:00 2001 From: Luis-ADFA Date: Mon, 31 Aug 2026 05:45:45 -0600 Subject: [PATCH 3/5] ADFA-5334 fix(site-updater): make the landing-site mirror proot-safe tar -x as root restores dir/file modes+owner via fchmodat2/fchownat, which this proot does not translate (same root cause as the rsync->tar switch in ADFA-5059). Under the rootfs bake the extraction aborted on ./js/./css/./img/./lang, site-updater exited 2, iiab-android (set -e) aborted rc=2, and flag_install_ready was never written -> every tier failed validation (HOLD) and the workflow exited 1. Pass --no-same-permissions --no-same-owner so tar skips that restore pass; the static assets take umask defaults (dirs 0755, files 0644), which is what nginx serves. --- static/site/site-updater.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/site/site-updater.sh b/static/site/site-updater.sh index e842ab1d2..0bc9c9d25 100755 --- a/static/site/site-updater.sh +++ b/static/site/site-updater.sh @@ -21,7 +21,11 @@ mkdir -p "$DEST_DIR" # Mirror: clear the destination, then copy via tar (proot-safe). Excludes this script and any *.sh. printf "Mirroring %s -> %s ...\n" "$SITE_SRC" "$DEST_DIR" find "$DEST_DIR" -mindepth 1 -delete 2>/dev/null || true -( cd "$SITE_SRC" && tar --exclude='*.sh' -cf - . ) | ( cd "$DEST_DIR" && tar -xf - ) +# tar -x as root also restores dir/file modes+owner via fchmodat2/fchownat, which this proot +# does NOT translate (same root cause as the rsync->tar switch, ADFA-5059) -> extraction aborted +# on ./js, ./css, ./img, ./lang. Skip that restore pass; the static assets take umask defaults +# (dirs 0755, files 0644) here, which is exactly what nginx serves. +( cd "$SITE_SRC" && tar --exclude='*.sh' -cf - . ) | ( cd "$DEST_DIR" && tar --no-same-permissions --no-same-owner -xf - ) # Cache-bust: stamp ONLY the served index.html (it carries the asset ?v= refs and the runtime token # window.__CACHEBUST__). app.js is intentionally NOT stamped — it reads the token at runtime and From 6622c52b668f0dd38ae78ed00a83255dc7ae53f0 Mon Sep 17 00:00:00 2001 From: Luis-ADFA Date: Mon, 31 Aug 2026 12:38:55 -0600 Subject: [PATCH 4/5] ADFA-5334 fix(install): make the remaining proot install copies proot-safe (fchmodat2) The site-updater tar was only the first of several recursive perms-preserving copies the proot install runs after Ansible; each hits the same untranslated fchmodat2 on directory-mode restore, aborts iiab-android (set -e), and leaves every tier on HOLD. Extend the site-updater fix to the rest: - demo-content + yarn extracts: tar --no-same-permissions --no-same-owner - dashboard + pdf.js deploys: cp -a --no-preserve=mode (corrects the stale "cp -a is reliable" note; cp -a's mode restore fails the same way) NOTE added in bake-rootfs.yml: the real fix is translating fchmodat2 in libproot; drop these workarounds then. --- .github/workflows/bake-rootfs.yml | 8 ++++++++ iiab-android | 21 +++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bake-rootfs.yml b/.github/workflows/bake-rootfs.yml index afedcaad1..6921ac5c3 100644 --- a/.github/workflows/bake-rootfs.yml +++ b/.github/workflows/bake-rootfs.yml @@ -103,6 +103,14 @@ jobs: - name: Ensure AWS CLI is available run: aws --version || { sudo apt-get update && sudo apt-get install -y awscli; } + # NOTE (ADFA-5334 -- fchmodat2 tech debt, address soon): the builder installs the rootfs + # under proot, and this proot does NOT translate the fchmodat2 syscall (glibc>=2.39 / + # kernel>=6.6). Any recursive perms-preserving copy (tar -x, cp -a, rsync -a) then fails + # restoring directory modes -> the install aborts and every tier lands on HOLD. Worked + # around per call site (site-updater: tar --no-same-permissions; iiab-android: cp -a + # --no-preserve=mode). Proper fix: translate fchmodat2 in libproot (PRootEngine) and drop + # these workarounds; until then any NEW perms-preserving copy in the install MUST use the + # proot-safe form. - name: Build all tiers for ${{ matrix.arch }} run: | sudo bash ./tools/rootfs-builder/build-iiab-rootfs.sh \ diff --git a/iiab-android b/iiab-android index faffc1478..ed9adac6f 100644 --- a/iiab-android +++ b/iiab-android @@ -409,7 +409,9 @@ install_demo_contents() { if wget -c "${DEMO_REPO_URL}/${cw_tar}" -O "/tmp/${cw_tar}"; then log "Extracting $cw_tar into $cw_dir..." - tar -xzf "/tmp/${cw_tar}" -C "$cw_dir" + # proot-safe: tar -x as root restores directory modes via fchmodat2, untranslated by this + # proot (same root cause as the ADFA-5334 site-updater) -> it aborts on the dir entries. + tar --no-same-permissions --no-same-owner -xzf "/tmp/${cw_tar}" -C "$cw_dir" rm -f "/tmp/${cw_tar}" else warn "Failed to download Calibre-Web demo library ($cw_tar)" @@ -466,7 +468,9 @@ install_iiaboa_dashboard() { log "Downloading and installing Yarn directly..." mkdir -p /opt/yarn - curl -fsSL --compressed https://yarnpkg.com/latest.tar.gz | tar -xz -C /opt/yarn --strip-components=1 + # proot-safe: tar -x as root restores directory modes via fchmodat2 (untranslated by this proot, + # fails on dirs); --no-same-permissions keeps files' exec bits (umask only) so bin/yarn stays runnable. + curl -fsSL --compressed https://yarnpkg.com/latest.tar.gz | tar --no-same-permissions --no-same-owner -xz -C /opt/yarn --strip-components=1 ln -sf /opt/yarn/bin/yarn /usr/local/bin/yarn ln -sf /opt/yarn/bin/yarnpkg /usr/local/bin/yarnpkg @@ -474,9 +478,12 @@ install_iiaboa_dashboard() { # Copy dashboard files mkdir -p "$dash_dest" - # Proot-safe copy: rsync's lchmod -> fchmodat2 (glibc>=2.39, kernel>=6.6) isn't - # translated by proot (rc=23 under proot on 6.6+ kernels); cp -a is reliable. - cp -a "${dash_src}/." "$dash_dest/" + # Proot-safe copy: rsync's lchmod AND cp -a's mode restore both use fchmodat2 (glibc>=2.39, + # kernel>=6.6), which this proot does NOT translate -> it fails on directory entries (rc=23, + # same root cause as the ADFA-5334 site-updater). --no-preserve=mode drops only that failing + # chmod pass; ownership/timestamps/symlinks are still preserved. FIXME(fchmodat2): see the note + # in .github/workflows/bake-rootfs.yml -- translate fchmodat2 in libproot and drop these. + cp -a --no-preserve=mode "${dash_src}/." "$dash_dest/" # Install node dependencies and compile TS->JS (ADFA-4839: dash-node runs dist/server.js). log "Installing Node dependencies for the dashboard..." @@ -695,7 +702,9 @@ fi # files (removing a build is just dropping it from VERSIONS in fetch-pdfjs.sh). rm -rf /library/www/html/pdfjs/* if [ -f "${K2GO_OPT_DIR}/static/pdfjs/dist/manifest.json" ]; then - cp -a "${K2GO_OPT_DIR}/static/pdfjs/dist/." /library/www/html/pdfjs/ + # proot-safe: cp -a's mode restore uses fchmodat2 (untranslated by this proot, fails on dirs); + # --no-preserve=mode drops only that chmod pass (ADFA-5334, same as the site-updater). + cp -a --no-preserve=mode "${K2GO_OPT_DIR}/static/pdfjs/dist/." /library/www/html/pdfjs/ ok "pdf.js builds deployed: $(sed -n 's/.*\"id\":\"\([^\"]*\)\".*/\1/p' /library/www/html/pdfjs/manifest.json | tr '\n' ' ')" else warn "pdf.js dist not found; viewer will 404 until deployed." From b144aef47d416b7aedb078f2f657a00ba08ff38e Mon Sep 17 00:00:00 2001 From: Luis-ADFA Date: Mon, 31 Aug 2026 12:44:37 -0600 Subject: [PATCH 5/5] ADFA-5334 chore(ci): bump bake-rootfs checkout v4 -> v5 (drop Node 20) actions/checkout@v4 runs on the deprecated Node 20; @v5 runs on Node 24, which the rest of the repo's workflows already use. Clears the "Node.js 20 is no longer supported" warning on the bake runs. --- .github/workflows/bake-rootfs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bake-rootfs.yml b/.github/workflows/bake-rootfs.yml index 6921ac5c3..5a1647686 100644 --- a/.github/workflows/bake-rootfs.yml +++ b/.github/workflows/bake-rootfs.yml @@ -40,7 +40,7 @@ jobs: timeout-minutes: 30 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Ensure AWS CLI is available run: aws --version || { sudo apt-get update && sudo apt-get install -y awscli; } @@ -98,7 +98,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Ensure AWS CLI is available run: aws --version || { sudo apt-get update && sudo apt-get install -y awscli; }