BASEDISTRO ?= "auto"
require conf/distro/auto.conf

DISTRO_NAME = "nad-core"

PRODUCT = "auto"

# DM-Verity feature enabled/disabled under this distro. Uncomment to enable DM-Verity
#DISTRO_FEATURES += "dm-verity"

# Enable dm-verity working with avb feature in initramfs or/and in root system
# For initramfs, it also need to enable the distro feature of "initramfs"
DISTRO_FEATURES += "nad-avb"

# enable squahfs
DISTRO_FEATURES += "nand-squashfs"

DISTRO_FEATURES += "ab-boot-support"
DISTRO_FEATURES_NATIVE += "ab-boot-support"

# enable nand-ab
DISTRO_FEATURES += "nand-ab"

# NAD related partition changes are enabled under this distro
DISTRO_FEATURES += "nad-prod"

# enable modem-volume
DISTRO_FEATURES:append = " modem-volume"

# telaf specific features
DISTRO_FEATURES += "nad-telaf"

# Limiting squashfs rootfs size to 70MiB (size should be multiple of LEB, LEB is 253952 bytes)
SYSTEM_SQUASHFS_VOLUME_SIZE ?= "73646080"

CACHE_VOLUME_SIZE = "10MiB"

# Image names
UBIFS_UBI_IMAGE      = "${MACHINE}-sysfs-ubifs.ubi"
OUTPUT_FILE_FINAL_SQUASHFS_UBI = "${DEPLOY_DIR_IMAGE_NAND}/${MACHINE}-sysfs.ubi"
SQUASHFS_SYS_VOLUME = "system.squash"
RECOVERYFS_SQUASHFS_UBI_IMAGE = "${DEPLOY_DIR_IMAGE_NAND}/${MACHINE}-recoveryfs.ubi"
RECOVERYFS_SQUASHFS_IMAGE = "${DEPLOY_DIR_IMAGE_NAND}/recoveryfs.squash"
RECOVERYFS_UBIFS_UBI_IMAGE = "${DEPLOY_DIR_IMAGE_NAND}/${MACHINE}-recoveryfs-ubifs.ubi"

DISTRO_FEATURES:append = " nad-prod-test"
# Bundle initramfs image to kernel image
DISTRO_FEATURES += "initramfs"

DISTRO_FEATURES_NATIVESDK:append = " nad-prod-sdk nad-avb"

# Enable ZRAM as swap on RAM
DISTRO_FEATURES += "zram"

# Enable streaming update
DISTRO_FEATURES += "nad-stream-update"

# Enalbe Full Disc Encryption (FDE)
DISTRO_FEATURES += "nad-fde"

DISTRO_FEATURES_NATIVESDK:append = " nad-prod-sdk nad-avb nad-fde"

DISTRO_FEATURES:append = " nad-prod-test"

PREFERRED_RPROVIDER_libdevmapper = "${@bb.utils.contains('DISTRO_FEATURES', 'nad-prod', 'lvm2', '', d)}"
