Skip to content

Commit b8787c7

Browse files
committed
main: Support generic in-place step2 with pairing
This will fail for 11.x, but we haven't supported that in forever. Trust bputil to know about pairing, and allow in-place step2. This is useful for resuming/repairing installs from recoveryOS booted as paired, and eventually also for m1n1 updates. Signed-off-by: Hector Martin <[email protected]>
1 parent 67d17e5 commit b8787c7

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/main.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class IPSW:
2727
min_macos: str
2828
min_iboot: str
2929
min_sfr: str
30-
paired_sfr: bool
3130
expert_only: bool
3231
url: str
3332

@@ -65,23 +64,20 @@ class Device:
6564
"12.1",
6665
"iBoot-7429.61.2",
6766
"21.3.52.0.0,0",
68-
False,
6967
True,
7068
"https://updates.cdn-apple.com/2021FCSWinter/fullrestores/002-42433/F3F6D5CD-67FE-449C-9212-F7409808B6C4/UniversalMac_12.1_21C52_Restore.ipsw"),
7169
# This is the special M2 version, it comes ahead so it isn't the default in expert mode
7270
IPSW("12.4",
7371
"12.1",
7472
"iBoot-7459.101.3",
7573
"21.6.81.2.0,0",
76-
False,
7774
True,
7875
"https://updates.cdn-apple.com/2022SpringFCS/fullrestores/012-17781/F045A95A-44B4-4BA9-8A8A-919ECCA2BB31/UniversalMac_12.4_21F2081_Restore.ipsw"),
7976
IPSW("12.3",
8077
"12.1",
8178
"iBoot-7459.101.2",
8279
"21.5.230.0.0,0",
8380
False,
84-
False,
8581
"https://updates.cdn-apple.com/2022SpringFCS/fullrestores/071-08757/74A4F2A1-C747-43F9-A22A-C0AD5FB4ECB6/UniversalMac_12.3_21E230_Restore.ipsw"),
8682
]
8783

@@ -462,8 +458,7 @@ def step2(self):
462458
bootpicker_works = sys_ver >= (12, 3)
463459
if not bootpicker_works and self.ipsw:
464460
bootpicker_works = sys_ver >= split_ver(self.ipsw.min_macos)
465-
466-
if is_1tr and self.is_sfr_recovery and self.ipsw.paired_sfr:
461+
if is_1tr and self.osi.paired:
467462
subprocess.run([self.ins.step2_sh], check=True)
468463
self.startup_disk(recovery=True, volume_blessed=True, reboot=True)
469464
elif is_recovery:

src/osenum.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class OSInfo:
2323
recovery: object = None
2424
rec_vgid: str = None
2525
bp: object = None
26+
paired: bool = False
2627
admin_users: object = None
2728

2829
def __str__(self):
@@ -208,6 +209,9 @@ def collect_os(self, part, volumes, vgid):
208209
osi.m1n1_ver = fuos.split(b"##m1n1_ver##")[1].split(b"\0")[0].decode("ascii")
209210
logging.info(f" m1n1 version found: {osi.m1n1_ver}")
210211

212+
if b": Paired" in bps:
213+
osi.paired = True
214+
211215
return osi
212216

213217
def bputil(self, *args):

0 commit comments

Comments
 (0)