Skip to content

Conversation

@yo1dog
Copy link
Contributor

@yo1dog yo1dog commented Sep 8, 2022

This PR is child of #30. To see diff with parent:
yo1dog/gekkoboot@yo1dog/debug-mode...yo1dog/config-file-2

Meat is the changes to main.c here:
yo1dog@2982596#diff-7aaf2a1060a633eda3e75a71e84bdf8379c109b66a897e5094c655c602b6f71f
and config.c here:
https://github.com/yo1dog/iplboot/blob/2982596ed0374eb472902e2c5f86c2ef529e371b/source/config.c

Configuration file support is enabled by first searching each device for the a configuration file at root. If it does not exist, the old behavior of looking for hardcoded shortcut files is used. If that file is also not found, it moves on to the next device. You can see that here: yo1dog/gekkoboot@yo1dog/debug-mode...yo1dog/config-file-2#diff-7aaf2a1060a633eda3e75a71e84bdf8379c109b66a897e5094c655c602b6f71fR338-R342

I also updated the logic such that once shortcut information is found on a device (either config file or selected hardcoded shortcut file), no other devices are attempted. This causes iplboot to stop if any shortcut action or errors are encountered.

If a shortcut is found, the device populates a BOOT_PAYLOAD containing the BOOT_TYPE iplboot should preform along with the loaded DOL and argv (if applicable).

The configuration file is read and parsed using ini.h and mapped to the CONFIG struct. A configuration contains a BOOT_ACTION for each shortcut (including the default). All shortcuts default to BOOT_TYPE_NONE which is ignored in favor of the the default shortcut. The default shortcut defaults to BOOT_TYPE_DOL and a path of ipl.dol. You can see this here: https://github.com/yo1dog/iplboot/blob/2982596ed0374eb472902e2c5f86c2ef529e371b/source/config.c#L10

Configuration parameters are described here for now: https://github.com/yo1dog/iplboot#configuration

Parsing of CLI args was also updated to support parsing multiple options strings from the config and/or a CLI file. Only change here was putting the algo inside another loop.

Debug mode can also be enabled via config file. As soon as this flag is seen, debug mode is enabled in the global state.

@yo1dog yo1dog changed the title Add config file support. D) Add config file support. Sep 8, 2022
@9ary 9ary force-pushed the master branch 6 times, most recently from fe9049f to d4c4ad8 Compare December 3, 2023 15:23
@9ary 9ary force-pushed the master branch 4 times, most recently from 6e0d618 to 15f665f Compare December 3, 2023 21:34
@9ary 9ary closed this Mar 16, 2024
@yo1dog yo1dog deleted the yo1dog/config-file-2 branch October 28, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants