#!/bin/sh # Assemble PsionLX/, the public release for the RetroTechCollection archive. # # workspace/scripts/mkdist.sh # # Everything is copied from the project into a fixed layout. The hand-written # documents -- the README in every folder, README.txt and WHAT-IS-EVERYTHING.txt # -- live in release-docs/, mirroring the release, and are copied in last; this # script writes no documentation. PROVENANCE.txt is the project's own. # # It then refuses to finish if # * anything that can write a netBook Pro's internal flash has got in # (scripts/release-safety-check.py: whitelisted BooSt scripts, approved or # content-checked boot partitions, no psionlx-cf.img, no step1-repartition); # * a .md file is present outside the third-party source trees (the # release's own documents are plain text); # * any folder down to the third level lacks a README; # * an SSH key has got in (an authorized_keys, a private or host key). # # Last it writes restore-after-download.tar.gz and .txt (scripts/mkrestore.py): # the archive keeps no links, empty folders, permissions or hidden files, and # restore-after-download.py, copied to the top, puts them back in a download. # # Never released, whatever else changes: # psionlx-cf.img, parked/boot.fat.with-nand-erase-script, # parked/boot.fat.before-readme-fix-20261004 (its README says "needs 7e8"), # parked/card-archival-asphotographed-20261004 (holds psionlx-cf.img and old # boot partitions), CE-RESTORE-CARD/step1-repartition (nand partition 7e8). set -e P=$(cd "$(dirname "$0")/../.." && pwd) W=$P/workspace D=$P/PsionLX DOCS=$P/release-docs # APFS clones where the filesystem has them: instant, and independent once # either copy changes. Plain copies elsewhere. touch "$P/.clonetest" if cp -c "$P/.clonetest" "$P/.clonetest2" 2>/dev/null; then CP="cp -cpR"; else CP="cp -pR"; fi rm -f "$P/.clonetest" "$P/.clonetest2" C() { [ -e "$1" ] || { echo "ERROR: missing $1"; exit 1; }; mkdir -p "$(dirname "$2")"; $CP "$1" "$2"; } rm -rf "$D" mkdir -p "$D" echo "== 1-IMAGES" for i in psionlx-cf-1gb.img psionlx-cf-1gb-soho-safe.img psionlx-cf-1gb-soho-original-ARCHIVAL.img; do C "$P/PsionLX-CF-kit/$i" "$D/1-IMAGES/$i" done echo "== 2-WINDOWS-CE-RESTORE" C "$P/nbpce-404-int-20051129.zip" "$D/2-WINDOWS-CE-RESTORE/nbpce-404-int-20051129.zip" for s in stepA-dump stepB-repartition-540 step2-upgrade psionlx-autoboot; do C "$P/CE-RESTORE-CARD/$s" "$D/2-WINDOWS-CE-RESTORE/boost-scripts/$s" done # step1-repartition is NOT copied: "nand partition 7e8" is for the 64 MB # prototype and leaves a standard 32 MB machine unable to reinstall CE. echo "== 3-PSION-SOURCES" S=$D/3-PSION-SOURCES C "$P/PSIONEX/soho-image-netbook-pro-20050104074212.rootfs.tar.bz2" \ "$S/soho-image/soho-image-netbook-pro-20050104074212.rootfs.tar.bz2" # Pulster's psion-netbookpro-linux-sources.tgz is byte-identical to this one C "$P/auditeon/netbook-linux-sources.tgz" "$S/netbook-linux-sources.tgz" C "$P/auditeon/oe-netbook" "$S/oe-netbook" C "$P/auditeon/FINDING.txt" "$S/FINDING.txt" for t in linux-2.6.9 kdegames-3.3.1 gnome-games-2.6.2 linneighborhood-0.6.5 rdesktop-cvs; do C "$P/psion-src/$t" "$S/extracted-source-trees/$t" done for t in abiword-2.0.11.tar.gz aspell-0.50.5.tar.gz aspell-0.60.3.tar.gz \ aspell-en-0.50-2.tar.bz2 aspell6-en-6.0-0.tar.bz2 balsa-2.2.2.tar.bz2 \ firefox-1.0-source.tar.bz2 gnumeric-1.3.93.tar.bz2 samba-3.0.7-git.tar.gz \ linneighborhood_0.6.5-r7_armv5te.ipk linneighborhood_0.6.5-r8_armv5te.ipk \ linneighborhood-locale-de_0.6.5-r7_armv5te.ipk; do [ -e "$P/psion-src/$t" ] && C "$P/psion-src/$t" "$S/upstream-tarballs/$t" done O=$S/original-images C "$P/psion-src/nBkProOs.img" "$O/nBkProOs.img.psion-autobuild-nexus-20050104" C "$P/anonymous-linuxtogo/nBkProOs.img" "$O/nBkProOs.img.fuchs-gibson-20050308" C "$P/PsionLX-CF-kit/nBkProOs.img_cf" "$O/nBkProOs.img_cf.fuchs-gibson-20050325" C "$P/gpe-image-3.5.4.1-netbook-pro.rootfs.jffs2" "$O/gpe-image-3.5.4.1-netbook-pro.rootfs.jffs2" C "$P/anonymous-linuxtogo/gpe-image.jffs2" "$O/gpe-image.jffs2" C "$P/PsionLX-CF-kit/gpe-fs-cf.tar.bz2" "$O/gpe-fs-cf.tar.bz2" C "$P/anonymous-linuxtogo/mk-nBkProOsImg.c" "$O/mk-nBkProOsImg.c" # the LX prototype's NAND script, under a name BooSt will never run C "$P/anonymous-linuxtogo/nBkPro.img" "$O/nBkPro.img.LX-PROTOTYPE-NAND-SCRIPT-DO-NOT-BOOT" for f in "$P"/anonymous-linuxtogo/*.txt; do [ -e "$f" ] && C "$f" "$O/$(basename "$f")"; done C "$P/recovered" "$S/recovered" rm -rf "$S/recovered/netbook-pro-cd" # it is in 5-REFERENCE echo "== 4-BUILD-SYSTEM" B=$D/4-BUILD-SYSTEM # The folders the build scripts use keep the workspace's names, so the # scripts run from here unchanged (see README-HOW-TO-BUILD.txt). C "$W/scripts" "$B/scripts"; rm -rf "$B/scripts/__pycache__" # three PsionNet proxy test scripts that were saved here by mistake in September rm -f "$B/scripts/ce_bytes.py" "$B/scripts/ce_render.py" "$B/scripts/final.py" C "$W/card/root" "$B/card/root" for f in mknods.debugfs metadata.debugfs; do C "$W/card/$f" "$B/card/$f"; done C "$W/card-reconstruction/root" "$B/card-reconstruction/root" # The first edition's card carried the project's own SSH key for root, and its # dropbear host key. Neither is ever public: a card built from this tree would # let that key in as root, and share one host key. dropbear makes a new host # key when it starts without one. rm -rf "$B/card-reconstruction/root/home/root/.ssh" rm -f "$B/card-reconstruction/root/etc/dropbear/dropbear_rsa_host_key" for f in boot-original.fat boot-safe.fat nBkProOs.img.safe initrd-cf.ext2 initrd-safe.ext2 \ linuxrc.fuchs linuxrc.safe modules.dep.orig modules.dep.safe README-original.TXT README-safe.TXT; do C "$W/bootimg/$f" "$B/bootimg/$f" done C "$W/soho-analysis" "$B/soho-analysis" # the reconstruction-era compile system C "$W/build/buildroot" "$B/arm-oabi-chroot" rm -f "$B/arm-oabi-chroot/etc/dropbear/dropbear_rsa_host_key" # as above for f in debs Packages Packages.gz P-armel P-armel.gz kimg.deb kx; do [ -e "$W/build/$f" ] && C "$W/build/$f" "$B/debian-packages/$f" done C "$W/build/gpe-src" "$B/gpe-src" C "$W/built" "$B/built-binaries" C "$W/psionnet-spotify" "$B/psionnet-spotify" C "$W/psionlx-software" "$B/psionlx-software" C "$W/jffs2x" "$B/jffs2-extracted" for f in "$W"/build/job-*.sh "$W"/build/job-*.log; do [ -e "$f" ] && C "$f" "$B/jobs/$(basename "$f")" done for f in vmlinuz-versatile initramfs.gz xclick; do C "$W/qemu/$f" "$B/qemu/$f"; done C "$P/build" "$B/overlay-route" [ -d "$W/build/initramfs" ] && C "$W/build/initramfs" "$B/initramfs" [ -d "$W/build/mbpanel" ] && C "$W/build/mbpanel" "$B/mbpanel" C "$W/build/out-abiword-spell" "$B/last-build-output" echo "== 5-REFERENCE" R5=$D/5-REFERENCE C "$P/PsionLX-UI-photos" "$R5/ui-photos" C "$P/recovered/netbook-pro-cd" "$R5/netbook-pro-cd" C "$P/auditeon/BooStDongle.pdf" "$R5/BooStDongle.pdf" C "$P/jlime-xfce-image-2012.3-netbookpro-20120311.rootfs.tar.bz2" \ "$R5/other-netbookpro-linux/jlime-xfce-image-2012.3-netbookpro-20120311.rootfs.tar.bz2" for f in "$W"/soho-assets-preview/*.png; do C "$f" "$R5/soho-artwork/$(basename "$f")"; done for f in safe-image-today.png safe-image-programs.png full-image-today.png \ full-image-programs.png full-image-tasks.png \ full-image-spotify.png full-image-spotify-search.png find-new-software.png; do C "$W/qemu/$f" "$R5/emulator-screenshots/$f" done echo "== 6-PARKED-ORIGINALS" for f in "$P"/parked/*; do n=$(basename "$f") case "$n" in boot.fat.with-nand-erase-script|boot.fat.before-readme-fix-20261004) continue ;; # unsafe card-archival-asphotographed-20261004) continue ;; # holds psionlx-cf.img and old boot partitions release-docs-before-soho-20261004|*.md|*modulesdep-0644-20261004) continue ;; # project history only esac [ -d "$f" ] && [ -z "$(ls -A "$f")" ] && continue # empty C "$f" "$D/6-PARKED-ORIGINALS/$n" done echo "== documents" C "$P/PROVENANCE.txt" "$D/PROVENANCE.txt" ( cd "$DOCS" && find . -type f ! -name '.DS_Store' ) | while read f; do C "$DOCS/$f" "$D/$f" done echo "== tidying" find "$D" -name '.DS_Store' -delete echo "== checks" # The release's own documents are plain text. Markdown inside third-party # source trees is part of those sources and stays (stripping it would leave # them altered); anywhere else, a .md file is a project document that leaked. stray=$( cd "$D" && find . -name '*.md' \ ! -path './3-PSION-SOURCES/oe-netbook/*' ! -path './3-PSION-SOURCES/extracted-source-trees/*' \ ! -path './4-BUILD-SYSTEM/gpe-src/*' ! -path './4-BUILD-SYSTEM/arm-oabi-chroot/*' \ ! -path './4-BUILD-SYSTEM/mbpanel/*' ! -path './4-BUILD-SYSTEM/jffs2-extracted/*' \ ! -path './4-BUILD-SYSTEM/card/root/*' ! -path './4-BUILD-SYSTEM/card-reconstruction/root/*' \ ! -path './4-BUILD-SYSTEM/debian-packages/*' ! -path './4-BUILD-SYSTEM/built-binaries/*' \ ! -path './5-REFERENCE/other-netbookpro-linux/*' ) if [ -n "$stray" ]; then echo "ERROR: Markdown outside the source trees:"; echo "$stray"; exit 1; fi python3 "$W/scripts/release-safety-check.py" "$D" "$W/bootimg/boot-original.fat" "$W/bootimg/boot-safe.fat" missing=$( cd "$D" && find . -mindepth 1 -maxdepth 3 -type d \ ! -path './4-BUILD-SYSTEM/arm-oabi-chroot/*' ! -path './4-BUILD-SYSTEM/gpe-src/*' \ ! -path './3-PSION-SOURCES/oe-netbook/*' ! -path './3-PSION-SOURCES/extracted-source-trees/*/*' \ ! -path './4-BUILD-SYSTEM/card/root*' ! -path './4-BUILD-SYSTEM/card-reconstruction/root*' \ ! -path './4-BUILD-SYSTEM/jffs2-extracted/*' ! -path './4-BUILD-SYSTEM/built-binaries/*' \ ! -path './4-BUILD-SYSTEM/debian-packages/*' ! -path './4-BUILD-SYSTEM/initramfs/*' \ ! -path './4-BUILD-SYSTEM/mbpanel/*' ! -path './4-BUILD-SYSTEM/overlay-route/*' \ ! -path './4-BUILD-SYSTEM/last-build-output/*' ! -path './4-BUILD-SYSTEM/qemu/*' \ ! -path './3-PSION-SOURCES/recovered/*/*' ! -path './6-PARKED-ORIGINALS/*/*' \ ! -path './5-REFERENCE/ui-photos/*' ! -path './5-REFERENCE/netbook-pro-cd/*' \ -exec sh -c 'ls "$1"/README*.txt >/dev/null 2>&1 || echo "$1"' _ {} \; ) if [ -n "$missing" ]; then echo "ERROR: folders with no README:"; echo "$missing" | sed 's/^/ /'; exit 1 fi echo " every folder has a README" keys=$( cd "$D" && find . \( -name authorized_keys -o -name '*_host_key' -o -name id_rsa -o -name id_dsa \ -o -name id_ecdsa -o -name id_ed25519 -o -name '.ssh' \) ) if [ -n "$keys" ]; then echo "ERROR: SSH keys in the release:"; echo "$keys" | sed 's/^/ /'; exit 1 fi echo " no SSH keys" echo "== what the archive cannot hold" C "$W/scripts/restore-after-download.py" "$D/restore-after-download.py" python3 "$W/scripts/mkrestore.py" "$D" echo "== checksums" ( cd "$D/1-IMAGES" && shasum -a 256 *.img > SHA256SUMS.txt ) ( cd "$D" { echo "# PsionLX release -- SHA-256 of every image, archive and document" echo "# Generated $(date +%Y-%m-%d). Paths are relative to the release root." echo "#" echo "# Source and filesystem trees are not listed file by file -- they hold tens" echo "# of thousands of files. Verify the archives and images they come from." echo "#" echo "# Check: shasum -a 256 -c SHA256SUMS.txt (macOS)" echo "# sha256sum -c SHA256SUMS.txt (Linux)" find . -type f ! -name SHA256SUMS.txt \ ! -path './3-PSION-SOURCES/oe-netbook/*' ! -path './3-PSION-SOURCES/extracted-source-trees/*/*' \ ! -path './4-BUILD-SYSTEM/arm-oabi-chroot/*' ! -path './4-BUILD-SYSTEM/gpe-src/*' \ ! -path './4-BUILD-SYSTEM/card/root/*' ! -path './4-BUILD-SYSTEM/card-reconstruction/root/*' \ ! -path './4-BUILD-SYSTEM/jffs2-extracted/*' ! -path './4-BUILD-SYSTEM/mbpanel/*' \ ! -path './4-BUILD-SYSTEM/initramfs/*' ! -path './4-BUILD-SYSTEM/debian-packages/kx/*' \ ! -path './4-BUILD-SYSTEM/debian-packages/debs/*' ! -path './4-BUILD-SYSTEM/built-binaries/*' \ ! -path './4-BUILD-SYSTEM/overlay-route/overlay/*' ! -path './4-BUILD-SYSTEM/last-build-output/inst/*' \ ! -path './6-PARKED-ORIGINALS/*/*/*' -print0 | sort -z | xargs -0 shasum -a 256 } > SHA256SUMS.txt ) echo " $(grep -vc '^#' "$D/SHA256SUMS.txt" | tr -d ' ') files listed" echo "== done" du -sh "$D"; du -sh "$D"/*