[libcamera-devel] [PATCH] meson: detect kernel version

Nicolas Dufresne nicolas at ndufresne.ca
Wed Jun 10 23:15:41 CEST 2020


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.

> +
>  # 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).



More information about the libcamera-devel mailing list