[libcamera-devel] [PATCH] meson: detect kernel version
Kieran Bingham
kieran.bingham at ideasonboard.com
Thu Jun 11 09:48:00 CEST 2020
On 10/06/2020 22:15, Nicolas Dufresne wrote:
> Le mercredi 10 juin 2020 à 17:39 +0200, Stéphane Cerveau a écrit :
>> Add kernel version detection to warn user
>> that only >= 5.0.0 V4L API are supported in
>> libcamera.
>>
>> Signed-off-by: Stéphane Cerveau <scerveau at collabora.com>
>> ---
>> meson.build | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/meson.build b/meson.build
>> index e898782..5063edb 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -105,6 +105,12 @@ if get_option('test')
>> subdir('test')
>> endif
>>
>> +kernel_version_req = '>= 5.0.0'
>> +kernel_version = run_command('uname', '-r').stdout()
>> +if not kernel_version.version_compare(kernel_version_req)
>> + warning('V4L2 API version @0@ is too old, @1@ is required, consider to upgrade your kernel version to use libcamera'.format(kernel_version, kernel_version_req))
>> +endif
>
> This should not be checked for cross builds. Perhaps it could be made
> conditional to meson.is_cross_build() not be set ? It remains error
> prone as the host kernel may differ from the target kernel even without
> cross compilation.
Indeed,
Perhaps we should add some LOG(Media, Fatal) when enumerating the
devices at runtime which will print a more meaningful message based on
the kernel version given by the devices?
--
Kieran
>
>> +
>> # Create a symlink from the build root to the source root. This is used when
>> # running libcamera from the build directory to locate resources in the source
>> # directory (such as IPA configuration files).
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list