summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaul Wold <Saul.Wold@windriver.com>2022-04-04 07:12:05 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-05 10:49:36 +0100
commitdaafcdfb16a7404a99479c5bb644c841d8e5d821 (patch)
treee4a6b2b99b8837d5f0f6526717bd3310d3e2f3ba
parentca405e4529db47f471d8e49fd015c5d532e7c9ba (diff)
downloadpoky-daafcdfb16a7404a99479c5bb644c841d8e5d821.tar.gz
kmod: Update exclude patch to Accepted
Upstream made a few tweaks and accepted the patch. (From OE-Core rev: 28b79449ed6d0a9920c252f75d0b40da5faa0fd7) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-kernel/kmod/kmod/0001-depmod-Add-support-for-excluding-a-directory.patch35
1 files changed, 19 insertions, 16 deletions
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
index 18d9793533..ea0570af2b 100644
--- 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
@@ -1,6 +1,6 @@
1From 01f3fe68a7a42b06eb318f3b09fa5e5ea75d46c4 Mon Sep 17 00:00:00 2001 1From f50e2d67575ac5f256fb853ca9d29aeac92d9a57 Mon Sep 17 00:00:00 2001
2From: Saul Wold <saul.wold@windriver.com> 2From: Saul Wold <saul.wold@windriver.com>
3Date: Tue, 22 Mar 2022 12:11:45 -0700 3Date: Thu, 31 Mar 2022 14:56:28 -0700
4Subject: [PATCH] depmod: Add support for excluding a directory 4Subject: [PATCH] depmod: Add support for excluding a directory
5 5
6This adds support to depmod to enable a new exclude directive in 6This adds support to depmod to enable a new exclude directive in
@@ -12,13 +12,15 @@ via a new exclude directive.
12depmod.d/exclude.conf example: 12depmod.d/exclude.conf example:
13exclude .debug 13exclude .debug
14 14
15Upstream-Status: Submitted 15Upstream-Status: Accepted
16 16
17Signed-off-by: Saul Wold <saul.wold@windriver.com> 17Signed-off-by: Saul Wold <saul.wold@windriver.com>
18[ Fix warnings and make should_exclude_dir() return bool ]
19Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
18--- 20---
19 man/depmod.d.xml | 14 +++++++++++ 21 man/depmod.d.xml | 14 ++++++++++
20 tools/depmod.c | 65 +++++++++++++++++++++++++++++++++++++++++++++--- 22 tools/depmod.c | 66 +++++++++++++++++++++++++++++++++++++++++++++---
21 2 files changed, 75 insertions(+), 4 deletions(-) 23 2 files changed, 76 insertions(+), 4 deletions(-)
22 24
23diff --git a/man/depmod.d.xml b/man/depmod.d.xml 25diff --git a/man/depmod.d.xml b/man/depmod.d.xml
24index b315e93..76548e9 100644 26index b315e93..76548e9 100644
@@ -46,7 +48,7 @@ index b315e93..76548e9 100644
46 </refsect1> 48 </refsect1>
47 49
48diff --git a/tools/depmod.c b/tools/depmod.c 50diff --git a/tools/depmod.c b/tools/depmod.c
49index eb810b8..ac365e9 100644 51index 07a35ba..4117dd1 100644
50--- a/tools/depmod.c 52--- a/tools/depmod.c
51+++ b/tools/depmod.c 53+++ b/tools/depmod.c
52@@ -458,6 +458,11 @@ struct cfg_external { 54@@ -458,6 +458,11 @@ struct cfg_external {
@@ -125,32 +127,33 @@ index eb810b8..ac365e9 100644
125 } 127 }
126 128
127 129
128@@ -1229,6 +1270,24 @@ add: 130@@ -1229,6 +1270,25 @@ add:
129 return 0; 131 return 0;
130 } 132 }
131 133
132+static int should_exclude_dir(struct cfg *cfg, char *name) 134+static bool should_exclude_dir(const struct cfg *cfg, const char *name)
133+{ 135+{
134+ struct cfg_exclude *exc; 136+ struct cfg_exclude *exc;
135+ 137+
136+ if (name[0] == '.' && (name[1] == '\0' || 138+ if (name[0] == '.' && (name[1] == '\0' ||
137+ (name[1] == '.' && name[2] == '\0'))) 139+ (name[1] == '.' && name[2] == '\0')))
138+ return 1; 140+ return true;
141+
139+ if (streq(name, "build") || streq(name, "source")) 142+ if (streq(name, "build") || streq(name, "source"))
140+ return 1; 143+ return true;
141+ 144+
142+ for (exc = cfg->excludes; exc != NULL; exc = exc->next) { 145+ for (exc = cfg->excludes; exc != NULL; exc = exc->next) {
143+ if (streq(name, exc->exclude_dir)) { 146+ if (streq(name, exc->exclude_dir))
144+ return 1; 147+ return true;
145+ }
146+ } 148+ }
147+ return 0; 149+
150+ return false;
148+} 151+}
149+ 152+
150 static int depmod_modules_search_dir(struct depmod *depmod, DIR *d, size_t baselen, struct scratchbuf *s_path) 153 static int depmod_modules_search_dir(struct depmod *depmod, DIR *d, size_t baselen, struct scratchbuf *s_path)
151 { 154 {
152 struct dirent *de; 155 struct dirent *de;
153@@ -1240,11 +1299,9 @@ static int depmod_modules_search_dir(struct depmod *depmod, DIR *d, size_t basel 156@@ -1240,11 +1300,9 @@ static int depmod_modules_search_dir(struct depmod *depmod, DIR *d, size_t basel
154 size_t namelen; 157 size_t namelen;
155 uint8_t is_dir; 158 uint8_t is_dir;
156 159