#!/bin/sh

source /etc/prplconfig
source /lib/functions/ext4vol.sh

do_mount_ext() {
    if [ -n "$CONFIG_SAH_BOARD_CONFIGURATOR_EXT4_PHYSICAL_MOUNT_EXT" ]; then
        mount_ext4 "/ext" "$CONFIG_SAH_BOARD_CONFIGURATOR_EXT4_PHYSICAL_MOUNT_EXT"
    elif [ -n "$CONFIG_SAH_BOARD_CONFIGURATOR_EXT4_SUPPORT_SINGLE_PARTITION" ]; then
       mount_ext4_single_partition "ext"
    else
       echo "Invalid combination single partition vs dedicated partition for ext."
       return
    fi
}

boot_hook_add preinit_main do_mount_ext
