Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Weird behavior of `make menuconfig` when run w/wo `.config`

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
lucatrv
n00b
n00b
Posts: 13
Joined: Sun Mar 10, 2019 11:49 pm

Weird behavior of `make menuconfig` when run w/wo `.config`

  • Quote

Post by lucatrv » Wed May 08, 2024 9:20 pm

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: Select all

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`?...
Top
pietinger
Administrator
Administrator
Posts: 6640
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed May 08, 2024 10:02 pm

Do you have enabled CONFIG_EXPERT=y ?
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
lucatrv
n00b
n00b
Posts: 13
Joined: Sun Mar 10, 2019 11:49 pm

  • Quote

Post by lucatrv » Wed May 08, 2024 10:22 pm

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?
Top
pietinger
Administrator
Administrator
Posts: 6640
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed May 08, 2024 11:03 pm

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: Select all

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 --> New at Gentoo
Top
lucatrv
n00b
n00b
Posts: 13
Joined: Sun Mar 10, 2019 11:49 pm

  • Quote

Post by lucatrv » Thu May 09, 2024 8:43 pm

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
Top
pietinger
Administrator
Administrator
Posts: 6640
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Thu May 09, 2024 8:57 pm

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:Pieti ... 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:Pieti ... ersion_6.6 ->
I am not happy with the default configuration we have, after we have just emerged gentoo-sources [...]
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
lucatrv
n00b
n00b
Posts: 13
Joined: Sun Mar 10, 2019 11:49 pm

  • Quote

Post by lucatrv » Thu May 09, 2024 10:00 pm

pietinger wrote:Therefore I wrote this: https://wiki.gentoo.org/wiki/User:Pieti ... 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?...
Top
Jimmy Jazz
Guru
Guru
User avatar
Posts: 335
Joined: Mon Oct 04, 2004 5:29 pm
Location: Strasbourg

  • Quote

Post by Jimmy Jazz » Thu May 09, 2024 10:54 pm

Try

Code: Select all

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: Select all

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+ 
motto: WeLCRO
WritE Less Code, Repeat Often
Top
lucatrv
n00b
n00b
Posts: 13
Joined: Sun Mar 10, 2019 11:49 pm

  • Quote

Post by lucatrv » Sat May 11, 2024 10:41 pm

Jimmy Jazz wrote:Try

Code: Select all

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?
Top
Jimmy Jazz
Guru
Guru
User avatar
Posts: 335
Joined: Mon Oct 04, 2004 5:29 pm
Location: Strasbourg

  • Quote

Post by Jimmy Jazz » Mon May 13, 2024 6:23 pm

lucatrv wrote:
Jimmy Jazz wrote:Try

Code: Select all

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: Select all

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: Select all

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+ 
motto: WeLCRO
WritE Less Code, Repeat Often
Top
lucatrv
n00b
n00b
Posts: 13
Joined: Sun Mar 10, 2019 11:49 pm

  • Quote

Post by lucatrv » Mon May 13, 2024 8:57 pm

I suggested to reference to Pietinger's Manual kernel configuration tutorial here:
https://wiki.gentoo.org/wiki/Talk:Kerne ... n_tutorial
Hopefully it gets accepted.
Top
Post Reply

11 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic