Skip to content

feat: distro/DE selector UI and real, verified proot invocation flags#26

Merged
DaRipper91 merged 4 commits into
refork/distro-manifest-and-installerfrom
refork/distro-de-select-ui
Jul 21, 2026
Merged

feat: distro/DE selector UI and real, verified proot invocation flags#26
DaRipper91 merged 4 commits into
refork/distro-manifest-and-installerfrom
refork/distro-de-select-ui

Conversation

@DaRipper91

Copy link
Copy Markdown
Owner

Summary

Depends on #25 — wires that backend into an actual on-device build flow: menu entry -> distro pick -> DE pick -> confirm code -> build (progress dialog) -> back to container list. Also fixes a real correctness issue in #25's ProotExec.kt found while building this.

Base branch note: this targets refork/distro-manifest-and-installer (not REFORK directly) since it directly uses #25's classes — should be merged after #25, or rebased onto REFORK once #25 lands.

What's new

  • DistroSelectFragment / DeSelectFragment / DistroBuildViewModel — RecyclerView pickers following this repo's existing ListAdapter+DiffUtil+ViewBinding pattern (mirrors QuicksFragment). Unavailable DE/distro combos are shown disabled, not hidden.
  • Reuses ConfirmInstallDialogFragment (container-code prompt) and ProgressDialogFragment (build progress) as-is rather than duplicating them.
  • New "Build New Container" menu entry, new Screen.DistroSelect/Screen.DeSelect cases following the exact existing screen-routing pattern.

Real fix found while wiring this up

#25's ProotExec.kt chroot flags were a plausible-sounding guess that turned out to be meaningfully wrong. Found the real, live proot-distro.tiny.yaml in tiny-computer/images (this repo's own README points people to it for the .tiny.yaml format) — its actual boot_command/export_command use a different, more complete flag set (--change-id=1000:1000 not -r/-w, kernel-release spoofing, --sysvipc, and bind mounts for /proc/loadavg etc. targeting placeholder files that a live session's export script normally snapshots). DistroInstaller now creates those placeholder files after extraction. ProotExec now has runAsRootCommand (mirrors export_command) and bootCommandTemplate (mirrors boot_command, written into the synthesized config via new TinyYamlBuilder.kt).

de_packages.yaml gained a session_command per tier-1 DE (what runs inside the container once its X11 socket is ready). Tier-2 entries deliberately have none — TinyYamlBuilder refuses to build a container for a DE with no session_command rather than guess one, and the UI disables any such DE rather than offering it.

Still flagged, not hidden

  • Not device-tested — still can't build without jniLibs.zip.
  • Tier-2 is unselectable end-to-end in the UI until its session-launch story is prototyped (matches the brief's "don't block tier 1 on tier 2").
  • No back-stack for the wizard steps — matches this app's existing screens (none of them have one either), not a new gap.

🤖 Generated with Claude Code

Wires PR #25's backend into an actual on-device build flow (menu entry
-> distro pick -> DE pick -> confirm code -> build -> back to
container list), plus a significant correctness fix to the proot
invocation itself found while building this.

## UI (new)
- DistroSelectFragment / DeSelectFragment (+ DistroBuildViewModel,
  activity-scoped like ContainerManageViewModel): RecyclerView pickers
  following this repo's existing ListAdapter+DiffUtil+ViewBinding
  pattern (mirrors QuicksFragment/ContainerManageFragment). DE tier 2
  entries and any DE unavailable for the picked distro's package
  manager are visibly disabled, not hidden.
- Reuses two existing pieces as-is rather than duplicating them:
  ConfirmInstallDialogFragment for the container-code prompt (already
  decoupled via setFragmentResult, works fine from a different
  fragment) and ProgressDialogFragment for build progress.
- Entry point: new "Build New Container" menu item next to the
  existing Import action in ContainerManageFragment's menu.
- New Screen.DistroSelect / Screen.DeSelect(distroAlias) cases in
  MainViewModel/MainActivity, following the exact existing
  screen-routing pattern. Deliberately did NOT add fragment back-stack
  entries for these — the existing ContainerInstall/ContainerMain
  screens have no back-stack either (confirmed: this app's whole
  fragment_container navigation has none), so adding one only for the
  new screens would be inconsistent, not fixing anything.

