Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
.config overwritten?
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
k0OA1
n00b
n00b


Joined: 15 Jul 2014
Posts: 13

PostPosted: Thu Nov 14, 2019 9:01 pm    Post subject: .config overwritten? Reply with quote

Hi :D

I am experiencing an issue where the .config file I'm using is overwritten just before compilation.

I used eselect kernel to specify the latest gentoo-sources (linux-5.3.11-gentoo)

Next, I copied my old config to /usr/src/linux/

Ran
Code:
sudo genkernel --menuconfig all --makeopts=-j6



Loaded the previous config and saved it to .config

And compiled..


The result is:


Code:
* Gentoo Linux Genkernel; Version 4.0.0_beta20
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: --menuconfig all --makeopts=-j6

* Working with Linux kernel 5.3.11-gentoo-x86_64 for x86_64
* Using kernel config file '/usr/share/genkernel/arch/x86_64/generated-config' ...
*
* Note: The version above is subject to change (depends on config and status of kernel sources).

* kernel: >> Initializing ...
*         >> Previous config backed up to .config--2019-11-14--20-45-06.bak
*         >> Running 'make mrproper' ...
*         >> Running 'make oldconfig' ...
*         >> Invoking menuconfig ...
*         >> Re-running 'make oldconfig' due to changed kernel options ...
*         >> Compiling 5.3.11-gentoo-x86_64 bzImage ...
^Z



Where "Compiling 5.3.11-gentoo-x86_64 bzImage" should have the appended version string I set in menuconfig. But it doesn't.


When I check .config in /usr/src/linux/ , it has reverted to a default configuration.


I have tried recompiling the current kernel with a previously working config, but the same error occurs.

I have also tried changing various genkernel options with no joy.


Thank you for reading, I hope you can offer me some guidance.


Kind Regards,

Al
Back to top
View user's profile Send private message
OldTango
l33t
l33t


Joined: 21 Feb 2004
Posts: 628

PostPosted: Fri Nov 15, 2019 2:11 am    Post subject: Re: .config overwritten? Reply with quote

k0OA1 wrote:
Hi :D

I am experiencing an issue where the .config file I'm using is overwritten just before compilation.

The result is:
Code:
* Gentoo Linux Genkernel; Version 4.0.0_beta20
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: --menuconfig all --makeopts=-j6

* Working with Linux kernel 5.3.11-gentoo-x86_64 for x86_64
* Using kernel config file '/usr/share/genkernel/arch/x86_64/generated-config' ...
*
* Note: The version above is subject to change (depends on config and status of kernel sources).

* kernel: >> Initializing ...
*         >> Previous config backed up to .config--2019-11-14--20-45-06.bak
*         >> Running 'make mrproper' ...
*         >> Running 'make oldconfig' ...
*         >> Invoking menuconfig ...
*         >> Re-running 'make oldconfig' due to changed kernel options ...
*         >> Compiling 5.3.11-gentoo-x86_64 bzImage ...
^Z
I manually build all my own kernels and have never used genkernel so I am not sure how it works. Based on your output, your setting "make mrproper" which should clean all objects and .configs from your kernel sources. Are you sure this is what you want?

From the Gentoo Genkernel Wiki:
Quote:
--[no-]mrproper
Activates (or deactivates) the make mrproper command before kernel compilation. Like the make clean command listed above, make mrproper removes all object files and dependencies from the kernel's source tree. However, any previous configuration files (in /path/to/sources/.config or /path/to/sources/.config.old) will also be purged from the kernel's source tree. If it is undesirable that the kernel's .config file keeps disappearing, be sure to disable this option!


Best Tango..... :wink:
Back to top
View user's profile Send private message
jburns
Veteran
Veteran


Joined: 18 Jan 2007
Posts: 1076
Location: Massachusetts USA

PostPosted: Fri Nov 15, 2019 6:23 am    Post subject: Reply with quote

Use the --kernel-config=<your .config file> option with the genkernel command, where <your .config file> is the path and file name for the file.
Back to top
View user's profile Send private message
k0OA1
n00b
n00b


Joined: 15 Jul 2014
Posts: 13

PostPosted: Fri Nov 15, 2019 2:28 pm    Post subject: Re: .config overwritten? Reply with quote

OldTango wrote:
I manually build all my own kernels and have never used genkernel so I am not sure how it works. Based on your output, your setting "make mrproper" which should clean all objects and .configs from your kernel sources. Are you sure this is what you want?

