mirror of
https://github.com/limine-bootloader/limine
synced 2024-12-02 13:16:59 +03:00
stivale+stivale2: default to file path as the module string if NULL
Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
This commit is contained in:
parent
c338f575d8
commit
1580669781
@ -202,13 +202,24 @@ void stivale_load(char *config, char *cmdline) {
|
||||
struct stivale_module *m = ext_mem_alloc(sizeof(struct stivale_module));
|
||||
|
||||
char *module_string = config_get_value(config, i, "MODULE_STRING");
|
||||
|
||||
// TODO: perhaps change the module string to to be a pointer.
|
||||
//
|
||||
// NOTE: By default, the module string is the file name.
|
||||
if (module_string == NULL) {
|
||||
m->string[0] = '\0';
|
||||
size_t str_len = strlen(module_path);
|
||||
|
||||
if (str_len > 127)
|
||||
str_len = 127;
|
||||
|
||||
memcpy(m->string, module_path, str_len);
|
||||
} else {
|
||||
// TODO perhaps change this to be a pointer
|
||||
size_t str_len = strlen(module_string);
|
||||
|
||||
if (str_len > 127)
|
||||
str_len = 127;
|
||||
|
||||
memcpy(m->string, module_string, str_len);
|
||||
}
|
||||
|
||||
|
@ -313,13 +313,23 @@ failed_to_load_header_section:
|
||||
struct stivale2_module *m = &tag->modules[i];
|
||||
|
||||
char *module_string = config_get_value(config, i, "MODULE_STRING");
|
||||
|
||||
// TODO: perhaps change the module string to to be a pointer.
|
||||
//
|
||||
// NOTE: By default, the module string is the file name.
|
||||
if (module_string == NULL) {
|
||||
m->string[0] = '\0';
|
||||
} else {
|
||||
// TODO perhaps change this to be a pointer
|
||||
size_t str_len = strlen(module_string);
|
||||
size_t str_len = strlen(module_path);
|
||||
|
||||
if (str_len > 127)
|
||||
str_len = 127;
|
||||
|
||||
memcpy(m->string, module_path, str_len);
|
||||
} else {
|
||||
size_t str_len = strlen(module_string);
|
||||
|
||||
if (str_len > 127)
|
||||
str_len = 127;
|
||||
|
||||
memcpy(m->string, module_string, str_len);
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,8 @@ KERNEL_CMDLINE=Woah! Another example!
|
||||
MODULE_PATH=boot:///boot/bg.bmp
|
||||
MODULE_STRING=yooooo
|
||||
|
||||
MODULE_PATH=boot:///boot/bg.bmp
|
||||
|
||||
:EFI Chainloading
|
||||
|
||||
COMMENT=Test EFI image chainloading.
|
||||
|
Loading…
Reference in New Issue
Block a user