<Armbian-Discord>
<rpardini> very interested in this. grub might have been the safe choice back when... but if we can make systemd-boot go on MBR it'd be in
<Armbian-Discord>
<ManoftheSea> I got so far as to generate the offset-GPT for ebin, on which I know GPT UEFI sd-b work together. So I need to boot the image with the serial connected, and see how that goes. If u-boot doesn't work there, it's not gonna work elsewhere.
<Armbian-Discord>
<rpardini> btw I gave up on the 14/15 partitioning scheme as uefi default and will retire it down to some uefi-x86-legacy stuff
<Armbian-Discord>
<rpardini> I dunno ebin at all; on meson64 uboot and GPT will not live together AFAIK
<Armbian-Discord>
<rpardini> I mean on the "same media": both uboot and GPT on SD for example. If uboot is in SPI/MMC etc, no problem
<Armbian-Discord>
<ManoftheSea> do you know why they won't live together?
<Armbian-Discord>
<rpardini> never went into it, writing uboot to the required offset destroys gpt
<Armbian-Discord>
<rpardini> which is not true of rk for example
<Armbian-Discord>
<narmstrong> amlogic loads bootloader from sector 1, and we can't move it
<Armbian-Discord>
<narmstrong> we can make it load from another media or the emmc boot partitions for example to use EFI boot
<Armbian-Discord>
<narmstrong> on lafrite since u-boot is on an SPI we can use EFI boot, same for boards with SPI like the N2, but there's the shitty vendor bootloader on it
<Armbian-Discord>
<ManoftheSea> It's amlogic that loads sector 1? okay.
<Armbian-Discord>
<ManoftheSea> I remembered one of the two did sector 1, and the other did something like sector 32.
<Armbian-Discord>
<narmstrong> nop not on amlogic, only sector 1
<Armbian-Discord>
<narmstrong> remember those are high volume Set Top Box secure SoCs, so they care about boot security from big customers and not about a potential EFI boot on a low volume SBC market
<Armbian-Discord>
<narmstrong> unlike allwinner and rockchip who also targets general purpose platforms
<Armbian-Discord>
<ManoftheSea> Yeah, I've known that one of the vendors had this problem, just not which one.
<Armbian-Discord>
<ManoftheSea> Also, when doing a test, make sure you're using the right test medium. I just booted the known working system rather than the offset-GPT system, and got excited for a second.
<Armbian-Discord>
<Tonymac32> I've been victimized by this
<Armbian-Discord>
<rpardini> Yep, given the non-GPT-ness of Amlogic, my "non-plan" there for EFI is: do nothing. Armbian uboot already supports EFI; Armbian SD media will boot (in non-EFI mode), you can then use nand-sata-install to deploy to eMMC/SPI when board supports it. Then use that to EFI-mode boot whatever you want, even to/from USB or NVMe if supported.
<Armbian-Discord>
<rpardini> Alternative (but why?) is to produce SD image with uboot + MBR, and pass down kernel DTB to grub. A lot of work, just to claim "EFI boot", while still images won't be generic, instead still board specific. So I see no point.
<Armbian-Discord>
<narmstrong> yep no need to bother, but those EFI images would be useful for lafrite for example, and any board with mainlin u-boot in SPI or eMMC boot partition
<Armbian-Discord>
<Tonymac32> thankfully a generic aarch64 image should be fine on those
<Armbian-Discord>
<rpardini> indeed. That's work to be done on uefi-arm64 -- it probably is missing config options at least
<Armbian-Discord>
<rpardini> I started it's .config by steal from Ubuntu's generic, but that was years ago.
<Armbian-Discord>
<ManoftheSea> "Main partition table begins at sector 1024 and ends at sector 1055" So, yeah, u-boot and systemd-boot can both use offset GPT
<Armbian-Discord>
<rpardini> yeah but would an offset-gpt uboot also work on non-offset gpt media?
<Armbian-Discord>
<ManoftheSea> I didn't change u-boot
<Armbian-Discord>
<rpardini> interesting. how are you offsetting the gpt?
<Armbian-Discord>
<ManoftheSea> in gdisk, expert options, GPT offset
<Armbian-Discord>
<ManoftheSea> x, j "move the main partition table"
<Armbian-Discord>
<ManoftheSea> But it doesn't move the header, which is the amlogic conflict
<Armbian-Discord>
<rpardini> yeah so no game there.
<Armbian-Discord>
<rpardini> (sharp turn) volunteers to rebase our meson64 5.19 patches against 6.1-rcX ? It seems 6.1 will be LTS, and we've just removed 5.10 from master, while having no 5.15...
<Armbian-Discord>
<Tonymac32> lol
<Armbian-Discord>
<narmstrong> I started trying to make missing primary GPT table non a fatal error on Linux & U-Boot, but never finished it...
<Armbian-Discord>
<Tonymac32> I can help with that since I have 2 effected boards in GXL
<Armbian-Discord>
<rpardini> Yep, there's a backup GPT at the end of media right...
<Armbian-Discord>
<narmstrong> yep, we could simply use the backup and never the primary, but any change in the partitionning should use tools that only write the backup
<Armbian-Discord>
<rpardini> true, but I think Armbian writes u-boot "last", thus destroying the GPT, but not the backup. (not sure if true of installer as well as image builder).
<Armbian-Discord>
<rpardini> Right now I think we've the most usecases already handled. We might just add instructions for users. "Use Armbian meson64-board-specific SD to install uboot to SPI/MMC, then generic uefi-arm64 on SD/eMMC/USB/NVMe/SATA"
<Armbian-Discord>
<rpardini> and I'll watch with interest what happens with EFI-through-uboot on the rk side of things 😉
<Armbian-Discord>
<Tonymac32> lol I have my pine64pro booting whatever EFI image I throw at it, same for ROC-RK3399-PC
<Armbian-Discord>
<Tonymac32> thank you SPI
<Armbian-Discord>
<narmstrong> and thank to those board having a decend u-boot on SPI !
<Armbian-Discord>
<rpardini> and what's in that SPI? vendor? 😛
<Armbian-Discord>
<Tonymac32> No, ours 😄
<Armbian-Discord>
<Tonymac32> I do have a new vendor one from LC to put on the ROC-PC, but ours worked fine
<Armbian-Discord>
<rpardini> yeah, so same principle applies there too
<Armbian-Discord>
<Tonymac32> we could make a "minimal" flavor designed only to update u-boot on the flash
<Armbian-Discord>
<Tonymac32> of course in theory you don't even need linux for that, just boot command it
<Armbian-Discord>
<rpardini> yeah I think uboot can read from media and write itself to SPI even....
<Armbian-Discord>
<Tonymac32> I used to boot to me assembly language app using u-boot
<Armbian-Discord>
<Tonymac32> it can basically do whatever you want
<Armbian-Discord>
<Tonymac32> with some dinner and drinks first of course
<Armbian-Discord>
<rpardini> yeah it's easier raising things uboot can't do
<Armbian-Discord>
<Tonymac32> you have to romance it or you get nowhere
<Armbian-Discord>
<rpardini> I'll have a go: - uboot can't write to ext4 fs's using checksums 😉
<Armbian-Discord>
<rpardini> but yeah, that's stretching it 😉
<Armbian-Discord>
<ManoftheSea> u-boot on SPI is why ebin is so great for testing. Also, having zero kernel patches.
<Armbian-Discord>
<ManoftheSea> But as for "backup GPT", it's in the wrong place when the image is written to media, right? The image is installed on a virtual 4 GB disk, which might be written to a larger SD card. At which point, the installed system repartitions and extends the root FS, but that doesn't do any good for first boot from backup GPT (let alone not actually having a "repair backup GPT" step)
<Armbian-Discord>
<ManoftheSea> hmm, that's interesting... I wiped the header, and u-boot claims to be using backup GPT. But it errors something like 350 times before then launching boot/bootaa64.efi
<Armbian-Discord>
<ManoftheSea> did it just scan for the gpt entries?
<Armbian-Discord>
<ManoftheSea> hmm, no, it was looking for the "EFI PART" stringas the GUID Partition Table Header
<Armbian-Discord>
<ManoftheSea> still. u-boot appears to be able to use the backup GPT. On the other hand... linux doesn't seem to be able to find the partitions for root device