DESCRIPTION = "Initramfs image with the CoreOS emmc installer"



# Don't reboot the device at reboot and don't do A/B switching
BAD_RECOMMENDATIONS = "swupdate-progress swupdate-coreos-config"

export IMAGE_BASENAME = "${MLPREFIX}${PN}"
IMAGE_NAME_SUFFIX ?= ""
IMAGE_LINGUAS = ""

LICENSE = "MIT"

IMAGE_FSTYPES = "cpio.gz"

# Support for generating a SDCard installer is optional
COREOS_INSTALLER_WKS_FILE ??= ""
WKS_FILE = "${COREOS_INSTALLER_WKS_FILE}"
IMAGE_FSTYPES += "${@'wic.xz wic.bmap' if d.getVar('COREOS_INSTALLER_WKS_FILE') else ''}"
IMAGE_BOOT_FILES =  "${COREOS_KERNEL_FILENAME};EFI/BOOT/${EFI_BOOT_IMAGE}"

COREOS_IMAGE_GENERATE_UKI = "1"

# Avoid dependancy loop, we are already in an installer image, so we don't need
# to bundle another one
COREOS_IMAGE_GENERATE_INSTALLER = "0"

# IMGDEPLOYDIR has to be used instead of DEPLOY_DIR_IMAGE here, because it will
# run during image generation
COREOS_UKI_PART_INITRAMFS = "${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.cpio.gz"
COREOS_IMAGE_GENERATE_SWU = "0"

# Change generated UKI filename and reset the bundled command line to "APPEND"
# to ensure that root is not set in the kernel command line
COREOS_KERNEL_NAME ?= "coreos-installer-${MACHINE}"
COREOS_KERNEL_CMDLINE ?= "${APPEND}"

inherit coreos-image

# Only install a reduced set of package and feature to keep image size small
IMAGE_INSTALL = "packagegroup-coreos-boot coreos-installer swupdate-www util-linux-sfdisk util-linux-fdisk util-linux-cfdisk efibootguard efibootguard-tools"
IMAGE_FEATURES = "debug-tweaks swupdate networkmanager"
NO_RECOMMENDATIONS = "1"

IMAGE_ROOTFS_SIZE = "8192"
INITRAMFS_MAXSIZE = "976562"
IMAGE_ROOTFS_EXTRA_SPACE = "0"

# Use the same restriction as initramfs-module-install
COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
