Pseudo CODE TODO

if selected partition is btrfs

case
  if there is only one subvol, and it is @rootfs, mount this subvol
  if there are multiple subvols, present menu, mount using choice
  else mount the root subvol
esac

===========v2==============
This should be fed the unlocked LUKS device from /dev/mapper/NAME

if $(
     blkid --output export
     fancy regex to grab pattern from matching DEVNAME to a full blank line
     (matching DEVNAME to end of stanza marker)
    );
    then
        sudo btrfs sub list -t /
        other stuff goes here
fi


Also, to identify a Debian system, do this (I've tested it in busybox sed):

  # sed -n s:^ID=::p /target/etc/os-release
