image cfg.ext4 {
	empty = true
	temporary = true
	size = 16M

	ext4 {
		label = "cfg"
                use-mke2fs = true
                features = "uninit_bg"
                extraargs = "-m 0 -i 4096"
	}
}

# The /var partition will be expanded automatically at first boot
# to use the full size of the SD-card or eMMC media.
image var.ext4 {
	empty = true
	temporary = true
	size = 128M

	ext4 {
		label = "var"
                use-mke2fs = true
                features = "uninit_bg"
                extraargs = "-m 0 -i 4096"
	}
}

image #INFIX_ID##VERSION#-nanopi-r2s-sdcard.img {
	hdimage {
		partition-table-type = "gpt"
	}

	partition u-boot-tpl-spl-dtb {
		in-partition-table = "no"
		offset = 32K
		image = "idbloader.img"
	}

	partition u-boot-dtb {
		in-partition-table = "no"
		offset = 8M
		image = "u-boot.itb"
	}

	partition aux {
		partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035
		offset = 16M
		image = "aux.ext4"
	}

	partition primary {
		partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
		bootable = true
		size = 200M
		image = "rootfs.squashfs"
	}

	partition secondary {
		partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
		bootable = true
		size = 200M
		image = "rootfs.squashfs"
	}

	partition cfg {
		partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105
		image = "cfg.ext4"
	}

	partition var {
		partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F
		image = "var.ext4"
	}
}

# Silence genimage warnings
config {}
