diff options
author | Andrei Gherzan <andrei.gherzan@huawei.com> | 2022-09-10 00:04:22 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-13 10:36:50 +0100 |
commit | 1ad8bab5626f0fdeaeb2f837f651441d797f3551 (patch) | |
tree | 3b8705ff37c64cbc78909428e1b4af6db59ab237 /meta/recipes-kernel/kmod | |
parent | a3a5809647e387fe040a444a861bdf82aa2d224b (diff) | |
download | poky-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>
Diffstat (limited to 'meta/recipes-kernel/kmod')
-rw-r--r-- | meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 16 |
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 |
23 | if [ "\$1" != "-a" -o "\$2" != "-b" ]; then | 23 | if [ "\$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 |
26 | fi | 26 | fi |
27 | 27 | ||
28 | kernelpkgname="kernel" | ||
29 | # If no KERNEL_PACKAGE_NAME, assume "kernel". | ||
30 | [ -z "\$5" ] || kernelpkgname="\$5" | ||
31 | |||
28 | kernelabi="" | 32 | kernelabi="" |
29 | if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; then | 33 | if [ -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") |
31 | fi | 35 | fi |
32 | 36 | ||
33 | if [ ! -e "\$3${nonarch_base_libdir}/depmod.d/exclude.conf" ]; then | 37 | if [ ! -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" |
36 | fi | 40 | fi |
37 | 41 | ||
38 | if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then | 42 | if [ ! -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" |
41 | else | 45 | else |
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" |
43 | fi | 47 | fi |
44 | EOF | 48 | EOF |
45 | chmod +x ${D}${bindir_crossscripts}/depmodwrapper | 49 | chmod +x ${D}${bindir_crossscripts}/depmodwrapper |