Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 739195 Details for
Bug 811726
linux-info.eclass: packages fail with "Could not detect kernel version" with out of tree kernel
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rework get_running_version
0001-linux-info.eclass-rework-get_running_version.patch (text/plain), 2.95 KB, created by
Mike Gilbert
on 2021-09-13 14:57:41 UTC
(
hide
)
Description:
Rework get_running_version
Filename:
MIME Type:
Creator:
Mike Gilbert
Created:
2021-09-13 14:57:41 UTC
Size:
2.95 KB
patch
obsolete
>From b7a457c7bcb379054e921a273efd234a4b47b485 Mon Sep 17 00:00:00 2001 >From: Mike Gilbert <floppym@gentoo.org> >Date: Mon, 13 Sep 2021 10:46:57 -0400 >Subject: [PATCH] linux-info.eclass: rework get_running_version > >This function may fail if the version cannot be parsed from a Makefile >found by following the /lib/modules/${KV_FULL}/{source,build} symlinks. >Instead of failing, we should just split KV_FULL as a fallback. > >Also, simplify the existance checks for the kernel Makefile; if we can't >find the kernel source directory, there is really no point in checking >for the kernel build directory. The latter will probably contain a >Makefile with no version information. > >Bug: https://bugs.gentoo.org/811726 >Signed-off-by: Mike Gilbert <floppym@gentoo.org> >--- > eclass/linux-info.eclass | 47 +++++++++++++++++----------------------- > 1 file changed, 20 insertions(+), 27 deletions(-) > >diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass >index 4e08949a385..8f9d0366ca7 100644 >--- a/eclass/linux-info.eclass >+++ b/eclass/linux-info.eclass >@@ -629,34 +629,27 @@ get_running_version() { > die "${FUNCNAME}() called on non-Linux system, please fix the ebuild" > fi > >- KV_FULL=$(uname -r) >- >- if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then >- KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source) >- KBUILD_OUTPUT=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build) >- unset KV_FULL >- get_version >- return $? >- elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then >- KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source) >- unset KV_FULL >- get_version >- return $? >- elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then >- KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build) >- unset KV_FULL >- get_version >- return $? >- else >- # This handles a variety of weird kernel versions. Make sure to update >- # tests/linux-info_get_running_version.sh if you want to change this. >- local kv_full=${KV_FULL//[-+_]*} >- KV_MAJOR=$(ver_cut 1 ${kv_full}) >- KV_MINOR=$(ver_cut 2 ${kv_full}) >- KV_PATCH=$(ver_cut 3 ${kv_full}) >- KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}" >- : ${KV_PATCH:=0} >+ local kv=$(uname -r) >+ >+ if [[ -f ${ROOT%/}/lib/modules/${kv}/source/Makefile ]]; then >+ KERNEL_DIR=$(readlink -f "${ROOT%/}/lib/modules/${kv}/source") >+ if [[ -f ${ROOT%/}/lib/modules/${kv}/build/Makefile ]]; then >+ KBUILD_OUTPUT=$(readlink -f "${ROOT%/}/lib/modules/${kv}/build") >+ fi >+ get_version && return 0 > fi >+ >+ KV_FULL=$kv >+ >+ # This handles a variety of weird kernel versions. Make sure to update >+ # tests/linux-info_get_running_version.sh if you want to change this. >+ local kv_full=${KV_FULL//[-+_]*} >+ KV_MAJOR=$(ver_cut 1 ${kv_full}) >+ KV_MINOR=$(ver_cut 2 ${kv_full}) >+ KV_PATCH=$(ver_cut 3 ${kv_full}) >+ KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}" >+ : ${KV_PATCH:=0} >+ > return 0 > } > >-- >2.33.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 811726
:
737926
|
737938
| 739195