os/ persistent overlay #10
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/.agent#10
Loading…
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?
Plan: os/ Persistent Overlay
Current state
os/builds bootable x86_64 ISOs (residual,residual_virt) and is constructing an AArch64 RPI image (residual_rpi).overlaytmpfs=yes(RPI) or no writability (ISO) — changes lost on reboot.docs/os/os.mdis complete on paper: btrfs-backed overlayfs, qcow2 or labeled-partition backend,/boot/residual.conf,res-osCLI, custom initramfs hook.os-old/contains a previous partial implementation NOT migrated:init/residual-init— assumes Alpine/initsources it; incorrect (current Alpineinitramfs-initdoes not source external hook files).cmd/res-os/+internal/*— Go persistence CLI skeleton; all five subcommands returnfmt.Errorf("not yet implemented").overlayfs/rootfs/etc/ly/— static overlay forlyDM; obsolete (base ISO is console-only).build.sh/Dockerfile.build/suckless/— compile pipeline; not migrated to new shell-basedos/.Decisions (confirmed with user)
res-os setupcopies current tmpfs root into new@uppersubvolume to preserve live session; if persistence already has data, existing@upperused as-is.initramfs-init, installed as/usr/share/mkinitfs/initramfs-init-residual, selected via/etc/mkinitfs/mkinitfs.conf.Gaps vs. expected design
init/residual-initcan't be sourced).residualuser, getty/login wiring,/etc/residual/defaults; no place to shipres-os).res-osCLI does not exist inos/(stubs inos-old/).RESIDUAL-PERSISTnot created).docs/os/os.md:3says "future work"; stale binary namesresidual-loginetc.;AGENTS.mdreferencesos/cmd/res-os/,os/suckless/that only exist inos-old/).Proposed technical approach
os/residual/residual-initramfs/APKBUILDinstalling/etc/mkinitfs/features.d/residual.files+.modules,mkinitfs.conf(init → custom script), forkedinitramfs-init-residual, and/etc/initramfs-init.d/residualhook (mount persistence, snapshot@upper, overlay, orRESIDUAL_LIVE=1).setup.os/overlayfs/rootfs/console-only residual defaults (hostname,/etc/residual/, getty forres-login,residualuser,/etc/apk/repositories); ship viaapkovlor squashfs.res-osCLI: migrate skeleton fromos-old/toos/cmd/res-os/; implementsetup(qcow2 default, partition option, live-root migration),status,snapshot,rollback,export. Statically linked, no CGO, nocore/dependency.RESIDUAL-PERSISTbtrfs partition with@upper/@work/@snapshots; updatecmdline.txtto dropoverlaytmpfs=yesonce hook validated.os/build.sh+Dockerfile.build); addres-osto static overlay; addresidual-initramfspackage to profileapks.Phased plan
docs/os/os.md,AGENTS.md; decideos-old/fate; remove stale references).res-osCLI: migrate + implement 5 subcommands, live-root migration, QEMU test.Files likely to change
docs/os/os.md,AGENTS.md,os/scripts/mkimg.residual*.sh,os/scripts/mkimg.base.sh,os/overlayfs/rootfs/,os/residual/residual-initramfs/*,os/cmd/res-os/,os/internal/*/,os/build.sh,os/Dockerfile.build,os/compose.yml/Dockerfile.mkimage.Verification
PROFILE=residual_virt docker compose run --rm mkimagesucceeds.docker compose run --rm boot-testboots to configured console.res-os setupqcow2, reboot, changes persist.RESIDUAL-PERSISTpartition.Remaining open questions
res-loginon tty1 via inittab/openrc, or busybox getty for now?os-oldcleanup: delete once migrated, or archive outside workspace?Risks
initramfs-initcreates upgrade debt when Alpine bumpsmkinitfs.qemu-nbd+nbdmodule inside initramfs adds size/complexity.res-osoperates on block devices/btrfs; mistakes destroy data. Needs confirmation prompts + dry-run.