Skip to content

Commit

Permalink
protos: Make 'path' option standard to pick executable to boot for al…
Browse files Browse the repository at this point in the history
…l protos
  • Loading branch information
mintsuki committed Jan 10, 2025
1 parent 96a7031 commit c9cc7bb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
6 changes: 4 additions & 2 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ Editor control options:
*Locally assignable (protocol specific) options* are:

* Linux protocol:
* `kernel_path` - The path of the kernel.
* `path` - The path of the kernel.
* `kernel_path` - Alias of `path`.
* `module_path` - The path to a module (such as initramfs). This option can be specified multiple times to specify multiple modules.
* `resolution` - The resolution to be used. This setting takes the form of `<width>x<height>x<bpp>`. If the resolution is not available, Limine will pick another one automatically. Omitting `<bpp>` will default to 32.
* `textmode` - If set to `yes`, prefer text mode. (BIOS only)
Expand Down Expand Up @@ -151,7 +152,8 @@ Editor control options:
* `textmode` - If set to `yes`, prefer text mode. (BIOS only)

* EFI Chainload protocol:
* `image_path` - Path of the EFI application to chainload.
* `path` - Path of the EFI application to chainload.
* `image_path` - Alias of `path`.
* `resolution` - The resolution to be used. This setting takes the form of `<width>x<height>x<bpp>`. If the resolution is not available, Limine will pick another one automatically. Omitting `<bpp>` will default to 32.

* BIOS Chainload protocol:
Expand Down
9 changes: 6 additions & 3 deletions common/protos/chainload.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,12 @@ void bios_chainload_volume(struct volume *p) {
#elif defined (UEFI)

noreturn void chainload(char *config, char *cmdline) {
char *image_path = config_get_value(config, 0, "IMAGE_PATH");
if (image_path == NULL)
panic(true, "chainload: IMAGE_PATH not specified");
char *image_path = config_get_value(config, 0, "PATH");
if (image_path == NULL) {
image_path = config_get_value(config, 0, "IMAGE_PATH");
} else {
panic(true, "chainload: Image path not specified");
}

struct file_handle *image;
if ((image = uri_open(image_path)) == NULL)
Expand Down
10 changes: 7 additions & 3 deletions common/protos/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,13 @@ struct boot_params {
noreturn void linux_load(char *config, char *cmdline) {
struct file_handle *kernel_file;

char *kernel_path = config_get_value(config, 0, "KERNEL_PATH");
if (kernel_path == NULL)
panic(true, "linux: KERNEL_PATH not specified");
char *kernel_path = config_get_value(config, 0, "PATH");
if (kernel_path == NULL) {
kernel_path = config_get_value(config, 0, "KERNEL_PATH");
}
if (kernel_path == NULL) {
panic(true, "linux: Kernel path not specified");
}

print("linux: Loading kernel `%#`...\n", kernel_path);

Expand Down
7 changes: 5 additions & 2 deletions common/protos/linux_risc.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,12 @@ noreturn void linux_load(char *config, char *cmdline) {

struct file_handle *kernel_file;

char *kernel_path = config_get_value(config, 0, "KERNEL_PATH");
char *kernel_path = config_get_value(config, 0, "PATH");
if (kernel_path == NULL) {
panic(true, "linux: KERNEL_PATH not specified");
kernel_path = config_get_value(config, 0, "KERNEL_PATH");
}
if (kernel_path == NULL) {
panic(true, "linux: Kernel path not specified");
}

print("linux: Loading kernel `%#`...\n", kernel_path);
Expand Down

0 comments on commit c9cc7bb

Please sign in to comment.