Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: termux distro and rootfs #419

Open
knyipab opened this issue Jun 12, 2024 · 13 comments
Open

[Feature]: termux distro and rootfs #419

knyipab opened this issue Jun 12, 2024 · 13 comments
Labels
enhancement New feature or request

Comments

@knyipab
Copy link

knyipab commented Jun 12, 2024

Feature description

Would it be possible to add termux (bootstrap) as one of the supported distro in proot-distro?

Perhaps the primary use case is for on device build. Given that running termux build script and a build failure can mess up the existing termux environment. Also, building large package can require a large number of deps packages and tracking those manually can be painful. It would be useful if a Termux inside Termux environment can be done.

Besides, with qemu-user or qemu, proot-distro can manage a Termux rootfs in other architecture, probably useful for things like box64 (a glibc package) or fex (unlikely in Termux due to seccomp). If I am not mistaken, Termux does not support multiarch like ubuntu. I am not sure about this use case as I did not play around with box64.

Thanks for consideration.

@knyipab knyipab added the enhancement New feature or request label Jun 12, 2024
@23xvx
Copy link

23xvx commented Jun 16, 2024

I think there is already a package to install an isolated termux environment in termux
which is termux-install

@knyipab
Copy link
Author

knyipab commented Jun 16, 2024

Thanks for your info. However, the termux-install package has quite a number of limitations:

  • Uses an outdated version of Termux bootstrap (2022 version)
  • No option to isolate $HOME, which can be important in testing new packages
  • No alias feature like proot-distro so cannot host multiple instances
  • No multarch or qemu support (i.e. can't run x86_64 rootfs on aarch64)
  • It's not official (on TUR) and no more updates since two years ago

Still, your info is very useful. That is a good starting point and I will build on that if Termux dev has no plan or think it not appropriate to include Termux rootfs in the proot-distro.

@sylirre
Copy link
Member

sylirre commented Jun 26, 2024

Termux distro will be added eventually, but not before 5.x. It is not FHS-compliant and requires special handling.

@NoNameWasDefined
Copy link

You can try this old script.
I am trying to make a plugin for it but I'm not sure I will make it working.

@sylirre
Copy link
Member

sylirre commented Oct 14, 2024

A modified bootstrap archive is a minimal requirement to get started. Although changes to proot-distro script will be required because Termux doesn't have certain things expected on a normal Linux distribution (e.g. /etc/passwd).

For using https://github.com/Neo-Oli/chrooted-termux/blob/master/prooted-termux you need to change bootstrap url.

@NoNameWasDefined
Copy link

I know and I'm trying to bypass it.
For the bootstrap URL know where to download.

@23xvx
Copy link

23xvx commented Oct 15, 2024

Maybe bootstrap files can be found here https://github.com/termux/termux-packages/releases/

@NoNameWasDefined
Copy link

NoNameWasDefined commented Oct 15, 2024

Yes, just add a non-empty /etc folder with useless data for Termux but needed for PD and also create symlinks in SYMLINKS.txt.

@NoNameWasDefined
Copy link

Do someone know where is the bootstrap installer script of the app itself ?

@sylirre
Copy link
Member

sylirre commented Oct 15, 2024

Termux app doesn't use scripts to install bootstrap. It just unzips the archive and processes SYMLINKS.txt.

Here is relevant code piece: https://github.com/termux/termux-app/blob/8be53336c381f427137d60170269966a08b6f462/app/src/main/java/com/termux/app/TermuxInstaller.java#L154-L219

@NoNameWasDefined
Copy link

Ah ok, just that lol.

@NoNameWasDefined
Copy link

And what is loaded in each startups ?

@sylirre
Copy link
Member

sylirre commented Oct 15, 2024

On every session Termux runs /data/data/com.termux/files/usr/bin/login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants