diff options
7 files changed, 9 insertions, 177 deletions
diff --git a/meta-arm-bsp/classes/image_types_disk_img.bbclass b/meta-arm-bsp/classes/image_types_disk_img.bbclass deleted file mode 100644 index 78cc0d85..00000000 --- a/meta-arm-bsp/classes/image_types_disk_img.bbclass +++ /dev/null @@ -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" - diff --git a/meta-arm-bsp/conf/machine/fvp-common.inc b/meta-arm-bsp/conf/machine/fvp-common.inc index c4a5f6b3..169c0a36 100644 --- a/meta-arm-bsp/conf/machine/fvp-common.inc +++ b/meta-arm-bsp/conf/machine/fvp-common.inc @@ -7,24 +7,8 @@ MACHINE_FEATURES = "optee" -IMAGE_CLASSES += "image_types_disk_img" -IMAGE_FSTYPES += "disk.img" - -# 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 = "" +IMAGE_FSTYPES += "wic" +WKS_FILE ?= "fvp-base.wks" SERIAL_CONSOLES = "115200;ttyAMA0" diff --git a/meta-arm-bsp/documentation/fvp-base-arm32.md b/meta-arm-bsp/documentation/fvp-base-arm32.md index 52ca1a44..54408b0d 100644 --- a/meta-arm-bsp/documentation/fvp-base-arm32.md +++ b/meta-arm-bsp/documentation/fvp-base-arm32.md @@ -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.flashloader0.fname=${YOCTO_DEPLOY_IMGS_DIR}/fip-fvp.bin \ --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.cpu1.CONFIG64=0 \ -C cluster0.cpu2.CONFIG64=0 \ diff --git a/meta-arm-bsp/documentation/fvp-base.md b/meta-arm-bsp/documentation/fvp-base.md index 17c28c2b..b0026de4 100644 --- a/meta-arm-bsp/documentation/fvp-base.md +++ b/meta-arm-bsp/documentation/fvp-base.md @@ -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 \ --data cluster0.cpu0=${YOCTO_DEPLOY_IMGS_DIR}/Image@0x80080000 \ --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 ``` diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base-arm32/0001-Add-vexpress_aemv8a_aarch32-variant.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base-arm32/0001-Add-vexpress_aemv8a_aarch32-variant.patch index c61912e9..07196295 100644 --- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base-arm32/0001-Add-vexpress_aemv8a_aarch32-variant.patch +++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base-arm32/0001-Add-vexpress_aemv8a_aarch32-variant.patch @@ -68,7 +68,7 @@ index 0000000000..cf1e8d5cae +CONFIG_BOOTDELAY=1 +CONFIG_SYS_TEXT_BASE=0x88000000 +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_BOARDINFO is not set +CONFIG_HUSH_PARSER=y diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base/u-boot_vexpress_fvp.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base/u-boot_vexpress_fvp.patch index 0934e40d..b0cbe0d8 100644 --- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base/u-boot_vexpress_fvp.patch +++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-2021.01/fvp-base/u-boot_vexpress_fvp.patch @@ -10,7 +10,7 @@ index f0ac2f9da3..93fcd3026a 100644 CONFIG_BOOTDELAY=1 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 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_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/meta-arm-bsp/wic/fvp-base.wks b/meta-arm-bsp/wic/fvp-base.wks new file mode 100644 index 00000000..8399d042 --- /dev/null +++ b/meta-arm-bsp/wic/fvp-base.wks @@ -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 |