diff mbox series

busybox: Fix excluding .debug from depmod

Message ID 20230214131734.2002-1-a.kikin@tano-systems.com
State New
Headers show
Series busybox: Fix excluding .debug from depmod | expand

Commit Message

Anton Kikin Feb. 14, 2023, 1:17 p.m. UTC
The previously added patch for excluding .debug from depmod has an
invalid expression in the condition. The strstr function returns
NULL if substring is NOT found [1]. Therefore, the existing patch,
on the opposite, handles only modules that have a .debug substring
in the path. This commit fixes the condition in the patch to the
correct one.

[1]: https://man7.org/linux/man-pages/man3/strstr.3.html

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
---
 .../busybox/0001-depmod-Ignore-.debug-directories.patch    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Alexandre Belloni Feb. 14, 2023, 4:34 p.m. UTC | #1
Hello,

Saul sent this on Friday:
https://lore.kernel.org/openembedded-core/20230210153255.2716448-1-saul.wold@windriver.com/

On 14/02/2023 16:17:34+0300, Anton Kikin wrote:
> The previously added patch for excluding .debug from depmod has an
> invalid expression in the condition. The strstr function returns
> NULL if substring is NOT found [1]. Therefore, the existing patch,
> on the opposite, handles only modules that have a .debug substring
> in the path. This commit fixes the condition in the patch to the
> correct one.
> 
> [1]: https://man7.org/linux/man-pages/man3/strstr.3.html
> 
> Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
> ---
>  .../busybox/0001-depmod-Ignore-.debug-directories.patch    | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch b/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch
> index 354f83a4a5..3398a354c5 100644
> --- a/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch
> +++ b/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch
> @@ -1,6 +1,6 @@
>  From 5f6ed003f10ee0bd4a508d5f59129a29f0920dfc Mon Sep 17 00:00:00 2001
> -From: Saul Wold <saul.wold@windriver.com>
> -Date: Thu, 31 Mar 2022 11:21:45 -0700
> +From: Anton Kikin <a.kikin@tano-systems.com>
> +Date: Tue, 14 Feb 2023 15:46:42 +0300
>  Subject: [PATCH] depmod: Ignore .debug directories
>  
>  The .debug/<module>.ko files do not have the correct symbol information
> @@ -9,6 +9,7 @@ since it's split away from the actual <module>.ko file. Just ignore it.
>  Upstream-Status: Pending
>  
>  Signed-off-by: Saul Wold <saul.wold@windriver.com>
> +Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
>  ---
>   modutils/depmod.c | 3 +++
>   1 file changed, 3 insertions(+)
> @@ -21,7 +22,7 @@ index bb42bbe..aa5a2de 100644
>   	/* Arbitrary. Was sb->st_size, but that breaks .gz etc */
>   	size_t len = (64*1024*1024 - 4096);
>   
> -+	if (strstr(fname, ".debug") == NULL)
> ++	if (strstr(fname, ".debug"))
>  +		return TRUE;
>  +
>   	if (strrstr(fname, ".ko") == NULL)
> -- 
> 2.34.1.windows.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#177141): https://lists.openembedded.org/g/openembedded-core/message/177141
> Mute This Topic: https://lists.openembedded.org/mt/96959409/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch b/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch
index 354f83a4a5..3398a354c5 100644
--- a/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch
+++ b/meta/recipes-core/busybox/busybox/0001-depmod-Ignore-.debug-directories.patch
@@ -1,6 +1,6 @@ 
 From 5f6ed003f10ee0bd4a508d5f59129a29f0920dfc Mon Sep 17 00:00:00 2001
-From: Saul Wold <saul.wold@windriver.com>
-Date: Thu, 31 Mar 2022 11:21:45 -0700
+From: Anton Kikin <a.kikin@tano-systems.com>
+Date: Tue, 14 Feb 2023 15:46:42 +0300
 Subject: [PATCH] depmod: Ignore .debug directories
 
 The .debug/<module>.ko files do not have the correct symbol information
@@ -9,6 +9,7 @@  since it's split away from the actual <module>.ko file. Just ignore it.
 Upstream-Status: Pending
 
 Signed-off-by: Saul Wold <saul.wold@windriver.com>
+Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
 ---
  modutils/depmod.c | 3 +++
  1 file changed, 3 insertions(+)
@@ -21,7 +22,7 @@  index bb42bbe..aa5a2de 100644
  	/* Arbitrary. Was sb->st_size, but that breaks .gz etc */
  	size_t len = (64*1024*1024 - 4096);
  
-+	if (strstr(fname, ".debug") == NULL)
++	if (strstr(fname, ".debug"))
 +		return TRUE;
 +
  	if (strrstr(fname, ".ko") == NULL)