Do not force default values into the environment If the user does not specify teken.fg_color or teken.bg_color, allowing the kernel defaults to take effect.
PR: 261311
Differential D34509
loader: do not force default color environment settings emaste on Mar 9 2022, 4:48 PM. Authored by Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions This seems like the correct approach to me: if the user does not set teken.fg_color/teken.bg_color then the loader and kernel each use their compiled defaults. If the user sets the environment variables then the loader and kernel both use the set colors. Comment Actions This has changes for both efi and vidconsole. However, it seems this breaks the loader's own immediate color update. Without this change if you do set teken.fg_color=2 at the loader prompt the loader's fg color immediately changes. With this change it has no effect. Comment Actions Setting teken.fg_color has no effect in the loader that is - it does have the expected effect once the kernel starts. Comment Actions The whole point of color and font (and mode) setup is to provide consistent console from loader to kernel to user land. To use kernel color scheme, the loader should start with the values provided for kernel. As simple as that. Comment Actions Right now the documented method to set the kernel console colors just does not work at all, while teken.fg_color and teken.bg_color are completely undocumented. That needs to be fixed at the very minimum. That said, I do not see why it is unreasonable to apply a user-provided setting to the loader and kernel, while leaving each at their own default if not set. If the kernel and loader are built with the same default the net effect is identical to the status quo. Comment Actions Other issues:
Comment Actions I tend to agree here. Absent a mechanism for loader to inherit/infer/read the kernel's defaults, it's both surprising and unreasonable for loader to override those defaults without any other input (especially given that loader can't tell if the kernel's defaults are user-preferred or just the default). Ideally, we should document these things and offer a way to set them both independently or together to guarantee consistency or willful divergence.
|