#!/bin/sh

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

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

boot_hook_add preinit_main do_mount_perm
