dont use crystalstrap anymore

axtloss/rework-partitioning
amy 3 years ago
parent a2173c7f9a
commit 4d121cf368

@ -2,6 +2,7 @@ use crate::internal::exec::*;
use crate::internal::*; use crate::internal::*;
pub fn install_base_packages() { pub fn install_base_packages() {
files::copy_file("/etc/pacman.conf", "/mnt/etc/pacman.conf");
install::install(vec![ install::install(vec![
"base", "base",
"linux", "linux",
@ -25,11 +26,13 @@ pub fn install_base_packages() {
pub fn genfstab() { pub fn genfstab() {
exec_eval( exec_eval(
exec_chroot( exec(
"bash", "genfstab",
vec![ vec![
String::from("-c"), String::from("-U"),
String::from("'genfstab -U /mnt >> /mnt/etc/fstab'"), String::from("/mnt"),
String::from(">>"),
String::from("/mnt/etc/fstab"),
], ],
), ),
"Generate fstab", "Generate fstab",

@ -14,6 +14,24 @@ pub fn create_file(path: &str) {
} }
} }
pub fn copy_file(path: &str, destpath: &str) {
let return_code = std::fs::copy(path, destpath);
match return_code {
Ok(_) => {
log(format!(
"[ \x1b[2;1;32mOK\x1b[0m ] Copy {} to {}",
path, destpath
));
}
Err(e) => {
crash(
format!("Copy {} to {}: Failed with error {}", path, destpath, e),
1,
);
}
}
}
pub fn append_file(path: &str, content: &str) -> std::io::Result<()> { pub fn append_file(path: &str, content: &str) -> std::io::Result<()> {
log(format!( log(format!(
"[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}", "[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}",

@ -3,8 +3,10 @@ use std::process::Command;
pub fn install(pkgs: Vec<&str>) { pub fn install(pkgs: Vec<&str>) {
exec_eval( exec_eval(
Command::new("crystalstrap") Command::new("pacstrap")
.arg("/mnt") .arg("/mnt")
.arg("-C")
.arg("/etc/pacman.conf")
.args(&pkgs) .args(&pkgs)
.status(), .status(),
format!("Install packages {}", pkgs.join(", ")).as_str(), format!("Install packages {}", pkgs.join(", ")).as_str(),

Loading…
Cancel
Save