BUILD SCRIPTS
=============
Run them from the folder above this one (4-BUILD-SYSTEM); they use it as
their workspace. ../README-HOW-TO-BUILD.txt has the procedure.
BUILDING THE THREE IMAGES
mksoho.py Psion's soho tarball -> card-soho/ (unmodified) and
card-soho-safe/ (three safety changes). Verifies the
tarball's SHA-256 and the listing entry by entry.
merge-soho.py card-soho + the declared extras, custom files, the
programs written in 2026, safety changes and fixes ->
card/, the full image's tree. Registers every addition
with the image's package manager, and gives TASKS'
"Find new software" its command.
mkfeed.py Builds PsionLX-Software, the archive folder "Find new
software" installs from: an ipkg package for each
addition, from the same definitions merge-soho.py uses.
Its opening comment is the list of what it changes and
of what it leaves out, and why.
mkimage.sh A tree -> a 1 GB CF image. PSION_CARD_DIR picks the
tree (default card). No root privileges.
tarmeta2debugfs.py The tarball listing -> mknods.debugfs (device
nodes) and metadata.debugfs (Psion's mode and owner
for every file), which mkimage.sh writes into the
image with debugfs.
THE BOOT PARTITION
mkbootsafe.py fuchs's CF kernel image -> the hardened one: same
kernel, a start-up ramdisk that cannot reach the
internal flash. --install replaces the shipped one.
nbkproimg.py Read, verify, inflate and rebuild BooSt nBkProOs.img
files (header, zlib payload, two POSIX checksums --
the format of Psion's mk-nBkProOsImg.c).
fatpatch.py Replace one file inside a FAT16 boot partition, and
clear deleted entries, orphaned long names, orphaned
clusters and free space.
CHECKING
linkcheck.py Models the dynamic linker: every program must find
every function it uses in the libraries it links.
Psion's image: 315 programs, 0 failures. Full: 327, 0.
treehash.py One SHA-256 for a whole tree, to compare a rebuild
with what was shipped.
release-safety-check.py
Fails if a folder holds any BooSt script not on its
whitelist, any boot partition that could write the
internal flash, or a file that must never be
released. The release is built with it.
guitest.sh Boots a tree under QEMU and photographs it.
GUITEST_CARD picks the tree; GUITEST_XCLICK='x y ...'
taps the screen first ("d x y" double-taps);
GUITEST_KEYS presses keys; GUITEST_NET=1 adds a
network (this computer is 10.0.2.2); GUITEST_RUN_ROOT
and GUITEST_RUN run a command as root or in the
session; GUITEST_FETCH copies guest files out;
GUITEST_SETTLE is the wait after the taps.
elfdeps.py An ELF's needed libraries.
elfsyms.py An ELF's dynamic symbols, defined and undefined.
THE RELEASE
mkdist.sh Assembles PsionLX/ from the project, copies in the
hand-written documents, and refuses to finish if the
safety check fails, a project Markdown file got in,
a folder has no README, or an SSH key got in. Last it
runs mkrestore.py.
mkrestore.py Writes restore-after-download.tar.gz and .txt at the
top of the release: everything the archive cannot
hold -- links, empty folders, hidden files and
folders, permissions -- and a manifest of every file
with its size and permissions.
restore-after-download.py
Copied to the top of the release. Puts all of that
back into a copy downloaded from the archive, and
checks that every file is there at its full size.
THE FIRST EDITION'S TOOLS (before Psion's image was found)
qbuild.sh Runs a build job inside the emulated ARM OABI machine
(../arm-oabi-chroot). It packs a FRESH chroot every
run and recovers only /build/out.
psionise.py Rebuild a GPE application the way Psion's recipe
says: pinned version, Psion's patches in order.
install-built.py Install a built binary into a card tree, after
checking its ABI, libraries and symbols.
install-libs.py Install missing shared libraries from extracted
Debian ARM packages.
mkgconf.py Build /etc/gconf/gconf.xml.defaults from .schemas
files (without it Solitaire drew blank cards).
mkbg.py, mkicons.py
The reconstructed wallpaper and dock artwork --
superseded by Psion's own.
tapswitch.sh An early emulator test of the reconstructed launcher.
PATHS
e2fsprogs is looked for in Homebrew's places, then /sbin and /usr/sbin;
set E2FS=/path/to/sbin to override. Inside the project these scripts
find Psion's tarball in PSIONEX/ and fuchs's kernel in PsionLX-CF-kit/;
inside the release, in 3-PSION-SOURCES/.