#
✕ nick:tpw_rules
#asahi · 2024-01-05 03:58
tpw_rulesi'm sorry but i think i've about reached the limits of static analysis
#asahi · 2024-01-05 03:56
tpw_rulesyeah it all does
#asahi · 2024-01-05 03:51
tpw_rulesthe fact that the UUIDs are wrong or on the wrong partitions, or the type codes/underlying type UUIDs are wrong
#asahi · 2024-01-05 03:51
tpw_rulesi mean maybe it's a bit presumptuous of me to assume you are fluent in C but really that's what the evidence points to
#asahi · 2024-01-05 03:49
tpw_rulesand the type codes too
#asahi · 2024-01-05 03:48
tpw_rulescan u-boot print the UUIDs somehow, and its bootable flag?
#asahi · 2024-01-05 03:47
tpw_rulesi still think something is not lining up in the partition table
#asahi · 2024-01-05 03:47
tpw_rulesi guess fw_dev_part didn't get set if the esp was not found
#asahi · 2024-01-05 03:46
tpw_rulesit would be great to see if you can print the BootNNNN variables from u-boot
#asahi · 2024-01-05 03:45
tpw_ruleshm it might not be compiled in
#asahi · 2024-01-05 03:43
tpw_rulescan you look at the efi variables with efidebug
#asahi · 2024-01-05 03:42
tpw_rulesthe efi boot manager handles that
#asahi · 2024-01-05 03:42
tpw_ruleshttps://github.com/AsahiLinux/u-boot/blob/71f6d0feb47836614752a0e30a1b7339b9e15656/arch/arm/mach-apple/board.c#L826
#asahi · 2024-01-05 03:36
tpw_rulesis that env var really not there?
#asahi · 2024-01-05 03:35
tpw_rulesok i think that's right
#asahi · 2024-01-05 03:30
tpw_ruleswhat u-boot version does it print?
#asahi · 2024-01-05 03:27
tpw_ruleshttps://github.com/AsahiLinux/u-boot/blob/71f6d0feb47836614752a0e30a1b7339b9e15656/arch/arm/mach-apple/board.c#L937 the commit you are probably running
#asahi · 2024-01-05 03:27
tpw_ruleshttps://github.com/AsahiLinux/u-boot/blob/75f0cb2074aaffcc13d18f6f6e5ab475550513e1/arch/arm/mach-apple/board.c#L936
#asahi · 2024-01-05 03:26
tpw_rulesalso what's the fw_dev_part env variable
#asahi · 2024-01-05 03:23
tpw_ruleswhat if you stop autoboot then do `run boot_efi_bootmgr`?
#asahi · 2024-01-05 03:20
tpw_rulesare you using grub?
#asahi · 2024-01-05 03:19
tpw_rulesthe full thing i meant, sorry
#asahi · 2024-01-05 03:17
tpw_rulesi'd have to see the log to be sure what you're talking about
#asahi · 2024-01-05 03:15
tpw_ruless/gparted/gdisk/
#asahi · 2024-01-05 03:15
tpw_rulesdo your ESPs have the EF00 type code in gparted?
#asahi · 2024-01-05 03:13
tpw_rulesthe one you care about is the one that's booting the wrong linux?
#asahi · 2024-01-05 03:11
tpw_rulesi'm not sure, it depends which you're talking about. m1n1 won't put anything on the screen unless it can't find the second copy of itself. but it could also be grub or the kernel
#asahi · 2024-01-05 03:10
tpw_rulesand just to be clear, they are both different and also both correspond to the PARTUUID of a partition on your disk
#asahi · 2024-01-05 03:08
tpw_rulesso then it has to be a problem with grub or whichever bootloader you use
#asahi · 2024-01-05 03:05
tpw_rulesso you're able to read /chosen ?
#asahi · 2024-01-05 03:04
tpw_ruleswith the address
#asahi · 2024-01-05 03:04
tpw_rulesbut iirc there's an environment variable fdt_addr_r
#asahi · 2024-01-05 03:04
tpw_rulesfdt should work by default, it shouldn't need an address
#asahi · 2024-01-05 02:47
tpw_rulesi think you can also query u-boot for which ESP it's using
#asahi · 2024-01-05 02:44
tpw_rulesso it's not really clear to me which step is getting mixed up
#asahi · 2024-01-05 02:43
tpw_rules(apple's stuff may even load m1n1 from the APFS partition, not 100% sure)
#asahi · 2024-01-05 02:43
tpw_rulesbasically, apple's stuff does apple's stuff and loads m1n1 from a secret place somehow related to that APFS partition. that m1n1 searches the attached ESP (pointed to by chainload) for another copy of itself. that second copy has u-boot attached and that gets loaded. u-boot then checks /chosen/asahi,efi-system-partition to check which ESP to load a bootloader off. then that bootloader does whatever to find the rootfs and start linux
#asahi · 2024-01-05 02:41
tpw_rulesthat asahi,efi-system-partition should show up in the device tree under /chosen if you want to check in each u-boot and make sure it's different
#asahi · 2024-01-05 02:39
tpw_rulesi'm not sure if apple's stuff can get confused about which stub to boot
#asahi · 2024-01-05 02:39
tpw_rulesok, i'm not sure what could be up then
#asahi · 2024-01-05 02:36
tpw_rulesboth ESPs
#asahi · 2024-01-05 02:35
tpw_rulesfor both partitions?
#asahi · 2024-01-05 02:34
tpw_rulesdid you just strings the partition? it should be after chainload= and like asahi,efi-system-partition=
#asahi · 2024-01-05 02:34
tpw_rulesok, then use gdisk to set it back. i think you need x for the advanced menu then c and it will let you type it back in
#asahi · 2024-01-05 01:48
tpw_rulesthe correct UUID is in the special blessed boot object and i'm not immediately sure if there's a way to pull that back out. it's certainly not changeable without apple's tools
#asahi · 2024-01-05 01:48
tpw_rulesif you can't find it, the second easiest way is probably to back up your ESPs, destroy them and the corresponding stubs, then create two new UEFI-only ones using the installer and restore their contents
#asahi · 2024-01-05 01:46
tpw_rulesit's also the ESP that is wrong, not the rootfs
#asahi · 2024-01-05 01:46
tpw_rulesi don't know if lsblk and blkid show that one, i think they show the one in the filesystem
#asahi · 2024-01-05 01:46
tpw_rulesthe PARTUUID in the GPT shown by gdisk
#asahi · 2024-01-05 01:41
tpw_rulesyes, but you can read the GUIDs out of it and re-apply them

plus ›