From 6a5c9b9462667f6983c30c796b37d354b970c075 Mon Sep 17 00:00:00 2001 From: Srilatha Sridharan <38865230+srisrid@users.noreply.github.com> Date: Wed, 30 Nov 2022 17:23:51 -0800 Subject: [PATCH 1/4] Add PcdShellFvGuid to allow platforms to provide FV GUID to search shell image in (#116) ## Description Add PcdShellFvGuid to allow platforms to provide FV GUID to search shell image in - [x] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested When a FV GUID is provided, a default boot option for shell with the FV device path is created. as long as the device path exists, system is able to boot to internal UEFI shell. If the PCD is not updated by platform and is at default value (zero guid), then all FV's are searched and shell is located to create a boot option device path. ## Integration Instructions N/A --- .../MsBootOptionsLib/MsBootOptionsLib.c | 52 +++++++++++++++++-- .../MsBootOptionsLib/MsBootOptionsLib.inf | 1 + PcBdsPkg/PcBdsPkg.dec | 4 ++ 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c b/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c index 5f8282976c..05b9dd5d37 100644 --- a/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c +++ b/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.c @@ -30,6 +30,33 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define MS_PXE_BOOT L"PXE Network" #define MS_PXE_BOOT_PARM "PXE" +typedef struct { + MEDIA_FW_VOL_DEVICE_PATH FvDevPath; + EFI_DEVICE_PATH_PROTOCOL EndDevPath; +} FV_PIWG_DEVICE_PATH; + +FV_PIWG_DEVICE_PATH mFvPIWGDevicePathTemplate = { + { + { + MEDIA_DEVICE_PATH, + MEDIA_PIWG_FW_VOL_DP, + { + (UINT8)(sizeof (MEDIA_FW_VOL_DEVICE_PATH)), + (UINT8)(sizeof (MEDIA_FW_VOL_DEVICE_PATH) >> 8) + } + }, + { 0 } + }, + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH, + 0 + } + } +}; + /** * Constructor * @@ -303,13 +330,24 @@ CreateFvBootOption ( (EFI_DEVICE_PATH_PROTOCOL *)&FileNode ); } else { - DevicePath = CreateShellDevicePath (); - if (DevicePath == NULL) { - return EFI_NOT_FOUND; + if (IsZeroGuid (PcdGetPtr (PcdShellFvGuid))) { + // Search all FV's for Shell. + DevicePath = CreateShellDevicePath (); + if (DevicePath == NULL) { + return EFI_NOT_FOUND; + } + } else { + // Create FV devicepath from template + DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); + // Update FvName to the Shell GUID from PCD if it is not ZeroGuid + CopyGuid ( + &((FV_PIWG_DEVICE_PATH *)DevicePath)->FvDevPath.FvName, + PcdGetPtr (PcdShellFvGuid) + ); } DevicePath = AppendDevicePathNode ( - DevicePath, + (EFI_DEVICE_PATH_PROTOCOL *)DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&FileNode ); } @@ -324,7 +362,11 @@ CreateFvBootOption ( OptionalData, OptionalDataSize ); - FreePool (DevicePath); + + if (DevicePath != NULL) { + FreePool (DevicePath); + } + return Status; } diff --git a/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf b/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf index 303ca008ba..7edf3e2245 100644 --- a/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf +++ b/PcBdsPkg/Library/MsBootOptionsLib/MsBootOptionsLib.inf @@ -48,6 +48,7 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile gPcBdsPkgTokenSpaceGuid.PcdShellFile + gPcBdsPkgTokenSpaceGuid.PcdShellFvGuid [Depex] TRUE diff --git a/PcBdsPkg/PcBdsPkg.dec b/PcBdsPkg/PcBdsPkg.dec index 0ddcb11787..7fde755942 100644 --- a/PcBdsPkg/PcBdsPkg.dec +++ b/PcBdsPkg/PcBdsPkg.dec @@ -125,6 +125,10 @@ # @Prompt FFS Name of Shell Application gPcBdsPkgTokenSpaceGuid.PcdShellFile|{ 0xB7, 0xD6, 0x7A, 0xC5, 0x15, 0x05, 0xA8, 0x40, 0x9D, 0x21, 0x55, 0x16, 0x52, 0x85, 0x4E, 0x37 }|VOID*|0x40000129 + ## GUID of the FV to locate the shell in. + # If left at default zero guid value, all FV's will be searched to find Shell image. + gPcBdsPkgTokenSpaceGuid.PcdShellFvGuid|{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }|VOID*|0x40000130 + ## This fixed at build flag tells MsBootPolicyLib that it is part of BDS gPcBdsPkgTokenSpaceGuid.PcdBdsBootPolicy|FALSE|BOOLEAN|0x40000141 From 3ce0f7c4a9d3eb09deefac548613cab04b6e468f Mon Sep 17 00:00:00 2001 From: Project Mu Uefibot <45776386+uefibot@users.noreply.github.com> Date: Tue, 6 Dec 2022 06:48:26 -0800 Subject: [PATCH 2/4] Repo File Sync: Synced file(s) with microsoft/mu_devops (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Synced local file(s) with [microsoft/mu_devops](https://github.com/microsoft/mu_devops). 🤖: View the [Repo File Sync Configuration File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml) to see how files are synced. --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#3598065818](https://github.com/microsoft/mu_devops/actions/runs/3598065818) Signed-off-by: Project Mu UEFI Bot --- .azurepipelines/Ubuntu-GCC5.yml | 2 +- .azurepipelines/Windows-VS.yml | 2 +- .github/workflows/label-issues.yml | 2 +- .github/workflows/label-issues/regex-pull-requests.yml | 2 +- .github/workflows/label-sync.yml | 2 +- .github/workflows/stale.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index 2199b6a8ac..358fd1f67e 100644 --- a/.azurepipelines/Ubuntu-GCC5.yml +++ b/.azurepipelines/Ubuntu-GCC5.yml @@ -20,7 +20,7 @@ resources: type: github endpoint: microsoft name: microsoft/mu_devops - ref: main + ref: refs/tags/v1.1.1 variables: - group: architectures-arm-64-x86-64 diff --git a/.azurepipelines/Windows-VS.yml b/.azurepipelines/Windows-VS.yml index 1e8357e6b1..7275181faa 100644 --- a/.azurepipelines/Windows-VS.yml +++ b/.azurepipelines/Windows-VS.yml @@ -20,7 +20,7 @@ resources: type: github endpoint: microsoft name: microsoft/mu_devops - ref: main + ref: refs/tags/v1.1.1 variables: - group: architectures-x86-64 diff --git a/.github/workflows/label-issues.yml b/.github/workflows/label-issues.yml index 2ad0297809..5896397090 100644 --- a/.github/workflows/label-issues.yml +++ b/.github/workflows/label-issues.yml @@ -31,4 +31,4 @@ on: jobs: apply: - uses: microsoft/mu_devops/.github/workflows/Labeler.yml@main + uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v1.1.1 diff --git a/.github/workflows/label-issues/regex-pull-requests.yml b/.github/workflows/label-issues/regex-pull-requests.yml index 175d3c3eed..26d6e5d3e0 100644 --- a/.github/workflows/label-issues/regex-pull-requests.yml +++ b/.github/workflows/label-issues/regex-pull-requests.yml @@ -12,7 +12,7 @@ impact:breaking-change: - '\s*-\s*\[\s*[x|X]\s*\] Breaking change\?' impact:non-functional: - - '\s*-\s*\[\s*[x|X]\s*\] Impacts functionality\?' + - '\s*-\s*\[\s*(?![x|X])\s*\] Impacts functionality\?' impact:security: - '\s*-\s*\[\s*[x|X]\s*\] Impacts security\?' diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml index e7b493eed1..274b0fc1e3 100644 --- a/.github/workflows/label-sync.yml +++ b/.github/workflows/label-sync.yml @@ -24,4 +24,4 @@ on: jobs: sync: - uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@main + uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v1.1.1 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 043c26b852..0db0a5260f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -24,4 +24,4 @@ on: jobs: check: - uses: microsoft/mu_devops/.github/workflows/Stale.yml@main + uses: microsoft/mu_devops/.github/workflows/Stale.yml@v1.1.1 From e041f076a1c16473f4eb9da9560744ef535c5175 Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Tue, 6 Dec 2022 10:55:09 -0800 Subject: [PATCH 3/4] Add logic for container build to Matrix-Build-Job.yml (#118) ## Description Changes the matrix build job to be able to take input for the container image used in the generic mu_devops file generated. Will be used by: https://github.com/microsoft/mu_devops/pull/59 - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested Tested on test pipeline with mu_devops changes made locally ## Integration Instructions N/A --- .azurepipelines/Matrix-Build-Job.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.azurepipelines/Matrix-Build-Job.yml b/.azurepipelines/Matrix-Build-Job.yml index 97024d1c46..29051b5058 100644 --- a/.azurepipelines/Matrix-Build-Job.yml +++ b/.azurepipelines/Matrix-Build-Job.yml @@ -29,6 +29,10 @@ parameters: displayName: Virtual Machine Image (e.g. windows-latest) type: string default: 'windows-latest' +- name: container_image + displayName: Container Image + type: string + default: '' jobs: @@ -53,10 +57,16 @@ jobs: workspace: clean: all + ${{ if ne(parameters.container_image, '') }}: + container: ${{ parameters.container_image }} + pool: vmImage: ${{ parameters.vm_image }} steps: + - ${{ if and(ne(parameters.container_image, ''), not(contains(parameters.vm_image, 'windows'))) }}: + - script: echo "##vso[task.prependpath]/home/vsts_azpcontainer/.local/bin" + displayName: Add User Local Bin to Path - template: Steps/PrGate.yml@mu_devops parameters: build_archs: ${{ parameters.arch_list }} @@ -70,3 +80,4 @@ jobs: extra_build_args: ${{ parameters.extra_build_args }} extra_install_step: ${{ parameters.extra_install_step }} tool_chain_tag: ${{ parameters.tool_chain_tag }} + install_tools: ${{ eq(parameters.container_image, '') }} From 9d4e9e6fb737ee90a123f972bc7973aecfd71d4d Mon Sep 17 00:00:00 2001 From: Project Mu Uefibot <45776386+uefibot@users.noreply.github.com> Date: Fri, 9 Dec 2022 06:04:12 -0800 Subject: [PATCH 4/4] Repo File Sync: Synced file(s) with microsoft/mu_devops (#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Synced local file(s) with [microsoft/mu_devops](https://github.com/microsoft/mu_devops). 🤖: View the [Repo File Sync Configuration File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml) to see how files are synced. --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#3641761478](https://github.com/microsoft/mu_devops/actions/runs/3641761478) Signed-off-by: Project Mu UEFI Bot --- .azurepipelines/Ubuntu-GCC5.yml | 8 +++- .azurepipelines/Windows-VS.yml | 2 +- .devcontainer/devcontainer.json | 12 +++++ .github/advanced-issue-labeler.yml | 48 +++++++++++++++++++ .github/workflows/auto-merge.yml | 39 +++++++++++++++ .github/workflows/label-issues.yml | 2 +- .github/workflows/label-issues/file-paths.yml | 6 +++ .../label-issues/regex-pull-requests.yml | 6 +++ .github/workflows/label-sync.yml | 2 +- .github/workflows/stale.yml | 2 +- .github/workflows/triage-issues.yml | 22 +++++++++ 11 files changed, 143 insertions(+), 6 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/advanced-issue-labeler.yml create mode 100644 .github/workflows/auto-merge.yml create mode 100644 .github/workflows/triage-issues.yml diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index 358fd1f67e..90f2af19cc 100644 --- a/.azurepipelines/Ubuntu-GCC5.yml +++ b/.azurepipelines/Ubuntu-GCC5.yml @@ -20,7 +20,10 @@ resources: type: github endpoint: microsoft name: microsoft/mu_devops - ref: refs/tags/v1.1.1 + ref: refs/tags/v1.3.0 + containers: + - container: linux-gcc + image: ghcr.io/tianocore/containers/fedora-35-build:2113a0e variables: - group: architectures-arm-64-x86-64 @@ -33,8 +36,9 @@ jobs: extra_build_args: CODE_COVERAGE=TRUE CC_HTML=TRUE extra_install_step: - script: | - sudo apt-get install -y mingw-w64 lcov + sudo microdnf install --assumeyes mingw64-gcc lcov pip install lcov_cobertura pycobertura displayName: Install Windows Resource Compiler for Linux & Code Coverage Tools tool_chain_tag: $(tool_chain_tag) vm_image: $(vm_image) + container_image: linux-gcc diff --git a/.azurepipelines/Windows-VS.yml b/.azurepipelines/Windows-VS.yml index 7275181faa..fd416fb93a 100644 --- a/.azurepipelines/Windows-VS.yml +++ b/.azurepipelines/Windows-VS.yml @@ -20,7 +20,7 @@ resources: type: github endpoint: microsoft name: microsoft/mu_devops - ref: refs/tags/v1.1.1 + ref: refs/tags/v1.3.0 variables: - group: architectures-x86-64 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..ebcf852c90 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "image": "ghcr.io/tianocore/containers/fedora-35-dev:latest", + "postCreateCommand": "git config --global --add safe.directory * && pip install --upgrade -r pip-requirements.txt", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "DavidAnson.vscode-markdownlint" + ] + } + } +} \ No newline at end of file diff --git a/.github/advanced-issue-labeler.yml b/.github/advanced-issue-labeler.yml new file mode 100644 index 0000000000..b003c650ad --- /dev/null +++ b/.github/advanced-issue-labeler.yml @@ -0,0 +1,48 @@ +# Defines the mappings between GitHub issue responses and labels applied to the issue +# for Project Mu repos. +# +# IMPORTANT: Only use labels defined in the .github/Labels.yml file in this repo. +# +# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there +# instead of the file in this repo. +# +# - Mu DevOps Repo: https://github.com/microsoft/mu_devops +# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# For more information, see: +# https://github.com/redhat-plumbers-in-action/advanced-issue-labeler + +policy: + - template: [bug_report.yml, documentation_request.yml, feature_request.yml] + section: + + # Issue Template - Urgency Dropdown + - id: ['urgency'] + block-list: [] + label: + - name: 'urgency:low' + keys: ['Low'] + - name: 'urgency:medium' + keys: ['Medium'] + - name: 'urgency:high' + keys: ['High'] + + # Issue Template - Fix Owner Dropdown + - id: ['fix_owner', 'request_owner'] + block-list: [] + label: + - name: 'state:needs-owner' + keys: [ + 'Someone else needs to fix it', + 'Someone else needs to make the change', + 'Someone else needs to implement the feature' + ] + - name: 'state:needs-triage' + keys: [ + 'Someone else needs to fix it', + 'Someone else needs to make the change', + 'Someone else needs to implement the feature' + ] diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 0000000000..22da5d62cc --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,39 @@ +# This workflow automatically merges pull requests under certain conditions. +# +# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there +# instead of the file in this repo. +# +# NOTE: This file uses a reusable workflow. Do not make changes to the file that should be made +# in the common/reusable workflow. +# +# - Mu DevOps Repo: https://github.com/microsoft/mu_devops +# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +name: Auto Merge Pull Request + +on: + pull_request_target: + types: + - edited + - labeled + - opened + - ready_for_review + - reopened + - synchronize + - unlabeled + - unlocked + pull_request_review: + types: + - submitted + check_suite: + types: + - completed + status: {} + +jobs: + merge_check: + uses: microsoft/mu_devops/.github/workflows/AutoMerger.yml@v1.3.0 diff --git a/.github/workflows/label-issues.yml b/.github/workflows/label-issues.yml index 5896397090..9c530d34ee 100644 --- a/.github/workflows/label-issues.yml +++ b/.github/workflows/label-issues.yml @@ -31,4 +31,4 @@ on: jobs: apply: - uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v1.1.1 + uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v1.3.0 diff --git a/.github/workflows/label-issues/file-paths.yml b/.github/workflows/label-issues/file-paths.yml index 5cd3a7bf61..c3b3cc8039 100644 --- a/.github/workflows/label-issues/file-paths.yml +++ b/.github/workflows/label-issues/file-paths.yml @@ -1,5 +1,11 @@ # Specifies labels to apply to issues and pull requests based on file path patterns in Project Mu repositories. # +# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there +# instead of the file in this repo. +# +# - Mu DevOps Repo: https://github.com/microsoft/mu_devops +# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml +# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent # diff --git a/.github/workflows/label-issues/regex-pull-requests.yml b/.github/workflows/label-issues/regex-pull-requests.yml index 26d6e5d3e0..484fc6ce7e 100644 --- a/.github/workflows/label-issues/regex-pull-requests.yml +++ b/.github/workflows/label-issues/regex-pull-requests.yml @@ -1,5 +1,11 @@ # Specifies labels to apply to pull requests in Project Mu repositories based on regular expressions. # +# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there +# instead of the file in this repo. +# +# - Mu DevOps Repo: https://github.com/microsoft/mu_devops +# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml +# # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent # diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml index 274b0fc1e3..9fe1f0ab5f 100644 --- a/.github/workflows/label-sync.yml +++ b/.github/workflows/label-sync.yml @@ -24,4 +24,4 @@ on: jobs: sync: - uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v1.1.1 + uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v1.3.0 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 0db0a5260f..50990e5680 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -24,4 +24,4 @@ on: jobs: check: - uses: microsoft/mu_devops/.github/workflows/Stale.yml@v1.1.1 + uses: microsoft/mu_devops/.github/workflows/Stale.yml@v1.3.0 diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml new file mode 100644 index 0000000000..8a12fb739c --- /dev/null +++ b/.github/workflows/triage-issues.yml @@ -0,0 +1,22 @@ +# This workflow assists with initial triage of new issues by applying +# labels based on data provided in the issue. +# +# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there +# instead of the file in this repo. +# +# - Mu DevOps Repo: https://github.com/microsoft/mu_devops +# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +name: Initial Triage for New Issue + +on: + issues: + types: [ opened ] + +jobs: + sync: + uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v1.3.0