Re: [OE-core] [PATCH v2 3/3] depmodwrapper: Use nonarch_base_libdir for depmod.d

2022-04-01 Thread Saul Wold



On 4/1/22 04:11, Richard Purdie wrote:

On Thu, 2022-03-31 at 15:21 -0700, Saul Wold wrote:

This ensure that when depmod-native runs we can find the correct
exclude.conf information, in this case adding .debug to ignore
the .debug kernell modules. The kmod utilities like depmod can use
either /etc/depmod.d or /lib/depmod.d. The kmod recipe is installing
the existing search.conf to /lib/depmod.d (nonarch_base_lib)

When the busybox modutils are used, /lib/depmod.d is not used, so
it's safe add the exclude.conf file to /lib/depmod.d.

Signed-off-by: Saul Wold 
---
  meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 9 +++--
  1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb 
b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
index 04fc14a6d21..65068f02df8 100644
--- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -30,11 +30,16 @@ if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; 
then
  kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion")
  fi
  
+if [ ! -e "\3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then

+mkdir -p "\$3${nonarch_base_libdir}/depmod.d"
+echo "exclude .debug" > "\$3${nonarch_base_libdir}/depmod.d/exclude.conf"
+fi


Shouldn't the above go into the kmod recipe? We need this on target as well as
in our rootfs build, right? I'm worried about the case where someone calls
depmod on target.

The kmod recipe does install it into nonarch_base_libdir/depmod.d, this 
is for the case of busybox which does not install anything and we are 
using kmod-native and the code below has depmod-native pointing to the 
correct depmod.d in the target rootfs image.


Files installed by kmod-native don't make it to the target rootfs, so we 
need to create the exclude.conf here.  I could remove it after 
depmod-native runs if that's your concern.



+
  if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != 
"\$4" ]; then
  echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
-exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" "\$4"
+exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" 
"\$4"
  else
-exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" -F 
"${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" -F 
"${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
  fi
  EOF
chmod +x ${D}${bindir_crossscripts}/depmodwrapper


Does anything in the build install to $sysconfdir/depmod.d ?


Not that I know of, it's only created by the kmod recipe.

Sau!



Cheers,

Richard




--
Sau!

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#163943): 
https://lists.openembedded.org/g/openembedded-core/message/163943
Mute This Topic: https://lists.openembedded.org/mt/90166048/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v2 3/3] depmodwrapper: Use nonarch_base_libdir for depmod.d

2022-04-01 Thread Richard Purdie
On Thu, 2022-03-31 at 15:21 -0700, Saul Wold wrote:
> This ensure that when depmod-native runs we can find the correct
> exclude.conf information, in this case adding .debug to ignore
> the .debug kernell modules. The kmod utilities like depmod can use
> either /etc/depmod.d or /lib/depmod.d. The kmod recipe is installing
> the existing search.conf to /lib/depmod.d (nonarch_base_lib)
> 
> When the busybox modutils are used, /lib/depmod.d is not used, so
> it's safe add the exclude.conf file to /lib/depmod.d.
> 
> Signed-off-by: Saul Wold 
> ---
>  meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb 
> b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
> index 04fc14a6d21..65068f02df8 100644
> --- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
> +++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
> @@ -30,11 +30,16 @@ if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" 
> ]; then
>  kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion")
>  fi
>  
> +if [ ! -e "\3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then
> +mkdir -p "\$3${nonarch_base_libdir}/depmod.d"
> +echo "exclude .debug" > "\$3${nonarch_base_libdir}/depmod.d/exclude.conf"
> +fi

Shouldn't the above go into the kmod recipe? We need this on target as well as
in our rootfs build, right? I'm worried about the case where someone calls
depmod on target.

> +
>  if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" 
> != "\$4" ]; then
>  echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
> -exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" "\$4"
> +exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" 
> "\$3" "\$4"
>  else
> -exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" -F 
> "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
> +exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" 
> "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
>  fi
>  EOF
>   chmod +x ${D}${bindir_crossscripts}/depmodwrapper

Does anything in the build install to $sysconfdir/depmod.d ?

Cheers,

Richard



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#163884): 
https://lists.openembedded.org/g/openembedded-core/message/163884
Mute This Topic: https://lists.openembedded.org/mt/90166048/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v2 3/3] depmodwrapper: Use nonarch_base_libdir for depmod.d

2022-03-31 Thread Saul Wold
This ensure that when depmod-native runs we can find the correct
exclude.conf information, in this case adding .debug to ignore
the .debug kernell modules. The kmod utilities like depmod can use
either /etc/depmod.d or /lib/depmod.d. The kmod recipe is installing
the existing search.conf to /lib/depmod.d (nonarch_base_lib)

When the busybox modutils are used, /lib/depmod.d is not used, so
it's safe add the exclude.conf file to /lib/depmod.d.

Signed-off-by: Saul Wold 
---
 meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb 
b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
index 04fc14a6d21..65068f02df8 100644
--- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -30,11 +30,16 @@ if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; 
then
 kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion")
 fi
 
+if [ ! -e "\3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then
+mkdir -p "\$3${nonarch_base_libdir}/depmod.d"
+echo "exclude .debug" > "\$3${nonarch_base_libdir}/depmod.d/exclude.conf"
+fi
+
 if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != 
"\$4" ]; then
 echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
-exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" "\$4"
+exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" 
"\$4"
 else
-exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" -F 
"${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" 
-F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
 fi
 EOF
chmod +x ${D}${bindir_crossscripts}/depmodwrapper
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#163874): 
https://lists.openembedded.org/g/openembedded-core/message/163874
Mute This Topic: https://lists.openembedded.org/mt/90166048/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-