Skip to content

Commit

Permalink
Replace Make with Just
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd committed Nov 21, 2024
1 parent 59562e9 commit e4d3b02
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 63 deletions.
13 changes: 13 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[build]
target = "x86_64-unknown-uefi"

[target.x86_64-unknown-uefi]
rustflags = [
"-Clink-arg=/heap:0,0",
"-Clink-arg=/stack:0,0",
"-Clink-arg=/dll",
"-Clink-arg=/base:0",
"-Clink-arg=/align:32",
"-Clink-arg=/filealign:32",
"-Clink-arg=/subsystem:efi_boot_service_driver"
]
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: NONE

.gitattributes export-ignore
.gitignore export-ignore
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
branches: [master]
pull_request:

env:
FIRMWARE_OPEN_VBT: "../lemp9.vbt"

jobs:
build:
runs-on: ubuntu-24.04
Expand All @@ -12,10 +15,14 @@ jobs:

- name: Install dependencies
run: |
sudo apt install --yes make mtools parted
sudo apt install --no-install-recommends --assume-yes just rustup
rustup show
- name: Build UEFI application
env:
FIRMWARE_OPEN_VBT: "../lemp9.vbt"
run: make
- name: clippy
run: just clippy -- -D warnings

- name: fmt
run: just fmt --check

- name: build
run: just build --release
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
build
target
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: NONE

target/
vendor/
54 changes: 0 additions & 54 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion gop-policy.inf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
VERSION_STRING = 1.0

[Binaries.X64]
PE32|build/x86_64-unknown-uefi/boot.efi|*
PE32|target/x86_64-unknown-uefi/release/system76_gop_policy.efi|*
26 changes: 26 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: 2024 System76, Inc.

# List available recipes
@help:
just --list

# Build the project
@build *args='':
cargo build {{args}}

# Generate API documentation
@doc *args='':
cargo doc --workspace --document-private-items --no-deps {{args}}

# Run clippy
@clippy *args='':
cargo clippy --all-features {{args}}

# Run rustfmt
@fmt *args='':
cargo fmt --all {{args}}

# Remove build artifacts
@clean:
cargo clean
5 changes: 4 additions & 1 deletion src/gop_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ static VBT: &[u8] = include_bytes!(env!("FIRMWARE_OPEN_VBT"));
pub static GOP_POLICY_GUID: Guid = guid!("ec2e931b-3281-48a5-8107-df8a8bed3c5d");
pub const GOP_POLICY_REVISION: u32 = 0x03;

#[allow(clippy::enum_variant_names)]
#[allow(unused)]
#[repr(C)]
pub enum LidStatus {
Expand All @@ -17,6 +18,7 @@ pub enum LidStatus {
LidStatusMax,
}

#[allow(clippy::enum_variant_names)]
#[allow(unused)]
#[repr(C)]
pub enum DockStatus {
Expand Down Expand Up @@ -51,6 +53,7 @@ extern "win64" fn GetPlatformDockStatus(_CurrentDockStatus: DockStatus) -> Statu
Status::UNSUPPORTED
}

#[rustfmt::skip]
#[repr(C)]
pub struct GopPolicy {
pub Revision: u32,
Expand Down Expand Up @@ -80,7 +83,7 @@ impl GopPolicy {
&mut handle,
&GOP_POLICY_GUID,
InterfaceType::Native,
self_ptr as usize
self_ptr as usize,
))?;

//let _ = (uefi.BootServices.UninstallProtocolInterface)(handle, &GOP_POLICY_GUID, self_ptr as usize);
Expand Down

0 comments on commit e4d3b02

Please sign in to comment.