[OnePlus 3 & 3T Cross Device Development] :
I remeber back in twrp 2.x.x-x times (5 years back, perhaps more) I tried my first zips (for completeness: on nexus 10) with the edify builtin mount (to mount system) and failed. Next I've tried run_program with /sbin/mount and it failed, too. Then I've examined other peoples zips and found the combination of run_program and busybox working.

Back then I wasn't interested in why edify builtin mount (or /sbin/mount) wasn't working; I was only interested in working flashable zips. Since the bb solution was working, I've never thought of it again - untill [MENTION=7193743]Flounderist[/MENTION]'s log.

I could imagine, that other devs expririenced the same. Since bb was working everybody switched to it, and never tried someting else, because it was reliable working.

For the mount command it's easy to change the bb call - for more complecated zips (using more from bb then mount(*)) it's probably usefull to package bb within the zip, extract to /tmp and run_program /tmp/busybox.

The problem with the edify builtin mount is, that filesystem type and partition type needs to be supplied, meaning, that a zip is only working for one defined filesystem type and one defined partition type. I.e. if you make a zip that mounts system for ext4 and MTD, it wouldn't mount on devices with ext4 and EMMC. I.e. lineageos uses a dedicated mount script to serve all combinations (see references below).

(*) toybox is NOT a plugin replacement for busybox, but - at best - it's impotent, ugly, little brother. toybox has - by far - not the commands that bb has, and some of the implemented commands doesn't have all options bb commands have. For more complecated tasks it makes sense to ship bb within the zip.

Google has decided to replace bb by toybox not for any technical reason (bb is much more powerfull then toybox), but for licence reason: bb is gpl, toybox is apache. Surprise: G doesn't like gpl...

I've no clue, why omni has decided to replace bb by toybox in twrp. I could guess, because we have no really current bb arm/arm64 port.

References:

edify: https://source.android.com/devices/tech/ota/nonab/inside_packages

lineageos (from addonsu):

updater-script:

ifelse(is_mounted("/system"), unmount("/system"));
package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");

mount-system.sh:

#!/sbin/sh

# Modern devices use /system as root ("/")
system_as_root=`getprop ro.build.system_root_image`
if [ "$system_as_root" == "true" ]; then
if mount /system_root; then
exit 0
fi

active_slot=`getprop ro.boot.slot_suffix`
if [ ! -z "$active_slot" ]; then
block=/dev/block/bootdevice/by-name/system$active_slot
else
block=/dev/block/bootdevice/by-name/system
fi
mkdir -p /system_root
if mount -o rw $block /system_root; then
exit 0
fi
else
if mount /system; then
exit 0
fi

# Try to get the block from /etc/recovery.fstab
block=`cat /etc/recovery.fstab | cut -d '#' -f 1 | grep /system | grep -o '/dev/[^ ]*' | head -1`
if [ -n "$block" ] && mount $block /system; then
exit 0
fi
fi

exit 1