View previous topic :: View next topic |
Author |
Message |
tckosvic Apprentice

Joined: 18 Apr 2023 Posts: 180
|
Posted: Mon May 05, 2025 12:46 pm Post subject: how to change from distribution kernel to sources kernel |
|
|
Gentoo was installed following the Handbook using a distribution kernel installed by an emerge of "sys-kernel/gentoo-kernel". The systems looks to be functioning well. Xorg and a mate desktop environment have been added.
The distribution kernel is: 6.12.25. This is a qemu/libvirt vm.
I wish to move kernel to 6.14.4 and compile manually from sources in the future. In an older vm, I was able to do that. Emerge does not let an install of 6.14.4. See below:
Code: |
gentoo /usr/src # emerge --ask --update --deep --with-bdeps=y --newuse sys-kernel/gentoo-sources-6.14.4
!!! 'sys-kernel/gentoo-sources-6.14.4' is not a valid package atom.
!!! Please check ebuild(5) for full details.
|
I have no idea what ebuild(5) is or how to get around this.
I did remove the distribution kernel "sys-kernel/gentoo-kernel" from the world file.
I did try to emerge gentoo kernel sources without specifying the version and 6.12.21 (a regression) was downloaded.
How do I move kernel from a distribution kernel to a sources kernel?
thanks, tom kosvic |
|
Back to top |
|
 |
NichtDerHans Apprentice

Joined: 27 Jan 2023 Posts: 204
|
Posted: Mon May 05, 2025 1:11 pm Post subject: |
|
|
Hi,
Code: | emerge -av gentoo-sources |
if you want the latest 6.14.x you have to add "sys-kernel/gentoo-sources ~amd64" to "/etc/portage/pacage.use[/quote]" |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23456
|
Posted: Mon May 05, 2025 1:28 pm Post subject: Re: how to change from distribution kernel to sources kernel |
|
|
tckosvic wrote: | Code: | gentoo /usr/src # emerge --ask --update --deep --with-bdeps=y --newuse sys-kernel/gentoo-sources-6.14.4
!!! 'sys-kernel/gentoo-sources-6.14.4' is not a valid package atom. |
| If you give a name and a version, you must also give a relational operator. In this case, you want an equal sign: =sys-kernel/gentoo-sources-6.14.4. tckosvic wrote: | Code: | !!! Please check ebuild(5) for full details.
| I have no idea what ebuild(5) is or how to get around this. | This is a very traditional way of referring you to the manual page. In this case, it wants you to read the manual page ebuild in section 5 of the manual, by running man 5 ebuild. However, since my earlier sentence addresses your immediate question, there is no need for you to read the manual unless you want to learn about the other operators and ways to refer to a package. |
|
Back to top |
|
 |
tckosvic Apprentice

Joined: 18 Apr 2023 Posts: 180
|
Posted: Mon May 05, 2025 2:09 pm Post subject: |
|
|
I added "sys-kernel/gentoo-sources ~amd64" to "/etc/portage/pacage.use". Emerge still wants to download 6.12.21, not latest 6.14.4, as it did before. I tried with ">=" in front and still wants to download 6.12.21.
Do I possibly need a reboot?
I also unsuccessfully tried:
Code: |
gentoo /etc/portage/package.use # emerge --ask --update --deep --with-bdeps=y --newuse =sys-kernel/gentoo-sources-6.14.4--- Invalid atom in /etc/portage/package.use/use_additions: >=sys-kernel/gentoo-sources
* IMPORTANT: 26 news items need reading for repository 'gentoo'.
* Use eselect news read to view new items.
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 0.96 s (backtrack: 0/20).
!!! All ebuilds that could satisfy "=sys-kernel/gentoo-sources-6.14.4" have been masked.
!!! One of the following masked packages is required to complete your request:
- sys-kernel/gentoo-sources-6.14.4::gentoo (masked by: ~amd64 keyword)
For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.
gentoo /etc/portage/package.use #
|
|
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5677 Location: Bavaria
|
|
Back to top |
|
 |
NichtDerHans Apprentice

