Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux Variable Writing Script #353

Merged
merged 10 commits into from
May 28, 2024
Merged

Add Linux Variable Writing Script #353

merged 10 commits into from
May 28, 2024

Conversation

os-d
Copy link
Contributor

@os-d os-d commented May 21, 2024

Description

This adds a Python script to write UEFI variables to and from config bins from Linux. The current support is only for Windows.

For each item, place an "x" in between [ and ] if true. Example: [x].
(you can also check items in the GitHub UI)

  • 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

Tested in Ubuntu 24.04 with the QemuQ35 virtual platform using mu_feature_config as well as on physical platforms using it.

Integration Instructions

Run the same flows as for the Windows script, the scripts will automatically detect that this is run from Linux and choose the right script. It needs to be run as sudo.

@os-d os-d requested review from kuqin12 and apop5 May 21, 2024 19:45
@github-actions github-actions bot added language:python Pull requests that update Python code impact:non-functional Does not have a functional impact labels May 21, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 36.22%. Comparing base (3d2bcc4) to head (d9928ba).

Current head d9928ba differs from pull request most recent head 521d59a

Please upload reports for the commit 521d59a to get more accurate results.

Files Patch % Lines
SetupDataPkg/Tools/ReadUefiVarsToConfVarList.py 0.00% 12 Missing ⚠️
SetupDataPkg/Tools/WriteConfVarListToUefiVars.py 0.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #353      +/-   ##
==========================================
- Coverage   36.29%   36.22%   -0.07%     
==========================================
  Files          31       31              
  Lines        6246     6258      +12     
  Branches      449      449              
==========================================
  Hits         2267     2267              
- Misses       3977     3989      +12     
  Partials        2        2              
Flag Coverage Δ
Linux 27.56% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@apop5 apop5 linked an issue May 22, 2024 that may be closed by this pull request
os-d and others added 9 commits May 22, 2024 14:29
* first error?

* too many values to unpack

* too many values to unpack 2

* test run

* how about now?

* odd?

* more junk

* Why does this not fail on windows?

* more junk 2

* Why does this not fail on windows 2?

* remove the correct part

* How about now

* revert some junk

* Some erros

* fixing is?

* Not sure if this will work
* first error?

* too many values to unpack

* too many values to unpack 2

* test run

* how about now?

* odd?

* more junk

* Why does this not fail on windows?

* more junk 2

* Why does this not fail on windows 2?

* remove the correct part

* How about now

* revert some junk

* Some erros

* fixing is?

* Not sure if this will work

* hmm, endianness?

* hardcode?

* size

* adding junk prints

* adding junk prints 2

* update len

* how about now?

* revert

* just try on

* more prints/

* this is stupid

* f it

* how about now

* another one

* That should do

* now we write

* junk test

* now we write

* another one

* one mote

* one mot 2e

* now?

* now?

* back to file ops

* now

* that should resolve the write part
@os-d os-d merged commit 2fffa56 into microsoft:main May 28, 2024
12 checks passed
@os-d os-d deleted the osde/linux_var branch May 28, 2024 16:36
ProjectMuBot added a commit to microsoft/mu_tiano_platforms that referenced this pull request Jun 5, 2024
Introduces 9 new commits in [Features/CONFIG](https://github.com/microsoft/mu_feature_config.git).

<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/22702a39b8e92af72aed9858f546fb5eff62fb4e">22702a</a> Repo File Sync: .gitattributes: Prevent line ending conversion (<a href="https://github.com/microsoft/mu_feature_config/pull/346">#346</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/2acde62130d7dde32694ea0a80351b8ab7777e3b">2acde6</a> pip: bump regex from 2024.4.28 to 2024.5.10 (<a href="https://github.com/microsoft/mu_feature_config/pull/348">#348</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/5c8ad4789f71c4c862a715156f0143b7968ef767">5c8ad4</a> pip: bump pygount from 1.6.1 to 1.8.0 (<a href="https://github.com/microsoft/mu_feature_config/pull/347">#347</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/ad7737d7c2c8a240b5ce487dbdcf6c45ec48faad">ad7737</a> pip: bump pytest from 8.2.0 to 8.2.1 (<a href="https://github.com/microsoft/mu_feature_config/pull/354">#354</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/3d2bcc44e6d542599f71e2fd76b17743841da6a9">3d2bcc</a> Add Pretty Name to Config XML (<a href="https://github.com/microsoft/mu_feature_config/pull/351">#351</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/319a618dabaccfba5f212d5f7c88d78aee41a90e">319a61</a> pip: bump regex from 2024.5.10 to 2024.5.15 (<a href="https://github.com/microsoft/mu_feature_config/pull/355">#355</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/2fffa561d0f0b17c2a51183000a7f65df63f0d21">2fffa5</a> Add Linux Variable Writing Script (<a href="https://github.com/microsoft/mu_feature_config/pull/353">#353</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/64d62365d6d6171250f8bc1d0bc03c2a6d4c219b">64d623</a> Repo File Sync: synced file(s) with microsoft/mu_devops (<a href="https://github.com/microsoft/mu_feature_config/pull/358">#358</a>)</li>
<li><a href="https://github.com/microsoft/mu_feature_config/commit/c7552fe116eefe601a5dd7116ba37ab5ba937b95">c7552f</a> pip: bump edk2-pytool-extensions from 0.27.4 to 0.27.5 (<a href="https://github.com/microsoft/mu_feature_config/pull/359">#359</a>)</li>
</ul>
</details>

Signed-off-by: Project Mu Bot <mubot@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact language:python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support Applying Config Binary to Uefi Vars On Linux
4 participants