Repository navigation
x86_64: desktop dev profile for PCs/laptops (pygame UI, hybrid BIOS+EFI USB image) + CI - #143
Open
3rdIteration wants to merge 12 commits into
Open
3rdIteration wants to merge 12 commits into
3rdIteration wants to merge 12 commits into
Conversation
Runs SeedSigner's existing desktop mode (pygame display + keyboard/mouse, OpenCV/UVC webcam, CCID readers) on a minimal X11 stack bootable from a hybrid BIOS+EFI USB stick, so an ordinary laptop can run the tool. - opt/external-packages/python-pygame-ce: pygame-ce 2.5.8 as a meson package (sdl2/image/mixer/ttf + freetype from buildroot, midi off, stripped install; sha256-pinned sdist) - opt/x86_64-smartcard-dev: defconfig (La Frite smartcard package set minus Pi/GPIO/Wi-Fi bits, plus X11 + SDL2 + pygame-ce), laptop kernel (PS/2 kbd, UVC, FAT/exFAT, broad DRM+fbdev), grub hybrid EFI+BIOS with fixed-UUID ext4 root, eudev sd* rules reusing the shared mdev.sh mount helper, and a tty1 console launcher (startx -> app) in place of S02seedsigner/getty - opt/rootfs-overlay/etc/mdev/mdev.sh: SS_SKIP_DIY=1 opt-out for architectures with no pinned diy-tools squashfs (no-op for Pi/La Frite) - opt/build.sh: --x86_64 flag (dev-only until a hardened profile lands) - build.yml: x86_64 in the build matrix and dispatch choices; dropped from non-dev runs automatically
embit ships prebuilt libsecp256k1 .so files for every platform and the
RPi arch patch restricts packaging to 'libsecp256k1_linux_arm*'. On the
new x86_64 profile that installed the two ARM32 shared objects into the
rootfs and buildroot's per-package check_bin_arch failed the build
('architecture ... is ARM, should be ... X86-64'). Mirror the existing
aarch64 hook: drop the foreign .so files from the source tree and point
the packaging glob at the linux_x86_64 prebuilt. No-op for every other
profile.
x86_64 CI build reached python-pygame-ce and compiled 111/117 modules,
then died on pypm (the MIDI extension):
gcc: ERROR: unsafe header/library path used in cross-compilation:
'-I/usr/local/include'
Root cause in pygame-ce's meson.build: with -Dmidi=disabled the portmidi
pkg-config lookup misses, and the fallback cc.find_library('portmidi',
required: false) yields a not-found library, but the surrounding
declare_dependency() still reports found(), so src_c/meson.build's
'if portmidi_dep.found()' is true and pypm is built anyway. That fallback
is the only dependency whose include_directories come from pg_inc_dirs
(every other dep resolves via pkg-config, which is why only pypm broke),
and pg_inc_dirs is seeded from bases including /usr/local -- so pypm is
compiled with -I/usr/local/include, which buildroot's cross gcc rejects.
Gate the fallback on get_option('midi').enabled(): with midi disabled the
dependency stays the not-found pkg-config result, pypm is skipped, and no
/usr path leaks into the compile. No-op when midi is enabled and portmidi
is present. Verified the patch applies cleanly to the 2.5.8 sdist.
The x86_64 build now compiles end to end (pygame-ce, X11, grub EFI+BIOS, kernel bzImage, rootfs.ext2 with the fixed UUID all produced) and failed only on the very last step: post-image-seedsigner.sh: line 35: cd: buildroot: No such file or directory buildroot runs post-image scripts with CWD set to its own source tree (the same reason the script's own path arrives as ../x86_64-smartcard-dev/board/...), not the output dir, so there is no 'buildroot' subdirectory to cd into -- buildroot's own board/pc/post-image-efi.sh calls support/scripts/genimage.sh with no cd for exactly this reason. Drop the cd and invoke genimage.sh from wherever it lives: prefer the CWD source tree, else resolve it relative to the (now absolute) board dir via ../../buildroot. genimage.sh derives input/output paths from the exported BINARIES_DIR and BUILD_DIR and takes the config via an absolute -c, so it is CWD-independent.
The kernel's early_lookup_bdev() parses only PARTUUID=/PARTLABEL=/dev/.../ major:minor for root= -- a bare UUID= is an initramfs convention this image has no initramfs to resolve, so the Dell test machine panicked with 'Disabling rootwait; root= is invalid'. Switch grub to root=PARTUUID=ba5eba11-02 and pin the MBR disk signature via genimage's disk-signature option (which otherwise defaults to 0), re-pinned and verified idempotently in post-image.
The Dell test bench has no serial access and no network adaptor, so a black-screen boot is undiagnosable. Create seedsigner-bootlog.txt on the SEEDSIGNOS FAT partition and the launcher mounts it and appends dmesg, the live kernel ring, its own output, the app's stdout/stderr, and a copy of Xorg.0.log on session exit to seedsigner-boot.log on the stick. Marker checked at every respawn; no reflash to toggle; logs are FAT- flushed plus sync on session exit so a hard power-cut keeps them. The hotplug wrapper now skips the SEEDSIGNOS-labelled partition so the boot stick's ESP is never mounted as /mnt/microsd (which would collide with the log mount and get ripped away by the REMOVE handler). Entirely in the dev profile's board overlay -- a release profile cannot inherit it -- and inert without the marker file.
The shared overlay's fstab has no tmpfs /tmp line. Harmless on profiles whose rootfs is gone at power-off, but this profile boots a persistent, rw-remounted ext4, so a /tmp/.X0-lock left by a power-cut X session survived reboot and every startx died with "Server is already active for display 0" -- blank screen and an init respawn loop. Append tmpfs /tmp to the target fstab in post-build, and have the launcher remove display-0 locks before startx (init runs exactly one copy on tty1, so any lock there is stale). Also mount the boot-log FAT partition with -t vfat to stop the kernel probing ext*/squashfs with 'flush'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xserver_xorg-server installs /etc/init.d/S40xorg, which starts a bare
"Xorg :0 vt01" at boot. It took display :0 and vt1 before the tty1
launcher ran, so every startx failed ("Server is already active", then
"server already running" once the lock was cleared) and the screen sat
on S40xorg's empty black root window. Remove it in post-build.
The launcher's lock cleanup now only removes /tmp/.X0-lock when the PID
in it is dead, and logs the holder's cmdline otherwise, so a real
conflict is reported instead of masked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rootfs: switch from an ext4 partition to a gzipped cpio that grub loads as an initrd, so the whole system runs from RAM like the Pi / La Frite images and the USB stick can be pulled after boot. It is a separate initrd rather than embedded in bzImage (several hundred MB of X11 / OpenCV / numpy). The image is now a single FAT32 ESP sized at build time from bzImage + rootfs.cpio.gz; root=PARTUUID is gone and post-image verifies the one-partition layout instead. Display: the app's desktop window is a fixed 960x480, which sat in the middle of a 1366x768 panel. grub passes video=eDP-1:960x480 (and LVDS-1) so the internal panel runs at that mode and the GPU scales it to full screen; external monitors are untouched. Editable in grub.cfg on the FAT. Cards: the udev wrapper now runs fsck.fat -a before mounting a FAT card (clears the dirty bit every reboot leaves), lazily unmounts a dead mount left by a yanked card so the next card is not stacked on it, and on remove only unmounts /mnt/microsd if the removed device is the one mounted there -- pulling the boot stick no longer takes the card away. With the bootlog marker set, the launcher logs the card mount state, settings.json and the fsck/mount logs just before starting the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the video=eDP-1/LVDS-1:960x480 override from grub.cfg: forcing a CVT mode depends on GPU panel-fitter behaviour and is a compatibility risk across machines. The display stays at its native resolution, and xinitrc-seedsigner exports SEEDSIGNER_DESKTOP_FULLSCREEN=1 as the hook for the app to scale its fixed 960x480 desktop layout to fill the screen (app-side work in the seedsigner repo; ignored by refs without it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the udev RUN rules with /usr/sbin/seedsigner-automount, started by S30seedsigner-automount after udev has populated /dev. It polls once a second and keeps one removable card mounted at /mnt/microsd, where the app looks for it: * a card already inserted at boot is mounted on the first pass, with no dependence on udev coldplug ordering; * cards with no partition table (whole-disk FAT) are found -- the old sd[a-z][0-9] rule never matched them; * only USB- or SD-bus devices qualify, so a laptop's internal SATA/NVMe/ eMMC partitions (its own EFI FAT included) are never mistaken for a card; the boot stick's SEEDSIGNOS ESP is skipped; * FAT is fsck'd before mounting; a yanked card's dead mount is always lazily cleared; pulling another stick never unmounts the card. Mounting, options and the FIFO notification stay in the shared mdev.sh. It runs with a deadline and is killed if blocked on the FIFO, so a reader-less FIFO (between app respawns, or one the app recreated) can never stall the loop -- the app polls the mount state itself. xinitrc now launches main.py --fullscreen (app scales its 960x480 desktop layout to the native screen), passing the flag only when the checkout's main.py defines it so an older APP_BRANCH still boots; the SEEDSIGNER_DESKTOP_FULLSCREEN env var stays as the same switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev boot log found its partition by the SEEDSIGNOS label alone, so an internal disk partition carrying that label could be mounted. Restrict it to a USB device, mount vfat only (no type-probing fallback), and add noexec,nosuid,nodev. State the removable-only rule explicitly in seedsigner-automount and the README: only USB- and SD-bus media is ever mounted; internal SATA/NVMe/eMMC storage is rejected before probing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an x86_64 build target that runs SeedSigner's existing desktop mode on an old laptop / PC: minimal Linux + X11, full-screen app, keyboard/mouse input via the app's pygame fallback, USB webcam via OpenCV/UVC (same stack as La Frite), full smartcard set (pcscd + ccid over USB), and real hotplug storage — USB sticks / SD readers auto-mount at /mnt/microsd\ instead of the repo MicroSD folder.
Everything needed already existed on the app side (\desktop_display.py, pygame keyboard mapping in \�uttons.py, OpenCV camera fallback, /mnt/microsd\ preference in \microsd.py); this PR is all OS plumbing. No app changes required: the desktop code paths engage automatically because \periphery/\spidev/\picamera\ are absent and no \io_config.json\ device model matches → \RUNTIME_PROFILE=desktop.
Components
oot=UUID=...) since the stick enumerates as sd[a-c]a depending on the machine's own disks.
oexec,nosuid,nodev, /tmp/mdev_fifo\ app notification, unmount on remove).
Scope / follow-ups
Verified locally: shell syntax of all new/changed scripts, LF line endings, exec bits (\git ls-files -s), jq matrix selection semantics for all board/variant combos.