[meta-freescale] [meta-fsl-arm][PATCH] Add sdcard image compression

Daiane Angolini daiane.list at gmail.com
Fri Nov 21 06:30:39 PST 2014


On Fri, Nov 21, 2014 at 11:52 AM, info <info at embexus.com> wrote:
> Signed-off-by: embexus <info at embexus.com>
> ---

Thanks Info Embexus for sending this patch, now I can see it better.

Could you, please, add a commit log?

Other thing, what is the IMAGE_FSTYPE I need to add to get it applied
in my system?

I think you can include this info in commit log.


>  classes/image_types_fsl.bbclass |   20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/classes/image_types_fsl.bbclass
> b/classes/image_types_fsl.bbclass
> index 9533578..1c1a28b 100644
> --- a/classes/image_types_fsl.bbclass
> +++ b/classes/image_types_fsl.bbclass
> @@ -92,6 +92,13 @@ SDCARD_GENERATION_COMMAND_mx5 = "generate_imx_sdcard"
>  SDCARD_GENERATION_COMMAND_mx6 = "generate_imx_sdcard"
>  SDCARD_GENERATION_COMMAND_vf60 = "generate_imx_sdcard"
>
> +# Compression method to apply to SDCARD after it has been created.
> Supported
> +# compression formats are "gzip", "bzip2" or "xz". The original .sdcard
> file
> +# is kept and a new compressed file is created if one of these compression
> +# formats is chosen. If SDCARD_COMPRESSION is set to any other value it is
> +# silently ignored.
> +#SDCARD_COMPRESSION ?= ""

SDCARD_COMPRESSION would be a new BSP variable. Can you, please,
describe how to use it in commit log?

I think it's something like:

if SDCARD_COMPRESSION = "gzip bzip2 xz" then I get 4 sdcard images on
my tmp/deploy/image/ directory, right?

If I have SDCARD_COMPRESSION = "xz" I get 2 images only.

> +
>  #
>  # Create an image that can by written onto a SD card using dd for use
>  # with i.MX SoC family
> @@ -312,6 +319,19 @@ IMAGE_CMD_sdcard () {
>      dd if=/dev/zero of=${SDCARD} bs=1 count=0 seek=$(expr 1024 \*
> ${SDCARD_SIZE})
>
>      ${SDCARD_GENERATION_COMMAND}
> +
> +    # Optionally apply compression
> +    case "${SDCARD_COMPRESSION}" in
> +    "gzip")
> +        gzip -k9 "${SDCARD}"
> +        ;;
> +    "bzip2")
> +        bzip2 -k9 "${SDCARD}"
> +        ;;
> +    "xz")
> +        xz -k "${SDCARD}"
> +        ;;
> +    esac
>  }
>
>  # The sdcard requires the rootfs filesystem to be built before using
> --
> 1.7.9.5
>
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
>


More information about the meta-freescale mailing list