make iiab-android proot-safe (deterministic chroot/reboot handling)#22
Merged
Merged
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Collaborator
Author
|
@claude review |
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, comment @claude review on this pull request to trigger a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building / running the IIAB installer under proot relies on chroot/container detection that is environment-dependent and unreliable. On a phone it usually resolves "chroot/proot" so the install works; but in headless /
async builds — building the rootfs on an ARM64 board (Rock 5B+), via GitHub Actions, or as a server maintenance routine on
iiab.switnet.org— the same checks can flip the other way, and IIAB then attempts systemd / rebootactions that don't exist under proot, breaking the build at a different spot each time (the "it breaks for any little thing" symptom).
There are three independent detections, at three layers:
Ansible fact
ansible_facts.is_chroot— gates systemd-only tasks, e.g.roles/0-init/tasks/hostname.yml:command: hostnamectl ...withwhen: not ansible_facts.is_chroot. Under proot, when the fact is wronglyFalse,hostnamectlruns and fails (hostnamectl: not found).The fact is driven by the
debian_chrootenv var (or a/procheuristic).Native
/usr/sbin/iiabbashIS_CHROOT—ischroot -t || systemd-detect-virt --container -q. WhenFalse, the installer ends withreboot(absent under proot →rc 127), which aborts this wrapper before its Android tail (install_iiaboa_dashboard, readiness flags).Missing binaries under proot:
reboot,hostnamectl.Fixed by,
ansible_facts.is_chroot = Truedeterministically: exportsdebian_chroot, persists it in/etc/environment(pam_env), and keeps it acrosssudovia/etc/sudoers.d/99-iiab-proot-chroot(Defaults env_keep += "debian_chroot").install.txtruns the installer viasudo, whose defaultenv_resetwould otherwise strip it.ischroot(exit 0) and a no-oprebootin/usr/local/sbin, so the native installer takes itsIS_CHROOT=truepath ("IIAB Done", no reboot, no tty prompt) and the wrapper continues to the Android tail. These are also correct to keep in the rootfs (under proot we are chroot-like and must never drive the host init).hostnamectlshim (writes/etc/hostname).