mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
allow non-zero exit cpupower frequency-info -g (#2523)
* set better governor hierarchy and add cli command to change * allow non-zero exit `cpupower frequency-info -g`
This commit is contained in:
@@ -39,13 +39,12 @@ impl std::borrow::Borrow<str> for Governor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_available_governors() -> Result<BTreeSet<Governor>, Error> {
|
pub async fn get_available_governors() -> Result<BTreeSet<Governor>, Error> {
|
||||||
let raw = String::from_utf8(
|
let raw = Command::new("cpupower")
|
||||||
Command::new("cpupower")
|
.arg("frequency-info")
|
||||||
.arg("frequency-info")
|
.arg("-g")
|
||||||
.arg("-g")
|
.invoke(ErrorKind::CpuSettings)
|
||||||
.invoke(ErrorKind::CpuSettings)
|
.await
|
||||||
.await?,
|
.map_or_else(|e| Ok(e.source.to_string()), String::from_utf8)?;
|
||||||
)?;
|
|
||||||
let mut for_cpu: OrdMap<u32, BTreeSet<Governor>> = OrdMap::new();
|
let mut for_cpu: OrdMap<u32, BTreeSet<Governor>> = OrdMap::new();
|
||||||
let mut current_cpu = None;
|
let mut current_cpu = None;
|
||||||
for line in raw.lines() {
|
for line in raw.lines() {
|
||||||
|
|||||||
Reference in New Issue
Block a user