[OE-core] [RFC PATCH 6/6] classes/image: check kernel config supports IMAGE_FSTYPES items

Bruce Ashfield bruce.ashfield at gmail.com
Mon May 9 12:05:06 UTC 2016


On Mon, May 9, 2016 at 12:43 AM, Paul Eggleton <
paul.eggleton at linux.intel.com> wrote:

> A lot of the IMAGE_FSTYPES items require the appropriate filesystem
> driver to be enabled in the kernel configuration; e.g. in order to read
> a btrfs filesystem, the kernel must enable CONFIG_BTRFS_FS. Add a check
> to ensure that is the case.
>


So what's the overall design for this ? Is it documented anywhere ? This is
something
that we talked about a couple of years and I have reservations and
objections to
the current implementation.

.. but since I can only see bits and chunks of patches, I'd rather read
something
complete and offer some more detailed feedback.

Bottom line: I see a slippery slope to tightly specified option that depend
on kernel
versions, I see kernel options sprayed all over layers, etc, etc. Which is
exactly
what we've been trying to avoid with the centralized kernel meta-data, and
again,
there's a mechanism that I finished early this year to extend those options
to any
kernel, enforce, warn, error, etc .. but now, I'll just toss it into the
bin.

Cheers,

Bruce


>
> Fixes [YOCTO #5574].
>
> Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
> ---
>  meta/classes/image.bbclass       | 23 +++++++++++++++++++++++
>  meta/classes/image_types.bbclass | 11 +++++++++++
>  2 files changed, 34 insertions(+)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 4542e95..c56b053 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -238,9 +238,32 @@ do_rootfs[cleandirs] += "${S}"
>  do_rootfs[umask] = "022"
>  addtask rootfs before do_build
>
> +inherit kernel-check
> +
> +def check_image_fstypes_kernel(d):
> +    """
> +    Check that the kernel we have built has the appropriate config
> options enabled
> +    to support the image formats specified in IMAGE_FSTYPES
> +    """
> +    fstypes = (d.getVar('IMAGE_FSTYPES', True) or '').split()
> +    ctypes = (d.getVar('COMPRESSIONTYPES', True) or '').split()
> +    for fstype in fstypes:
> +        kernconfig = (d.getVar('IMAGE_TYPE_KERNEL_OPTIONS_' + fstype,
> True) or '').split()
> +        for ctype in ctypes:
> +            if fstype.endswith("." + ctype):
> +                basetype = fstype[:-len("." + ctype)]
> +                kernconfig.extend((d.getVar('IMAGE_TYPE_KERNEL_OPTIONS_'
> + basetype, True) or '').split())
> +        kernconfig = list(set(kernconfig))
> +        if kernconfig:
> +            missing, diffvalue = check_kernel_config_options(kernconfig,
> d)
> +            if missing or diffvalue:
> +                bb.warn('IMAGE_FSTYPES contains %s, but the following
> required kernel configuration items are not present in the kernel
> configuration:\n  %s' % (fstype, '\n  '.join(missing + ['%s=%s (actual
> value %s)' % item for item in diffvalue])))
> +
>  fakeroot python do_image () {
>      from oe.utils import execute_pre_post_process
>
> +    check_image_fstypes_kernel(d)
> +
>      pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND", True)
>
>      execute_pre_post_process(d, pre_process_cmds)
> diff --git a/meta/classes/image_types.bbclass
> b/meta/classes/image_types.bbclass
> index 53af7ca..dd79726 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -240,6 +240,17 @@ IMAGE_DEPENDS_ubifs = "mtd-utils-native"
>  IMAGE_DEPENDS_multiubi = "mtd-utils-native"
>  IMAGE_DEPENDS_wic = "parted-native"
>
> +IMAGE_TYPE_KERNEL_OPTIONS_jffs2 = "CONFIG_JFFS2_FS"
> +IMAGE_TYPE_KERNEL_OPTIONS_jffs2.sum = "CONFIG_JFFS2_SUMMARY"
> +IMAGE_TYPE_KERNEL_OPTIONS_cramfs = "CONFIG_CRAMFS"
> +IMAGE_TYPE_KERNEL_OPTIONS_ext2 =
> "CONFIG_EXT2_FS|CONFIG_EXT4_USE_FOR_EXT23"
> +IMAGE_TYPE_KERNEL_OPTIONS_ext3 =
> "CONFIG_EXT3_FS|CONFIG_EXT4_USE_FOR_EXT23"
> +IMAGE_TYPE_KERNEL_OPTIONS_ext4 = "CONFIG_EXT4_FS"
> +IMAGE_TYPE_KERNEL_OPTIONS_btrfs = "CONFIG_BTRFS_FS"
> +IMAGE_TYPE_KERNEL_OPTIONS_squashfs = "CONFIG_SQUASHFS"
> +IMAGE_TYPE_KERNEL_OPTIONS_squashfs-xz = "CONFIG_SQUASHFS_XZ"
> +IMAGE_TYPE_KERNEL_OPTIONS_squashfs-lzo = "CONFIG_SQUASHFS_LZO"
> +
>  # This variable is available to request which values are suitable for
> IMAGE_FSTYPES
>  IMAGE_TYPES = " \
>      jffs2 jffs2.sum \
> --
> 2.5.5
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160509/d8c168a8/attachment-0002.html>


More information about the Openembedded-core mailing list