|
|
@ -90,46 +90,60 @@ pub fn read_config(configpath: &str) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let config: Config = config.unwrap();
|
|
|
|
let config: Config = config.unwrap();
|
|
|
|
|
|
|
|
|
|
|
|
println!("---------Setup Partitions---------");
|
|
|
|
info(format!(
|
|
|
|
println!("{}", config.partition.device);
|
|
|
|
"Block device to use : /dev/{}",
|
|
|
|
println!("{}", config.partition.mode);
|
|
|
|
config.partition.device
|
|
|
|
println!("{}", config.partition.efi);
|
|
|
|
));
|
|
|
|
|
|
|
|
info(format!("Partitioning mode : {}", config.partition.mode));
|
|
|
|
|
|
|
|
info(format!("Partitioning for EFI : {}", config.partition.efi));
|
|
|
|
partition::partition(
|
|
|
|
partition::partition(
|
|
|
|
config.partition.device.as_str(),
|
|
|
|
format!("/dev/{}", config.partition.device).as_str(),
|
|
|
|
config.partition.mode.as_str(),
|
|
|
|
config.partition.mode.as_str(),
|
|
|
|
config.partition.efi,
|
|
|
|
config.partition.efi,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
base::install_base_packages();
|
|
|
|
base::install_base_packages();
|
|
|
|
base::genfstab();
|
|
|
|
base::genfstab();
|
|
|
|
println!("---------Install Bootloader---------");
|
|
|
|
println!();
|
|
|
|
println!("{}", config.bootloader.r#type);
|
|
|
|
info(format!(
|
|
|
|
println!("{}", config.bootloader.location);
|
|
|
|
"Installing bootloader : {}",
|
|
|
|
|
|
|
|
config.bootloader.r#type
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
info(format!(
|
|
|
|
|
|
|
|
"Installing bootloader to : {}",
|
|
|
|
|
|
|
|
config.bootloader.location
|
|
|
|
|
|
|
|
));
|
|
|
|
if config.bootloader.r#type == "grub-efi" {
|
|
|
|
if config.bootloader.r#type == "grub-efi" {
|
|
|
|
base::install_bootloader_efi(config.bootloader.location.as_str());
|
|
|
|
base::install_bootloader_efi(config.bootloader.location.as_str());
|
|
|
|
} else if config.bootloader.r#type == "grub-legacy" {
|
|
|
|
} else if config.bootloader.r#type == "grub-legacy" {
|
|
|
|
base::install_bootloader_legacy(config.bootloader.location.as_str());
|
|
|
|
base::install_bootloader_legacy(config.bootloader.location.as_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println!("---------Set Locale---------");
|
|
|
|
println!();
|
|
|
|
println!("{:?}", config.locale.locale);
|
|
|
|
info(format!("Adding Locales : {:?}", config.locale.locale));
|
|
|
|
println!("{}", config.locale.keymap);
|
|
|
|
info(format!("Using keymap : {}", config.locale.keymap));
|
|
|
|
println!("{}", config.locale.timezone);
|
|
|
|
info(format!("Setting timezone : {}", config.locale.timezone));
|
|
|
|
locale::set_locale(config.locale.locale.join(" "));
|
|
|
|
locale::set_locale(config.locale.locale.join(" "));
|
|
|
|
locale::set_keyboard(config.locale.keymap.as_str());
|
|
|
|
locale::set_keyboard(config.locale.keymap.as_str());
|
|
|
|
locale::set_timezone(config.locale.timezone.as_str());
|
|
|
|
locale::set_timezone(config.locale.timezone.as_str());
|
|
|
|
println!("---------Set Networking---------");
|
|
|
|
println!();
|
|
|
|
println!("{}", config.networking.hostname);
|
|
|
|
info(format!("Hostname : {}", config.networking.hostname));
|
|
|
|
println!("{}", config.networking.ipv6);
|
|
|
|
info(format!("Enabling ipv6 : {}", config.networking.ipv6));
|
|
|
|
network::set_hostname(config.networking.hostname.as_str());
|
|
|
|
network::set_hostname(config.networking.hostname.as_str());
|
|
|
|
network::create_hosts();
|
|
|
|
network::create_hosts();
|
|
|
|
if config.networking.ipv6 {
|
|
|
|
if config.networking.ipv6 {
|
|
|
|
network::enable_ipv6();
|
|
|
|
network::enable_ipv6();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println!("---------Create Users---------");
|
|
|
|
println!();
|
|
|
|
println!("---------");
|
|
|
|
println!("---------");
|
|
|
|
for i in 0..config.users.len() {
|
|
|
|
for i in 0..config.users.len() {
|
|
|
|
println!("{}", config.users[i].name);
|
|
|
|
info(format!("Creating user : {}", config.users[i].name));
|
|
|
|
println!("{}", config.users[i].password);
|
|
|
|
info(format!(
|
|
|
|
println!("{}", config.users[i].hasroot);
|
|
|
|
"Setting use password : {}",
|
|
|
|
|
|
|
|
config.users[i].password
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
info(format!(
|
|
|
|
|
|
|
|
"Enabling root for user : {}",
|
|
|
|
|
|
|
|
config.users[i].hasroot
|
|
|
|
|
|
|
|
));
|
|
|
|
users::new_user(
|
|
|
|
users::new_user(
|
|
|
|
config.users[i].name.as_str(),
|
|
|
|
config.users[i].name.as_str(),
|
|
|
|
config.users[i].hasroot,
|
|
|
|
config.users[i].hasroot,
|
|
|
@ -137,19 +151,20 @@ pub fn read_config(configpath: &str) {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
println!("---------");
|
|
|
|
println!("---------");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println!("---------Set Rootpass---------");
|
|
|
|
println!();
|
|
|
|
println!("{}", config.rootpass);
|
|
|
|
info(format!("Setting root password : {}", config.rootpass));
|
|
|
|
users::root_pass(config.rootpass.as_str());
|
|
|
|
users::root_pass(config.rootpass.as_str());
|
|
|
|
println!("---------Install Desktop---------");
|
|
|
|
println!();
|
|
|
|
println!("{}", config.desktop);
|
|
|
|
info(format!("Installing desktop : {}", config.desktop));
|
|
|
|
|
|
|
|
if config.desktop == "none" || config.desktop.is_empty() {
|
|
|
|
desktops::choose_pkgs(config.desktop.as_str());
|
|
|
|
desktops::choose_pkgs(config.desktop.as_str());
|
|
|
|
println!("---------Setup Timeshift---------");
|
|
|
|
}
|
|
|
|
println!("{}", config.timeshift);
|
|
|
|
println!();
|
|
|
|
|
|
|
|
info(format!("Enabling timeshift : {}", config.timeshift));
|
|
|
|
if config.timeshift {
|
|
|
|
if config.timeshift {
|
|
|
|
base::setup_timeshift();
|
|
|
|
base::setup_timeshift();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
println!("---------Install Extra packages---------");
|
|
|
|
info(format!("Extra packages : {:?}", config.extra_packages));
|
|
|
|
println!("{:?}", config.extra_packages);
|
|
|
|
|
|
|
|
let mut extra_packages: Vec<&str> = Vec::new();
|
|
|
|
let mut extra_packages: Vec<&str> = Vec::new();
|
|
|
|
for i in 0..config.extra_packages.len() {
|
|
|
|
for i in 0..config.extra_packages.len() {
|
|
|
|
extra_packages.push(config.extra_packages[i].as_str());
|
|
|
|
extra_packages.push(config.extra_packages[i].as_str());
|
|
|
|