config: Slight change to the config file search semantics for EFI
diff --git a/CONFIG.md b/CONFIG.md
index 2151b08b..fb411646 100644
--- a/CONFIG.md
+++ b/CONFIG.md
@@ -13,8 +13,11 @@ Next, Limine scans for a config file on *the boot drive*. Every partition on
the boot drive is scanned sequentially - first partition first (or, on UEFI,
the partition containing the EFI executable of the booted Limine is scanned
first), last partition last - for the presence of either a `/limine.conf`,
-`/limine/limine.conf`, `/boot/limine.conf`, `/boot/limine/limine.conf`, or
-a `/EFI/BOOT/limine.conf` file, in that order.
+`/limine/limine.conf`, `/boot/limine.conf`, or a `/boot/limine/limine.conf`
+file, in that order.
+
+For EFI-booted Limine, `/EFI/BOOT/limine.conf` and `/EFI/limine/limine.conf`
+are also scanned, after the aforementioned paths, in that order.
Once the file is located, Limine will use it as its config file. Other possible
candidates in subsequent partitions or directories are ignored.
diff --git a/common/entry.s3.c b/common/entry.s3.c
index 2b873446..14bde164 100644
--- a/common/entry.s3.c
+++ b/common/entry.s3.c
@@ -105,7 +105,11 @@ could_not_match:
|| (f = fopen(volume_index[i], "/limine/limine.conf")) != NULL
|| (f = fopen(volume_index[i], "/boot/limine.conf")) != NULL
|| (f = fopen(volume_index[i], "/boot/limine/limine.conf")) != NULL
- || (f = fopen(volume_index[i], "/EFI/BOOT/limine.conf")) != NULL) {
+#if defined (UEFI)
+ || (f = fopen(volume_index[i], "/EFI/BOOT/limine.conf")) != NULL
+ || (f = fopen(volume_index[i], "/EFI/limine/limine.conf")) != NULL
+#endif
+ ) {
goto opened;
}
diff --git a/common/lib/config.c b/common/lib/config.c
index 4aa6d461..a82aa08f 100644
--- a/common/lib/config.c
+++ b/common/lib/config.c
@@ -36,7 +36,11 @@ int init_config_disk(struct volume *part) {
|| (f = fopen(part, "/limine/limine.conf")) != NULL
|| (f = fopen(part, "/boot/limine.conf")) != NULL
|| (f = fopen(part, "/boot/limine/limine.conf")) != NULL
- || (f = fopen(part, "/EFI/BOOT/limine.conf")) != NULL) {
+#if defined (UEFI)
+ || (f = fopen(part, "/EFI/BOOT/limine.conf")) != NULL
+ || (f = fopen(part, "/EFI/limine/limine.conf")) != NULL
+#endif
+ ) {
goto opened;
}
