From fb862d9456f2aed66ef1039b88100373eed7eaa6 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Thu, 23 Feb 2023 11:11:12 +0000 Subject: [PATCH] v4l-utils: update to 1.24.1 --- packages/sysutils/v4l-utils/package.mk | 4 +- .../v4l-utils-002-support-libbpf-1-0-0.patch | 140 ------------------ 2 files changed, 2 insertions(+), 142 deletions(-) delete mode 100644 packages/sysutils/v4l-utils/patches/v4l-utils-002-support-libbpf-1-0-0.patch diff --git a/packages/sysutils/v4l-utils/package.mk b/packages/sysutils/v4l-utils/package.mk index d3b5fcedf2..daae63e06d 100644 --- a/packages/sysutils/v4l-utils/package.mk +++ b/packages/sysutils/v4l-utils/package.mk @@ -5,8 +5,8 @@ # with 1.0.0 repeat delay is broken. test on upgrade PKG_NAME="v4l-utils" -PKG_VERSION="1.22.1" -PKG_SHA256="65c6fbe830a44ca105c443b027182c1b2c9053a91d1e72ad849dfab388b94e31" +PKG_VERSION="1.24.1" +PKG_SHA256="cbb7fe8a6307f5ce533a05cded70bb93c3ba06395ab9b6d007eb53b75d805f5b" PKG_LICENSE="GPL" PKG_SITE="http://linuxtv.org/" PKG_URL="http://linuxtv.org/downloads/v4l-utils/${PKG_NAME}-${PKG_VERSION}.tar.bz2" diff --git a/packages/sysutils/v4l-utils/patches/v4l-utils-002-support-libbpf-1-0-0.patch b/packages/sysutils/v4l-utils/patches/v4l-utils-002-support-libbpf-1-0-0.patch deleted file mode 100644 index aafbe47bcc..0000000000 --- a/packages/sysutils/v4l-utils/patches/v4l-utils-002-support-libbpf-1-0-0.patch +++ /dev/null @@ -1,140 +0,0 @@ -From dce0e3e1e4ea91d3e46098362a880371ec5afe1b Mon Sep 17 00:00:00 2001 -From: Sudip Mukherjee -Date: Tue, 1 Nov 2022 20:25:28 +0000 -Subject: keytable: Convert deprecated libbpf API - -The libbpf APIs bpf_load_program_xattr(), bpf_create_map_node() and -bpf_create_map_in_map_node() have been deprecated since v0.7. Convert -them to use bpf_prog_load() and bpf_map_create(). -Also, modify config script to add a check for libbpf version. - -Signed-off-by: Sudip Mukherjee -Signed-off-by: Sean Young ---- - configure.ac | 2 +- - utils/keytable/bpf_load.c | 59 ++++++++++++++++++++++++++--------------------- - 2 files changed, 34 insertions(+), 27 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 05298981..9b7c371d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -564,7 +564,7 @@ AM_CONDITIONAL([WITH_V4L2_CTL_32], [test x${enable_v4l2_ctl_32} = xyes]) - AM_CONDITIONAL([WITH_V4L2_COMPLIANCE], [test x$ac_cv_func_fork = xyes]) - AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_LIBV4L], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_libv4l} != xno]) - AM_CONDITIONAL([WITH_V4L2_COMPLIANCE_32], [test x$ac_cv_func_fork = xyes -a x${enable_v4l2_compliance_32} = xyes]) --PKG_CHECK_MODULES([LIBBPF], [libbpf], [bpf_pc=yes], [bpf_pc=no]) -+PKG_CHECK_MODULES([LIBBPF], [libbpf >= 0.7], [bpf_pc=yes], [bpf_pc=no]) - AM_CONDITIONAL([WITH_BPF], [test x$enable_bpf != xno -a x$libelf_pkgconfig = xyes -a x$CLANG = xclang -a x$bpf_pc = xyes]) - - # append -static to libtool compile and link command to enforce static libs -diff --git a/utils/keytable/bpf_load.c b/utils/keytable/bpf_load.c -index 7c633dac..06098fc3 100644 ---- a/utils/keytable/bpf_load.c -+++ b/utils/keytable/bpf_load.c -@@ -63,19 +63,17 @@ struct bpf_file { - - static int load_and_attach(int lirc_fd, struct bpf_file *bpf_file, struct bpf_insn *prog, int size) - { -- struct bpf_load_program_attr load_attr; -- int fd, err; -+ LIBBPF_OPTS(bpf_prog_load_opts, opts); -+ int fd, err, insn_cnt; - -- memset(&load_attr, 0, sizeof(struct bpf_load_program_attr)); -+ insn_cnt = size / sizeof(struct bpf_insn); - -- load_attr.prog_type = BPF_PROG_TYPE_LIRC_MODE2; -- load_attr.expected_attach_type = BPF_LIRC_MODE2; -- load_attr.name = bpf_file->name; -- load_attr.insns = prog; -- load_attr.insns_cnt = size / sizeof(struct bpf_insn); -- load_attr.license = bpf_file->license; -+ opts.expected_attach_type = BPF_LIRC_MODE2; -+ opts.log_buf = bpf_log_buf; -+ opts.log_size = LOG_BUF_SIZE; - -- fd = bpf_load_program_xattr(&load_attr, bpf_log_buf, LOG_BUF_SIZE); -+ fd = bpf_prog_load(BPF_PROG_TYPE_LIRC_MODE2, bpf_file->name, -+ bpf_file->license, prog, insn_cnt, &opts); - if (fd < 0) { - printf("bpf_load_program() err=%m\n%s", bpf_log_buf); - return -1; -@@ -95,6 +93,9 @@ static int build_raw_map(struct bpf_map_data *map, struct raw_entry *raw, int nu - int no_patterns, value_size, fd, key, i; - struct raw_entry *e; - struct raw_pattern *p; -+ LIBBPF_OPTS(bpf_map_create_opts, opts, -+ .map_flags = map->def.map_flags, -+ ); - - no_patterns = 0; - -@@ -110,14 +111,13 @@ static int build_raw_map(struct bpf_map_data *map, struct raw_entry *raw, int nu - - value_size = sizeof(struct raw_pattern) + max_length * sizeof(short); - -- fd = bpf_create_map_node(map->def.type, -- map->name, -- map->def.key_size, -- value_size, -- no_patterns, -- map->def.map_flags, -- numa_node); -- -+ opts.numa_node = numa_node; -+ fd = bpf_map_create(map->def.type, -+ map->name, -+ map->def.key_size, -+ value_size, -+ no_patterns, -+ &opts); - if (fd < 0) { - printf(_("failed to create a map: %d %s\n"), - errno, strerror(errno)); -@@ -174,27 +174,34 @@ static int load_maps(struct bpf_file *bpf_file, struct raw_entry *raw) - - if (maps[i].def.type == BPF_MAP_TYPE_ARRAY_OF_MAPS || - maps[i].def.type == BPF_MAP_TYPE_HASH_OF_MAPS) { -- int inner_map_fd = bpf_file->map_fd[maps[i].def.inner_map_idx]; -+ LIBBPF_OPTS(bpf_map_create_opts, opts, -+ .inner_map_fd = bpf_file->map_fd[maps[i].def.inner_map_idx], -+ .map_flags = maps[i].def.map_flags, -+ .numa_node = numa_node, -+ ); - -- bpf_file->map_fd[i] = bpf_create_map_in_map_node( -+ bpf_file->map_fd[i] = bpf_map_create( - maps[i].def.type, - maps[i].name, - maps[i].def.key_size, -- inner_map_fd, -+ 4, - maps[i].def.max_entries, -- maps[i].def.map_flags, -- numa_node); -+ &opts); - } else if (!strcmp(maps[i].name, "raw_map")) { - bpf_file->map_fd[i] = build_raw_map(&maps[i], raw, numa_node); - } else { -- bpf_file->map_fd[i] = bpf_create_map_node( -+ LIBBPF_OPTS(bpf_map_create_opts, opts, -+ .map_flags = maps[i].def.map_flags, -+ .numa_node = numa_node, -+ ); -+ -+ bpf_file->map_fd[i] = bpf_map_create( - maps[i].def.type, - maps[i].name, - maps[i].def.key_size, - maps[i].def.value_size, - maps[i].def.max_entries, -- maps[i].def.map_flags, -- numa_node); -+ &opts); - } - - if (bpf_file->map_fd[i] < 0) { --- -cgit v1.2.1 -