config: Search for tomatboot.cfg config files as well

This commit is contained in:
mintsuki 2020-12-28 23:46:00 +01:00
parent ed0212bd0d
commit 3f3971415d
5 changed files with 9 additions and 6 deletions

View File

@ -4,7 +4,8 @@
Limine scans for a config file on *the boot drive*. Every partition on the boot drive
is scanned sequentially (first partition first, last partition last) for the presence
of either a `/limine.cfg` or a `/boot/limine.cfg` file, in that order.
of either a `/limine.cfg`, `/boot/limine.cfg`, `/tomatboot.cfg`, or a
`/boot/tomatboot.cfg` file, 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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -19,10 +19,11 @@ static char *config_addr;
int init_config_disk(struct part *part) {
struct file_handle f;
if (fopen(&f, part, "/limine.cfg")) {
if (fopen(&f, part, "/boot/limine.cfg")) {
return -1;
}
if (fopen(&f, part, "/limine.cfg")
&& fopen(&f, part, "/boot/limine.cfg")
&& fopen(&f, part, "/tomatboot.cfg")
&& fopen(&f, part, "/boot/tomatboot.cfg")) {
return -1;
}
size_t config_size = f.size + 1;
@ -35,7 +36,8 @@ int init_config_disk(struct part *part) {
int init_config_pxe(void) {
struct tftp_file_handle cfg;
if (tftp_open(&cfg, 0, 69, "limine.cfg")) {
if (tftp_open(&cfg, 0, 69, "limine.cfg")
&& tftp_open(&cfg, 0, 69, "tomatboot.cfg")) {
return -1;
}
config_addr = conv_mem_alloc(cfg.file_size);