it works :D

axtloss/rework-partitioning
axtlos 3 years ago
parent d6923ae6b6
commit 0d50ec605d

@ -93,6 +93,7 @@ pub fn fmt_mount(mountpoint: &str, filesystem: &str, blockdevice: &str) {
exec( exec(
"mkfs.btrfs", "mkfs.btrfs",
vec![ vec![
String::from("-f"),
String::from(blockdevice), String::from(blockdevice),
], ],
), ),

@ -59,11 +59,21 @@ pub fn remount(root: &str, oldroot: &str, efi: bool, efidir: &str, bootdev: &str
exec_eval( exec_eval(
exec( exec(
"umount", "umount",
vec![String::from("/")], vec![String::from(oldroot)],
), ),
"Unmount old root", "Unmount old root",
); );
mount(root, "/", ""); mount(root, "/mnt", "");
exec_eval(
exec(
"mkdir",
vec![
String::from("-p"),
String::from(efidir),
],
),
format!("Creating mountpoint {efidir} for {bootdev}").as_str(),
);
mount(bootdev, efidir, ""); mount(bootdev, efidir, "");
} else if efi && !firstrun { } else if efi && !firstrun {
exec_eval( exec_eval(
@ -76,11 +86,11 @@ pub fn remount(root: &str, oldroot: &str, efi: bool, efidir: &str, bootdev: &str
exec_eval( exec_eval(
exec( exec(
"umount", "umount",
vec![String::from("/")], vec![String::from(root)],
), ),
"Unmount unakite root", "Unmount unakite root",
); );
mount(root, "/", ""); mount(oldroot, "/mnt", "");
mount(bootdev, efidir, ""); mount(bootdev, efidir, "");
} else if !efi && firstrun { } else if !efi && firstrun {
exec_eval( exec_eval(
@ -93,12 +103,22 @@ pub fn remount(root: &str, oldroot: &str, efi: bool, efidir: &str, bootdev: &str
exec_eval( exec_eval(
exec( exec(
"umount", "umount",
vec![String::from("/")], vec![String::from(oldroot)],
), ),
"Unmount old root", "Unmount old root",
); );
mount(root, "/", ""); mount(root, "/mnt", "");
mount(bootdev, "/boot", ""); exec_eval(
exec(
"mkdir",
vec![
String::from("-p"),
String::from("/mnt/boot"),
],
),
format!("Creating mountpoint /boot for {bootdev}").as_str(),
);
mount(bootdev, "/mnt/boot", "");
} else if !efi && !firstrun { } else if !efi && !firstrun {
exec_eval( exec_eval(
exec( exec(
@ -110,12 +130,12 @@ pub fn remount(root: &str, oldroot: &str, efi: bool, efidir: &str, bootdev: &str
exec_eval( exec_eval(
exec( exec(
"umount", "umount",
vec![String::from("/")], vec![String::from(root)],
), ),
"Unmount unakite root", "Unmount unakite root",
); );
mount(oldroot, "/", ""); mount(oldroot, "/mnt", "");
mount(bootdev, "/boot", ""); mount(bootdev, "/mnt/boot", "");
} else { } else {
panic!("Unknown state"); panic!("Unknown state");
} }
@ -127,9 +147,9 @@ pub fn setup_unakite(root: &str, oldroot: &str, efi: bool, efidir: &str, bootdev
base::install_base_packages(); base::install_base_packages();
base::genfstab(); base::genfstab();
if efi { if efi {
install_bootloader_efi(PathBuf::from(efidir)); install_bootloader_efi(PathBuf::from(efidir.replace("/mnt", "")));
} }
locale::set_locale("".to_string()); locale::set_locale("en_US.UTF-8 UTF-8".to_string());
locale::set_timezone("Europe/Berlin"); // TODO: get the proper timezone locale::set_timezone("Europe/Berlin"); // TODO: get the proper timezone
network::set_hostname("unakite"); network::set_hostname("unakite");
network::create_hosts(); network::create_hosts();

Loading…
Cancel
Save