diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-12-02 15:04:38 +1300 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-05-09 16:33:52 +1200 |
commit | 29259d2220b8e6e577a3efaa160b77e3366fb6d5 (patch) | |
tree | 457bc3de22e04390de63e720645b8a47a247beec /meta/classes/image.bbclass | |
parent | 35665d96131a41adc73cd9149f0d21d23e796714 (diff) | |
download | openembedded-core-contrib-paule/kernel-check.tar.gz |
classes/image: check kernel config supports IMAGE_FSTYPES itemspaule/kernel-check
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.
Fixes [YOCTO #5574].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r-- | meta/classes/image.bbclass | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 4542e95d1e..c56b053f18 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) |