Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156897 - linux-info.eclass: an extra dot between ${KV_PATCH}.${KV_EXTRA} should be eliminated
Summary: linux-info.eclass: an extra dot between ${KV_PATCH}.${KV_EXTRA} should be eli...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Lowest enhancement (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-02 05:13 UTC by Zhang Le (RETIRED)
Modified: 2006-12-05 10:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
linux-info.eclass.KBUILD_OUTPUT.patch (linux-info.eclass.KBUILD_OUTPUT.patch,1.28 KB, patch)
2006-12-02 05:14 UTC, Zhang Le (RETIRED)
Details | Diff
eliminate the dot between ${KV_PATCH}.${KV_EXTRA} (linux-info.eclass.patch,836 bytes, patch)
2006-12-04 18:02 UTC, Zhang Le (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhang Le (RETIRED) gentoo-dev 2006-12-02 05:13:55 UTC
We could get KBUILD_OUTPUT from "readlink -f /lib/modules/`uname -r`/build"
The attached patch demonstrates the idea.
Comment 1 Zhang Le (RETIRED) gentoo-dev 2006-12-02 05:14:32 UTC
Created attachment 103190 [details, diff]
linux-info.eclass.KBUILD_OUTPUT.patch
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-12-02 05:21:40 UTC
Honestly, I fail to see a single reason to touch the eclass because of this. Reading the target of some (potentially stale or dead) symlink is a horrible way to determine the correct directory for KBUILD_OUTPUT (and don't fix what's not broken applies as well).
Comment 3 Zhang Le (RETIRED) gentoo-dev 2006-12-02 06:50:46 UTC
(In reply to comment #2)
> Honestly, I fail to see a single reason to touch the eclass because of this.
> Reading the target of some (potentially stale or dead) symlink is a horrible
> way to determine the correct directory for KBUILD_OUTPUT (and don't fix what's
> not broken applies as well).
> 
Then how about treat it as a fallback solution? I think normally this particular symlink /lib/modules/`uname -r`/build should be up-to-date.
At least, maybe we can eliminate this:
kbuild_output="$(getfilevar KBUILD_OUTPUT ${KV_DIR}/Makefile)"
normally KV_DIR is /usr/src/linux, if my KBUILD_OUTPUT is elsewhere, then Makefile in /usr/src/linux won't contain KBUILD_OUTPUT.
Please correct me if I were wrong.
Comment 4 Stefan Schweizer (RETIRED) gentoo-dev 2006-12-04 13:23:41 UTC
This should already be in place in the code:

    [ "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.${KV_EXTRA}" == "$(uname -r)" ] && \
        OUTPUT_DIR="${OUTPUT_DIR:-/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.${KV_EXTRA}/build}"

Any idea why this does not work for you?
Comment 5 Zhang Le (RETIRED) gentoo-dev 2006-12-04 17:47:50 UTC
(In reply to comment #4)
> This should already be in place in the code:
> 
>     [ "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.${KV_EXTRA}" == "$(uname -r)" ] && \
>        
> OUTPUT_DIR="${OUTPUT_DIR:-/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.${KV_EXTRA}/build}"
> 
> Any idea why this does not work for you?
Thanks genstef. I overlooked this.
However there is a little mistake in this code, look at this:
${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.${KV_EXTRA}
actually we don't need the dot between KV_PATCH and KV_EXTRA, otherwise kernel version like 2.6.18-suspend2 will become 2.6.18.-suspend2
I will post another patch. 
Comment 6 Zhang Le (RETIRED) gentoo-dev 2006-12-04 18:02:24 UTC
Created attachment 103371 [details, diff]
eliminate the dot between ${KV_PATCH}.${KV_EXTRA}
Comment 7 Stefan Schweizer (RETIRED) gentoo-dev 2006-12-05 10:16:15 UTC
Thanks, I fixed this in linux-info.eclass