Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Weird behavior of `make menuconfig` when run w/wo `.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
lucatrv
n00b
n00b


Joined: 10 Mar 2019
Posts: 10

PostPosted: Wed May 08, 2024 9:20 pm    Post subject: Weird behavior of `make menuconfig` when run w/wo `.config` Reply with quote

I'm getting unexpected results when I run `make menuconfig` with or without an existing `.config` file.
I'm manually compiling the kernel for a VMware guest system, and booting to a textual console (no graphical desktop installed yet). I found out that I need to manually activate framebuffer support, however results change whether I activate it at the first run of `make menuconfig` (no `.config` file present), or after a `.config` file already exists. It took some times to find out what it was happening...

Here are some simple steps to reproduce this, considering the latest `gentoo-sources` package v6.6.30:
  • Rename the existing `.config` file if present.
  • Run `make menuconfig`, and enable the "Device Drivers / Graphics support / Frame buffer Devices / Support for frame buffer devices" device option (`CONFIG_FB=y`).
  • Exit `menuconfig`, save the newly created `.config` file, then rename it `config.GOOD` (this configuration contains all required settings).
  • Verify that the previous `.config` file is not present, now run `make menuconfig` and exit it right away, saving the newly created `.config` file. Now run again `make menuconfig`, set the same option as above, then finally exit `menuconfig`, save the newly created `.config` file, and rename it `config.BAD` (this configuration does NOT contains all required settings).

Now you can compare the two created configuration files with `diff config.GOOD config.BAD`. I would expect to get the same configuration (the first time I set the option at the first run, the second time at the second run, but that's the only option that I change so I would expect the end result to be the same), however the `config.BAD` file misses some options which are required to correctly boot the system, in particular (among others):
Code:
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_FB_FRAMEBUFFER_CONSOLE=y
CONFIG_FB_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y

Can anyone explain why this is happening and if it is expected or not? Do I need to remember to set this option only when I first run `make menuconfig`?...
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4291
Location: Bavaria

PostPosted: Wed May 08, 2024 10:02 pm    Post subject: Reply with quote

Do you have enabled CONFIG_EXPERT=y ?
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
lucatrv
n00b
n00b


Joined: 10 Mar 2019
Posts: 10

PostPosted: Wed May 08, 2024 10:22 pm    Post subject: Reply with quote

pietinger wrote:
Do you have enabled CONFIG_EXPERT=y ?

No I did not enable it, I just enabled `CONFIG_FB=y`, all the rest is plain default. Would it make a difference?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4291
Location: Bavaria

PostPosted: Wed May 08, 2024 11:03 pm    Post subject: Reply with quote

lucatrv wrote:
pietinger wrote:
Do you have enabled CONFIG_EXPERT=y ?

Would it make a difference?

No .... sorry this was a problem with a previous kernel (before 6.6) ...

Okay ... the dependencies of FB (FB_CORE) and CONSOLE are weird .. you have to look into the Kconfig files (*) to see that some of them have a default ... you can have a simple default (like Y or N) or a default to another option ... In this case: As soon as another option is enabled then this option will be enabled also ... but these defaults work only the first time

*)
/usr/src/linux-6.6.30-gentoo/drivers/gpu/drm/Kconfig
/usr/src/linux-6.6.30-gentoo/drivers/video/fbdev/Kconfig
/usr/src/linux-6.6.30-gentoo/drivers/video/console/Kconfig

Now look to the different Kconfigs (see above):

Code:
config DRM_FBDEV_EMULATION
        bool "Enable legacy fbdev support for your modesetting driver"
        depends on DRM
        select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
        default FB

menuconfig FB
        tristate "Support for frame buffer device drivers"
        select FB_CORE
        select FB_NOTIFY

config FRAMEBUFFER_CONSOLE
        bool "Framebuffer Console support"
        depends on FB_CORE && !UML
        default DRM_FBDEV_EMULATION
        select VT_HW_CONSOLE_BINDING
        select CRC32
        select FONT_SUPPORT
        help
          Low-level framebuffer-based console driver.

DRM_FBDEV_EMULATION has a default on FB and FRAMEBUFFER_CONSOLE has a default on DRM_FBDEV_EMULATION

If you enable FB (immediately) then these defaults will be true ... but if you do a "make menuconfig" on a fresh installed gentoo-sources (==no .config file) (this is the same as you would do a "make defconfig") without enabling FB then you save an "empty" (=disabled) FB ... AND now the defaults are set/saved also to "disabled".

If you enable FB now (in a 2nd make menuconfig) these defaults will never work ... and you have to enable FRAMEBUFFER_CONSOLE and DRM_FBDEV_EMULATION by yourself. :lol:
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
lucatrv
n00b
n00b


Joined: 10 Mar 2019
Posts: 10

PostPosted: Thu May 09, 2024 8:43 pm    Post subject: Reply with quote

pietinger wrote:
Okay ... the dependencies of FB (FB_CORE) and CONSOLE are weird .. you have to look into the Kconfig files (*) to see that some of them have a default ... you can have a simple default (like Y or N) or a default to another option ... In this case: As soon as another option is enabled then this option will be enabled also ... but these defaults work only the first time

Wow... I'm surprised. Believe me the reason why I was ending up with black screen was very difficult to troubleshoot, because every time I was trying to modify the previous `.config` file, and due to this behavior I struggled to identify which options I actually needed to enable to get it right.

Now I have two questions:
  • You mentioned that "the dependencies of FB (FB_CORE) and CONSOLE are weird", so in your experience does this weird behavior of `make menuconfig` affect only frambuffer support configuration, or also other sections? In this case I think it should be mentioned in the handbook or kernel configuration guide.
  • I thought that framebuffer support was needed for most/all systems, otherwise how can people switch to a textual console if they have issues with their graphical environment? Not to mention the installation process. So don't you think that framebuffer support should be enabled by default in the `gentoo-sources` package?
Thanks
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4291
Location: Bavaria

PostPosted: Thu May 09, 2024 8:57 pm    Post subject: Reply with quote

lucatrv wrote:
[...] I struggled to identify which options I actually needed to enable to get it right.

Therefore I wrote this: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_Configuring_Kernel_Version_6.6#Part_3_-_Must_Haves

lucatrv wrote:
[...] does this weird behavior of `make menuconfig` affect only frambuffer support configuration, or also other sections? [...]

I dont know every option (and which of them have a default), but for (usual) AMD64 systems I know only this trio... maybe "weird" was the wrong word ... because, yes, it has its sense (you must be able to configure every possible combination of these options).

lucatrv wrote:
[...] In this case I think it should be mentioned in the handbook or kernel configuration guide.
[...]
I thought that framebuffer support was needed for most/all systems, otherwise how can people switch to a textual console if they have issues with their graphical environment? Not to mention the installation process. So don't you think that framebuffer support should be enabled by default in the `gentoo-sources` package?

May I quote myself from the beginning of: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_Configuring_Kernel_Version_6.6 ->
Quote:
I am not happy with the default configuration we have, after we have just emerged gentoo-sources [...]

_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
lucatrv
n00b
n00b


Joined: 10 Mar 2019
Posts: 10

PostPosted: Thu May 09, 2024 10:00 pm    Post subject: Reply with quote

pietinger wrote:
Therefore I wrote this: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_Configuring_Kernel_Version_6.6#Part_3_-_Must_Haves

Thanks for your references! The links to your tutorials "Manual kernel configuration" and "Manual Configuring Kernel Version 6.6" should be reported either in the handbook's kernel section or in the kernel configuration guide. Without those information how is a new user supposed to understand how to manually compile the kernel?...
Back to top
View user's profile Send private message
Jimmy Jazz
Guru
Guru


Joined: 04 Oct 2004
Posts: 331
Location: Strasbourg

PostPosted: Thu May 09, 2024 10:54 pm    Post subject: Reply with quote

Try
Code:

make mrproper
copy your old obsolete but still helpful .config in the kernel tree (KBUILD_OUTPUT or KERNEL_DIR)
make oldconfig
make menuconfig

in that order.
_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
lucatrv
n00b
n00b


Joined: 10 Mar 2019
Posts: 10

PostPosted: Sat May 11, 2024 10:41 pm    Post subject: Reply with quote

Jimmy Jazz wrote:
Try
Code:

make mrproper
copy your old obsolete but still helpful .config in the kernel tree (KBUILD_OUTPUT or KERNEL_DIR)
make oldconfig
make menuconfig

in that order.

Yes but... one first needs to have a working `.config` file, which is not the case if he follows the instructions of the handbook and kernel configuration guide. Moreover I was referring to new users, people who have never installed Gentoo before, how are they supposed to figure out how to manually compile the kernel if those information are not reported in the handbook?
Back to top
View user's profile Send private message
Jimmy Jazz
Guru
Guru


Joined: 04 Oct 2004
Posts: 331
Location: Strasbourg

PostPosted: Mon May 13, 2024 6:23 pm    Post subject: Reply with quote

lucatrv wrote:
Jimmy Jazz wrote:
Try
Code:

make mrproper
copy your old obsolete but still helpful .config in the kernel tree (KBUILD_OUTPUT or KERNEL_DIR)
make oldconfig
make menuconfig

in that order.

Yes but... one first needs to have a working `.config` file, which is not the case if he follows the instructions of the handbook and kernel configuration guide. Moreover I was referring to new users, people who have never installed Gentoo before, how are they supposed to figure out how to manually compile the kernel if those information are not reported in the handbook?


They suggest to run one of the 'installation CD'. I never used them. If it contains a default .config just use it ... As you were able to boot from the CD/USBstick, its .config for sure will be useful for your own new kernel. Peraphs it is in the kernel itself. Sad the handbook doesn't mention it :)
Code:

modprobe -v configs (or configfs I don't remember)
zcat /proc/config.gz


You still could try with a generic generated .config file:

make defconfig
or
make savedefconfig and copy defconfig to .config if it is missing.

Run 'make help' (in the kernel src dir) if you didn't already read it and choose a configuration related to a new config.
_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
lucatrv
n00b
n00b


Joined: 10 Mar 2019
Posts: 10

PostPosted: Mon May 13, 2024 8:57 pm    Post subject: Reply with quote

I suggested to reference to Pietinger's Manual kernel configuration tutorial here:
https://wiki.gentoo.org/wiki/Talk:Kernel/Gentoo_Kernel_Configuration_Guide#Please_add_reference_to_Pietinger.27s_Manual_kernel_configuration_tutorial
Hopefully it gets accepted.
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