-
-
Notifications
You must be signed in to change notification settings - Fork 26
D) Add config file support. #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fe9049f to
d4c4ad8
Compare
6e0d618 to
15f665f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.chere:yo1dog@2982596#diff-7aaf2a1060a633eda3e75a71e84bdf8379c109b66a897e5094c655c602b6f71f
and
config.chere: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_PAYLOADcontaining theBOOT_TYPEiplboot 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
CONFIGstruct. A configuration contains aBOOT_ACTIONfor each shortcut (including the default). All shortcuts default toBOOT_TYPE_NONEwhich is ignored in favor of the the default shortcut. The default shortcut defaults toBOOT_TYPE_DOLand a path ofipl.dol. You can see this here: https://github.com/yo1dog/iplboot/blob/2982596ed0374eb472902e2c5f86c2ef529e371b/source/config.c#L10Configuration 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.