Skip to content

feat: custom Linux images and separate storage policies - #4

Open
pdev-labs wants to merge 6 commits into
mainfrom
custom
Open

pdev-labs wants to merge 6 commits into
mainfrom
custom

Conversation

@pdev-labs

@pdev-labs pdev-labs commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

What does this change?

Two related additions on the custom branch.

Custom Linux userlands. Guided setup gains option 9, and lfa install
gains --iso PATH and --rootfs PATH. A rootfs tarball, an extracted
directory, or a live ISO is unpacked and runs under proot next to the eight
built-in distros.

Separate storage policies. Android shared storage and external (SD card /
USB) storage can now be disabled independently. Both default to on, which
keeps proot-distro's normal binds. When either is off, the session starts with
--isolated and LFA adds back only the enabled category, so the disabled tree
is not reachable through /storage.

Why?

The installer only offered the eight proot-distro aliases, and the README
explicitly said arbitrary rootfs tarballs were unsupported. Users with an
arm64 live ISO or a vendor rootfs had no supported path.

Storage was previously a single yes/no. A guest that should see an SD card but
not the phone's shared storage (or the reverse) had no way to express that.

How was it tested?

  • ./tests/test-all.sh passes locally (PASS=965 FAIL=0)
  • shellcheck -S warning install_linux.sh tests/test-all.sh is clean
  • Exercised on a real device (state device, Android version, distro, backend)

Device / distro / backend used: Vivo V2437, Android 16 (SDK 36), kernel
6.1.145, ubuntu/xfce4/x11. Each storage combination was toggled on the real
instance and checked with a second proot login, including --all. The host
suite also runs on the phone; its four L4/N failures reproduce on main
because those tests hardcode /usr/bin:/bin, which Termux does not have.

The Y12-Y12f tests cover a known-family tarball, an unknown package
manager, a live ISO with a squashfs, wrong-architecture refusal, CLI source
validation, and the guided custom flow. Y13-Y13c cover the runtime
toggles, conf persistence, the guided four-way storage menu, CLI install
flags, that --isolated is emitted only when needed, and --all across
multiple instances.

Usage

lfa install --distro ubuntu --android-storage off -i ubuntu
lfa install --distro debian --no-android-storage --no-external-storage -i minimal
lfa storage android disable -i ubuntu
lfa storage android enable -i ubuntu
lfa storage external status -i ubuntu
lfa storage android disable --all
lfa storage external status --all

Checklist

  • No secrets, passwords, or personal paths in the diff or logs
  • Docs updated if behaviour or the test count changed
  • README.md numbers still match the suite (the suite enforces this)

Add a ninth guided-setup option and `lfa install --iso/--rootfs` so a
user-supplied userland can run under proot next to the built-in distros.

- Accept rootfs tarballs, extracted directories, live ISOs and raw
  images; extract the live squashfs (including Fedora's nested ext4)
  with unsquashfs when available and 7z as the fallback.
- Check the CPU architecture before installing, since proot cannot
  emulate another CPU.
- Read /etc/os-release, map the image to a package-manager family and
  reuse the normal desktop/software setup. Unknown families install
  terminal-only instead of calling a package manager that is absent.
- Stage the extracted tree during guided setup so the family is known
  before the desktop and software menus, then move it into the
  proot-distro layout. Clean the stage and temporary extraction
  directories on interrupt.
- Reject tar members with absolute or parent-relative paths, and handle
  zipped rootfs trees with a single top-level directory.
- Record CUSTOM_SOURCE, CUSTOM_NAME and CUSTOM_ID in the guest config.

Tests cover a known-family tarball, an unknown family, a live ISO,
wrong-architecture refusal, CLI validation and the guided flow. The
host suite is now 917 checks.
Guests can now disable Android shared storage and external (SD card/USB)
storage independently. Both default to on, which keeps proot-distro's
normal binds. When either is off, the session starts with --isolated and
LFA adds back only the enabled binds, so the disabled tree is not
reachable through /storage.

- guided setup offers Both / Android only / External only / None
- lfa install gains --android-storage and --external-storage, plus
  --no-android-storage and --no-external-storage shortcuts
- lfa storage android|external on|off|status changes an instance without
  reinstalling
- start-linux, terminal-linux, and lfa storage status share the policy
  helper
- docs, changelog, and tests updated (952 checks)
@pdev-labs pdev-labs changed the title feat: install custom Linux ISO and rootfs images feat: custom Linux images and separate storage policies Nov 28, 2026
`lfa storage android|external` now documents enable|disable|status, with
on/off kept as aliases. The help text, README, CHANGELOG, and USB docs use
the new forms, and the Y13 tests exercise disable, enable, and status.

Also rewrites README passages that leaned on rhetorical contrasts,
repeated points, curly quotes, and decorative closers. Facts, commands,
paths, tables, and the enforced check count are unchanged.
Plain wording in the README introduction and the repository About field.
The description now says what the project runs and where, lists the
distros, and keeps the no-root and Android 5.1 to 16 facts. Removed the
em dashes, the arrow, and "graphical Linux environment".
The nightly tag no longer publishes termux-x11-universal-debug.apk, so
the Android scenario failed at download with a 404. Switch to
termux-x11-universal-release.apk and bump the pinned digest. This is the
asset review the digest check is meant to trigger.
`lfa storage android|external enable|disable|status --all` applies the
change to every installed instance. --all and -i are rejected together.
Single-instance output is unchanged; --all prefixes each line with the
instance name.

README, CHANGELOG, and Y13d tests updated (965 checks).
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.

1 participant