david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[build] Allow setting help text URI to be customised via config/branding.h

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2015-02-11 13:57:34 +00:00
parent 92f3bd901e
commit b06fdcf936
3 changed files with 46 additions and 3 deletions

View File

@ -117,6 +117,49 @@ FILE_LICENCE ( GPL2_OR_LATER );
*/
#define PRODUCT_COMMAND_URI "http://ipxe.org/cmd/%s"
/*
* Setting help messages
*
* iPXE setting help messages include a URI constructed from the
* setting name, such as
*
* "http://ipxe.org/cfg/initiator-iqn"
*
* The iPXE web site includes documentation for the settings used by
* iPXE, including:
*
* - details of the corresponding DHCP option number.
*
* - details of the corresponding ISC dhcpd option name.
*
* - examples of using the setting from the iPXE command line, or in
* iPXE scripts.
*
* - examples of configuring the setting via a DHCP server.
*
* - a formal description of the setting.
*
* - links to documentation for related settings.
*
* - links to documentation for relevant build options.
*
* - general notes about the setting.
*
* If you want to provide your own documentation for all of the
* settings used by iPXE, rather than using the existing support
* infrastructure provided by http://ipxe.org, then you may define a
* custom URI to be included within setting help messages.
*
* Note that the custom URI is a printf() format string which must
* include a format specifier for the setting name.
*
* [ Please also note that the existing documentation is licensed
* under Creative Commons terms which require attribution to the
* iPXE project and prohibit the alteration or removal of any
* references to "iPXE". ]
*/
#define PRODUCT_SETTING_URI "http://ipxe.org/cfg/%s"
#include <config/local/branding.h>
#endif /* CONFIG_BRANDING_H */

View File

@ -378,8 +378,7 @@ static void draw_info_row ( struct setting_widget *widget ) {
msg ( INFO_ROW, "%s - %s", buf, widget->row.setting.description );
attroff ( A_BOLD );
color_set ( CPAIR_URL, NULL );
msg ( ( INFO_ROW + 1 ), "http://ipxe.org/cfg/%s",
widget->row.setting.name );
msg ( ( INFO_ROW + 1 ), PRODUCT_SETTING_URI, widget->row.setting.name );
color_set ( CPAIR_NORMAL, NULL );
}

View File

@ -59,6 +59,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/efi/efi_hii.h>
#include <ipxe/efi/efi_snp.h>
#include <ipxe/efi/efi_strings.h>
#include <config/branding.h>
/** EFI platform setup formset GUID */
static EFI_GUID efi_hii_platform_setup_formset_guid
@ -136,7 +137,7 @@ static void efi_snp_hii_questions ( struct efi_snp_device *snpdev,
previous = setting;
name_id = efi_ifr_string ( ifr, "%s", setting->name );
prompt_id = efi_ifr_string ( ifr, "%s", setting->description );
help_id = efi_ifr_string ( ifr, "http://ipxe.org/cfg/%s",
help_id = efi_ifr_string ( ifr, PRODUCT_SETTING_URI,
setting->name );
question_id = setting->tag;
efi_ifr_string_op ( ifr, prompt_id, help_id,