Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tools/aurora-sep/install-aurora-sep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1099,10 +1099,17 @@ m3_stub_problem() {
# M3_STAGE1_VERSIONS); nothing when it is.
# Clean v1.6.1 has the same base/entry/BootArgs chainload ABI as aurora13.
# Both supported Air boards use the same T8122 chainload ABI and exact stub.
# The 14" M3 Pro (J514S) qualifies on the same terms: an Asahi-installer
# Mac reports clean v1.6.1 where an Omarchy-installer Mac reports
# v1.6.1-dirty, with the same 14.8.3 stub. Only with --m3-handoff.
m3_clean_stage1_14_qualified() {
local fw target version
[[ $M3_GPU_PROFILE == legacy && ($(this_board) == j613 || $(this_board) == j615) && $(this_soc) == t8122 &&
" $M3_PERSISTENT_BOARDS " == *" $(this_board) "* ]] || return 1
if [[ $M3_GPU_PROFILE == legacy && $(this_board) == j514s && $(this_soc) == t6030 ]]; then
((M3_TRY)) || return 1
else
[[ $M3_GPU_PROFILE == legacy && ($(this_board) == j613 || $(this_board) == j615) && $(this_soc) == t8122 &&
" $M3_PERSISTENT_BOARDS " == *" $(this_board) "* ]] || return 1
fi
[[ ! -e $DT/$M3_OSLOG_OVERLAP ]] || return 1
fw=$({ tr -d '\0' <"$DT/chosen/asahi,os-fw-version"; } 2>/dev/null) || return 1
[[ ($fw == 14.7 || $fw == 14.8.3) && -z $(m3_stub_problem) ]] || return 1
Expand Down
29 changes: 29 additions & 0 deletions tools/aurora-sep/tests/test_m3_handoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,35 @@ def test_plan_on_another_stage1(self):
self.assertIn("stage 1 is v1.7.0", proc.stderr)
self.assertIn("Nothing was installed", proc.stderr)

def asahi_installer_mac(self, board, os_fw="14.7"):
# A Mac set up by the Asahi installer: clean v1.6.1 stage 1, same 14.8.3 stub.
self.mac(board, stage1="v1.6.1")
(self.dt / "chosen" / "asahi,os-fw-version").write_bytes(os_fw.encode() + b"\0")

def test_stage1_clean_on_j514s_with_handoff(self):
self.asahi_installer_mac("j514s")
self.assertEqual(self.run_sh("M3_TRY=1\nm3_stage1_problem").stdout, "")
self.assertEqual(self.plan(try_=1), "handoff")

def test_stage1_clean_on_j514s_without_handoff(self):
# A plain run keeps the kernel-only install, as before.
self.asahi_installer_mac("j514s")
self.assertIn("stage 1 is v1.6.1", self.run_sh("m3_stage1_problem").stdout)
self.assertEqual(self.plan(), "kernel")

def test_stage1_clean_on_j514s_needs_the_stub(self):
for os_fw, stub in [("13.5", "14.8.3"), ("14.7", "15.6")]:
with self.subTest(os_fw=os_fw, stub=stub):
self.asahi_installer_mac("j514s", os_fw=os_fw)
self.mac("j514s", stage1="v1.6.1", stub=stub)
proc = self.run_sh("M3_TRY=1\nm3_plan", check=False)
self.assertNotEqual(proc.returncode, 0)
self.assertIn("Nothing was installed", proc.stderr)

def test_stage1_clean_stays_refused_on_j516s(self):
self.asahi_installer_mac("j516s")
self.assertIn("stage 1 is v1.6.1", self.run_sh("M3_TRY=1\nm3_stage1_problem").stdout)

def test_overlap_marker(self):
self.mac("j516s")
self.assertEqual(self.run_sh("m3_oslog_overlap_check").stderr, "")
Expand Down