Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-osdev/uefi-rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: uefi-v0.29.0
Choose a base ref
...
head repository: rust-osdev/uefi-rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jul 6, 2024

  1. Copy the full SHA
    44ae084 View commit details

Commits on Jul 7, 2024

  1. Merge pull request #1224 from nicholasbishop/bishop-book-release-2

    book: Publish the latest release instead of main
    phip1611 authored Jul 7, 2024
    Copy the full SHA
    3d350f7 View commit details
  2. Drop SystemTable arg from uefi::helpers::init

    Use the global system table pointer instead.
    nicholasbishop committed Jul 7, 2024
    Copy the full SHA
    7131204 View commit details
  3. Copy the full SHA
    6b149bb View commit details
  4. Merge pull request #1226 from nicholasbishop/bishop-drop-init-param

    Drop SystemTable arg from uefi::helpers::init
    phip1611 authored Jul 7, 2024
    Copy the full SHA
    cc7a14c View commit details
  5. Merge pull request #1227 from rust-osdev/bishop-allow-zero-arg-entry

    uefi-macros: Allow zero-param function in the entry macro
    phip1611 authored Jul 7, 2024
    Copy the full SHA
    8ede408 View commit details
  6. uefi: Fix return value lifetime for register_protocol_notify

    Due to the rules of lifetime elision
    (https://doc.rust-lang.org/reference/lifetime-elision.html), the lifetime of the
    `SearchType` returned from `register_protocol_notify` was infered to be the
    lifetime of `Self`. The correct lifetime is the `protocol` reference.
    nicholasbishop committed Jul 7, 2024
    Copy the full SHA
    4b564bf View commit details

Commits on Jul 8, 2024

  1. Copy the full SHA
    f83ff34 View commit details
  2. Copy the full SHA
    6826794 View commit details
  3. Merge pull request #1232 from rust-osdev/renovate/crate-ci-typos-1.x

    chore(deps): update crate-ci/typos action to v1.23.1
    renovate[bot] authored Jul 8, 2024
    Copy the full SHA
    5db2c4a View commit details
  4. Merge pull request #1233 from rust-osdev/renovate/lock-file-maintenance

    chore(deps): lock file maintenance
    renovate[bot] authored Jul 8, 2024
    Copy the full SHA
    d660bd0 View commit details
  5. Merge pull request #1228 from nicholasbishop/bishop-fix-lifetime

    uefi: Fix return value lifetime for register_protocol_notify
    phip1611 authored Jul 8, 2024
    Copy the full SHA
    c80c232 View commit details

Commits on Jul 9, 2024

  1. Copy the full SHA
    3880ef5 View commit details
  2. logger: Remove some unnecessary cfgs

    This whole module is already gated by `cfg(feature = "logger")`, so no need to
    do that inside the module.
    nicholasbishop committed Jul 9, 2024
    Copy the full SHA
    2b2640f View commit details
  3. Merge pull request #1235 from rust-osdev/bishop-remove-unnecessary-co…

    …nfig
    
    logger: Remove some unnecessary cfgs
    phip1611 authored Jul 9, 2024
    Copy the full SHA
    b19eb85 View commit details
  4. Merge pull request #1231 from rust-osdev/renovate/syn-2.x-lockfile

    fix(deps): update rust crate syn to v2.0.70
    phip1611 authored Jul 9, 2024
    Copy the full SHA
    6afbf78 View commit details

Commits on Jul 13, 2024

  1. uefi: _print more failsafe

    When one accidentally call println! after exit_boot_services, one now at least
    gets some more debugging info why the machine suddenly reboots.
    
    Specifically, this prints now info to `integration-test-debugcon.log` in such
    a case.
    phip1611 committed Jul 13, 2024
    Copy the full SHA
    52f53ef View commit details
  2. Merge pull request #1239 from phip1611/println

    uefi: _print more failsafe
    nicholasbishop authored Jul 13, 2024
    Copy the full SHA
    94938ef View commit details

Commits on Jul 14, 2024

  1. Copy the full SHA
    bcb91aa View commit details
  2. Copy the full SHA
    ab6edf9 View commit details
  3. uefi: introduce types MemoryMapOwned, MemoryMapRef, and MemoryMapRefMut

    This provides API users all the flexibility they need. The main motivation for
    the addition is that one can use a chunk of memory in a kernel (provided by a
    bootloader) and parse it as EFI memory map. The main motivation for the specific
    implementation (via traits) is code reduction.
    phip1611 committed Jul 14, 2024
    Copy the full SHA
    831d8b5 View commit details
  4. Copy the full SHA
    94bef93 View commit details
  5. doc: update changelog

    phip1611 committed Jul 14, 2024
    Copy the full SHA
    66c42bc View commit details
  6. uefi: cleanup

    phip1611 committed Jul 14, 2024
    Copy the full SHA
    8264e47 View commit details
  7. Copy the full SHA
    db5e9c8 View commit details

Commits on Jul 15, 2024

  1. Merge pull request #1234 from phip1611/mem

    mem: introduce traits MemoryMap and MemoryMapMut
    nicholasbishop authored Jul 15, 2024
    Copy the full SHA
    380f98f View commit details
  2. Copy the full SHA
    e3f2fdb View commit details
  3. Merge pull request #1242 from rust-osdev/renovate/crate-ci-typos-1.x

    chore(deps): update crate-ci/typos action to v1.23.2
    renovate[bot] authored Jul 15, 2024
    Copy the full SHA
    dda8910 View commit details
  4. uefi: Add table::system_table_raw_panicking

    This is `pub(crate)`, not part of the public API currently.
    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    5cfc5f0 View commit details
  5. Add uefi::system module

    This is similar to existing methods of `SystemTable`, but as freestanding
    functions that use the global system table pointer.
    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    7758fe4 View commit details
  6. Copy the full SHA
    fc637c8 View commit details
  7. Copy the full SHA
    46e47c7 View commit details
  8. Copy the full SHA
    1c68af3 View commit details
  9. Merge pull request #1245 from rust-osdev/renovate/lock-file-maintenance

    chore(deps): lock file maintenance
    renovate[bot] authored Jul 15, 2024
    Copy the full SHA
    611202b View commit details
  10. Merge pull request #1237 from nicholasbishop/bishop-system-freestanding

    Add uefi::system module
    phip1611 authored Jul 15, 2024
    Copy the full SHA
    7a0a8ee View commit details
  11. tcg: PcrEvent/PcrEventInputs: impl Align

    This is needed for make_boxed.
    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    2cd0d91 View commit details
  12. tcg: PcrEvent/PcrEventInputs: return required size on error

    This is needed for make_boxed.
    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    373c4ea View commit details
  13. tcg: PcrEvent/PcrEventInputs: use initialized buf for input

    This is needed for make_boxed. Technically it's slightly less efficient, since
    the input buf must now be initialized, but in practice these structs are quite
    small and not created all that often, so there's no meaningful difference.
    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    d83e1d5 View commit details
  14. tcg: Impl Eq/PartialEq for PcrEventInputs

    A manual implementation is required since this is a packed struct.
    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    6bead2e View commit details
  15. tcg: Return a mut ref from PcrEventInputs::new_in_buffer

    This is needed for make_boxed.
    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    6c726f3 View commit details
  16. Copy the full SHA
    2e0be2a View commit details
  17. uefi: Update changelog

    nicholasbishop committed Jul 15, 2024
    Copy the full SHA
    8bc7605 View commit details

Commits on Jul 16, 2024

  1. Merge pull request #1246 from nicholasbishop/bishop-tcg-new-boxed

    Add PcrEvent::new_in_box/PcrEventInputs::new_in_box
    phip1611 authored Jul 16, 2024
    Copy the full SHA
    1fa9408 View commit details

Commits on Jul 17, 2024

  1. boot: Always impl Drop for MemoryMapBackingMemory

    Gating this on `cfg(not(test))` isn't necessary; during unit tests
    `system_table_boot()` will return `None` and so the drop won't do anything
    anyway.
    
    Also fix a typo, excited -> exited.
    nicholasbishop committed Jul 17, 2024
    Copy the full SHA
    ccf9897 View commit details

Commits on Jul 19, 2024

  1. Add uefi::runtime module

    The initial version here just provides functions for getting and setting the
    system time. Later commits will add functions to get/set variables, handle
    update capsules, etc.
    
    Also added some tests for the new code in the test runner (note that there were
    no existing tests for the time-related functions of `RuntimeServices`).
    nicholasbishop committed Jul 19, 2024
    Copy the full SHA
    233a33a View commit details
  2. Merge pull request #1249 from nicholasbishop/bishop-runtime-mod-time

    Add uefi::runtime module
    phip1611 authored Jul 19, 2024
    Copy the full SHA
    9da5b55 View commit details
  3. data_types: impl Align for [u8]

    This will allow `make_boxed` to be used in `get_variable_boxed`.
    nicholasbishop committed Jul 19, 2024
    Copy the full SHA
    5d4a575 View commit details
  4. runtime: Add freestanding functions to get/set/delete UEFI variables

    The new version of `get_variable` returns the required size in the error data if
    the input buffer is too small. This allows `get_variable_boxed` to use
    `make_boxed`, and also makes `get_variable_size` unnecessary.
    
    Also added more info about errors to the docstrings.
    
    (Note: `variable_keys` function to come in a later commit.)
    nicholasbishop committed Jul 19, 2024
    Copy the full SHA
    55c99ad View commit details
  5. Copy the full SHA
    3fe8b6b View commit details

Commits on Jul 21, 2024

  1. Merge pull request #1250 from rust-osdev/bishop-runtime-mod-vars

    runtime: Add freestanding functions to get/set/delete UEFI variables
    phip1611 authored Jul 21, 2024
    Copy the full SHA
    23eb0e8 View commit details
Showing 319 changed files with 21,605 additions and 10,414 deletions.
5 changes: 3 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# If your shell has direnv support, it will automatically open a "nix-shell".
use nix
# If your shell has direnv support, it will automatically open a Nix shell with
# all relevant dependencies to develop this project.
use flake
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# If you are a frequent contributor to uefi-rs and would like to be featured in
# the sponsors section, please contact the maintainers.
github: phip1611
1 change: 1 addition & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: false
6 changes: 4 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"config:recommended",
"schedule:weekly"
],
"lockFileMaintenance": {
@@ -11,7 +11,9 @@
"rangeStrategy": "update-lockfile",
"packageRules": [
{
"matchPackageNames": ["crate-ci/typos"],
"matchPackageNames": [
"crate-ci/typos"
],
"automerge": true
}
]
39 changes: 24 additions & 15 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ name: Book
on:
push:
branches: [main]
tags: ['*']
permissions:
contents: write
# Adapted from:
@@ -21,24 +22,32 @@ jobs:
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Deploy GitHub Pages
run: |
cd book
mdbook build
git worktree add gh-pages gh-pages
# Configure git user so that `git commit` works.
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Get the highest `uefi` release tag.
highest_tag="$(git tag --list | grep uefi-v | sort -V | tail -1)"
# Create a worktree for the tag.
git worktree add wt-tag refs/tags/"${highest_tag}"
# Create a worktree for the `gh-pages` branch.
git worktree add wt-gh-pages gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
# Place the book under a "HEAD" directory so that we can later
# add other versions (e.g. "stable" or "v0.17") without breaking
# URLs.
rm -rf HEAD
mv ../book HEAD
git add HEAD
# Add an index in the root to redirect to HEAD. If we eventually
# serve multiple versions, this can be changed to a real index.
cp ../head_redirect.html index.html
git add index.html
git -C wt-gh-pages update-ref -d refs/heads/gh-pages
# Build the book for the tag. Don't use `--dest-dir` because it will
# delete the destination directory including the worktree checkout's
# ".git".
mdbook build wt-tag/book
# Copy output to the destination directory. Note the "/." is needed at
# the end of the source path so that hidden files are included.
cp -r wt-tag/book/book/. wt-gh-pages
# Commit and push.
cd wt-gh-pages
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force
21 changes: 9 additions & 12 deletions .github/workflows/developer_productivity.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ on:
push:
pull_request:
jobs:
# Job to run change detection
# Job to run change detection for Nix-related files
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step.
@@ -19,32 +19,29 @@ jobs:
filters: |
nix-src:
- 'nix/**'
- 'shell.nix'
- 'flake.nix'
- 'flake.lock'
# This is a convenience test to verify that the toolchain provided by
# shell.nix is valid and can build + run the integration test.
#
# It only runs if the "nix-src" output of the "changes" job is true.
nix_shell_toolchain:
name: "Nix toolchain: `cargo xtask run` works"
name: "Nix shell toolchain: `cargo xtask run` works"
needs: changes
if: ${{ needs.changes.outputs.nix-src == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: cachix/install-nix-action@v27
with:
# This channel is only required to invoke "nix-shell".
# Everything inside that nix-shell will use a pinned version of nixpkgs.
nix_path: nixpkgs=channel:nixos-23.05
- uses: cachix/install-nix-action@v31
# Dedicated step to separate all the
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
# messages from the actual build output. This job takes ~60secs.
# messages from the actual build output.
- name: Prepare Nix Store
run: nix-shell --pure --run "cargo --version"
run: nix develop --command bash -c "cargo --version"
- name: Run VM tests
run: |
COMMAND="cargo xtask run --target x86_64 --headless --ci --tpm=v1"
echo "Executing in nix shell: $COMMAND"
nix-shell --pure --run "$COMMAND"
echo "Executing in Nix shell: $COMMAND"
nix develop --command bash -c "$COMMAND"
3 changes: 0 additions & 3 deletions .github/workflows/msrv_toolchain.toml

This file was deleted.

36 changes: 34 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -3,8 +3,40 @@ on: [merge_group, push, pull_request]
jobs:
spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Executes "typos ."
- uses: crate-ci/typos@v1.22.9
- uses: crate-ci/typos@v1.34.0
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: Swatinem/rust-cache@v2
# Dedicated step to separate all the
# "copying path '/nix/store/...' from 'https://cache.nixos.org'."
# messages from the actual build output.
- name: Prepare Nix Store
run: nix develop --command echo
# A dedicated step removes spam from the actual job.
- name: Build cargo xtask
run: cargo xtask help >/dev/null
# Executing this in a Nix shell ensures that all our checks run as all
# required tooling exists.
- name: Check formatting
run: |
CMD="cargo xtask fmt --check"
nix develop --command bash -c "$CMD"
- name: Run clippy
run: |
rustup component add clippy
cargo xtask clippy --warnings-as-errors
- name: Run cargo doc (without unstable)
run: cargo xtask doc --warnings-as-errors --document-private-items
- name: Verify generated code is up-to-date
run: cargo xtask gen-code --check
- name: Run additional checks on the uefi-raw package
run: cargo xtask check-raw
110 changes: 74 additions & 36 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -13,10 +13,13 @@ on:
- cron: '0 0 * * 0-6'
env:
RUSTFLAGS: -D warnings
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test_aarch64:
name: Integration Test (AArch64)
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -44,7 +47,7 @@ jobs:
timeout-minutes: 4
test_ia32:
name: Integration Test (IA-32)
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -78,27 +81,6 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Run cargo test (without unstable)
run: cargo xtask test
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
run: |
rustup component add rustfmt
cargo fmt --all -- --check
- name: Run clippy
run: |
rustup component add clippy
cargo xtask clippy --warnings-as-errors
- name: Run cargo doc (without unstable)
run: cargo xtask doc --warnings-as-errors --document-private-items
- name: Verify generated code is up-to-date
run: cargo xtask gen-code --check
- name: Run additional checks on the uefi-raw package
run: cargo xtask check-raw
# Run the build with our current stable MSRV (specified in
# ./msrv_toolchain.toml). This serves to check that we don't
# accidentally start relying on a new feature without intending
@@ -111,23 +93,44 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set toolchain
run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml
run: |
# Extract the MSRV using cargo.
msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "uefi") | .rust_version')
echo "MSRV: ${msrv}"
# Set the MSRV in the toolchain config.
sed -i "s:stable:${msrv}:" rust-toolchain.toml
- uses: Swatinem/rust-cache@v2
- name: Build
# Build uefi-test-runner since its dependency tree includes all the
# library packages. Note that xtask isn't used or built here; since it's
# just a dev tool we don't care about the MSRV for that package.
run: cargo build --target x86_64-unknown-uefi -p uefi-test-runner
run: |
cargo --version
cargo build --target x86_64-unknown-uefi -p uefi-test-runner
# The uefi-raw crate has its own MSRV. Check that the crate builds correctly
# with that version of the toolchain.
build_msrv_raw:
name: Build (uefi-raw MSRV)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set toolchain
run: |
# Extract the MSRV using cargo.
msrv=$(cargo metadata --no-deps --format-version=1 | jq --raw-output '.packages[] | select(.name == "uefi-raw") | .rust_version')
echo "MSRV: ${msrv}"
# Set the MSRV in the toolchain config.
sed -i "s:stable:${msrv}:" rust-toolchain.toml
- name: Build
run: |
cargo --version
cargo build -p uefi-raw
# This job requires the nightly channel, but keep it as a separate job from
# `nightly_channel` because it takes a while to run.
build_feature_permutations:
name: Build (feature permutations)
runs-on: ubuntu-latest
env:
# TODO: temporarily allow warnings to not be errors on nightly due to
# incorrect dead_code lint.
# https://github.com/rust-osdev/uefi-rs/issues/1205
RUSTFLAGS: ""
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -136,14 +139,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo xtask build --feature-permutations
# Nightly + unstable feature
nightly_channel:
name: Build (nightly + unstable feature)
name: Nightly (build, test, doc)
runs-on: ubuntu-latest
env:
# TODO: temporarily allow warnings to not be errors on nightly due to
# incorrect dead_code lint.
# https://github.com/rust-osdev/uefi-rs/issues/1205
RUSTFLAGS: ""
steps:
- name: Checkout sources
uses: actions/checkout@v4
@@ -163,7 +162,46 @@ jobs:
# Skip testing uefi-macros on nightly because the tests that check the
# compiler error output produce different output on stable vs nightly.
run: cargo xtask test --unstable --skip-macro-tests
miri:
name: Unit + Doc Tests (Miri)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Enable nightly toolchain
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml
- uses: Swatinem/rust-cache@v2
- name: Run unit tests and doctests under Miri
run: |
rustup component add miri
cargo xtask miri
# Builds a Rust standard binary using the `std` impl for UEFI, rather than
# creating a `no_std` + `no_main` binary.
build_standard_uefi_binary:
name: Build Standard Binary (nightly)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set toolchain
run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --target x86_64-unknown-uefi --verbose -p uefi-std-example
coverage:
name: Test Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo xtask cov --lcov
- name: Upload code coverage
uses: codecov/codecov-action@v5.4.3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: target/lcov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@

# Integration test output by QEMU.
integration-test-debugcon.log
ovmf-firmware-debugcon.log
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -17,4 +17,6 @@ extend-ignore-identifiers-re = [
HD = "HD"

[default.extend-identifiers]
# We sometimes use "typ" as "type" is a reserved keyword
typ = "typ"

Loading