refactor
This commit is contained in:
parent
eabd898ccf
commit
f2b1a43f62
13 changed files with 453 additions and 390 deletions
53
src/install/first_boot.rs
Normal file
53
src/install/first_boot.rs
Normal file
|
@ -0,0 +1,53 @@
|
|||
// GENFSTAB
|
||||
|
||||
use crate::{config::GeneralConfig, run_command};
|
||||
|
||||
use super::{str_vec, uncomment_first_value_of};
|
||||
|
||||
pub fn genfstab() {
|
||||
let (stdout, _) = run_command(&str_vec(vec!["genfstab", "-U", "/mnt"]), None, false);
|
||||
std::fs::write("/mnt/etc/fstab", stdout).unwrap();
|
||||
}
|
||||
|
||||
pub fn first_boot_values(conf: &GeneralConfig) {
|
||||
// CHROOT
|
||||
run_command(
|
||||
&vec![
|
||||
"arch-chroot".into(),
|
||||
"/mnt".into(),
|
||||
"systemd-firstboot".into(),
|
||||
format!("--locale={}", conf.locale),
|
||||
format!("--keymap={}", conf.keymap),
|
||||
format!("--timezone={}", conf.timezone),
|
||||
format!("--hostname={}", conf.hostname),
|
||||
],
|
||||
None,
|
||||
false,
|
||||
);
|
||||
|
||||
// LOCALE
|
||||
uncomment_first_value_of(&conf.locale, "/mnt/etc/locale.gen");
|
||||
run_command(
|
||||
&str_vec(vec!["arch-chroot", "/mnt", "locale-gen"]),
|
||||
None,
|
||||
false,
|
||||
);
|
||||
|
||||
run_command(
|
||||
&str_vec(vec!["arch-chroot", "/mnt", "hwclock", "--systohc"]),
|
||||
None,
|
||||
false,
|
||||
);
|
||||
|
||||
run_command(
|
||||
&str_vec(vec![
|
||||
"arch-chroot",
|
||||
"/mnt",
|
||||
"systemctl",
|
||||
"enable",
|
||||
"NetworkManager.service",
|
||||
]),
|
||||
None,
|
||||
false,
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue