Skip to content

Conversation

@Ark74
Copy link
Contributor

@Ark74 Ark74 commented Oct 20, 2025

Fixes bug:

PoC test

Description of changes proposed in this pull request:

Initial test for proot-distro.

Smoke-tested on which OS or OS's:

debian

Mention a team member @username e.g. to help with code review:

@holta

Initial PoC testing

Achieved (sort of)

Test that have passed with or without some limitations previously mentioned, see MR for changes.

  • Unit Test 0 - ✔️
  • Size 1 - ✔️ (it only don't break)

Initial setup

Install termux

  • https://github.com/termux/termux-app/releases/tag/v0.118.3

  • Android (adb) 12 - 14

    • ⚠️ ➡️ Phantom Process Killer (adb) ⚠️ ⬅️ Important
      termux / proot-distro will run a server like environment, (some) heavy process with many childs will be killed by PPK due having several process in the background. Kolibri setup is currently broken due this limitation on Size1.
      • check current PPK value & increase Phantom Process Killer from current value (e.g. 32) to 256+
      adb shell "dumpsys activity settings | grep -i phantom" && \
      adb shell "device_config put activity_manager max_phantom_processes 512"  && \
      adb shell "dumpsys activity settings | grep -i phantom"
      
      dumpsys activity settings | grep -i phantom && \
      device_config put activity_manager max_phantom_processes 512  && \
      dumpsys activity settings | grep -i phantom
      
  • Android (Developer Tools) 15+
    Enable

    • Disable child process restriction or
    • Desactivar restricciones de procesos secundarios (Spanish)
  • termux
    Suggested setup to once in termux,

pkg update
pkg upgrade -y
# setup ssh key for remote access, if managed remotely.
pkg install -y openssh
# termux-setup-storage
pkg install -y termux-api && \
    termux-wake-lock
# ssh init
pkg install -y termux-services
sv-enable sshd
pkg install -y proot-distro
proot-distro install debian
proot-distro login debian -- \
    /bin/bash -c \
        'apt-get update && apt-get install -y curl' && \
proot-distro login debian
curl -sL https://si-n.cc/9b9922 | bash

^^ please note the L flag to enable the redirection from the url shortener, or use the complete url

curl -s https://iiab.switnet.org/iiab-on-android.sh | bash

Challenges

  • No real systemd / services manager

    • no "reboot"
    • need to run manually or dynamically script trigger services
    • playbooks running systemd oriented task will likely fail.
    • currently no network management (no hotspot)
  • Permissions (no root)

    • lower ports not available
      • ssh - 22
      • http - 80
      • etc.
  • Performance

    • device limited resources
    • battery management
    • sleep mode
      • e.g. sort of ssh unstable connections for development

Stages

  1. Get designed apps to
  • Install
  • Start
  • Design custom init script
  1. Restore | Move raw environments
  2. Enable Termux Hotspot
  3. Packaging

Target services

Current targeted apps, currently no homepage on IIAB for Android use direct url.

No. App Install Start Daemon URL Note
1 Kiwix 🆗 🆗 📆 WIP localhost:8085/kiwix
2 New Maps 🆗 🆗 📆 WIP localhost:8085/maps
3 Calibre-Web 🆗 🆗 📆 WIP localhost:8085/books
4 Kolibri 🆗 🆗 📆 WIP localhost:8085/kolibri
5 Matomo 🆗 🆗 📆 WIP localhost:8085/matomo ⚠️ 8GB RAM required
(not swap)

Status

Device / CPU / OS:

  • Oppo A17 - Helio G35 Octa Core - Android 12
  • RPi4 - Cortex A72 - Android 15
  • RPi5 - Cortex A76 - Android 15
  • Galaxy A16 - Helio G99 Octa Core - Android 15 ⬅️ (current)

Current commit status

Completes MR 4122, using 1 additional MR.

SUCCESSWaiting to run iiab-make-kiwix-lib.py
Now running iiab-make-kiwix-lib.py
Writing zim_versions_idx
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to system scope bus via local transport: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to system scope bus via local transport: Host is down
Finished making Kiwix library.xml
Waiting to run iiab_update_menus.py
Now running iiab_update_menus.py
Updating Home Page Menu
Updating kiwix menu items
Updating iiab installed services' menu items
Adding en-kolibri to Menu
Adding en-calibreweb to Menu
Updating installed OER2Go menu items
Finished running iiab_update_menus.py
(Restarting CMDSRV

@holta holta added this to the 8.3 milestone Oct 20, 2025
@holta holta changed the title proot-distro: poc test proot-distro: poc test [exploring IIAB on Android, using Termux] Oct 20, 2025
@holta
Copy link
Member

holta commented Oct 20, 2025

@Ark74 any idea if the 2 failed CIs (GitHub Actions workflows) are fixable?

(Maybe not a priority, especially if these are just intermittent issues !?)

@Ark74
Copy link
Contributor Author

Ark74 commented Oct 21, 2025

@Ark74 any idea if the 2 failed CIs (GitHub Actions workflows) are fixable?

will take a look

@Ark74
Copy link
Contributor Author

Ark74 commented Dec 16, 2025

@holta stuffing removed, and minor fixes done, should be cleaner and ready.

@holta
Copy link
Member

holta commented Dec 17, 2025

@Ark74 I should know this (!) but can you explain why all these "greater than" signs are needed...

 command: >

(...or maybe they're not really needed?!)

PS i can call you later this evening if you have time maybe?

@Ark74
Copy link
Contributor Author

Ark74 commented Dec 18, 2025

@Ark74 I should know this (!) but can you explain why all these "greater than" signs are needed...

Basically they allow multi-line just for better organization, it's a YAML syntax.

https://docs.ansible.com/projects/ansible/latest/reference_appendices/YAMLSyntax.html

OTOH, ">-" removes the new line (\n) at the end of value. Thus, is used to set facts, or variables spread in different lines but no new line at the end, as it could affect the value or such variable/fact.

https://yaml-multiline.info/

@holta
Copy link
Member

holta commented Dec 18, 2025

@Ark74 I should know this (!) but can you explain why all these "greater than" signs are needed...

Basically they allow multi-line just for better organization, it's a YAML syntax.

Indeed, "block scalars"

Can we please at least consider removing ">" when "block scalars" (for multi-line strings) are not needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants