Martin Roth has uploaded this change for review.

View Change

Documentation: Add the osource keyword to kconfig.md

The 'source' kconfig keyword will soon return an error if the file being
referenced does not exist. The 'osource' keyword has been added to
allow for sourcing files that may or may not exist.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: If22b9012a3c512720fcd4b84f396cc2b5e668d3c
---
M Documentation/getting_started/kconfig.md
1 file changed, 41 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/48906/1
diff --git a/Documentation/getting_started/kconfig.md b/Documentation/getting_started/kconfig.md
index 037371b..71fed2c 100644
--- a/Documentation/getting_started/kconfig.md
+++ b/Documentation/getting_started/kconfig.md
@@ -699,6 +699,47 @@

--------------------------------------------------------------------------------

+### osource
+
+The 'osource' keyword functions similarly to an 'include' statement in c or
+the 'source' keyword in Kconfig, except that there is no error if the file
+being sourced is not present.
+This pulls one or more files into Kconfig at the location of the 'osource'
+command. This statement is always parsed - there is no way to conditionally
+source a file. coreboot's source and osource statements have been updated to
+accept directory globbing. The '*' character will match with any directory.
+
+
+
+##### Usage:
+osource &lt;prompt&gt;
+
+
+##### Example:
+# load site-local kconfig to allow user specific defaults and overrides
+osource "site-local/Kconfig"
+
+##### Notes:
+- As with all prompt values, the 'osource' prompt may be enclosed in single or
+ double quotes, or left without any quotes. Using quotes is highly recommended
+ however.
+- The 'osource' keyword loads files relative to the working directory where the
+ Kconfig command was run. For coreboot, this is the root coreboot directory, so
+ all osource commands in the src directory need to start with ‘src/’.
+- 'osource' pulls a file into the Kconfig tree at the location of the keyword.
+ This allows for files containing small bits of the Kconfig tree to be pulled
+ into a larger construct. A restriction on this is that the starting/ending
+ keyword pairs must be within the same file - ‘endif’ cannot appear in a
+ different file than the ‘if’ statement that it ends. The same is true of
+ menu/endmenu and choice/endchoice pairs.
+
+##### Restrictions:
+- 'osource' keywords always load in the specified file or files if they exist.
+ This does not optionally pull in a file, it just doesn't error out if the
+ file does not exist.
+
+--------------------------------------------------------------------------------
+
### prompt

The 'prompt' keyword sets the text displayed for a config symbol or choice in

To view, visit change 48906. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If22b9012a3c512720fcd4b84f396cc2b5e668d3c
Gerrit-Change-Number: 48906
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth@google.com>
Gerrit-MessageType: newchange