## Real correctness fix found while wiring this up
ProotExec.kt's chroot flags (from PR #25) were a plausible-sounding
guess (-r/-w/-b, no --change-id, no proc/sys fakes) that turned out to
be meaningfully wrong. Found tiny-computer/images' actual, live
proot-distro.tiny.yaml (a real, presumably-working example this
repo's own README points people to for the .tiny.yaml format) and its
boot_command/export_command use a completely different, more complete
flag set: --change-id=1000:1000 (not -r/-w), --kernel-release spoofing,
--sysvipc, and — most importantly — bind mounts for /proc/loadavg,
/proc/stat, /proc/uptime, /proc/version, /proc/vmstat, and two sysctl
entries, all targeting placeholder files
($CONTAINER_DIR/proc/.loadavg etc.) that upstream's own export.sh
creates by snapshotting a LIVE session via `tar --transform`. A
freshly-pulled distro image has none of these, so DistroInstaller now
creates them with plausible static content after extraction and before
any first-boot step. ProotExec now has two entry points matching the
real file's two real commands: runAsRootCommand (mirrors
export_command, used for first-boot/DE-install) and
bootCommandTemplate (mirrors boot_command, written into the
synthesized .tiny.yaml — TinyYamlBuilder.kt, new).

de_packages.yaml gained a session_command field per tier-1 DE (what to
run inside the container once its boot_command's X11 socket is ready —
verified shape, real dbus-launch/DE-session commands) — tier-2 entries
deliberately have none, since how a Wayland-only compositor gets a
picture onto this app's Termux:X11 bridge is still the unprototyped
question flagged in PR #25, and TinyYamlBuilder refuses to build a
container for a DE with no session_command rather than guess one.

## Still not done / still flagged
- Not device-tested — this repo still can't build without jniLibs.zip
  from upstream's releases page.
- Tier-2 DE build path exists in DeInstaller (PR #25) but the UI here
  disables any DE lacking a session_command, so tier-2 is currently
  unselectable end-to-end until that's prototyped — matches the task
  brief's "don't block tier 1 on tier 2."
- No fragment back-stack / no way to go back a step in the wizard
  besides the system back button (which exits, matching existing
  screens) — a real gap, just not a regression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 21, 2026 03:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…CI) to trigger CI on this PR

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
DaRipper91 pushed a commit that referenced this pull request Jul 21, 2026
CI (#27) caught two things on this branch's original ProotExec.kt:

1. A genuine compile error: the KDoc comment's own text contained the
   literal sequence "PROOT_LOADER*/PROOT_TMP_DIR" — the `*/` inside
   that prose prematurely closed the doc comment, so everything after
   it (the rest of the comment, then the real code) got parsed as
   top-level Kotlin and failed with cascading "Expecting a top level
   declaration" syntax errors starting at that exact line/column.

2. The underlying proot flags this file guessed at (-r/-w/-b, no
   --change-id, no proc/sys placeholder files) were also substantively
   wrong, not just wrapped in a comment with a syntax bug. This was
   already found and fixed while building PR #26's UI (which needed to
   actually invoke this to synthesize a working boot_command) by
   locating tiny-computer/images' real, live proot-distro.tiny.yaml —
   but the fix only landed on #26's branch, never backported here,
   which is why CI still caught the old broken version on this one.

Pulling over the already-corrected files as-is from #26 rather than
re-deriving them: ProotExec.kt (runAsRootCommand/bootCommandTemplate
replacing the old runInContainerCommand, using the real verified
flags), DistroInstaller.kt (creates the proc/sys placeholder files
those real flags' bind mounts require, in a second shell session after
extraction completes), DeInstaller.kt (updated call site).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
DaRipper and others added 2 commits July 20, 2026 22:43
CI (#27) caught this: showFragmentForScreen()'s new Screen.DistroSelect/
DeSelect cases referenced these classes without importing them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… keep the stack clean

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@DaRipper91
DaRipper91 merged commit a09df47 into refork/distro-manifest-and-installer Jul 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants