mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 23:19:29 +02:00
Optionally run a command for chroot
This commit is contained in:
parent
420756df61
commit
7b235aa9bc
@ -83,6 +83,10 @@ struct ChrootCommand {
|
|||||||
/// Open an encrypted root partition
|
/// Open an encrypted root partition
|
||||||
#[structopt(short = "e", long = "encrypted-root")]
|
#[structopt(short = "e", long = "encrypted-root")]
|
||||||
encrypted_root: bool,
|
encrypted_root: bool,
|
||||||
|
|
||||||
|
/// Optional command to run
|
||||||
|
#[structopt()]
|
||||||
|
command: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fix_fstab(fstab: &str) -> String {
|
fn fix_fstab(fstab: &str) -> String {
|
||||||
@ -293,6 +297,7 @@ fn chroot(command: ChrootCommand) -> Result<(), Error> {
|
|||||||
arch_chroot
|
arch_chroot
|
||||||
.execute()
|
.execute()
|
||||||
.arg(mount_point.path())
|
.arg(mount_point.path())
|
||||||
|
.args(&command.command)
|
||||||
.run(ErrorKind::Interactive)?;
|
.run(ErrorKind::Interactive)?;
|
||||||
|
|
||||||
info!("Unmounting filesystems");
|
info!("Unmounting filesystems");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user