summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei.gherzan@huawei.com>2022-09-10 00:04:22 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-13 10:36:50 +0100
commit1ad8bab5626f0fdeaeb2f837f651441d797f3551 (patch)
tree3b8705ff37c64cbc78909428e1b4af6db59ab237
parenta3a5809647e387fe040a444a861bdf82aa2d224b (diff)
downloadpoky-1ad8bab5626f0fdeaeb2f837f651441d797f3551.tar.gz
depmodwrapper-cross: Take into consideration kernel package name
depmodwrapper assumes that the kernel package name is "kernel". Since this is configurable via KERNEL_PACKAGE_NAME variable, the wrapper can easily look in the wrong place. This change adds an optional positional argument that can be used to provide the kernel package name - when not provided, it defaults to "kernel" (current behaviour). (From OE-Core rev: 0c2cc62b009467b05bf6e1897989d8ede0412d73) Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb16
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
index 303026ad78..6c0739d64f 100644
--- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -21,13 +21,17 @@ do_install() {
21#!/bin/sh 21#!/bin/sh
22# Expected to be called as: depmodwrapper -a KERNEL_VERSION 22# Expected to be called as: depmodwrapper -a KERNEL_VERSION
23if [ "\$1" != "-a" -o "\$2" != "-b" ]; then 23if [ "\$1" != "-a" -o "\$2" != "-b" ]; then
24 echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2 24 echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION [KERNEL_PACKAGE_NAME]" >&2
25 exit 1 25 exit 1
26fi 26fi
27 27
28kernelpkgname="kernel"
29# If no KERNEL_PACKAGE_NAME, assume "kernel".
30[ -z "\$5" ] || kernelpkgname="\$5"
31
28kernelabi="" 32kernelabi=""
29if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; then 33if [ -r "${PKGDATA_DIR}/\${kernelpkgname}-depmod/\${kernelpkgname}-abiversion" ]; then
30 kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion") 34 kernelabi=\$(cat "${PKGDATA_DIR}/\${kernelpkgname}-depmod/\${kernelpkgname}-abiversion")
31fi 35fi
32 36
33if [ ! -e "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then 37if [ ! -e "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then
@@ -35,11 +39,11 @@ if [ ! -e "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then
35 echo "exclude .debug" > "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" 39 echo "exclude .debug" > "\$3${nonarch_base_libdir}/depmod.d/exclude.conf"
36fi 40fi
37 41
38if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then 42if [ ! -r ${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then
39 echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2 43 echo "Unable to read: ${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4" >&2
40 exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" "\$4" 44 exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" "\$4"
41else 45else
42 exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4" 46 exec env depmod -C "\$3${nonarch_base_libdir}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/\${kernelpkgname}-depmod/System.map-\$4" "\$4"
43fi 47fi
44EOF 48EOF
45 chmod +x ${D}${bindir_crossscripts}/depmodwrapper 49 chmod +x ${D}${bindir_crossscripts}/depmodwrapper