-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update autogen script for profile names on UEFI builds (#207)
# Preface Please ensure you have read the [contribution docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior to submitting the pull request. In particular, [pull request guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices). ## Description This change updated the autogen script to populate the profile names into profile header. The script will accept `-pn` as an input argument for the comma separated profile names. This autogen script is also hooked up to `CONF_PROFILE_NAMES` build variable to allow UEFI platform build to specify names through variables. If platform elects not to specify such argument, the indices will be used for such names during autogen process. A header file is also created for `PlatformConfigDataLib` to indicate what global variables will be produced by the autogen scripts and should serve as a contract between the autogen script and any data library should the consumer choose to implement so. Fixes #205 For each item, place an "x" in between `[` and `]` if true. Example: `[x]`. _(you can also check items in the GitHub UI)_ - [x] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested This was tested on QEMU Q35 and SBSA platforms. ## Integration Instructions Specify the `CONF_PROFILE_NAMES` build variable as comma separated strings during prebuild phase if need to customize.
- Loading branch information
Showing
9 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,7 @@ | |
"ntdll", | ||
"NTSTATUS", | ||
"PVARIABLE", | ||
"ANYSIZE" | ||
"ANYSIZE", | ||
"profilenames" | ||
] | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** @file | ||
Global variables from configuration data created by autogen header. | ||
Note: The data fields in this file is originated from the autogen script. | ||
One should not change the content in this file without pairing the | ||
autogen scripts. | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef PLATFORM_CONFIG_DATA_LIB_H_ | ||
#define PLATFORM_CONFIG_DATA_LIB_H_ | ||
|
||
#include <Uefi.h> | ||
#include <ConfigStdStructDefs.h> | ||
|
||
extern KNOB_DATA gKnobData[]; | ||
extern UINTN gNumKnobs; | ||
extern PROFILE gProfileData[]; | ||
// number of profile overrides (i.e. into gProfileData) | ||
// this does not count the generic profile, which is not | ||
// in gProfileData, but rather in gKnobData's defaults | ||
extern UINTN gNumProfiles; | ||
extern CHAR8 *gProfileFlavorName; | ||
|
||
#endif // PLATFORM_CONFIG_DATA_LIB_H_ |
21 changes: 21 additions & 0 deletions
21
SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.c
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* @file PlatformConfigDataLibNull.c | ||
Null instance of PlatformConfigDataLib. Platform is expected to implement this library and | ||
supply autogenerated data structures. | ||
Copyright (c) Microsoft Corporation. | ||
**/ | ||
|
||
#include <Uefi.h> | ||
#include <ConfigStdStructDefs.h> | ||
|
||
KNOB_DATA gKnobData = { 0 }; | ||
|
||
UINTN gNumKnobs = 0; | ||
|
||
PROFILE gProfileData = { 0 }; | ||
|
||
CHAR8 *gProfileFlavorName = { 0 }; | ||
|
||
UINTN gNumProfiles = 0; |
34 changes: 34 additions & 0 deletions
34
SetupDataPkg/Library/PlatformConfigDataLibNull/PlatformConfigDataLibNull.inf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## @file PlatformConfigDataLibNull.inf | ||
# | ||
# Null instance of PlatformConfigDataLib. The platform is expected to implement this library and | ||
# supply autogenerated data structures. | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# | ||
## | ||
|
||
|
||
[Defines] | ||
INF_VERSION = 0x00010017 | ||
BASE_NAME = PlatformConfigDataNullLib | ||
FILE_GUID = 88C6BBE4-419C-42A0-BAE7-CC2CA37E1801 | ||
VERSION_STRING = 1.0 | ||
MODULE_TYPE = BASE | ||
LIBRARY_CLASS = NULL | ||
|
||
# | ||
# The following information is for reference only and not required by the build tools. | ||
# | ||
# VALID_ARCHITECTURES = ANY | ||
# | ||
|
||
[Sources] | ||
PlatformConfigDataLibNull.c | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
SetupDataPkg/SetupDataPkg.dec | ||
|
||
[Depex] | ||
# This library is intended to have no dependencies and only carry data | ||
TRUE |
This file contains 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
This file contains 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
This file contains 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
This file contains 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