#!/bin/sh

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

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

boot_hook_add preinit_main do_mount_cfg

