View previous topic :: View next topic |
Author |
Message |
mschraff Tux's lil' helper


Joined: 08 Jun 2008 Posts: 105
|
Posted: Tue May 05, 2020 8:16 pm Post subject: Switching from genkernel to a manually configured kernel |
|
|
Hello,
last year I started again with gentoo and after some time my system runs as it should be. KDE is properly configured, graphic card, WLAN and sound work as good as they should. The last remaining thing is getting away from using genkernel. My first aim was getting my system work and now that this goal is achieved I can dig a little bit deeper and manually compile my kernel.
First of all: I just updated with genkernel to the gentoo-sources-5.4.38 (which are the recent stable sources) and there is one question remaining. How do I change the grub menu, because up to now the old kernel (4.19.97) is starded by default.
After that: can I use the .config file created by genkernel and start editing to my needs? _________________ DELL Latitude 5550 intel Core i5-5300 CPU @ 2.30GHz
gentoo genkernel-5.4.38 gcc 9.3.0 portage 2.3.89-r3 |
|
Back to top |
|
 |
Linubie Guru


Joined: 11 Jun 2004 Posts: 395
|
Posted: Tue May 05, 2020 9:32 pm Post subject: |
|
|
Code: | grub-mkconfig -o /boot/grub/grub.cfg |
check if .config file is in that directory
have fun! _________________ Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something... |
|
Back to top |
|
 |
389292 Guru

Joined: 26 Mar 2019 Posts: 504
|
Posted: Wed May 06, 2020 12:33 am Post subject: |
|
|
better start with standard kernel and add what you need, rather than starting with a bloated config trying to remove what you don't want, you may not even know what can be safely removed. |
|
Back to top |
|
 |
mschraff Tux's lil' helper


Joined: 08 Jun 2008 Posts: 105
|
Posted: Wed May 06, 2020 5:56 pm Post subject: |
|
|
Thanks to both of you.
@etnull:
You overestimate my proficiency in configuring my system So my rationale behind this method is to start with a working system and then step by step get rid of all that I don´t need. And if something goes wrong I am able to step back very easily.
@Linubie:
So I´m compiling a kernel just as I was used to 10 years ago.
Two further questions before I start.
GRUB menu entries
How do I change the standard menu entry which is loaded? In the /etc/default/grub I made two changes
Code: |
# Default menu entry
GRUB_DEFAULT=5
# Boot the default entry this many seconds after the menu is displayed
GRUB_TIMEOUT=3
|
and while the changes in the timeout have an effect after rebooting (and of course grub-mkconfig -o /boot/grub/grub.cfg) changing GRUB_DEFAULT is to no avail. My system always boots the old kernel.
deleting old kernels and modules
Is it sufficient to delete the following details:
- kernel-genkernel-x86-64-OLD_VERSION
- System.map-genkernel-x86-64-OLD_VERSION
- initramfs-genkernel-x86-64-OLD-VERSION
_________________ DELL Latitude 5550 intel Core i5-5300 CPU @ 2.30GHz
gentoo genkernel-5.4.38 gcc 9.3.0 portage 2.3.89-r3 |
|
Back to top |
|
 |
Linubie Guru


Joined: 11 Jun 2004 Posts: 395
|
Posted: Wed May 06, 2020 6:24 pm Post subject: |
|
|
What I am doing is, deleting the .old and executing the grub-config command.
I am sorry I am not deep into grub config
but deleting the old kernel and executing the mentioned command works for me.
do you have a separate parition for /boot and have mounted it?
I once made the mistake not to mount the /boot partition and the system was creating a boot directory on my main (root) partition.
The commands I execute for every new kernel are
if I have to adjust something
Code: | make && make modules_install && make install |
_________________ Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something... |
|
Back to top |
|
 |
charles17 Advocate

Joined: 02 Mar 2008 Posts: 3686
|
Posted: Thu May 07, 2020 7:29 am Post subject: Re: Switching from genkernel to a manually configured kernel |
|
|
mschraff wrote: | ... The last remaining thing is getting away from using genkernel. ... is achieved I can dig a little bit deeper and manually compile my kernel. |
The allmodconfig target could be of help to find the kernel options you need.
mschraff wrote: | ... How do I change the grub menu, ... |
Do you really want or need to keep using grub?
If not, switching to EFI Boot Stub could be an option for you. |
|
Back to top |
|
 |
