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

new-workspace.sh: a copy that stops halfway leaves a workspace that cannot build

vcvkkaf0741662007
diff --git a/tools/new-workspace.sh b/tools/new-workspace.sh
index ee560b4..eb9a0a7 100755
--- a/tools/new-workspace.sh
+++ b/tools/new-workspace.sh
@@ -37,15 +37,23 @@ rm -rf $K/BUILD
)
# what the kernel build needs besides the tree
cp -a --reflink=auto "$ROOT/xnu-deps/." xnu-deps/
-# the files of iOS and the system image made of them
-for d in rootfs cryptex "20F66__iPhone10,3_6"; do cp -al "$ROOT/ios165/$d" ios165/; done
-for f in system.files system.manifest var.skel .done-rootfs .done-cryptex a2s.json; do
- [ -e "$ROOT/ios165/$f" ] && cp -a "$ROOT/ios165/$f" ios165/
+# The files of iOS and the system image made of them. Every one of these is taken only if it is
+# there: a main copy that has not built its images yet has no system.apfs nor root.apfs, and
+# cryptex-app is unpacked only where somebody has needed it -- under "set -e" a copy of a file that
+# is not there used to end the script halfway, leaving a workspace without its QEMU instance number
+# and without a kernel.
+for d in rootfs cryptex cryptex-app "20F66__iPhone10,3_6"; do
+ if [ -e "$ROOT/ios165/$d" ]; then cp -al "$ROOT/ios165/$d" ios165/; fi
done
-for f in rootfs.dmg rootfs.slt extracted; do
- [ -e "$ROOT/ios165/$f" ] && ln -s "$ROOT/ios165/$f" ios165/
+for f in system.files system.manifest var.skel .done-rootfs .done-cryptex .done-cryptex-app a2s.json; do
+ if [ -e "$ROOT/ios165/$f" ]; then cp -a "$ROOT/ios165/$f" ios165/; fi
+done
+for f in rootfs.dmg rootfs.slt cryptex-app.dmg extracted; do
+ if [ -e "$ROOT/ios165/$f" ]; then ln -s "$ROOT/ios165/$f" ios165/; fi
+done
+for f in obj system.apfs root.apfs hello; do
+ if [ -e "$ROOT/userland/$f" ]; then cp -a --reflink=auto "$ROOT/userland/$f" userland/; fi
done
-cp -a --reflink=auto "$ROOT/userland/obj" "$ROOT/userland/system.apfs" "$ROOT/userland/root.apfs" "$ROOT/userland/hello" userland/
[ -f "$ROOT/xnuloader/loader.efi" ] && cp -a "$ROOT/xnuloader/loader.efi" xnuloader/
[ -f "$ROOT/qemu/kernel.syms" ] && cp -a "$ROOT/qemu/kernel.syms" qemu/
echo "$INSTANCE" > qemu/instance