[OE-core] [PATCH] image_types.bbclass: allow JFFS2 image with cleanmarkers

Andrea Adami andrea.adami at gmail.com
Wed Oct 16 21:51:54 UTC 2013


On Wed, Oct 16, 2013 at 10:16 PM, Andrea Adami <andrea.adami at gmail.com> wrote:
> The creation of JFFS2 images was hardcoding the
> --no-cleanmarkers option (-n) after those two commits:
>
> 70a276509f0f006fcc269296afc3dcc88d2825e1
> 7c803cea58737ea0abc62cd21c3813d955f07224
>
> The documentation explains that the -n option is
> intended for flash NAND only: devices with NOR flash
> need the cleanmarkers and should not make use of this option.
>
> To add more flexibility, parametrize the padding size
> as well, creating JFFS2_PADSIZE.
>
> Finally, add EXTRA_IMAGE_CMD_jffs2 in explicit form:
> sumtool has slightly different options:
>
>  -l  --littleendian
>  -p, --pad
>
> To give an idea about size differences:
>
> core-image-base-xxx.rootfs.jffs2     | 16496K
> core-image-base-xxx.rootfs.sum.jffs2 | 22816K
>
> core-image-minimal-xxx.rootfs.jffs2     | 6160384
> core-image-minimal-xxx.rootfs.sum.jffs2 | 9879552
>
> Signed-off-by: Andrea Adami <andrea.adami at gmail.com>
> ---
>  meta/classes/image_types.bbclass | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> index 9ead059..2a1acfa 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -140,9 +140,9 @@ XZ_COMPRESSION_LEVEL ?= "-e -6"
>  XZ_INTEGRITY_CHECK ?= "crc32"
>  XZ_THREADS ?= "-T 0"
>
> -IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 -n ${EXTRA_IMAGECMD}"
> +IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 ${EXTRA_IMAGECMD}"
>  IMAGE_CMD_sum.jffs2 = "${IMAGE_CMD_jffs2} && sumtool -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
> -       -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 -n ${EXTRA_IMAGECMD}"
> +       -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.sum.jffs2 ${EXTRA_IMAGECMD}"
>
>  IMAGE_CMD_cramfs = "mkfs.cramfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cramfs ${EXTRA_IMAGECMD}"
>
> @@ -209,9 +209,12 @@ IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_
>  EXTRA_IMAGECMD = ""
>
>  inherit siteinfo
> -JFFS2_ENDIANNESS ?= "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--little-endian', '--big-endian', d)}"
> +JFFS2_PADSIZE ?= ""
> +JFFS2_ENDIANNESS ?= "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}"
>  JFFS2_ERASEBLOCK ?= "0x40000"
> -EXTRA_IMAGECMD_jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} --no-cleanmarkers"
> +JFFS2_NOCLEANMARKERS ?= "--no-cleanmarkers"
> +EXTRA_IMAGECMD_jffs2 ?= "--pad ${JFFS2_PADSIZE} ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} ${JFFS2_NOCLEANMARKERS}"
> +EXTRA_IMAGECMD_sum.jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} ${JFFS2_NOCLEANMARKERS}"
>
>  # Change these if you want default mkfs behavior (i.e. create minimal inode number)
>  EXTRA_IMAGECMD_ext2 ?= "-i 8192"
> --
> 1.8.1.5
>

Well, this patch still works in the default case but has one flaw with
regard to jffs2 summary images with specific padding size:
it never uses the JFFS_PADSIZE size because EXTRA_IMAGECMD_sum.jffs2
is the final value.

At the moment I'm tempted to remove the experimental sum.jffs2 support :/

Thanks for suggestions

Andrea



More information about the Openembedded-core mailing list