mschraff Tux's lil' helper


Joined: 08 Jun 2008 Posts: 105
|
Posted: Thu May 07, 2020 6:48 pm Post subject: |
|
|
Thanks a lot for your help.
@charles: I´ll take a look at allmodconfig and especiallyEFI Boot Stub as soon as possible. But before I start to switch to a new option I want to fix all of the remaining issues with my current configuration. That doens´t seem to bee to dramatic because (thants to @Linubie) I reduced the possible menu entries in grub by just deleting
Code: |
kernel-genkernel-x86-64-OLD_VERSION
System.map-genkernel-x86-64-OLD_VERSION
initramfs-genkernel-x86-64-OLD-VERSION
|
as I supposed before.
I also found out that GRUB_DEFAULT applies to the only two options you can see at first:
- standard entry
- entering into the submenu where all the available kernels are listet
So my question is: how can I change the standard entry from kernel 4.19.82 to 5.4.38? Here you can find my /boot/grub/grub.cfg where you can see that the old kernel is set as standard.
Code: |
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-c9c13832-38d1-4b41-96f2-383cf748e1be' {
savedefault
load_video
if [ "x$grub_platform" = xefi ]; then
set gfxpayload=keep
fi
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 39F4-6A2F
else
search --no-floppy --fs-uuid --set=root 39F4-6A2F
fi
echo 'Loading Linux x86_64-4.19.82-gentoo ...'
linux /kernel-genkernel-x86_64-4.19.82-gentoo root=UUID=c9c13832-38d1-4b41-96f2-383cf748e1be ro
echo 'Loading initial ramdisk ...'
initrd /initramfs-genkernel-x86_64-4.19.82-gentoo
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-c9c13832-38d1-4b41-96f2-383cf748e1be' {
menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.19.82-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.19.82-gentoo-advanced-c9c13832-38d1-4b41-96f2-383cf748e1be' {
savedefault
load_video
if [ "x$grub_platform" = xefi ]; then
set gfxpayload=keep
fi
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 39F4-6A2F
else
search --no-floppy --fs-uuid --set=root 39F4-6A2F
fi
echo 'Loading Linux x86_64-4.19.82-gentoo ...'
linux /kernel-genkernel-x86_64-4.19.82-gentoo root=UUID=c9c13832-38d1-4b41-96f2-383cf748e1be ro
echo 'Loading initial ramdisk ...'
initrd /initramfs-genkernel-x86_64-4.19.82-gentoo
}
menuentry 'Gentoo GNU/Linux, with Linux 5.4.38-gentoo-x86_64' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.4.38-gentoo-x86_64-advanced-c9c13832-38d1-4b41-96f2-383cf748e1be' {
savedefault
load_video
if [ "x$grub_platform" = xefi ]; then
set gfxpayload=keep
fi
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 39F4-6A2F
else
search --no-floppy --fs-uuid --set=root 39F4-6A2F
fi
echo 'Loading Linux 5.4.38-gentoo-x86_64 ...'
linux /vmlinuz-5.4.38-gentoo-x86_64 root=UUID=c9c13832-38d1-4b41-96f2-383cf748e1be ro
echo 'Loading initial ramdisk ...'
initrd /initramfs-5.4.38-gentoo-x86_64.img
}
|
_________________ DELL Latitude 5550 intel Core i5-5300 CPU @ 2.30GHz
gentoo genkernel-5.4.38 gcc 9.3.0 portage 2.3.89-r3 |
|
Back to top |
|
 |
Goverp Advocate


Joined: 07 Mar 2007 Posts: 2217
|
Posted: Fri May 08, 2020 9:24 am Post subject: |
|
|
One option (which I use) is to write a grub.cfg by hand; it's very similar to grub legacy (a.k.a. Grub 1)'s grub.conf - you just need to find the documentation. Doing that, I've set my box up to boot kernels selected by the symbolic links "vmlinuz", "vmlinux.old" and "vmlinuz.new".
OK, my menu's is missing the gee-whiz graphics and prettiness, and darn it I can still see the boot messages. (Why are so many people keen to hide the messages? They're really quite useful when things break...) _________________ Greybeard |
|
Back to top |
|
 |
|