1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-06-02 13:30:09 +00:00

arm-bsp/fvp-base*: Introduce WIC support for fvp-base* machines

Add wks script, modify documentation and kernel command line.
Remove 'image_types_disk_img.bbclass' as it is no longer used.

Change-Id: I2a95349adc038e8484d7b9f578ad3ce698b1f528
Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Anders Dellien
2021-05-05 12:11:02 +01:00
committed by Jon Mason
parent b8860852dd
commit f614d579dc
7 changed files with 9 additions and 177 deletions
@@ -1,155 +0,0 @@
# Defines the disk.img image type
#
# Add an image type 'disk.img' which creates a disk image
# with up to 4 partitions
#
# For partition 1 (replace 1 by 2 for partition 2, and so on for 3 and 4):
#
# * DISK_IMG_PARTITION1_SIZE is the partition size in MB (1024 is 1 GB)
#
# * DISK_IMG_PARTITION1_FSTYPE is the file system to format the partition with.
# We support only ext files systems (ext2, ext3 and ext4)
# If this is empty, the partition will not be formated.
#
# * DISK_IMG_PARTITION1_CONTENT is the content to put in the filesystem.
# Only 'rootfs' is supported and will create a partition with the Yocto
# root filesystem.
#
# Default values for partition 1
DISK_IMG_PARTITION1_SIZE ??= "2048"
DISK_IMG_PARTITION1_FSTYPE ??= "ext4"
DISK_IMG_PARTITION1_CONTENT ??= "rootfs"
# Default values for partition 2
DISK_IMG_PARTITION2_SIZE ??= "0"
DISK_IMG_PARTITION2_FSTYPE ??= "ext2"
DISK_IMG_PARTITION2_CONTENT ??= ""
# Default values for partition 3
DISK_IMG_PARTITION3_SIZE ??= "0"
DISK_IMG_PARTITION3_FSTYPE ??= "ext4"
DISK_IMG_PARTITION3_CONTENT ??= ""
# Default values for partition 4
DISK_IMG_PARTITION4_SIZE ??= "0"
DISK_IMG_PARTITION4_FSTYPE ??= "ext4"
DISK_IMG_PARTITION4_CONTENT ??= ""
# Default disk sector size
DISK_IMG_SECTOR_SIZE ??= "512"
# We need mkfs.ext and parted tools to create our image (dd is always there)
do_image_disk_img[depends] += "e2fsprogs-native:do_populate_sysroot \
parted-native:do_populate_sysroot"
DISK_IMG_FILE = "${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.disk.img"
# Create one disk partition
disk_img_createpart() {
local imagefile="$1"
local start="$2"
local size="$3"
local fstype="${4:-}"
local content="${5:-}"
local formatargs=""
set -x
rm -f $imagefile
# Create the partition image
dd if=/dev/zero of=$imagefile bs=${DISK_IMG_SECTOR_SIZE} count=0 \
seek=$(expr $size / ${DISK_IMG_SECTOR_SIZE})
if [ -n "$fstype" ]; then
case $content in
rootfs)
formatargs=" -d ${IMAGE_ROOTFS}"
;;
boot)
echo "Unsupported"
exit 1
;;
*)
esac
# Create the file system (with content if needed)
mkfs.$fstype -F $imagefile $formatargs
fi
cat $imagefile >> ${DISK_IMG_FILE}
# Add the partition to the partition table
parted -s ${DISK_IMG_FILE} unit B mkpart primary $start \
$(expr $start + $realsize - 1)
}
disk_img_create () {
local currpos
local realsize
set -x
currpos=${DISK_IMG_SECTOR_SIZE}
# Create reserved part for partition table (1MB)
dd if=/dev/zero of=${DISK_IMG_FILE} bs=${DISK_IMG_SECTOR_SIZE} count=0 \
seek=1
parted -s ${DISK_IMG_FILE} mklabel msdos
if [ ${DISK_IMG_PARTITION1_SIZE} -ne 0 ]; then
# Reduce the first block size of one sector to make space
# for the partition table
realsize=$(expr ${DISK_IMG_PARTITION1_SIZE} \* 1024 \* 1024 \
- ${DISK_IMG_SECTOR_SIZE})
# Create the partition
disk_img_createpart ${WORKDIR}/part1.img $currpos $realsize \
"${DISK_IMG_PARTITION1_FSTYPE}" "${DISK_IMG_PARTITION1_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
if [ ${DISK_IMG_PARTITION2_SIZE} -ne 0 ]; then
# Partition size
realsize=$(expr ${DISK_IMG_PARTITION2_SIZE} \* 1024 \* 1024)
# Create the partition
disk_img_createpart ${WORKDIR}/part2.img $currpos $realsize \
"${DISK_IMG_PARTITION2_FSTYPE}" "${DISK_IMG_PARTITION2_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
if [ ${DISK_IMG_PARTITION3_SIZE} -ne 0 ]; then
# Partition size
realsize=$(expr ${DISK_IMG_PARTITION3_SIZE} \* 1024 \* 1024)
# Create the partition
disk_img_createpart ${WORKDIR}/part3.img $currpos $realsize \
"${DISK_IMG_PARTITION3_FSTYPE}" "${DISK_IMG_PARTITION3_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
if [ ${DISK_IMG_PARTITION4_SIZE} -ne 0 ]; then
# Partition size
realsize=$(expr ${DISK_IMG_PARTITION4_SIZE} \* 1024 \* 1024)
# Create the partition
disk_img_createpart ${WORKDIR}/part4.img $currpos $realsize \
"${DISK_IMG_PARTITION4_FSTYPE}" "${DISK_IMG_PARTITION4_CONTENT}"
currpos=$(expr $currpos + $realsize)
fi
}
IMAGE_CMD_disk.img = "disk_img_create"
IMAGE_TYPES += "disk.img"
+2 -18
View File
@@ -7,24 +7,8 @@
MACHINE_FEATURES = "optee" MACHINE_FEATURES = "optee"
IMAGE_CLASSES += "image_types_disk_img" IMAGE_FSTYPES += "wic"
IMAGE_FSTYPES += "disk.img" WKS_FILE ?= "fvp-base.wks"
# Disk image configuration
# We don't use the first partition
DISK_IMG_PARTITION1_SIZE = "128"
DISK_IMG_PARTITION1_FSTYPE = ""
DISK_IMG_PARTITION1_CONTENT = ""
# Second partition is used for rootfs
DISK_IMG_PARTITION2_SIZE = "2048"
DISK_IMG_PARTITION2_FSTYPE = "ext4"
DISK_IMG_PARTITION2_CONTENT = "rootfs"
# Empty third partition (8G - 2048M - 128M)
DISK_IMG_PARTITION3_SIZE = "6016"
DISK_IMG_PARTITION3_FSTYPE = ""
DISK_IMG_PARTITION3_CONTENT = ""
SERIAL_CONSOLES = "115200;ttyAMA0" SERIAL_CONSOLES = "115200;ttyAMA0"
+1 -1
View File
@@ -33,7 +33,7 @@ bash$ ./FVP_Base_RevC-2xAEMv8A -C bp.virtio_net.enabled=1 \
-C bp.secureflashloader.fname=${YOCTO_DEPLOY_IMGS_DIR}/bl1-fvp.bin \ -C bp.secureflashloader.fname=${YOCTO_DEPLOY_IMGS_DIR}/bl1-fvp.bin \
-C bp.flashloader0.fname=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin \ -C bp.flashloader0.fname=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin \
--data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \ --data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \
-C bp.virtioblockdevice.image_path=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-fvp-base-arm32.disk.img \ -C bp.virtioblockdevice.image_path=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-fvp-base-arm32.wic \
-C cluster0.cpu0.CONFIG64=0 \ -C cluster0.cpu0.CONFIG64=0 \
-C cluster0.cpu1.CONFIG64=0 \ -C cluster0.cpu1.CONFIG64=0 \
-C cluster0.cpu2.CONFIG64=0 \ -C cluster0.cpu2.CONFIG64=0 \
+1 -1
View File
@@ -34,7 +34,7 @@ bash$ ./FVP_Base_RevC-2xAEMv8A -C bp.virtio_net.enabled=1 \
-C bp.flashloader0.fname=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin \ -C bp.flashloader0.fname=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin \
--data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \ --data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \
--data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/fvp-base-gicv3-psci-custom.dtb@0x83000000 \ --data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/fvp-base-gicv3-psci-custom.dtb@0x83000000 \
-C bp.virtioblockdevice.image_path=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-fvp-base.disk.img -C bp.virtioblockdevice.image_path=${YOCTO_DEPLOY_IMGS_DIR}/core-image-minimal-fvp-base.wic
``` ```
@@ -68,7 +68,7 @@ index 0000000000..cf1e8d5cae
+CONFIG_BOOTDELAY=1 +CONFIG_BOOTDELAY=1
+CONFIG_SYS_TEXT_BASE=0x88000000 +CONFIG_SYS_TEXT_BASE=0x88000000
+CONFIG_USE_BOOTARGS=y +CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 systemd.log_target=null root=/dev/vda2 rw androidboot.hardware=fvpbase rootwait loglevel=9" +CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 systemd.log_target=null root=/dev/vda1 rw androidboot.hardware=fvpbase rootwait loglevel=9"
+# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set +# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_HUSH_PARSER=y +CONFIG_HUSH_PARSER=y
@@ -10,7 +10,7 @@ index f0ac2f9da3..93fcd3026a 100644
CONFIG_BOOTDELAY=1 CONFIG_BOOTDELAY=1
CONFIG_USE_BOOTARGS=y CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 loglevel=9" -CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 loglevel=9"
+CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 androidboot.hardware=fvpbase root=/dev/vda2 rw rootwait loglevel=9" +CONFIG_BOOTARGS="console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 androidboot.hardware=fvpbase root=/dev/vda1 rw rootwait loglevel=9"
# CONFIG_USE_BOOTCOMMAND is not set # CONFIG_USE_BOOTCOMMAND is not set
# CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set
+3
View File
@@ -0,0 +1,3 @@
# For fvp-base* machines we just need to populate the rootfs partition
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024 --extra-space 100