[Magisk] pndwal:
Special (exclusive) case for Sammy AFAIK.

Generally, if those are A/B devices /recovery partitions/images are gone; recovery ramdisk is now in /boot... There are exceptions but not with Xiaomi AFAIK. OnePlus however has A/B devices w/ recovery_a and recovery _b however, so, being 2SI devices also, these have 4 'generic' ramdisks altogether, 2 in /recovery partitions and 2 in /boot partitions... But OP devices are freaks! 😜

You need to check A-only Xiaomi device ROMs and you will then always find) recovery with ramdisk. And then only Android 9 Launch Version devices (legacy SAR) have ramdisk only in /recovery (ie. 1 generic ramdisk in total). Android 10+ LV (modern 2SI ramdisk SAR) A-only devices have ramdisk in both /recovery and in /boot (ie. 2 generic ramdisks in total) just like legacy ramsisk (original Android) devices.

No!... Recovery mode flashing is to configure Magisk only to patch /recovery partition/image!... Even if it's patching the recovery ramdisk in /boot partition (ie all A/B legacy SAR and most A/B 2SI ramdisk SAR devices), this is still Magisk in boot mode!; Recovery mode should NOT be selected...

So to obtain parity with Magisk App this (recovery mode) option should only and always be available for Ramdisk=No, ie. A-only legacy SAR devices all of which are Android 9 LV models... You already understand how Magisk determines Ramdisk=No, so it should be a sinch to show checkbox for A-only Android 9 LV devices (all of and exclusively these in fact) and to extract and patch /recovery if user doesn't deselect recovery mode which should be checked (enabled) by default but user selection retained if changed. 😛

It is only available for Ramdisk=No, ie. A-only Android 9 LV devices as detailed above...

If ramdisk contains a generic ramdisk in recovery you could make this work; Magisk simply needs to be in ramdisk... So it can theoretically work for A-only and A/B 2SI devices w/ recovery_a and recovery _b as well as old Legacy ramdisk. But why would you?...

Magisk in /recovery is awkward; Users must (with some exceptions) boot to system with Magisk via recovery every time, ie they need to use recovery key combo and release keys at the correct time to avoid ending up in recovery environment, and in the case of late Samsung running up to day OneUI this means they must always boot from powered down state with a USB connection to PC or a USB headset connected to boot with Magisk... Also, if they ever forget and boot normally they will likely have to clear bank and G Pay/Wallet data etc to reset these since Play Integrity deviceIntegrity verdict will have failed...

So Magisk only offers the option to A-only A9 LV devices only as (unless bootloader is inexplicably compatible with ramdisk in /boot as with Xiaomi) there is simply no alternative means to use Magisk...

Always see Recovery mode option... Legacy SAR devices are 'stuck' with kernel directly mounting system without "retrofitted" 2SI support (which would add a ramdisk to /boot)... Only Google has ever done that, and that was for Pixel models which are A/B. A-only legacy SAR has never had retrofitted 2SI AFAIK.

Covered, but you confusing different things here. Recovery ROMs (parlance for .zip ROM archives compatible with custom recovery flashing) will contain exactly the same boot and recovery images as Fastboot ROMs (parlance for .tgz ROM archives compatible with fastboot flashing) so the results will be identical and there's no need to detect ROM package type except that without .tgz extraction support we need to use your "needle" option and manually load the .img file selected.

So whether or not a "Recovery" type ROM archive was used has nothing to do with Recovery mode Magisk (Magisk in /recovery partition)...

Just flash it... 😜

As I said, it seems .tgz was always the traditional compression/type for fastboot ROMs and i gave you links to Pixel stock .tgz ROMs...

Apparently Google/Pixel have overcome the issue w/ .zip type fastboot ROMs (limitations on size etc) and have not only moved from .tgz to .zip at some point but have retrospectively updated older device RON archives to .zip also. Nb. links to at least some .tgz ROMs for Google devices are still up and working, eg: https://dl.google.com/dl/android/aosp/ryu-nrd90m-factory-6aec2222.tgz

Other manufacturers still regard .zip archives ROMs as "Recovery" type ROMs distinguished from .tgz "Fastboot" ROMs; I guess .tgz ROMs are always Fastbioot only ROMs however.

Exactly the same way...

The confusion seems to be that for Xiaomi users a .zip ROM = Recovery ROM, ie flashable only from recovery, while for Pixel users a .zip ROM can/does = Fastboot ROM, ie flashable from fastboot...

... Compression algorithm seems to be the only essential difference here...

Yup, or extract first, flash ROM, boot, patch image, boot to fastboot and flash...

Since it seems you only need to support .tgz compression it seems a practical enhancement. I think many OEMs supply .tgz ROMs for fastboot flashing.

Touché! 😀... I'll test sometime. 😜

👍 PW