Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/bake-rootfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -98,14 +98,22 @@ 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; }

# 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 ./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
Expand Down
21 changes: 15 additions & 6 deletions iiab-android
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -466,17 +468,22 @@ 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

log "Yarn version: $(yarn -v)"

# 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..."
Expand Down Expand Up @@ -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."
Expand Down
6 changes: 5 additions & 1 deletion static/site/site-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file modified tools/rootfs-builder/build-iiab-rootfs.sh
100644 → 100755
Empty file.
Loading