From the Gentoo Genkernel Wiki:
Quote:
--[no-]mrproper
Activates (or deactivates) the make mrproper command before kernel compilation. Like the make clean command listed above, make mrproper removes all object files and dependencies from the kernel's source tree. However, any previous configuration files (in /path/to/sources/.config or /path/to/sources/.config.old) will also be purged from the kernel's source tree. If it is undesirable that the kernel's .config file keeps disappearing, be sure to disable this option!


Best Tango..... :wink:


It looks like the same error occurs with these options disabled:

Code:

$ sudo genkernel all  --no-mrproper --no-oldconfig --kernel-config=/usr/src/linux/.superkoala-31.6

* Gentoo Linux Genkernel; Version 4.0.0_beta20
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: all --no-mrproper --no-oldconfig --kernel-config=/usr/src/linux/.superkoala-31.6

* Working with Linux kernel 5.3.11-gentoo-x86_64 for x86_64
* Using kernel config file '/usr/src/linux-5.3.11-gentoo/.superkoala-31.6' ...
*
* Note: The version above is subject to change (depends on config and status of kernel sources).

* kernel: >> Initializing ...
*         >> Running 'make clean' ...
*         >> --no-mrproper is set; Skipping 'make mrproper' ...
*         >> --no-oldconfig is set; Skipping 'make oldconfig' ...
*         >> Running 'make olddefconfig' due to changed kernel options ...
*         >> Compiling 5.3.11-gentoo-x86_64 bzImage ...
^Z


Would you please share your method for manual building of the kernel? Thank you.


jburns wrote:
Use the --kernel-config=<your .config file> option with the genkernel command, where <your .config file> is the path and file name for the file.


Thanks, tried it but doesn't seem to make any difference.
Back to top
View user's profile Send private message
Whissi
Developer
Developer


Joined: 12 Jan 2011
Posts: 78

PostPosted: Sun Nov 24, 2019 10:38 pm    Post subject: Re: .config overwritten? Reply with quote

k0OA1 wrote:
I am experiencing an issue where the .config file I'm using is overwritten just before compilation.

I used eselect kernel to specify the latest gentoo-sources (linux-5.3.11-gentoo)

Next, I copied my old config to /usr/src/linux/

Ran
Code:
sudo genkernel --menuconfig all --makeopts=-j6



Loaded the previous config and saved it to .config

And compiled..


The result is:


Code:
* Gentoo Linux Genkernel; Version 4.0.0_beta20
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: --menuconfig all --makeopts=-j6

* Working with Linux kernel 5.3.11-gentoo-x86_64 for x86_64
* Using kernel config file '/usr/share/genkernel/arch/x86_64/generated-config' ...
*
* Note: The version above is subject to change (depends on config and status of kernel sources).

* kernel: >> Initializing ...
*         >> Previous config backed up to .config--2019-11-14--20-45-06.bak
*         >> Running 'make mrproper' ...
*         >> Running 'make oldconfig' ...
*         >> Invoking menuconfig ...
*         >> Re-running 'make oldconfig' due to changed kernel options ...
*         >> Compiling 5.3.11-gentoo-x86_64 bzImage ...
^Z



Where "Compiling 5.3.11-gentoo-x86_64 bzImage" should have the appended version string I set in menuconfig. But it doesn't.


When I check .config in /usr/src/linux/ , it has reverted to a default configuration.

Thank you for testing genkernel-4!

No, this is not a bug. Please view genkernel.log: You will see a message like

Code:

* kernel: >> Initializing ...
*         >> --no-clean is set; Skipping 'make clean' ...
*         >> --no-mrproper is set; Skipping 'make mrproper' ...
*         >> Will ignore kernel config from '/proc/config.gz'
*            in favor of already existing but different kernel config
*            found in '/usr/src/linux/.config' ...
*         >> Running 'make oldconfig' ...
COMMAND: nice -n10 make -j 31 -l 31.8  ARCH="x86" oldconfig
scripts/kconfig/conf  --oldconfig Kconfig
#
# No change to .config
#
*         >> Invoking menuconfig ...
COMMAND: nice -n10 make -j 31 -l 31.8 -j1  ARCH="x86" menuconfig
*         >> Ensure that CONFIG_LOCALVERSION is set ...
*                  - Setting option 'CONFIG_LOCALVERSION' to '"-x86_64-test1"' in '/usr/src/linux/.config'...

Do you already spot what's going on? We are using your changed .config but because we added --kernel-localversion and --kernel-append-localversion options in genkernel we must apply these settings after the user has made all changes so we can be sure that values set via genkernel will be last set value.

So you are changing values in menuconfig which will get overwritten later by set KERNEL_LOCALVERSION/KERNEL_APPEND_LOCALVERSION from genkernel. Your .config isn't ignored!
_________________
Regards,
Whissi
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