Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
genkernel keeps overwriting .config
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
librin.so.1
n00b
n00b


Joined: 16 Sep 2014
Posts: 4
Location: Kaunas, Lithuania

PostPosted: Thu Nov 21, 2024 2:06 pm    Post subject: genkernel keeps overwriting .config Reply with quote

How do I stop genkernel from trying to overwrite my .config?
All I want genkernel to do here is build the kernel with the .config file provided, exactly as-is, yet it keeps trying to change it as if it knows better (it doesn't).
I read through the man page, yet I cannot find an option to not do this.
I tried to chattr +i .config, but that only makes genkernel barf and quit as it tries to change it. :(
_________________
"why do you wear glasses if you're deaf?" –Kenji
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1926

PostPosted: Thu Nov 21, 2024 2:42 pm    Post subject: Reply with quote

--no-clean option, or, better, copy the config to /etc/kernels/ with a name like kernel-config-x86_64-6.6.52-gentoo which varies by kernel build arch and version
genkernel always prefers the config in /etc/kernels/ if it exists
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2447

PostPosted: Thu Nov 21, 2024 3:09 pm    Post subject: Reply with quote

I stopped using genkernel a long time ago exactly because of its strange behavior. It also was unable to produce initramf which would enable my touchpad, no matter what. I moved to dracut because it was used in gentoo-kernel who's pre-built counterpart did enable my touchpad. Later I abandoned those tools altogether and stopped using intramfs. If you don't need initramfs, that's a viable option. You just need a few things built into the kernel, including some firmware and microcode if your hardware needs any.

Best Regards,
Georgi
Back to top
View user's profile Send private message
librin.so.1
n00b
n00b


Joined: 16 Sep 2014
Posts: 4
Location: Kaunas, Lithuania

PostPosted: Thu Nov 21, 2024 5:08 pm    Post subject: Reply with quote

A big thank you for all the replies!

grknight wrote:
--no-clean option, or, better, copy the config to /etc/kernels/ with a name like kernel-config-x86_64-6.6.52-gentoo which varies by kernel build arch and version
genkernel always prefers the config in /etc/kernels/ if it exists


I already run it with both --no-clean and --no-mrproper options.
To clarify, it doesn't clean away the .config file, it modifies it. It also modifies the config file if I put it under /etc/kernels/

to give a few examples of what it does (but this is not an exhaustive list, if I would list everything, the post would be uncomfortably long)

  • it changes CONFIG_LOCALVERSION and there seems to be no option to avoid that. At the time of writing, the only options I managed to find are: either default behavior (overwrite it with dash-µarch e.g. -x86_64, set it with --kernel-localversion or append something to the default one with --kernel-append-localversion. But an option to simply not touch it and use CONFIG_LOCALVERSION as already set in the .config file? Nope.
  • it sets options such as CONFIG_MD_RAID{0,1,10,456} and some other options, too, if --mdadm option is given. I need mdadm support, but I don't want it to change the kernel config.

again, the list is non-exhaustive; I don't want to barf a wall of text here listing every single such case.

some background: I used to run Gentoo some years ago, until I moved to Funtoo for reasons I don't remember.
When I used Gentoo back in the day, genkernel wouldn't attempt to modify the kernel config like this, neither would the Funtoo fork of genkernel would do it. Several months ago, as Funtoo has been EOL'd I moved back to Gentoo and now genkernel is doing very unexpected things – namely changing my kernel config no matter what and with no clear way to make it stop. Assuming it can stop. I fear it has been changed far too much and always tries to be """smart""" where, in my case, it ought not do so.
So far I have kept around a partition containing a Funtoo installation on one of my machines specifically so I could chroot into it and build me a kernel+initramfs, but that's just silly. :?
I need to find a solution from within Gentoo itself. :roll:

logrusx wrote:
I stopped using genkernel a long time ago exactly because of its strange behavior. It also was unable to produce initramf which would enable my touchpad, no matter what. I moved to dracut because it was used in gentoo-kernel who's pre-built counterpart did enable my touchpad. Later I abandoned those tools altogether and stopped using intramfs. If you don't need initramfs, that's a viable option. You just need a few things built into the kernel, including some firmware and microcode if your hardware needs any.


in my case, I absolutely need an initramfs due to reasons including, but not limited to:
  • the root partition on all my machines is encrypted
  • /boot and / are not even on the same device

_________________
"why do you wear glasses if you're deaf?" –Kenji
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3443

PostPosted: Thu Nov 21, 2024 5:15 pm    Post subject: Reply with quote

--oldconfig

Other than that, genkernel always updates stuff like local build version, and AFAIR there were some things it used to pull from genkernel's config and force onto linux/.config, though looking at my genkernel.conf I can't remember what it was.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2447

PostPosted: Thu Nov 21, 2024 5:17 pm    Post subject: Reply with quote

librin.so.1 wrote:

in my case, I absolutely need an initramfs


You can have it as part of the kernel itself, though I can't give you details on that.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum