[OE-core] [RFC PATCH 2/2] image_types.bbclass: add support for fastboot image type

Andre McCurdy armccurdy at gmail.com
Wed Aug 26 20:31:42 UTC 2015


On Wed, Aug 26, 2015 at 8:48 AM, Nicolas Dechesne
<nicolas.dechesne at linaro.org> wrote:
> Fastboot images are images that can be flashed using the fastboot protocol
> implemented in many popular bootloader for SBCs or even real world products
> (such as Android phones and tablets).
>
> This image type was implemented in meta-smartphone, and is being moved in
> oe-core.
>
> Signed-off-by: Nicolas Dechesne <nicolas.dechesne at linaro.org>
> ---
>  meta/classes/image_types.bbclass | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> index 8547574..4c53dc9 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -156,6 +156,19 @@ IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_
>
>  EXTRA_IMAGECMD = ""
>
> +FASTBOOT_PARTITION_SIZE ?= "16384"
> +
> +IMAGE_CMD_ext4.fastboot () {
> +       if [ ${ROOTFS_SIZE} -lt ${FASTBOOT_PARTITION_SIZE} ]; then
> +               make_ext4fs -l `expr ${FASTBOOT_PARTITION_SIZE} \* 1024` \
> +                       ${EXTRA_IMAGECMD} \
> +                       ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4.fastboot \
> +                       ${IMAGE_ROOTFS}
> +       else
> +               bbfatal "Rootfs is too small for partition (Rootfs Actual Size: ${ROOTFS_SIZE}, Partition size: ${FASTBOOT_PARTITION_SIZE})"

Should the error be "Rootfs is too LARGE for partition" ?

> +       fi
> +}
> +
>  inherit siteinfo
>  JFFS2_ENDIANNESS ?= "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}"
>  JFFS2_ERASEBLOCK ?= "0x40000"
> @@ -167,6 +180,7 @@ EXTRA_IMAGECMD_ext3 ?= "-i 4096"
>  EXTRA_IMAGECMD_ext4 ?= "-i 4096"
>  EXTRA_IMAGECMD_btrfs ?= ""
>  EXTRA_IMAGECMD_elf ?= ""
> +EXTRA_IMAGECMD_ext4.fastboot ?= "-s -b 4096"
>
>  IMAGE_DEPENDS = ""
>  IMAGE_DEPENDS_jffs2 = "mtd-utils-native"
> @@ -182,6 +196,7 @@ IMAGE_DEPENDS_elf = "virtual/kernel mkelfimage-native"
>  IMAGE_DEPENDS_ubi = "mtd-utils-native"
>  IMAGE_DEPENDS_ubifs = "mtd-utils-native"
>  IMAGE_DEPENDS_multiubi = "mtd-utils-native"
> +IMAGE_DEPENDS_ext4.fastboot = "android-tools-native"
>
>  # This variable is available to request which values are suitable for IMAGE_FSTYPES
>  IMAGE_TYPES = " \
> @@ -201,6 +216,7 @@ IMAGE_TYPES = " \
>      vdi \
>      qcow2 \
>      elf \
> +    ext4.fastboot \
>  "
>
>  COMPRESSIONTYPES = "gz bz2 lzma xz lz4 sum"
> --
> 2.3.5
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list