Joined: 27 Jan 2023 Posts: 204
|
Posted: Mon May 05, 2025 2:31 pm Post subject: |
|
|
Quote: | if you want the latest 6.14.x you have to add "sys-kernel/gentoo-sources ~amd64" to "/etc/portage/pacage.use |
I made a mistake, write "sys-kernel/gentoo-sources ~amd64" in "/etc/portage/package.accept_keywords"
edit: see Pietinger |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23456
|
Posted: Mon May 05, 2025 2:37 pm Post subject: |
|
|
No, a reboot is not needed.
tckosvic wrote: | I also unsuccessfully tried: Code: | gentoo /etc/portage/package.use # emerge --ask --update --deep --with-bdeps=y --newuse =sys-kernel/gentoo-sources-6.14.4
!!! All ebuilds that could satisfy "=sys-kernel/gentoo-sources-6.14.4" have been masked.
!!! One of the following masked packages is required to complete your request:
- sys-kernel/gentoo-sources-6.14.4::gentoo (masked by: ~amd64 keyword) |
| This is progress. Although it failed, we see that it understood your request and tried to pick the right version, then failed out due to the keyword mask. That means once you solve the accept_keywords issue (see pietinger's post), this should work. |
|
Back to top |
|
 |
tckosvic Apprentice

Joined: 18 Apr 2023 Posts: 180
|
Posted: Mon May 05, 2025 3:09 pm Post subject: |
|
|
thanks
Emerge kernel sources 6.14.5 is now running
Any suggestions for the .config? I am thinking: make defconfig
tom kosvic |
|
Back to top |
|
 |
tckosvic Apprentice

Joined: 18 Apr 2023 Posts: 180
|
Posted: Mon May 05, 2025 3:30 pm Post subject: |
|
|
I copied over dist config and ran make olddefconfig
I need to understand how "keyword" differs from USE
After I get the new kernel running, can I delete the "keyword" entry?
thanks again. tom kosvic |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 5677 Location: Bavaria
|
Posted: Mon May 05, 2025 5:57 pm Post subject: |
|
|
tckosvic wrote: | Any suggestions for the .config? I am thinking: make defconfig |
Yes ... this is possible ... if you want a black screen ... (or stuck at "Loading Gentoo ..." if you are using grub as boot manager) ... just follow the link in my article ... and then all other links
Short way for a kernel .config: You are familiar with configuring a kernel and know what you can do and must do.
Long way: Read a few hours all the links and then start.
Very long way: Try using other kernel .configs ... without knowing what an initramfs is and does .. without knowing how complicate a manual kernel configuration can be ... and look at this thread =>
https://forums.gentoo.org/viewtopic-t-1173089-highlight-.html
 _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
 |
rfx Apprentice

Joined: 19 Apr 2023 Posts: 161 Location: de-by
|
Posted: Mon May 05, 2025 6:04 pm Post subject: |
|
|
tckosvic wrote: | Any suggestions for the .config? I am thinking: make defconfig |
Easiest is to copy the .config from your old distributionkernel and delete drivers and filesystems which you don't need and do your stuff what you want to do  |
|
Back to top |
|
 |
sublogic Guru


Joined: 21 Mar 2022 Posts: 334 Location: Pennsylvania, USA
|
Posted: Tue May 06, 2025 12:36 am Post subject: |
|
|
rfx wrote: | tckosvic wrote: | Any suggestions for the .config? I am thinking: make defconfig |
Easiest is to copy the .config from your old distributionkernel and delete drivers and filesystems which you don't need and do your stuff what you want to do  |
Seconded. What I did:- While on the distribution kernel, save the output of lsmod and lspci -nnk for future reference.
- emerge gentoo-sources, eselect kernel list, eselect kernel set, cd /usr/src/linux .
- make localyesconfig
- make menuconfig
- Try it. Revise the menuconfig as needed.
(This was a while ago so I may get a few details wrong. Anyway,)
Step 3 starts from the running kernel's /proc/config.gz, discards all the drivers not in use, and turns the drivers of loaded modules into built-ins.
In step 4, I manually turn some drivers back into modules: anything that requires firmware, and anything not strictly needed to boot successfully (e.g. wireless, in my case). The listings from step 1 are useful here.
I use a bootloader (grub) so it's easy to return to the distribution kernel if the custom kernel fails to boot.
You can also try localmodconfig at step 3, but make sure your initramfs generator knows how to put all the critical modules in the initramfs.
(The local{yes,mod}config also resets the CONFIG_MODULE_SIG_KEY for you. Otherwise, you would get errors when signing the modules.)
Edit to add: local*config looks for an existing .config before falling back to /proc/config.gz . So do not run make defconfig before step 3 above. |
|
Back to top |
|
 |
nokilli Apprentice


Joined: 25 Feb 2004 Posts: 238
|
Posted: Thu May 22, 2025 12:02 pm Post subject: |
|
|
sublogic wrote: | rfx wrote: | tckosvic wrote: | Any suggestions for the .config? I am thinking: make defconfig |
Easiest is to copy the .config from your old distributionkernel and delete drivers and filesystems which you don't need and do your stuff what you want to do  |
Seconded. What I did:[list=1][*]While on the distribution kernel, save the output of lsmod and lspci -nnk for future reference.
[*] emerge gentoo-sources, eselect kernel list, eselect kernel set, cd /usr/src/linux .
[*] make localyesconfig
[*] make menuconfig
[*]Try it. ... |
I think the latest dist kernel may be doing something like this. My initramfs size for 6.12.16 was 95515108. Just built 6.12.28 and it's now 16152190!
I remember reading something about how the gentoo kernel system profiles or analyzes previous kernel use.
It appears to be working well.
(why dist? I literally do emerge -uDwhatever and it's a day compile and then i reboot and everything works perfectly) _________________ We are the block device. The kernel is our client. |
|
Back to top |
|
 |
|