Skip to content

Commit

Permalink
refactor: change "efiboot" tool name to "efivarcli"
Browse files Browse the repository at this point in the history
  • Loading branch information
iTrooz committed Jan 16, 2024
1 parent b364785 commit cf1fbd7
Show file tree
Hide file tree
Showing 41 changed files with 88 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"assets": [
"CHANGELOG.md",
"Cargo.lock",
"efiboot/Cargo.toml",
"efivarcli/Cargo.toml",
"efivar/Cargo.toml",
"efivar/src/lib.rs"
],
Expand Down
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = [
"efiboot",
"efivarcli",
"efivar"
]

Expand Down
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if is_windows
suffix = set ".exe"
end
target_binary_name = set efiboot
target_binary_name = set efivarcli
target_binary = set "target/release/${target_binary_name}${suffix}"
mkdir ${output_dir}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This repository contains the source code for:
* [![crates.io](https://img.shields.io/crates/v/efivar.svg)](https://crates.io/crates/efivar) [efivar](efivar) - A Rust crate to read and write EFI variables
* [![crates.io](https://img.shields.io/crates/v/efiboot.svg)](https://crates.io/crates/efiboot) [efiboot](efiboot) - A command-line tool to manage the UEFI boot manager

The efiboot tool supports both Windows and Linux:
The efivarcli tool supports both Windows and Linux:

* Windows: administrative rights are required to both *read* and *write* variables.
* Linux: the efivar filesystem should be mounted at /sys/firmware/efi/efivars on all major
Expand Down
2 changes: 1 addition & 1 deletion efivar/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# efivar

efivar is a Rust crate for manipulating EFI variables using the OS interface.
This crate is mainly used by [efiboot](../efiboot) to implement its
This crate is mainly used by [efivarcli](../efivarcli) to implement its
functionality.

## Author
Expand Down
2 changes: 1 addition & 1 deletion efivar/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! efivar is a crate for manipulating EFI variables using the OS interface. This crate is mainly
//! used by `efiboot` to implement its functionality.
//! used by `efivarcli` to implement its functionality.
//!
//! On Linux, it is assumed that efivarfs is mounted and available at /sys/firmware/efi/efivars,
//! which should be the default nowadays on all major distros.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion efiboot/Cargo.toml → efivarcli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "efiboot"
name = "efivarcli"
version = "1.4.0"
authors = ["Vincent Tavernier <[email protected]>", "iTrooz <[email protected]>"]
license = "MIT"
Expand Down
6 changes: 4 additions & 2 deletions efiboot/README.md → efivarcli/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# efiboot
# efivarcli

efiboot is a Rust crate that provides the `efiboot` utility, a command-line tool
efivarcli is a Rust crate that provides the `efivarcli` utility, a command-line tool
to manage EFI variables related to UEFI boot manager operation.

## Author

iTrooz

Vincent Tavernier <[email protected]>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn run(manager: &mut dyn VarManager, cmd: BootNextCommand) -> ExitCode {
.attributes
.contains(BootEntryAttributes::LOAD_OPTION_ACTIVE)
{
eprintln!("Warning: boot entry is not active, and may not boot. Enable it with `efiboot boot enable {id:04X}`");
eprintln!("Warning: boot entry is not active, and may not boot. Enable it with `efivarcli boot enable {id:04X}`");
}

manager
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod tests;

#[derive(Parser)]
pub enum OrderCommand {
/// Get current boot order IDs. See `efiboot boot get-entries` to get boot entries information
/// Get current boot order IDs. See `efivarcli boot get-entries` to get boot entries information
Get,
/// Adds an id to the boot order
Add {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn run(manager: &mut dyn VarManager, id: u16, force: bool) -> ExitCode {

if manager.read(&Variable::new(&id.boot_var_name())).is_ok() && !force {
eprintln!("Warning: A variable with the name {} exists. Deleting its id from the boot order won't delete it.\n\
Use `efiboot boot del {id:04X}` instead.\n\
Use `efivarcli boot del {id:04X}` instead.\n\
Pass argument --force to skip this warning", id.boot_var_name());
return ExitCode::FAILURE;
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn get_order() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "order", "get"]),
Command::parse_from(["efivarcli", "boot", "order", "get"]),
manager,
)
);
Expand All @@ -41,7 +41,16 @@ fn set_order() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "order", "set", "0001", "2", "1000", "500"]),
Command::parse_from([
"efivarcli",
"boot",
"order",
"set",
"0001",
"2",
"1000",
"500"
]),
manager,
)
);
Expand All @@ -66,15 +75,15 @@ fn add_to_order() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "order", "add", "1", "--position", "0"]),
Command::parse_from(["efivarcli", "boot", "order", "add", "1", "--position", "0"]),
manager,
)
);

assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "order", "add", "500"]),
Command::parse_from(["efivarcli", "boot", "order", "add", "500"]),
manager,
)
);
Expand All @@ -99,7 +108,7 @@ fn remove_from_order() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "order", "remove", "1000"]),
Command::parse_from(["efivarcli", "boot", "order", "remove", "1000"]),
manager,
)
);
Expand All @@ -124,7 +133,7 @@ fn remove_inexistent_from_order() {
assert_eq!(
ExitCode::FAILURE,
crate::run(
Command::parse_from(["efiboot", "boot", "order", "remove", "2000"]),
Command::parse_from(["efivarcli", "boot", "order", "remove", "2000"]),
manager,
)
);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ use crate::{

#[test]
fn add() {
//! Test that the basic `efiboot boot add` subcommand works.
//! Test that the basic `efivarcli boot add` subcommand works.
//! Note: we are using the current partition, not specifying one

let manager = &mut MemoryStore::new();

let setup_entry = standard_setup(manager, 0x0001);

// execute `efiboot boot add`
// execute `efivarcli boot add`
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from([
"efiboot",
"efivarcli",
"boot",
"add",
"--file",
Expand Down Expand Up @@ -63,18 +63,18 @@ fn add() {

#[test]
fn add_set_id() {
//! Use `efiboot boot add` with a given entry ID.
//! Use `efivarcli boot add` with a given entry ID.

let manager = &mut MemoryStore::new();

let setup_entry = standard_setup(manager, 0x0001);

// execute `efiboot boot add`
// execute `efivarcli boot add`
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from([
"efiboot",
"efivarcli",
"boot",
"add",
"--file",
Expand Down Expand Up @@ -116,18 +116,18 @@ fn add_set_id() {

#[test]
fn add_verify_file_path_fix() {
//! Use `efiboot boot add` with a given entry ID.
//! Use `efivarcli boot add` with a given entry ID.

let manager = &mut MemoryStore::new();

let setup_entry = standard_setup(manager, 0x0001);

// execute `efiboot boot add`
// execute `efivarcli boot add`
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from([
"efiboot",
"efivarcli",
"boot",
"add",
"--file",
Expand Down Expand Up @@ -181,12 +181,12 @@ fn add_on_existing() {
.unwrap()
.to_owned();

// execute `efiboot boot add`
// execute `efivarcli boot add`
assert_eq!(
ExitCode::FAILURE,
crate::run(
Command::parse_from([
"efiboot",
"efivarcli",
"boot",
"add",
"--file",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn delete() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "delete", "1"]),
Command::parse_from(["efivarcli", "boot", "delete", "1"]),
manager,
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn enable() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "enable", "0001",]),
Command::parse_from(["efivarcli", "boot", "enable", "0001",]),
manager,
)
);
Expand All @@ -40,7 +40,7 @@ fn enable_enabled() {
assert_eq!(
ExitCode::FAILURE,
crate::run(
Command::parse_from(["efiboot", "boot", "enable", "0001",]),
Command::parse_from(["efivarcli", "boot", "enable", "0001",]),
manager,
)
);
Expand All @@ -61,7 +61,7 @@ fn disable() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "disable", "0001",]),
Command::parse_from(["efivarcli", "boot", "disable", "0001",]),
manager,
)
);
Expand All @@ -82,7 +82,7 @@ fn disable_disabled() {
assert_eq!(
ExitCode::FAILURE,
crate::run(
Command::parse_from(["efiboot", "boot", "disable", "0001",]),
Command::parse_from(["efivarcli", "boot", "disable", "0001",]),
manager,
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn get_entries() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "get-entries"]),
Command::parse_from(["efivarcli", "boot", "get-entries"]),
manager,
)
);
Expand All @@ -33,7 +33,7 @@ fn get_entries_verbose() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "get-entries", "-v"]),
Command::parse_from(["efivarcli", "boot", "get-entries", "-v"]),
manager,
)
);
Expand All @@ -49,7 +49,7 @@ fn get_entries_not_in_bootorder() {
assert_eq!(
ExitCode::SUCCESS,
crate::run(
Command::parse_from(["efiboot", "boot", "get-entries"]),
Command::parse_from(["efivarcli", "boot", "get-entries"]),
manager,
)
);
Expand Down
File renamed without changes.
Loading

0 comments on commit cf1fbd7

Please sign in to comment.