Rebuild the rootfs after SD loss - package everything that lived only on the card #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened
The SD card was wiped and reused by accident (2026-09-27), and there was no rootfs backup. A minimal replacement card now boots: the Aug 18
alarm/out/gts6l-alarm-rootfs.ext4plus current modules, with the console on the serial jig. See MAINLINE-NOTES "Linux on the serial console". Everything set up by hand on the device after Aug 18 is gone. Every feature marked working in #5, #13, #16 and #18 depended on some of it.What was lost
Inventory from
baselines/good-boot-20260823-083110.state(a working boot, Aug 23) plus the notes:Services (all enabled and active in the good boot):
rmtfs,pd-mapper,tqftpservas proper units. Don't start them as background jobs from a oneshot: systemd reaps those (notes 2026-08-22).gts6l-modem.service: starts the modem remoteproc. WritingstartBLOCKS about 40 s, so run it in the background or raise TimeoutStartSec. It needsqcom_q6v5_pas.auto_boot=0and recovery set todisabledBEFORE start (#16, commitb0c82aaf1d).gts6l-wifi.service: only starts the modem, with Requires=/After=.pd-mapperhas an empty WantedBy= and only came up through this chain.gts6l-kmsgcap.service: dmesg to/root/kmsg.log. It's the log channel that survives resets (ramoops doesn't).hexagonrpcd-sdsp.service: hexagonrpcd built from github linux-msm/hexagonrpc into /usr/local. It serves/usr/share/qcom/sm8150/Samsung/gts6l./etc/systemd/timesyncd.conf.dNTP=pool.ntp.org. The RTC is read-only and reads 1970, which also breaks pacman's PGP checks.Code / packages:
/root/rmtfs.fd_open()falls back to the read-only shadow buffer on EROFS/EACCES, because fsg sits on a write-protected UFS LUN. Without it the modem gets no NV. It's upstreamable to linux-msm/rmtfs, so this time put it in a package or a fork.Config:
10-usb0.network.d/route.conf: a persistent default route via 172.16.42.2, metric 1000.root=/dev/mmcblk0p2 rootwait rw console=tty0 consoleblank=0 earlycon=gtsfb,0x9c400000 panic=10 sysctl.kernel.panic_on_rcu_stall=1 ufs_qcom.dbg_rate_a=1 regulator_ignore_unused systemd.unit=multi-user.targetufs_qcom.dbg_rate_a=1is still required. Leaving it out offlines UFS and stalls init for 49 s. The serial variant swaps inearlycon=qcom_geni,0xa90000 console=ttyMSM0,115200n8.What to do
linux-gts6l(the kernel is 26 commits past its last package) andgts6l-device(the Aug 24 source was never built).gts6l-device. rmtfs, hexagonrpcd and libssc get their own PKGBUILDs.alarm/build-rootfs.sh extract && customize && image, and flash it with the golden cmdline.pacman -Qqe, pulled to the host.Done when
A fresh card built only from packages boots with UFS, sensors (
ssccli), WiFi, BT and the modem services all working together (Kit's in-tandem standard). Losing the card again would then cost one script run.2026-09-27: offline half done - a rootfs built only from packages
Everything below is built and checked on the host. None of it has run on the device yet.
Packages (kit/gts6l-alarm, all in
alarm/out/):linux-gts6l6.17.0-3: 43-patch series, incl. the MUIC UART fix and the #9 fuel gauge. The first time this PKGBUILD has ever built (it had two latent bugs: sources in a subdirectory, wrong checksum count).gts6l-device0.7: the whole Aug 23 on-device setup, rebuilt from the notes and #5. gts6l-rproc (auto_boot=0, recovery=disabled before start, modem held until uptime 120 s, configurable in/etc/gts6l/rproc.conf), a rmtfs drop-in-P -r -v(never-s: that stops the modem on exit, which is the TrustZone hang), sensors (persistro,noload, served tree under /run, hexagonrpcd started by udev), BT/board.bin copied, kmsgcap, usb0 on networkd, NM for WiFi, timesyncd.pd-mapper,tqftpserv,hexagonrpc: built natively in an aarch64 chroot.qrtr-gitandrmtfs-gitcome from ALARM's aur repo; libssc and iio-sensor-proxy from extra.gts6l-uboot2025.10-2: U-Boot with menu 38 (SD boot + serial console) and menu 39 (XBL+ABL log to SD).Rootfs:
alarm/out/gts6l-alarm-rootfs.ext4(4 GB, 2.2 GB used), viasudo WORK=<tmpfs> alarm/build-rootfs.sh extract && customize && image 4096. Verified by mounting it: all packages present, stock kernel removed, every Aug 23 unit enabled,/boothas our kernel + DTB, andresolv.conf/nsswitch.conf/pacman.confare stock.Deploy:
tools/deploy-sd.sh /dev/sdX --writepartitions the card, writes that image, and buildsboot-gts6l.img+ CRC from the rootfs's own kernel with the golden cmdline (tools/mkboot-gts6l.shrefuses any cmdline missingufs_qcom.dbg_rate_a=1).Deliberately NOT restored:
-ris enough (the modem never asked for EFS) and can't corrupt Samsung's NV. The patch is parked inalarm/upstream/rmtfs.Still open, needs the tablet:
gts6l-flash-ubootand test menus 38/39.Bugs found along the way:
build-rootfs.shcopiedresolv.confthrough ALARM's absolute symlink onto the host's/run/systemd/resolve/resolv.conf. Fixed.logsave/mirsaveraw SD writes would land inside the new card's FAT. Fixed.