Skip to content

fix(install): inject resolv.conf + hosts on fast-install AND restore (no-DNS fix)#25

Merged
luisguzman-adfa merged 3 commits into
mainfrom
fix/fast-install-resolv-conf
Jun 22, 2026
Merged

fix(install): inject resolv.conf + hosts on fast-install AND restore (no-DNS fix)#25
luisguzman-adfa merged 3 commits into
mainfrom
fix/fast-install-resolv-conf

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Problem. The fast-install path (download latest_<tier>_<arch>.meta4 -> extract our prebuilt rootfs into rootfs/installed-rootfs/iiab) never wrote /etc/resolv.conf. proot has no resolver daemon, so a fast-installed system booted with no DNS -> name resolution fails -> apparent 'no internet'. Only the reset (MainActivity) and advanced-reset bootstrap (DeployFragment) paths wrote it.

Why the app, not the build. Our standalone tools/build-iiab-rootfs.sh intentionally strips resolv.conf from the artifact: runtime network config should not be baked into a publicly downloadable tarball (the app is the single owner of system/network state, and it's easy to change here). So the app must inject DNS on fast-install too.

Fix. Right after extraction (and before the companion-data maps/kiwix steps, which also need DNS), write nameserver 1.1.1.1 / 8.8.8.8 to etc/resolv.conf and 127.0.0.1 localhost to etc/hosts into debianRootfs -- mirroring the existing reset path. Wrapped in try/catch; failure only logs a warning.

Touches only DeployFragment.java. Will trigger the APK sanity-check (real app code).

The fast-install path (download latest_<tier>_<arch>.meta4 -> extract our
prebuilt rootfs) never wrote /etc/resolv.conf, so a fast-installed system
booted with no DNS resolver (proot has no resolver daemon) -> no name
resolution -> 'no internet'. Only the reset / advanced-reset bootstrap paths
wrote it.

Our standalone build script intentionally strips resolv.conf from the
artifact (network config shouldn't be baked into a downloadable tarball;
the app owns runtime network state). So the app must inject it on
fast-install too. Mirror the reset path: write nameserver 1.1.1.1/8.8.8.8
and 127.0.0.1 localhost into the rootfs right after extraction, before the
companion-data (maps/kiwix) steps that themselves need DNS.

@claude claude Bot 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.

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.

Mark the imperative resolv.conf/hosts write as a quick add inside the
DeployFragment god-object, to be folded into the rootfs domain/data
slice during the ongoing Clean Architecture strangler refactor.
The reported 'no internet' repro uses the RESTORE path (import backup from
external storage -> restore as internal backup -> boot), NOT fast-install.
That path extracted the rootfs and only updated the UI; it never wrote
/etc/resolv.conf, so the booted guest had no resolver -> name resolution
failed (ping: Temporary failure in name resolution; /etc/resolv.conf absent).

- Extract a single helper ensureRuntimeNetworkConfig(debianRootfs) that writes
  resolv.conf (1.1.1.1/8.8.8.8) + hosts, guarded by an etc/ isDirectory() check
  (logs instead of silently creating files in the wrong place) and logging.
- Call it from BOTH fast-install and restore onComplete (restore targets
  installed-rootfs/iiab, matching the artifact layout).
- Keeps the tech-debt note: imperative, belongs in the rootfs Clean-Arch slice.
@luisguzman-adfa luisguzman-adfa changed the title fix(install): write resolv.conf + hosts after fast-install fix(install): inject resolv.conf + hosts on fast-install AND restore (no-DNS fix) Jun 20, 2026
@luisguzman-adfa luisguzman-adfa merged commit 933552c into main Jun 22, 2026
1 check passed
@luisguzman-adfa luisguzman-adfa deleted the fix/fast-install-resolv-conf branch June 23, 2026 15:42
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