From 7b235aa9bcdddf6c0f10742a0f4d74f81102dfe4 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Sun, 30 Dec 2018 14:18:55 +0200 Subject: [PATCH] Optionally run a command for chroot --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index e266c85..1bab420 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,6 +83,10 @@ struct ChrootCommand { /// Open an encrypted root partition #[structopt(short = "e", long = "encrypted-root")] encrypted_root: bool, + + /// Optional command to run + #[structopt()] + command: Vec, } fn fix_fstab(fstab: &str) -> String { @@ -293,6 +297,7 @@ fn chroot(command: ChrootCommand) -> Result<(), Error> { arch_chroot .execute() .arg(mount_point.path()) + .args(&command.command) .run(ErrorKind::Interactive)?; info!("Unmounting filesystems");