Summary: | sys-kernel/gentoo-kernel-bin: [Enhancement request] For kernel detection and to build other packages, retain some more files | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Teika kazura <teika> |
Component: | Current packages | Assignee: | Distribution Kernel Project <dist-kernel> |
Status: | RESOLVED INVALID | ||
Severity: | enhancement | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
emerge --info sys-kernel/gentoo-kernel-bin:6.5.10
build.log of "emerge www-client/firefox-bin" |
Description
Teika kazura
2023-11-13 00:43:59 UTC
I think there's some sort of misunderstanding going on here. You can *absolutely* build out-of-tree modules like xpadneo and zfs-kmod against the sources that gentoo-kernel or gentoo-kernel-bin installs. Please include the full build.log and emerge --info when something fails version detection. Created attachment 874721 [details]
emerge --info sys-kernel/gentoo-kernel-bin:6.5.10
First let us make it clear that sys-kernel/gentoo-kernel is different from gentoo-kernel-bin, and that difference is the point.
Let me show an imaginary "stacktrace" of kernel detection failure:
---
* Determining the location of the kernel source code
* Found kernel source directory:
* /usr/src/linux
* Could not detect kernel version.
* Please ensure that /usr/src/linux points to a complete set of Linux sources.
---
Though not fatal, this happens for www-client/firefox-bin, too. (In that case ebuild instead uses the running kernel version. In fact, this has been the case for years for me, and I've been wondering why.)
In linux-info.eclass, the above message comes from here:
---[quote]--
get_version() {
....
KV_MAJOR=$(getfilevar VERSION "${KERNEL_MAKEFILE}")
KV_MINOR=$(getfilevar PATCHLEVEL "${KERNEL_MAKEFILE}")
KV_PATCH=$(getfilevar SUBLEVEL "${KERNEL_MAKEFILE}")
KV_EXTRA=$(getfilevar EXTRAVERSION "${KERNEL_MAKEFILE}")
if [[ -z "${KV_MAJOR}" || -z "${KV_MINOR}" || -z "${KV_PATCH}" ]]; then
if [[ -z "${get_version_warning_done}" ]]; then
get_version_warning_done=1
qeerror "Could not detect kernel version."
qeerror "Please ensure that ${KERNEL_DIR} points to a complete set of Linux sources."
fi
---[/quote]
I saw the return value of$( getfilevar ), which was empty. What's the code there?
---[quote]
getfilevar() {
...
echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
nonfatal emake -C "${basedname}" --no-print-directory M="${T}" \
dot-config=0 need-config= need-compiler= \
${BUILD_FIXES} -s -f - 2>/dev/null
---[/quote]
It's echo-ing 'e:\n\t@echo $(VERSION | PATCHLEVEL | etc)\ninclude Makefile' into make. Removing 2>/dev/null, make's error message is:
---
Makefile:1108: scripts/Makefile.extrawarn: No such file or directory
make: *** No rule to make target 'scripts/Makefile.extrawarn'. Stop.
---
Thus scripts/Makefile.extrawarn is necessary, which is lacking in the gentoo-kernel-bin. (I've got sys-kernel/gentoo-kernel-bin-6.5.10 .)
Believe me, my "fix" in the original post actually works as a remedy. (I built a kernel from sys-kernel/gentoo-sources, and copied scripts/ and objtool into /usr/src/linux, which points to linux-6.5.10-gentoo-dist, which comes from gentoo-kernel-bin .) At the very least, kernel detection fails.
# I'd like to believe you as a good Gentoo user; I also think my claim should already have been made by others — gentoo-kernel-bin has been there for at least three years.
Created attachment 874722 [details]
build.log of "emerge www-client/firefox-bin"
gentoo-kernel-bin is built using gentoo-kernel (it's just a binpkg created from the gentoo-kernel ebuild) so it follows the same procedure. It is therefore very unlikely you'd have a file missing from gentoo-kernel-bin which is in gentoo-kernel. Taking /var/cache/distfiles/gentoo-kernel-6.5.8-1.amd64.gpkg.tar and untarring the image within: ``` /tmp/foo/gentoo-kernel-6.5.8-1/image $ stat ./usr/src/linux-6.5.8-gentoo-dist/scripts/Makefile.extrawarn File: ./usr/src/linux-6.5.8-gentoo-dist/scripts/Makefile.extrawarn Size: 3572 Blocks: 8 IO Block: 4096 regular file Device: 0,37 Inode: 78496 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ sam) Gid: ( 1000/ sam) Access: 2023-11-14 05:45:34.141318147 +0000 Modify: 2023-08-27 22:49:51.000000000 +0100 Change: 2023-11-14 05:45:34.141318147 +0000 Birth: 2023-11-14 05:45:34.141318147 +0000 ``` The file you're talking about is there. I believe your workaround works for you, I'm saying it shouldn't be necessary at all, and it's indicative of something else being wrong. It would help to see 'find /usr/src/linux' to see what other files you're missing. You can compare it with the image output from the gpkg. I am sorry. I have been doing a silly thing in /etc/portage/env, and I have forgotten it. I apologize for making you spare your time and mental energy. No worries, it happens. Thank you for the closure / explanation as it helps if someone turns up with a similar thing in the future. |