- only umount /metadata and /persist if not already mounted, as some recoveries have these always mounted
- combine into list of possibly pre-mounted partitions to umount
- look for .ak3-debugging file in /tmp /cache /metadata or /persist to allow debugging better on recoveries that only support sideload
- use /tmp for ak3-debug.tgz if sideloading, and fix .tgz compression when apex fails to mount
- fix duplicate kernel version (vertmp) entries from some kernels
- don't use head when grep -m1 will suffice
- fix some (bad) OEM prop files including entries twice, use last entry like live system
- attempt to mount other partitions whether determined as /system or /system_root
- /system_root by that point if mounted will actually be /system_root so no need for further checks
- add missing /system_ext entries to custom getprop and cleanup functions
- touch up a couple pesky minor things
- add global scope to replace_line and remove_line so they match replace_string, and can now work on all matches found in a file
- remove unnecessary slot swapping since this is already handled with $POSTINSTALL and FlashAfterUpdate addon.d-v2's setup
- add cache mounting into main functions
- rename slot function to bring in line with my other projects
- don't rely on props if possible: determine dynamic/logical partitions from /dev/block/mapper presence, and detect slots more robustly using props and cmdline as in AK3 Core
- fix opposite slot detection for pushing modules to system and/or vendor during addon.d-v2
- only do setup_env and restore_env when in recovery to prevent environment/mount issues post-install
- use busybox [ for simple integer test to ensure known numerical operator behavior
- Lineage 17 Recovery has some problems currently: /system mountpoint in ramdisk, neither /system nor /system_root in fstab (it has / instead, which is useless), ANDROID_ROOT=/system, and no /system_root symlink
- /etc is linked to /system/etc so once /system is mounted /etc/fstab is gone and no further simple mount commands will work so move other mounts before /system
- /system/bin are the only utilities available on PATH with none at all in /sbin so we need /apex files mounted immediately or no non-busybox commands will work after mounting /system over the recovery's skeleton /system
- not all devices have /dev/block/bootdevice symlinks, but at some point "broken recovery is broken" has to apply, so I don't intend to build out full system partition discovery for the SAR mount fallback