Skip to content

XNU as a loadable kernel module inside Linux (macOS personality for arm64 Linux)

C

System disk without Rosetta: xcodebuild -runFirstLaunch completes from a clean disk (Install Succeeded, 13 s)

Heyang Zhou01789566f69f
diff --git a/scripts/vm-park.sh b/scripts/vm-park.sh
index 5de9b7a..be8c81e 100755
--- a/scripts/vm-park.sh
+++ b/scripts/vm-park.sh
@@ -8,11 +8,19 @@ PARK="com.apple.audiomxd com.apple.audio.coreaudiod com.apple.audio.AudioCompone
com.apple.PerfPowerServices com.apple.PerfPowerServicesExtended com.apple.perfpowermetricd
com.apple.bluetoothd com.apple.mobileactivationd com.apple.xprotectd com.apple.security.xprotectd com.apple.XProtect.daemon.scan com.apple.MRTd
com.apple.systemstats.daily com.apple.systemstats.analysis com.apple.systemstats.microstackshot_periodic
- com.apple.endpointsecurity.endpointsecurityd com.apple.MobileSoftwareUpdate.CleanupPreparePathService ${PARK_MORE:-}"
+ com.apple.endpointsecurity.endpointsecurityd com.apple.MobileSoftwareUpdate.CleanupPreparePathService
+ com.apple.oahd com.apple.oahd-root-helper ${PARK_MORE:-}"
+# Rosetta (oahd): the hosted kernel runs no x86_64 code ("Bad CPU type in executable"), oahd exits at start and launchd
+# keeps its Mach service, so PackageKit's Rosetta cache step after every install (PKUpdateCambriaCacheOperation) waits
+# on it forever. With the daemon parked the installer fails instead ("Could not connect to AOT daemon", "Translation of
+# Intel binaries failed", PKInstallErrorDomain 129); with the Rosetta runtime moved aside too the disk looks like a Mac
+# without Rosetta installed, and the installer skips that step.
sudo mount -o loop,rw,force -t hfsplus "$IMG" /mnt/sys || exit 1
D=/mnt/sys/System/Library/LaunchDaemons; P=/mnt/sys/private/var/xnulinux-parked
sudo mkdir -p $P
-n=0; for j in $PARK; do if [ -e $D/$j.plist ]; then sudo mv $D/$j.plist $P/ && n=$((n+1)); fi; done
+n=0; for j in $PARK; do for d in $D /mnt/sys/Library/Apple/System/Library/LaunchDaemons; do
+ if [ -e $d/$j.plist ]; then sudo mv $d/$j.plist $P/ && n=$((n+1)); fi; done; done
+if [ -d /mnt/sys/Library/Apple/usr/libexec/oah ]; then sudo mv /mnt/sys/Library/Apple/usr/libexec/oah $P/oah && n=$((n+1)); fi
echo "parked $n now; $(ls $P | wc -l) parked in all; $(ls $D | wc -l) jobs left"
sudo umount /mnt/sys
sudo fsck.hfsplus -fy "$IMG" 2>&1 | tail -1; sync
diff --git a/tools/hosted/tests/rfl9.sh b/tools/hosted/tests/rfl9.sh
new file mode 100644
index 0000000..7c03bde
--- /dev/null
+++ b/tools/hosted/tests/rfl9.sh
@@ -0,0 +1,7 @@
+# xcodebuild -runFirstLaunch from a clean system disk, timed; the packages' receipts and the install log after it
+pkgutil --pkgs | grep -c "XcodeSystemResources\|MobileDevice\|CoreTypes"
+S0=$(date +%s); xcodebuild -runFirstLaunch > /tmp/rfl9.log 2>&1; echo "RFL rc=$? in $(( $(date +%s) - S0 ))s"
+grep -v "^$" /tmp/rfl9.log | grep -v "Package Authoring\|com.apple.xpc\|powerd" | tail -6 | cut -c1-200
+pkgutil --pkgs | grep "XcodeSystemResources\|MobileDevice\|CoreTypes"
+grep -a "Install Succeeded\|Install Failed\|Writing system content receipt\|Removing client" /var/log/install.log | tail -4 | cut -c1-180
+S0=$(date +%s); xcodebuild -runFirstLaunch > /dev/null 2>&1; echo "RFL again rc=$? in $(( $(date +%s) - S0 ))s"