Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved) CONFIG_EXPERT is a booby trap
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
shrike
Apprentice
Apprentice


Joined: 20 Feb 2004
Posts: 187
Location: Closer to home

PostPosted: Tue May 02, 2017 1:59 pm    Post subject: [Solved) CONFIG_EXPERT is a booby trap Reply with quote

While diagnosing a black screen login issue I noticed a parameter enabled by EXPERT. I did enable EXPERT some time ago, ignoring the warning (enable only if you really know what you are doing) but I did not know that this would affect other kernel settings outside of the EXPERT menu. Anyway, I found this thread on LKML which alleviates my ignorance a bit:

https://lkml.org/lkml/2012/9/30/159

Regards,

shrike


Last edited by shrike on Thu May 04, 2017 3:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
NTU
Apprentice
Apprentice


Joined: 17 Jul 2015
Posts: 187

PostPosted: Wed May 03, 2017 8:56 pm    Post subject: Reply with quote

I use CONFIG_EXPERT personally to disable things such as PC speaker and 16-bit UIDs. CONFIG_EXPERT forces all of the debugging and expert options to be visible in the kernel hacking section as well, makes it convenient for me to further tune things. I also have CONFIG_EMBEDDED set to have the potential to trim additional space and adjust further configs for things I don't need / use.

As for the email you linked, I just ran a git grep for CONFIG_EXPERT and the only thing I could find that isn't directly related to the options in the EXPERT menu is this:
drivers/gpu/drm/drm_fb_helper.c:#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)

That section of the file is referring to this part in the code, and it is properly commented as to why, and this part may be related to your issue:

Code:
/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
 * but the module doesn't depend on any fb console symbols.  At least
 * attempt to load fbcon to avoid leaving the system without a usable console.
 */
#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
static int __init drm_fb_helper_modinit(void)
{
   const char *name = "fbcon";
   struct module *fbcon;

   mutex_lock(&module_mutex);
   fbcon = find_module(name);
   mutex_unlock(&module_mutex);

   if (!fbcon)
      request_module_nowait(name);
   return 0;
}

module_init(drm_fb_helper_modinit);
#endif


As I use KMS (Radeon R9 290X user here) I need to have the following enabled, not set as modules, but rather built-in, to avoid the black screen, as I don't use an initrd (initial ramdisk) let alone with framebuffer modules built into it:

Code:
CONFIG_FB=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_FRAMEBUFFER_CONSOLE=y


Your black screen is not caused by the CONFIG_EXPERT menu being enabled, but rather a configuration problem with your graphics/DRM/KMS/FB settings.

As for the CONFIG_HID_APPLE problem he was referring to, when CONFIG_EXPERT is selected, yes it disables certain configs, but that doesn't mean you can't turn them back on again.

If you look here starting at line 115: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/drivers/hid/Kconfig?h=linux-4.10.y&id=96e132ebc0a162c643e0e6e6f1f85c3be3355715

Line 118 is default !EXPERT which means it is default y unless EXPERT is set. I agree that people shouldn't mess with kernel configuration when they don't know what they're doing and don't have the skill to toggle through the menus again to re-enable whatever they need. That's also the wrong way to do it in the first place, EXPERT and the major general options go on first and you tweak from there. I always start off with make tinyconfig (if supported by the kernel version, otherwise I use the defconfigs for older releases) and configure the kernel to my system after fully understanding what all the options do, how my distribution is configured, and what hardware I'm using/plan on using. I then go back and double check through the menus and ensure no options have either been flipped on or back off. After verifying the entire kernel configuration which I have memorized like the back of my hand, I compile and reboot to a heavily optimized and tuned kernel specifically for my machine. If you know what you're doing, it's perfectly safe to toggle EXPERT and it's suboptions.
Back to top
View user's profile Send private message
shrike
Apprentice
Apprentice


Joined: 20 Feb 2004
Posts: 187
Location: Closer to home

PostPosted: Thu May 04, 2017 3:05 pm    Post subject: [Solved] CONFIG_EXPERT is a booby trap Reply with quote

@NTU,

I did indeed have CONFIG_FB=m, thinking it would auto-udev-magically work. Built-in works.

Well 'oley $hit'. I've been screwing around with FB settings for months. Do you have a tip jar? Do you take requests? :)

----------------------------

