Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Jan 30, 2024
2 parents 5e827ce + 7cb5fb4 commit 0e2a29a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions userspace/ksud/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ enum Module {

/// list all modules
List,

/// Shrink module image size
Shrink,
}

#[derive(clap::Subcommand, Debug)]
Expand Down Expand Up @@ -251,6 +254,7 @@ pub fn run() -> Result<()> {
Module::Enable { id } => module::enable_module(&id),
Module::Disable { id } => module::disable_module(&id),
Module::List => module::list_modules(),
Module::Shrink => module::shrink_image(),
}
}
Commands::Install => event::install(),
Expand Down
9 changes: 9 additions & 0 deletions userspace/ksud/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,3 +673,12 @@ pub fn list_modules() -> Result<()> {
println!("{}", serde_json::to_string_pretty(&modules)?);
Ok(())
}

pub fn shrink_image() -> Result<()> {
Command::new("resize2fs")
.arg("-M")
.arg(defs::MODULE_IMG)
.stdout(Stdio::piped())
.status()?;
Ok(())
}

0 comments on commit 0e2a29a

Please sign in to comment.