|
|
@ -62,7 +62,6 @@ struct Unakite {
|
|
|
|
oldroot: String,
|
|
|
|
oldroot: String,
|
|
|
|
efidir: String,
|
|
|
|
efidir: String,
|
|
|
|
bootdev: String,
|
|
|
|
bootdev: String,
|
|
|
|
kernel: String,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn read_config(configpath: PathBuf) {
|
|
|
|
pub fn read_config(configpath: PathBuf) {
|
|
|
@ -108,8 +107,7 @@ pub fn read_config(configpath: PathBuf) {
|
|
|
|
&mut partitions,
|
|
|
|
&mut partitions,
|
|
|
|
config.unakite.enable
|
|
|
|
config.unakite.enable
|
|
|
|
);
|
|
|
|
);
|
|
|
|
let kerneltype = config.unakite.kernel.clone(); // Implemented because the borrow checker doesn't allow passing the value itself to the function
|
|
|
|
base::install_base_packages(kernel);
|
|
|
|
base::install_base_packages(kerneltype);
|
|
|
|
|
|
|
|
base::genfstab();
|
|
|
|
base::genfstab();
|
|
|
|
println!();
|
|
|
|
println!();
|
|
|
|
log::info!("Installing bootloader : {}", config.bootloader.r#type);
|
|
|
|
log::info!("Installing bootloader : {}", config.bootloader.r#type);
|
|
|
@ -186,18 +184,18 @@ pub fn read_config(configpath: PathBuf) {
|
|
|
|
log::info!("Setup unakite");
|
|
|
|
log::info!("Setup unakite");
|
|
|
|
if config.partition.mode == PartitionMode::Auto && !config.partition.efi && config.unakite.enable && !config.partition.device.to_string().contains("nvme") {
|
|
|
|
if config.partition.mode == PartitionMode::Auto && !config.partition.efi && config.unakite.enable && !config.partition.device.to_string().contains("nvme") {
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
unakite::setup_unakite(format!("{}2",root.to_str().unwrap()).as_str(), format!("{}3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot", format!("{}1",root.to_str().unwrap()).as_str(), &config.unakite.kernel)
|
|
|
|
unakite::setup_unakite(format!("{}2",root.to_str().unwrap()).as_str(), format!("{}3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot", format!("{}1",root.to_str().unwrap()).as_str())
|
|
|
|
} else if config.partition.mode == PartitionMode::Auto && config.partition.efi && config.unakite.enable && !config.partition.device.to_string().contains("nvme") {
|
|
|
|
} else if config.partition.mode == PartitionMode::Auto && config.partition.efi && config.unakite.enable && !config.partition.device.to_string().contains("nvme") {
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
unakite::setup_unakite(format!("{}2",root.to_str().unwrap()).as_str(), format!("{}3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot/efi", format!("{}1",root.to_str().unwrap()).as_str(), &config.unakite.kernel)
|
|
|
|
unakite::setup_unakite(format!("{}2",root.to_str().unwrap()).as_str(), format!("{}3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot/efi", format!("{}1",root.to_str().unwrap()).as_str())
|
|
|
|
} else if config.unakite.enable {
|
|
|
|
} else if config.unakite.enable {
|
|
|
|
unakite::setup_unakite(&config.unakite.root, &config.unakite.oldroot, config.partition.efi, &config.unakite.efidir, &config.unakite.bootdev, &config.unakite.kernel);
|
|
|
|
unakite::setup_unakite(&config.unakite.root, &config.unakite.oldroot, config.partition.efi, &config.unakite.efidir, &config.unakite.bootdev);
|
|
|
|
} else if config.partition.mode == PartitionMode::Auto && config.partition.efi && config.unakite.enable && config.partition.device.to_string().contains("nvme") {
|
|
|
|
} else if config.partition.mode == PartitionMode::Auto && config.partition.efi && config.unakite.enable && config.partition.device.to_string().contains("nvme") {
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
unakite::setup_unakite(format!("{}p2",root.to_str().unwrap()).as_str(), format!("{}p3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot/efi", format!("{}p1",root.to_str().unwrap()).as_str(), &config.unakite.kernel)
|
|
|
|
unakite::setup_unakite(format!("{}p2",root.to_str().unwrap()).as_str(), format!("{}p3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot/efi", format!("{}p1",root.to_str().unwrap()).as_str())
|
|
|
|
} else if config.partition.mode == PartitionMode::Auto && !config.partition.efi && config.unakite.enable && config.partition.device.to_string().contains("nvme") {
|
|
|
|
} else if config.partition.mode == PartitionMode::Auto && !config.partition.efi && config.unakite.enable && config.partition.device.to_string().contains("nvme") {
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
let root = PathBuf::from("/dev/").join(config.partition.device.as_str());
|
|
|
|
unakite::setup_unakite(format!("{}p2",root.to_str().unwrap()).as_str(), format!("{}p3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot", format!("{}p1",root.to_str().unwrap()).as_str(), &config.unakite.kernel)
|
|
|
|
unakite::setup_unakite(format!("{}p2",root.to_str().unwrap()).as_str(), format!("{}p3",root.to_str().unwrap()).as_str(), config.partition.efi, "/boot", format!("{}p1",root.to_str().unwrap()).as_str())
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log::info!("Unakite disabled");
|
|
|
|
log::info!("Unakite disabled");
|
|
|
|
}
|
|
|
|
}
|
|
|
|