WRT EXPERT setting my motivation is to alert others to this 'silent' behavior.

Your thoughts on kernel configuration are appreciated, logical. Thank you for taking the time and sharing.

Regards,

shrike
Back to top
View user's profile Send private message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 264

PostPosted: Thu May 04, 2017 3:57 pm    Post subject: Reply with quote

NTU wrote:
Line 118 is default !EXPERT which means it is default y unless EXPERT is set. I agree that people shouldn't mess with kernel configuration when they don't know what they're doing and don't have the skill to toggle through the menus again to re-enable whatever they need. That's also the wrong way to do it in the first place, EXPERT and the major general options go on first and you tweak from there. I always start off with make tinyconfig (if supported by the kernel version, otherwise I use the defconfigs for older releases) and configure the kernel to my system after fully understanding what all the options do, how my distribution is configured, and what hardware I'm using/plan on using. I then go back and double check through the menus and ensure no options have either been flipped on or back off. After verifying the entire kernel configuration which I have memorized like the back of my hand, I compile and reboot to a heavily optimized and tuned kernel specifically for my machine. If you know what you're doing, it's perfectly safe to toggle EXPERT and it's suboptions.


Are you sure you understand every option? I took the better part of a week to read through it all in an attempt to do exactly what you described but was still left with a mountain of options to sort through. Most of them irrelevant, but this incident has shown me that there are "gotchas" out there. How CONFIG_EXPERT behaves on toggle is nonsensical.
Back to top
View user's profile Send private message
energyman76b
Advocate
Advocate


Joined: 26 Mar 2003
Posts: 2048
Location: Germany

PostPosted: Sun Jun 18, 2017 3:15 am    Post subject: Reply with quote

R0b0t1 wrote:
NTU wrote:
Line 118 is default !EXPERT which means it is default y unless EXPERT is set. I agree that people shouldn't mess with kernel configuration when they don't know what they're doing and don't have the skill to toggle through the menus again to re-enable whatever they need. That's also the wrong way to do it in the first place, EXPERT and the major general options go on first and you tweak from there. I always start off with make tinyconfig (if supported by the kernel version, otherwise I use the defconfigs for older releases) and configure the kernel to my system after fully understanding what all the options do, how my distribution is configured, and what hardware I'm using/plan on using. I then go back and double check through the menus and ensure no options have either been flipped on or back off. After verifying the entire kernel configuration which I have memorized like the back of my hand, I compile and reboot to a heavily optimized and tuned kernel specifically for my machine. If you know what you're doing, it's perfectly safe to toggle EXPERT and it's suboptions.


Are you sure you understand every option? I took the better part of a week to read through it all in an attempt to do exactly what you described but was still left with a mountain of options to sort through. Most of them irrelevant, but this incident has shown me that there are "gotchas" out there. How CONFIG_EXPERT behaves on toggle is nonsensical.


why? because it expects you to think about shit? Because it makes options available that most people should not mess with?

But seriously, to see something in framebuffer, you can't have it loaded by udev - because than you are through kernel boot anyway and way into userland init. So setting fb=m and then being surprised that there are not shiny things on the screen smells of 'should not touch expert at all' .
_________________
Study finds stunning lack of racial, gender, and economic diversity among middle-class white males

I identify as a dirty penismensch.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sun Jun 18, 2017 5:49 am    Post subject: Reply with quote

If you want to know what you're getting into with CONFIG_EXPERT, change it from N to Y by editing .config by hand and then run make oldconfig. It'll take a while. Same goes for some of the options in the kernel debugging section: they can expose other options all over the place with sub-optimal defaults and menuconfig/nconfig won't warn you of spooky action at a distance.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22723

PostPosted: Sun Jun 18, 2017 4:11 pm    Post subject: Reply with quote

energyman76b wrote:
why? because it expects you to think about shit? Because it makes options available that most people should not mess with?
The complaint here is that the user expected that changing CONFIG_EXPERT should have exactly one effect: offer choices on entries that were previously locked to a value chosen by the experts in that subsystem. The reality reported is that changing CONFIG_EXPERT also changes the value of some of those newly enabled choices, so switching on CONFIG_EXPERT, then saving and exiting with no other changes produces notable differences relative to CONFIG_EXPERT=n. If not documented, this is a surprising result.
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