Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

The reason in those comments was wrong: a prefix binary never asks iOS at all

vcvkka7490b629335
diff --git a/userland/build.sh b/userland/build.sh
index 4d2d17b..17c1f78 100755
--- a/userland/build.sh
+++ b/userland/build.sh
@@ -258,9 +258,10 @@ if [ -d $IOS/rootfs/usr/lib ]; then
mkdir -p root/var/root/.ssh
printf 'd\t700\t0\t0\t/private/var/root/.ssh\n' >> root/etc/var.skel
# the key that lets us in, and the host's own key beside it: made here and not on the
- # phone, because ssh-keygen asks the system who uid 0 is and gets "No user exists for
- # uid 0" -- the job that answers that (com.apple.mobile.usermanagerd) is loaded into
- # the user's domain, where a program of root's does not find it
+ # phone, because ssh-keygen asks who uid 0 is and gets "No user exists for uid 0" --
+ # it asks through libiosexec, which reads a database the bootstrap does not ship (see
+ # init.c, where it is now built at every boot); the key is made here all the same,
+ # since nothing should depend on the order of those two
for k in authorized_keys ssh_host_ed25519_key ssh_host_ed25519_key.pub; do
[ -f ../ssh/$k ] || continue
cp ../ssh/$k root/var/root/.ssh/$k
diff --git a/userland/src/init.c b/userland/src/init.c
index 1803880..c6a7f27 100644
--- a/userland/src/init.c
+++ b/userland/src/init.c
@@ -902,7 +902,9 @@ mount_writable(void)
* /var/jb/etc/pwd.db -- a Berkeley database that pwd_mkdb makes from master.passwd and
* that the bootstrap does not ship, only the text it is made from. Without it every
* program of the prefix answers "no such user": an sshd from here refused every login
- * with "Invalid user root" while iOS's own /bin/ps resolved users perfectly. The
+ * with "Invalid user root" while iOS's own /bin/ps resolved users perfectly -- and the
+ * asymmetry is exactly this, not anything about iOS's own database or the launchd domain
+ * its server sits in, because a program of the prefix never asks iOS at all. The
* writable copy of the prefix is new at every boot, so the database is made at every
* boot; it takes milliseconds.
*/