actually use the genfstab function

axtloss/rework-partitioning
amy 3 years ago
parent c0eef77d11
commit 533b9e7cb1

@ -13,7 +13,13 @@ pub fn choose_pkgs(desktop_setup: &str) {
]); ]);
} }
"gnome" => { "gnome" => {
install(vec!["xorg", "gnome", "gnome-tweaks", "chrome-gnome-shell", "gdm",]); install(vec![
"xorg",
"gnome",
"gnome-tweaks",
"chrome-gnome-shell",
"gdm",
]);
} }
"kde" => { "kde" => {
install(vec![ install(vec![

@ -309,16 +309,9 @@ fn mount(partition: &str, mountpoint: &str, options: &str) {
exec_eval( exec_eval(
exec( exec(
"mount", "mount",
vec![ vec![String::from(partition), String::from(mountpoint)],
String::from(partition),
String::from(mountpoint),
],
), ),
format!( format!("mount {} with no options at {}", partition, mountpoint).as_str(),
"mount {} with no options at {}",
partition, mountpoint
)
.as_str(),
); );
} }
} }

@ -15,7 +15,11 @@ pub fn create_file(path: &str) {
} }
pub fn append_file(path: &str, content: &str) -> std::io::Result<()> { pub fn append_file(path: &str, content: &str) -> std::io::Result<()> {
log(format!("[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}", content.replace("\n", ""), path)); log(format!(
"[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}",
content.replace("\n", ""),
path
));
let mut file = OpenOptions::new().append(true).open(path)?; let mut file = OpenOptions::new().append(true).open(path)?;
file.write_all(content.as_bytes())?; file.write_all(content.as_bytes())?;
Ok(()) Ok(())

@ -1,9 +1,12 @@
use std::process::Command;
use crate::internal::*; use crate::internal::*;
use std::process::Command;
pub fn install(pkgs: Vec<&str>) { pub fn install(pkgs: Vec<&str>) {
exec_eval(Command::new("crystalstrap") exec_eval(
.arg("/mnt") Command::new("crystalstrap")
.args(&pkgs) .arg("/mnt")
.status(), format!("Install packages {}", pkgs.join(", ")).as_str()); .args(&pkgs)
.status(),
format!("Install packages {}", pkgs.join(", ")).as_str(),
);
} }

@ -2,7 +2,7 @@ use crate::internal::*;
pub fn exec_eval( pub fn exec_eval(
return_code: std::result::Result<std::process::ExitStatus, std::io::Error>, return_code: std::result::Result<std::process::ExitStatus, std::io::Error>,
logmsg: &str logmsg: &str,
) { ) {
match &return_code { match &return_code {
Ok(_) => { Ok(_) => {

@ -193,6 +193,8 @@ fn main() {
} }
} else if app.subcommand_matches("install-base").is_some() { } else if app.subcommand_matches("install-base").is_some() {
base::install_base_packages(); base::install_base_packages();
} else if app.subcommand_matches("install-base").is_some() {
base::genfstab();
} else { } else {
println!("Running TUI installer"); println!("Running TUI installer");
} }

Loading…
Cancel
Save