stivale2: Support TERM_CONFIG_OVERRIDE and readd stivale2 config docs accidentally removed in dbfd18aa
diff --git a/CONFIG.md b/CONFIG.md
index 220b4776..3b671e11 100644
--- a/CONFIG.md
+++ b/CONFIG.md
@@ -119,6 +119,23 @@ Editor control options.
* `KASLR` - For relocatable kernels, if set to `no`, disable kernel address space layout randomisation. KASLR is enabled by default.
* `TERM_CONFIG_OVERRIDE` - If set to `yes`, override the terminal configuration for this entry. Resets all the `TERM_*` assignments to default and allows setting them anew inside the entry. Note that without this, Limine will never look for terminal configuration settings inside entries.
+* stivale and stivale2 protocols:
+ * `KERNEL_PATH` - The URI path of the kernel.
+ * `MODULE_PATH` - The URI path to a module.
+ * `MODULE_STRING` - A string to be passed to a module.
+
+ **Note:** One can define these 2 last variable multiple times to specify multiple
+ modules.
+ The entries will be matched in order. E.g.: The 1st module path entry will be matched
+ to the 1st module string entry that appear, and so on.
+
+ **Note**: If `MODULE_STRING` is not specified for an entry, the `MODULE_STRING` will default to the `MODULE_PATH`.
+
+ * `RESOLUTION` - The resolution to be used should the kernel request a graphical framebuffer. This setting takes the form of `<width>x<height>x<bpp>` and *overrides* any resolution requested by the kernel, or automatic resolution requests. If the resolution is not available, Limine will pick another one automatically. Omitting `<bpp>` will default to 32.
+ * `KASLR` - For relocatable kernels, if set to `no`, disable kernel address space layout randomisation. KASLR is enabled by default.
+ * `TEXTMODE` - If set to `yes`, prefer text mode if the kernel has no video mode requirements. (Only for stivale2)
+ * `TERM_CONFIG_OVERRIDE` - If set to `yes`, override the terminal configuration for this entry. Resets all the `TERM_*` assignments to default and allows setting them anew inside the entry. Note that without this, Limine will never look for terminal configuration settings inside entries. (Only for stivale2)
+
* Chainload protocol on BIOS:
* `DRIVE` - The 1-based drive to chainload, if omitted, assume boot drive.
* `PARTITION` - The 1-based partition to chainload, if omitted, or set to 0, chainload drive (MBR).
diff --git a/common/protos/stivale2.c b/common/protos/stivale2.c
index 919fcceb..172bb15c 100644
--- a/common/protos/stivale2.c
+++ b/common/protos/stivale2.c
@@ -552,7 +552,12 @@ failed_to_load_header_section:
#if uefi == 1
gop_force_16 = true;
#endif
- term_vbe(req_width, req_height);
+ char *term_conf_override_s = config_get_value(config, 0, "TERM_CONFIG_OVERRIDE");
+ if (term_conf_override_s != NULL && strcmp(term_conf_override_s, "yes") == 0) {
+ term_vbe(config, req_width, req_height);
+ } else {
+ term_vbe(NULL, req_width, req_height);
+ }
if (current_video_mode < 0) {
panic(true, "stivale2: Failed to initialise terminal");
