Optionally run a command for chroot

This commit is contained in:
Roey Darwish Dror 2018-12-30 14:18:55 +02:00
parent 420756df61
commit 7b235aa9bc

View File

@ -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<String>,
}
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");