Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/libefi/efi_console.c
Show First 20 Lines • Show All 1,040 Lines • ▼ Show 20 Lines | if (screen_buffer != NULL) { | ||||
*/ | */ | ||||
ptr = getenv("teken.fg_color"); | ptr = getenv("teken.fg_color"); | ||||
if (ptr != NULL) { | if (ptr != NULL) { | ||||
attr.ta_fgcolor = strtol(ptr, NULL, 10); | attr.ta_fgcolor = strtol(ptr, NULL, 10); | ||||
ptr = getenv("teken.bg_color"); | ptr = getenv("teken.bg_color"); | ||||
attr.ta_bgcolor = strtol(ptr, NULL, 10); | attr.ta_bgcolor = strtol(ptr, NULL, 10); | ||||
teken_set_defattr(&gfx_state.tg_teken, &attr); | teken_set_defattr(&gfx_state.tg_teken, &attr); | ||||
} else { | |||||
snprintf(env, sizeof(env), "%d", | |||||
attr.ta_fgcolor); | |||||
env_setenv("teken.fg_color", EV_VOLATILE, env, | |||||
kevans: You should be able to set these to the empty string, TUNABLE_INT_FETCH should fail as there's… | |||||
emasteAuthorUnsubmitted Done Inline ActionsIf there was already a teken.fg_color in loader.conf though we don't want to override it. emaste: If there was already a teken.fg_color in loader.conf though we don't want to override it. | |||||
emasteAuthorUnsubmitted Done Inline ActionsOops, that comment was sitting around unsubmitted until just now. If I understand correctly this would mean that no teken.*_color in loader.conf would translate to being set with an empty string in kenv, and both the loader and kernel would use their compiled-in defaults. Yes, I think this has the right user-facing effect, at the cost of having confusing kenv entries. emaste: Oops, that comment was sitting around unsubmitted until just now.
If I understand correctly… | |||||
efi_set_colors, env_nounset); | |||||
snprintf(env, sizeof(env), "%d", | |||||
attr.ta_bgcolor); | |||||
env_setenv("teken.bg_color", EV_VOLATILE, env, | |||||
efi_set_colors, env_nounset); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
if (screen_buffer == NULL) { | if (screen_buffer == NULL) { | ||||
conout->EnableCursor(conout, TRUE); | conout->EnableCursor(conout, TRUE); | ||||
#ifdef TERM_EMU | #ifdef TERM_EMU | ||||
conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, | conout->SetAttribute(conout, EFI_TEXT_ATTR(DEFAULT_FGCOLOR, | ||||
▲ Show 20 Lines • Show All 349 Lines • Show Last 20 Lines |
You should be able to set these to the empty string, TUNABLE_INT_FETCH should fail as there's nothing for strtoq() to process. The magic for immediate change is in the hook, which you can't set without setting a value (maybe room for future improvement).