33 lines
1.5 KiB
Plaintext
33 lines
1.5 KiB
Plaintext
# short-description: Create an image for eMMC
|
|
# long-description: Creates an eMMC card image for the User Data Area that can
|
|
# be used with the Nuvoton SoC family.
|
|
#
|
|
# Assumes a minimum flash size of 1GB.
|
|
# Assumes U-Boot is stored elsewhere, such as an eMMC boot volume or NOR flash.
|
|
#
|
|
# --- - ---------- -------- -------- -------- -------- ------ -------
|
|
# |GPT| | reserved | boot-a | boot-b | rofs-a | rofs-b | rwfs |GPT-sec|
|
|
# --- - ---------- -------- -------- -------- -------- ------ -------
|
|
# ^ 1MB 64MB 64MB 256MB 256MB 256MB
|
|
# |
|
|
# 0x5000
|
|
#
|
|
# Primary GPT size (Beginning of image):
|
|
# 512B (Protective MBR) + 512B (Primary Header) + 16KB (Primary Table)
|
|
# First partition (u-boot-env) is 4K-aligned, which puts it at offset 0x5000
|
|
#
|
|
# Secondary GPT size (End of image):
|
|
# 16KB (Secondary Table) + 512B (Secondary Header)
|
|
|
|
bootloader --ptable gpt
|
|
|
|
# Hint: bootimg-partition size must be same as MMC_BOOT_PARTITION_SIZE
|
|
# Note: the partition layout above is SoC default value, it may change by user
|
|
# set WKS_ROFS_SIZE, WKS_RWFS_SIZE or MMC_BOOT_PARTITION_SIZE.
|
|
part --align 4 --fixed-size 1M
|
|
part --fstype=ext4 --fixed-size ${MMC_BOOT_PARTITION_SIZE}K --source bootimg-partition --label boot-a
|
|
part --fstype=ext4 --fixed-size ${MMC_BOOT_PARTITION_SIZE}K --source bootimg-partition --label boot-b
|
|
part --fstype=ext4 --fixed-size ${WKS_ROFS_SIZE} --source rootfs --label rofs-a
|
|
part --fstype=ext4 --fixed-size ${WKS_ROFS_SIZE} --source rootfs --label rofs-b
|
|
part --fstype=ext4 --fixed-size ${WKS_RWFS_SIZE} --label rwfs
|