# Copyright (C) 2023, Advanced Micro Devices, Inc.  All rights reserved.
#
# SPDX-License-Identifier: MIT
#

menu "Image Packaging Configuration"
choice
prompt "Root filesystem type"
default SUBSYSTEM_ROOTFS_INITRAMFS

config SUBSYSTEM_ROOTFS_INITRAMFS
	bool "INITRAMFS"
	help
	  Choose this option to configure your PetaLinux build to use
	  the kernel INITRAMFS mechanism for the root filesystem.

	  The root filesystem will be writeable, but not persistent,
	  meaning that any changes are lost upon reboot.

config SUBSYSTEM_ROOTFS_INITRD
	bool "INITRD"
	help
	  Choose this opion to configure your PetaLinux build to use
	  kernel INITRD mechinsm for the root filesystem.

config SUBSYSTEM_ROOTFS_UBIFS
	bool "UBI/UBIFS"
	help
	  Choose this option to configure your PetaLinux build for the
	  root filesystem to be mounted on a UBI/UBIFS flash partition.

	  You must also ensure that your Flash Partition Table
          contains a partition named "ubi" and is of a suitable size.

config SUBSYSTEM_ROOTFS_NFS
	bool "NFS"
	help
	  Choose this setting to configure your PetaLinux build for NFS Root.

	  Your workstation must be properly configured for NFS, and the
	  NFS root directory (see below) must be exported properly.

config SUBSYSTEM_ROOTFS_EXT4
	bool "EXT4 (SD/eMMC/SATA/USB)"
	help
	  Choose this setting to configure your PetaLinux build for EXT4 Root.

          device examples:
          eMMC or SD root=/dev/mmcblkYpX
          SATA or USB root=/dev/sdX

config SUBSYSTEM_ROOTFS_OTHER
	bool "other"
	help
	  Choose this setting to configure your PetaLinux build for other root.

	  You will need to manually generate the Root FS image.

endchoice

config SUBSYSTEM_NFSROOT_DIR
	string "Location of NFS root directory"
	depends on SUBSYSTEM_ROOTFS_NFS
	default "/tftpboot/nfsroot"

config SUBSYSTEM_NFSSERVER_IP
	string "NFS Server IP address"
	default "AUTO"
	depends on SUBSYSTEM_ROOTFS_NFS
	help
	 The IP address of your NFS server in the main network interface.

config SUBSYSTEM_SDROOT_DEV
	string "Device node of SD device"
	depends on SUBSYSTEM_ROOTFS_EXT4
	default "/dev/mmcblk0p2"

config SUBSYSTEM_INITRD_RAMDISK_LOADADDR
	hex "RAMDISK loadaddr"
	default "0x0"
	depends on SUBSYSTEM_ROOTFS_INITRD
	help
	  RAMDISK Load address if INITRD is selected as rootfs type

config SUBSYSTEM_INITRAMFS_IMAGE_NAME
	string "INITRAMFS/INITRD Image name"
	default "petalinux-image-minimal"
	depends on SUBSYSTEM_ROOTFS_INITRD || SUBSYSTEM_ROOTFS_INITRAMFS
	help
	  Specifies the PROVIDES name of an image recipe that is used to
	  build an initial RAM filesystem (initramfs/initrd) image

config SUBSYSTEM_UBI_MKUBIFS_ARGS
	string "mkfs.ubifs args"
	default ""
	depends on SUBSYSTEM_ROOTFS_UBIFS
	help
	  Specify the arguments which needs to be used in mkfs.ubifs for creation of ubifs filesystem.
	  Ex: -m 2048 -e 129024 -c 2047
	  -m 2048  : is the minimum I/O unit here its 2KB.
	  -e 129024: logical eraseblock size of the UBI volume.
	  -c 2047  : specifies maximum file-system size in logical eraseblocks.
	  NOTE: make sure to add "ubifs" into "SUBSYSTEM_RFS_FORMATS" to take these values into consider.

config SUBSYSTEM_UBI_UBINIZE_ARGS
	string "ubinize args"
	default ""
	depends on SUBSYSTEM_ROOTFS_UBIFS
	help
	  Specify the arguments which needs to be used in ubinize for creation of ubifs filesystem.
	  Ex: -m 2048 -p 128KiB -s 512
	  -m 2048  : is the minimum I/O unit here its 2KB.
	  -p 128KiB: tells ubinize that physical eraseblock size of the flash chip the UBI image is created for is 128KiB
	  -s 512: tells ubinize that the flash supports sub-pages and sub-page size is 512 bytes
	  NOTE: make sure to add "ubifs" into "SUBSYSTEM_RFS_FORMATS" to take these values into consider.

config SUBSYSTEM_UBI_PART_NAME
	string "ubi part name"
	default "ubifs"
	depends on SUBSYSTEM_ROOTFS_UBIFS
	help
	  Specify the ubifs part name to be added into bootargs.

config SUBSYSTEM_UIMAGE_NAME
	string "name for bootable kernel image"
	default "image.ub"
	help
	  Specify the name of uboot bootable kernel image

config SUBSYSTEM_RFS_FORMATS
	string "Root filesystem formats"
	default "cpio cpio.gz cpio.gz.u-boot ext4 tar.gz" if SUBSYSTEM_ARCH_AARCH64
	default "cpio cpio.gz cpio.gz.u-boot ext4 tar.gz" if SUBSYSTEM_ARCH_ARM
	default "cpio cpio.gz cpio.gz.u-boot tar.gz" if SUBSYSTEM_ARCH_MICROBLAZE
	help
	  Specifies the formats the build system uses during the build
	  when creating the root filesystem.
	  Supported image formats:
	  tar.gz cpio cpio.gz.u-boot cpio.gz ext4 ext3 ext3.bz2 tar.bz2 cpio.bz2 ext4.gz

config SUBSYSTEM_COPY_TO_TFTPBOOT
	bool "Copy final images to tftpboot"
	help
	  Set this if you would like the final build image to be automatically
	  copied to your TFTP server directory.

config SUBSYSTEM_TFTPBOOT_DIR
	string "tftpboot directory"
	depends on SUBSYSTEM_COPY_TO_TFTPBOOT
	default "/tftpboot"
	help
	  The directory that your TFTP server serves its files from.

if SYSTEM_VERSAL
config SUBSYSTEM_PDI_FILENAME
	string "PDI File name"
	default ""
	help
	  Specify the PDI file name If design file has a multiple .pdi files.

endif
endmenu
