feat: support auto-cpufreq (#800)

This commit is contained in:
SteveLauC
2024-05-18 16:34:03 +08:00
committed by GitHub
parent 2a1999fe20
commit f661f00277
3 changed files with 15 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ pub enum Step {
Asdf,
Atom,
Audit,
AutoCpufreq,
Bin,
Bob,
BrewCask,

View File

@@ -235,6 +235,7 @@ fn run() -> Result<()> {
})?;
runner.execute(Step::Lure, "LURE", || linux::run_lure_update(&ctx))?;
runner.execute(Step::Waydroid, "Waydroid", || linux::run_waydroid(&ctx))?;
runner.execute(Step::AutoCpufreq, "auto-cpufreq", || linux::run_auto_cpufreq(&ctx))?;
}
#[cfg(target_os = "macos")]

View File

@@ -1062,6 +1062,19 @@ pub fn run_waydroid(ctx: &ExecutionContext) -> Result<()> {
.status_checked()
}
pub fn run_auto_cpufreq(ctx: &ExecutionContext) -> Result<()> {
let sudo = require_option(ctx.sudo().as_ref(), REQUIRE_SUDO.to_string())?;
let auto_cpu_freq = require("auto-cpufreq")?;
print_separator("auto-cpufreq");
ctx.run_type()
.execute(sudo)
.arg(auto_cpu_freq)
.arg("--update")
.status_checked()
}
#[cfg(test)]
mod tests {
use super::*;