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, '') }} diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index 2199b6a8ac..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: main + 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 1e8357e6b1..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: main + 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 2ad0297809..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@main + 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 175d3c3eed..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 # @@ -12,7 +18,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..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@main + uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v1.3.0 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 043c26b852..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@main + 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 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