# parameters:
  ENABLE_WHITEBOX_SDK:
    desc: "Add Whitebox-sdk features"
    "no":
      desc: "Nothing to do"
    "yes":
      default: true
      overrides:
        variables:
          META_WB_LAYER_PATH: "../../../"
          BUILD_DOMD_SDK: "0"
        components:
          dom0:
            builder:
              layers:
                - "%{META_WB_LAYER_PATH}/meta-rcar-whitebox/meta-dom0"
          domd:
            builder:
              conf:
                - [BUILD_SDK, "%{BUILD_DOMD_SDK}"]
                - [IMAGE_INSTALL_append, " iproute2-tc snort"]
                - [IMAGE_INSTALL_append, " iccom-lib iccom-test"]
                - [IMAGE_INSTALL_append, " docker python3-docker-compose"]
                - [IMAGE_INSTALL_append, " dhrystone whetstone sysbench"]
                - [IMAGE_INSTALL_append, " waii"]
                - [IMAGE_INSTALL_append, " node-exporter"]
                - [EXTRA_IMAGEDEPENDS_append, " s4-boot-script"]
                - [IMAGE_INSTALL_append, " ufs-duplication-script"]
              layers:
                - "%{META_WB_LAYER_PATH}/meta-rcar-whitebox/meta-rcar-common"
                - "%{META_WB_LAYER_PATH}/meta-rcar-whitebox/meta-domd"
              target_images:
                - "tmp/deploy/images/%{MACHINE}/var/statestorage.db"
                - "tmp/deploy/images/%{MACHINE}/boot-mmc.uImage"
          domu:
            builder:
              conf:
                - [IMAGE_INSTALL_append, " iproute2 iproute2-tc"]
        images:
          full:
            partitions:
              domd_rootfs:
                size: 3072 MiB
              domd_var:
                size: 1024 MiB
                files:
                  "statestorage.db": "%{YOCTOS_WORK_DIR}/build-domd/tmp/deploy/images/%{MACHINE}/var/statestorage.db"
                  "boot-mmc.uImage": "%{YOCTOS_WORK_DIR}/build-domd/tmp/deploy/images/%{MACHINE}/boot-mmc.uImage"
                  "boot-ufs.uImage": "%{YOCTOS_WORK_DIR}/build-domd/tmp/deploy/images/%{MACHINE}/boot-ufs.uImage"
              domd_aos:
                size: 3072 MiB

#   USING_REMOTE_META_WHITEBOX_LAYER:
#     desc: "Using remote repository instead of local meta layer"
#     "no":
#       default: true
#     "yes":
#       overrides:
#         variables:
#           META_WB_LAYER_PATH: "../whitebox-sdk/application_cpu/"
#         common_data:
#           sources:
#             - type: git
#               url: "https://github.com/renesas-rcar/whitebox-sdk.git"
#               rev: "vX.Y"

  ENABLE_MONITORING_TOOL:
    desc: "Add Grafana/Prometheus into DomD"
    "no":
      desc: "Nothing to do"
    "yes":
      default: true
      overrides:
        components:
          domd:
            builder:
              conf:
                - [IMAGE_INSTALL_append, " packagegroup-system-monitor"]

  BUILD_DOMD_SDK:
    desc: "Switch build DomD SDK or not"
    "no":
      desc: "Nothing to do"
    "yes":
      default: true
      overrides:
        variables:
          BUILD_DOMD_SDK: "1"

  ENABLE_AWS:
    desc: "Add AWS services into DomD"
    "no":
      desc: "Nothing to do"
    "yes":
      default: true
      overrides:
        components:
          domd:
            sources:
              - type: git
                url: https://github.com/aws4embeddedlinux/meta-aws.git
                rev: 6fea710d1b3c8a5ad93e7811e75d8f4cf5962bb2
            builder:
              conf:
                - [CORE_IMAGE_EXTRA_INSTALL_append, " kernel-modules"]
                - [IMAGE_INSTALL_append, " greengrass-bin texinfo sudo"]
                - [IMAGE_INSTALL_append, " python3-pip e2fsprogs-resize2fs"]
                - [IMAGE_INSTALL_append, " aws-iot-fleetwise-edge"]
              layers:
                - "../meta-aws"

