Skip to content

Commit ca6e088

Browse files
K2GO-399 chore(rootfs): drop the unused contrib component from the Debian base sources
The proot-distro base enables "contrib" in /etc/apt/sources.list (Termux's base recipe), but the IIAB install pulls nothing from it (the installed set is all main). Strip the non-main components right after extraction so the shipped rootfs and its apt config stay DFSG-free (main-only), for F-Droid. Post-extraction, so it also covers a --base-local base: one enforcement point.
1 parent a721de9 commit ca6e088

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎tools/rootfs-builder/build-iiab-rootfs.sh‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,16 @@ mkdir -p "$ROOTFS" # already wiped up front (START CLEAN); just (re)create it
604604
tar --exclude='*/dev/*' --strip-components=1 -xJf "$BASE_LOCAL" -C "$ROOTFS"
605605
[[ -e "$ROOTFS/bin/bash" || -L "$ROOTFS/bin/bash" ]] || die "Base has no /bin/bash; check the tarball."
606606

607+
# K2GO-399: keep the shipped rootfs DFSG-free (F-Droid). The proot-distro base enables
608+
# the "contrib" component in /etc/apt/sources.list (Termux's base recipe), but nothing in
609+
# the IIAB install pulls from it. Strip the non-main components here, before the install
610+
# runs, so the rootfs and its apt config stay main-only. Post-extraction, so this also
611+
# covers a --base-local base: one place enforces main-only.
612+
if [[ -f "$ROOTFS/etc/apt/sources.list" ]]; then
613+
sed -i -E 's/[[:space:]]+(contrib|non-free-firmware|non-free)\b//g' "$ROOTFS/etc/apt/sources.list"
614+
log "apt components set to main-only (F-Droid, K2GO-399)."
615+
fi
616+
607617
# DNS inside the rootfs (the app rewrites resolv.conf; we replicate so apt resolves)
608618
printf 'nameserver 1.1.1.1\nnameserver 8.8.8.8\n' > "$ROOTFS/etc/resolv.conf"
609619
printf '127.0.0.1 localhost\n' > "$ROOTFS/etc/hosts"

0 commit comments

Comments
 (0)