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::*;
pub fn install_base_packages() {
files::copy_file("/etc/pacman.conf", "/mnt/etc/pacman.conf");
install::install(vec![
"base",
"linux",
@ -25,11 +26,13 @@ pub fn install_base_packages() {
pub fn genfstab() {
exec_eval(
exec_chroot(
"bash",
exec(
"genfstab",
vec![
String::from("-c"),
String::from("'genfstab -U /mnt >> /mnt/etc/fstab'"),
String::from("-U"),
String::from("/mnt"),
String::from(">>"),
String::from("/mnt/etc/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<()> {
log(format!(
"[ \x1b[2;1;32mOK\x1b[0m ] Append '{}' to file {}",

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

Loading…
Cancel
Save