diff --git a/src/args.rs b/src/args.rs index 34b51ca..b61c4a2 100644 --- a/src/args.rs +++ b/src/args.rs @@ -7,6 +7,7 @@ pub fn get_args() -> clap::ArgMatches { command!("create-iso") .about("Create a new installation medium ISO") .arg(arg!(--without_gui "Create ISO with just terminal")) + .arg(arg!(--no_tmp "Create ISO on disk")) .arg(arg!(--kb_layout "Create ISO with this keyboard layout")) .arg(arg!(--kb_variant "Create ISO with this keyboard layout variant")) .arg(arg!(--install "Create ISO which automatically installs upon boot.")) diff --git a/src/create_iso.rs b/src/create_iso.rs index 14dd5b2..894542f 100644 --- a/src/create_iso.rs +++ b/src/create_iso.rs @@ -15,6 +15,7 @@ pub fn build_kxkbrc(layout: &str, variant: Option<&str>) -> String { pub fn create_iso( without_gui: bool, + no_tmp: bool, kb_layout: &str, kb_variant: Option<&str>, install: Option<&String>, @@ -59,9 +60,10 @@ pub fn create_iso( std::fs::create_dir_all("./work").unwrap(); - let mount_cmd = vec!["mount", "-t", "tmpfs", "-o", "size=10G", "tmpfs", "./work"]; - - run_command(&mount_cmd, None, false); + if !no_tmp { + let mount_cmd = vec!["mount", "-t", "tmpfs", "-o", "size=10G", "tmpfs", "./work"]; + run_command(&mount_cmd, None, false); + } let mkarchiso_cmd = vec!["mkarchiso", "-v", "-w", "./work", "-o", "./", "./iso"]; diff --git a/src/main.rs b/src/main.rs index f456913..d3b44e2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,13 +35,20 @@ fn main() { match args.subcommand() { Some(("create-iso", iso_args)) => { let without_gui = iso_args.get_flag("without_gui"); + let no_tmp = iso_args.get_flag("no_tmp"); let kb_layout_default = "us".to_string(); let kb_layout: &String = iso_args.get_one("kb_layout").unwrap_or(&kb_layout_default); let kb_variant: Option<&str> = iso_args.get_one("kb_variant").map(|x: &String| x.as_str()); let auto_install_config: Option<&String> = iso_args.get_one("install"); - create_iso(without_gui, kb_layout, kb_variant, auto_install_config); + create_iso( + without_gui, + no_tmp, + kb_layout, + kb_variant, + auto_install_config, + ); std::process::exit(0); } Some(("create-tar", _)) => {