From 7865eeae0633dad6500d893abcda6de2e05b7528 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 6 Jul 2022 10:07:01 +0200 Subject: kmod: upgrade 29 -> 30 (From OE-Core rev: 3f2084c3b6f2e9b251f87339e0fd60f9b1005f8c) Signed-off-by: Alexander Kanavin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- ...mod-Add-support-for-excluding-a-directory.patch | 172 --------------------- meta/recipes-kernel/kmod/kmod_29.bb | 90 ----------- meta/recipes-kernel/kmod/kmod_30.bb | 89 +++++++++++ 3 files changed, 89 insertions(+), 262 deletions(-) delete mode 100644 meta/recipes-kernel/kmod/kmod/0001-depmod-Add-support-for-excluding-a-directory.patch delete mode 100644 meta/recipes-kernel/kmod/kmod_29.bb create mode 100644 meta/recipes-kernel/kmod/kmod_30.bb (limited to 'meta/recipes-kernel/kmod') diff --git a/meta/recipes-kernel/kmod/kmod/0001-depmod-Add-support-for-excluding-a-directory.patch b/meta/recipes-kernel/kmod/kmod/0001-depmod-Add-support-for-excluding-a-directory.patch deleted file mode 100644 index ea0570af2b..0000000000 --- a/meta/recipes-kernel/kmod/kmod/0001-depmod-Add-support-for-excluding-a-directory.patch +++ /dev/null @@ -1,172 +0,0 @@ -From f50e2d67575ac5f256fb853ca9d29aeac92d9a57 Mon Sep 17 00:00:00 2001 -From: Saul Wold -Date: Thu, 31 Mar 2022 14:56:28 -0700 -Subject: [PATCH] depmod: Add support for excluding a directory - -This adds support to depmod to enable a new exclude directive in -the depmod.d/*.conf configuration file. Currently depmod -already excludes directories named source or build. This change -will allow additional directories like .debug to be excluded also -via a new exclude directive. - -depmod.d/exclude.conf example: -exclude .debug - -Upstream-Status: Accepted - -Signed-off-by: Saul Wold -[ Fix warnings and make should_exclude_dir() return bool ] -Signed-off-by: Lucas De Marchi ---- - man/depmod.d.xml | 14 ++++++++++ - tools/depmod.c | 66 +++++++++++++++++++++++++++++++++++++++++++++--- - 2 files changed, 76 insertions(+), 4 deletions(-) - -diff --git a/man/depmod.d.xml b/man/depmod.d.xml -index b315e93..76548e9 100644 ---- a/man/depmod.d.xml -+++ b/man/depmod.d.xml -@@ -131,6 +131,20 @@ - - - -+ -+ exclude excludedir -+ -+ -+ -+ This specifies the trailing directories that will be excluded -+ during the search for kernel modules. -+ -+ -+ The excludedir is the trailing directory -+ to exclude -+ -+ -+ - - - -diff --git a/tools/depmod.c b/tools/depmod.c -index 07a35ba..4117dd1 100644 ---- a/tools/depmod.c -+++ b/tools/depmod.c -@@ -458,6 +458,11 @@ struct cfg_external { - char path[]; - }; - -+struct cfg_exclude { -+ struct cfg_exclude *next; -+ char exclude_dir[]; -+}; -+ - struct cfg { - const char *kversion; - char dirname[PATH_MAX]; -@@ -469,6 +474,7 @@ struct cfg { - struct cfg_override *overrides; - struct cfg_search *searches; - struct cfg_external *externals; -+ struct cfg_exclude *excludes; - }; - - static enum search_type cfg_define_search_type(const char *path) -@@ -580,6 +586,30 @@ static void cfg_external_free(struct cfg_external *ext) - free(ext); - } - -+static int cfg_exclude_add(struct cfg *cfg, const char *path) -+{ -+ struct cfg_exclude *exc; -+ size_t len = strlen(path); -+ -+ exc = malloc(sizeof(struct cfg_exclude) + len + 1); -+ if (exc == NULL) { -+ ERR("exclude add: out of memory\n"); -+ return -ENOMEM; -+ } -+ memcpy(exc->exclude_dir, path, len + 1); -+ -+ DBG("exclude add: %s\n", path); -+ -+ exc->next = cfg->excludes; -+ cfg->excludes = exc; -+ return 0; -+} -+ -+static void cfg_exclude_free(struct cfg_exclude *exc) -+{ -+ free(exc); -+} -+ - static int cfg_kernel_matches(const struct cfg *cfg, const char *pattern) - { - regex_t re; -@@ -657,6 +687,11 @@ static int cfg_file_parse(struct cfg *cfg, const char *filename) - } - - cfg_external_add(cfg, dir); -+ } else if (streq(cmd, "exclude")) { -+ const char *sp; -+ while ((sp = strtok_r(NULL, "\t ", &saveptr)) != NULL) { -+ cfg_exclude_add(cfg, sp); -+ } - } else if (streq(cmd, "include") - || streq(cmd, "make_map_files")) { - INF("%s:%u: command %s not implemented yet\n", -@@ -857,6 +892,12 @@ static void cfg_free(struct cfg *cfg) - cfg->externals = cfg->externals->next; - cfg_external_free(tmp); - } -+ -+ while (cfg->excludes) { -+ struct cfg_exclude *tmp = cfg->excludes; -+ cfg->excludes = cfg->excludes->next; -+ cfg_exclude_free(tmp); -+ } - } - - -@@ -1229,6 +1270,25 @@ add: - return 0; - } - -+static bool should_exclude_dir(const struct cfg *cfg, const char *name) -+{ -+ struct cfg_exclude *exc; -+ -+ if (name[0] == '.' && (name[1] == '\0' || -+ (name[1] == '.' && name[2] == '\0'))) -+ return true; -+ -+ if (streq(name, "build") || streq(name, "source")) -+ return true; -+ -+ for (exc = cfg->excludes; exc != NULL; exc = exc->next) { -+ if (streq(name, exc->exclude_dir)) -+ return true; -+ } -+ -+ return false; -+} -+ - static int depmod_modules_search_dir(struct depmod *depmod, DIR *d, size_t baselen, struct scratchbuf *s_path) - { - struct dirent *de; -@@ -1240,11 +1300,9 @@ static int depmod_modules_search_dir(struct depmod *depmod, DIR *d, size_t basel - size_t namelen; - uint8_t is_dir; - -- if (name[0] == '.' && (name[1] == '\0' || -- (name[1] == '.' && name[2] == '\0'))) -- continue; -- if (streq(name, "build") || streq(name, "source")) -+ if (should_exclude_dir(depmod->cfg, name)) - continue; -+ - namelen = strlen(name); - if (scratchbuf_alloc(s_path, baselen + namelen + 2) < 0) { - err = -ENOMEM; --- -2.31.1 - diff --git a/meta/recipes-kernel/kmod/kmod_29.bb b/meta/recipes-kernel/kmod/kmod_29.bb deleted file mode 100644 index 32dc49c126..0000000000 --- a/meta/recipes-kernel/kmod/kmod_29.bb +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (C) 2012 Khem Raj -# Released under the MIT license (see COPYING.MIT for the terms) - -SUMMARY = "Tools for managing Linux kernel modules" -DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \ - insert, remove, list, check properties, resolve dependencies and aliases." -HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kmod/" -LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" -LICENSE:libkmod = "LGPL-2.1-or-later" -SECTION = "base" - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \ - " -inherit autotools bash-completion gtk-doc pkgconfig manpages update-alternatives - -SRCREV = "b6ecfc916a17eab8f93be5b09f4e4f845aabd3d1" - -SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master \ - file://depmod-search.conf \ - file://avoid_parallel_tests.patch \ - file://0001-depmod-Add-support-for-excluding-a-directory.patch \ - " - -S = "${WORKDIR}/git" - -EXTRA_OECONF += "--enable-tools" - -PACKAGECONFIG ??= "zlib xz" -PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" -PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" -PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" -PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" -PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz" -PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" -PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" - -GTKDOC_DOCDIR = "${S}/libkmod/docs" - -PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" -RPROVIDES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" -RCONFLICTS:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" -RREPLACES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" - -# to force user to remove old module-init-tools and replace them with kmod variants -RCONFLICTS:libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" - -# autotools set prefix to /usr, however we want them in /bin and /sbin -EXTRA_OECONF += "--bindir=${base_bindir} --sbindir=${base_sbindir}" - -do_install:append () { - install -dm755 ${D}${base_bindir} - install -dm755 ${D}${base_sbindir} - # add symlinks to kmod - ln -rs ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod - for tool in insmod rmmod depmod modinfo modprobe; do - ln -rs ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} - done - # configuration directories - install -dm755 ${D}${nonarch_base_libdir}/depmod.d - install -dm755 ${D}${nonarch_base_libdir}/modprobe.d - install -dm755 ${D}${sysconfdir}/depmod.d - install -dm755 ${D}${sysconfdir}/modprobe.d - - # install depmod.d file for search/ dir - install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf" - - # Add .debug to the exclude path for depmod - echo "exclude .debug" > ${D}${nonarch_base_libdir}/depmod.d/exclude.conf -} - -ALTERNATIVE_PRIORITY = "70" - -ALTERNATIVE:kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" - -ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" -ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" -ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" -ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" -ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" -ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" -ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" -ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" - -PACKAGES =+ "libkmod" -FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" -FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-kernel/kmod/kmod_30.bb b/meta/recipes-kernel/kmod/kmod_30.bb new file mode 100644 index 0000000000..8eb83efe6d --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod_30.bb @@ -0,0 +1,89 @@ +# Copyright (C) 2012 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "Tools for managing Linux kernel modules" +DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \ + insert, remove, list, check properties, resolve dependencies and aliases." +HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kmod/" +LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later" +LICENSE:libkmod = "LGPL-2.1-or-later" +SECTION = "base" + +LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \ + " +inherit autotools bash-completion gtk-doc pkgconfig manpages update-alternatives + +SRCREV = "5d46434a63ae0160150a0efdde1914873697e273" + +SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master \ + file://depmod-search.conf \ + file://avoid_parallel_tests.patch \ + " + +S = "${WORKDIR}/git" + +EXTRA_OECONF += "--enable-tools" + +PACKAGECONFIG ??= "zlib xz" +PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" +PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" +PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" +PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" +PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz" +PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" +PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" + +GTKDOC_DOCDIR = "${S}/libkmod/docs" + +PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" +RPROVIDES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" +RCONFLICTS:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" +RREPLACES:${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" + +# to force user to remove old module-init-tools and replace them with kmod variants +RCONFLICTS:libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" + +# autotools set prefix to /usr, however we want them in /bin and /sbin +EXTRA_OECONF += "--bindir=${base_bindir} --sbindir=${base_sbindir}" + +do_install:append () { + install -dm755 ${D}${base_bindir} + install -dm755 ${D}${base_sbindir} + # add symlinks to kmod + ln -rs ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod + for tool in insmod rmmod depmod modinfo modprobe; do + ln -rs ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} + done + # configuration directories + install -dm755 ${D}${nonarch_base_libdir}/depmod.d + install -dm755 ${D}${nonarch_base_libdir}/modprobe.d + install -dm755 ${D}${sysconfdir}/depmod.d + install -dm755 ${D}${sysconfdir}/modprobe.d + + # install depmod.d file for search/ dir + install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf" + + # Add .debug to the exclude path for depmod + echo "exclude .debug" > ${D}${nonarch_base_libdir}/depmod.d/exclude.conf +} + +ALTERNATIVE_PRIORITY = "70" + +ALTERNATIVE:kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" + +ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" +ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" +ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" +ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" +ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" +ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" +ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" +ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" + +PACKAGES =+ "libkmod" +FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" +FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d" + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf