More work on install stage

This commit is contained in:
kira committed 2026-11-20 17:12:56 +01:00
1 parent 841090d3d6
commit 7e72abb528
1 file changed
+16 -6
+16 -6
View File
@@ -38,9 +38,11 @@ use iced::{Color, Length, futures::channel::mpsc::Sender, widget::container};
use log; use log;
use rust_i18n::t; use rust_i18n::t;
const EFI_BOOT_MOUNT_POINT: &str = "/beefi"; const EFI_BOOT_MOUNT_POINT: &str = "/mnt/inst_root/beefi";
const MNT_DIR: &str = "/mnt/inst_root"; const MNT_DIR: &str = "/mnt/inst_root";
const ROOT_PARTLABEL_DEV: &str = "/dev/disk/by-partlabel/bee-root"; const ROOT_PARTLABEL_DEV: &str = "/dev/disk/by-partlabel/bee-root";
const EFI_PARTLABLE_DEV: &str = "/dev/disk/by-partlabel/bee-efi";
const SWAP_PARTLABLE_DEV: &str = "/dev/disk/by-partlabel/bee-swap";
/// ///
/// List of packages for desktop (elogind-dinit no need for headles system) /// List of packages for desktop (elogind-dinit no need for headles system)
/// ///
@@ -93,7 +95,7 @@ const PKG_LIST_CORE_DESKTOP: [&str; 19] = [
// const PKG_LIST_MEDIA_DESKTOP: [&str; 4] = ["ffmpeg", "ffmpeg4.4", "strawberry", "mpv"]; // const PKG_LIST_MEDIA_DESKTOP: [&str; 4] = ["ffmpeg", "ffmpeg4.4", "strawberry", "mpv"];
const PKG_LIST_KDE_DESKTOP: [&str; 44] = [ const PKG_LIST_KDE_DESKTOP: [&str; 45] = [
"wireless-regdb", "wireless-regdb",
"wpa_supplicant", "wpa_supplicant",
"wpa_supplicant-dinit", "wpa_supplicant-dinit",
@@ -138,6 +140,8 @@ const PKG_LIST_KDE_DESKTOP: [&str; 44] = [
"ffmpeg4.4", "ffmpeg4.4",
"strawberry", "strawberry",
"mpv", "mpv",
"ttf-unifont",
]; ];
// const PKG_LIST_AWESOME_DESKTOP: [&str; 5] = [ // const PKG_LIST_AWESOME_DESKTOP: [&str; 5] = [
@@ -149,7 +153,7 @@ const PKG_LIST_KDE_DESKTOP: [&str; 44] = [
// ]; // ];
/// Creates new GPT table and partitions from PartLayout /// Creates new GPT table and partitions from PartLayout
pub fn create_partitions(part_layout: &PartLayout) -> Result<(), ExecCommandError> { fn create_partitions(part_layout: &PartLayout) -> Result<(), ExecCommandError> {
log::info!("Creating GPT part table..."); log::info!("Creating GPT part table...");
kira_system::parted_init_gpt_part_table(&part_layout.dev)?; kira_system::parted_init_gpt_part_table(&part_layout.dev)?;
log::info!("Start to create partitions..."); log::info!("Start to create partitions...");
@@ -165,7 +169,7 @@ pub fn create_partitions(part_layout: &PartLayout) -> Result<(), ExecCommandErro
/// Unlock it if encryption used /// Unlock it if encryption used
/// Mount to specified dir /// Mount to specified dir
/// creates subvolumes bzz/root bzz/home /// creates subvolumes bzz/root bzz/home
pub fn bcachefs_init( fn bcachefs_init(
dev_name: &str, dev_name: &str,
mnt_dir: &str, mnt_dir: &str,
password: Option<String>, password: Option<String>,
@@ -182,7 +186,7 @@ pub fn bcachefs_init(
std::fs::create_dir(format!("{}{}", mnt_dir, "/bzz-snaps"))?; std::fs::create_dir(format!("{}{}", mnt_dir, "/bzz-snaps"))?;
// Creating boot directory for efi mounting // Creating boot directory for efi mounting
std::fs::create_dir_all(format!("{}{}", mnt_dir, EFI_BOOT_MOUNT_POINT))?; std::fs::create_dir_all(EFI_BOOT_MOUNT_POINT)?;
// create subvolumes // create subvolumes
log::info!("Creating subvolumes..."); log::info!("Creating subvolumes...");
@@ -194,7 +198,7 @@ pub fn bcachefs_init(
Ok(()) Ok(())
} }
pub fn init_disk(part_layout: &PartLayout, mnt_dir: &str) -> Result<(), ExecCommandError> { fn init_disk(part_layout: &PartLayout, mnt_dir: &str) -> Result<(), ExecCommandError> {
let mnt_path = Path::new(mnt_dir); let mnt_path = Path::new(mnt_dir);
log::info!("Cheking is MNT path exists: {}", mnt_dir); log::info!("Cheking is MNT path exists: {}", mnt_dir);
if !mnt_path.exists() { if !mnt_path.exists() {
@@ -309,6 +313,12 @@ pub fn mount_and_init_root(
))); )));
} }
log::info!("Mounting EFI partition");
kira_system::mount_fs(EFI_PARTLABLE_DEV, EFI_BOOT_MOUNT_POINT)?;
log::info!("Attaching swap partition");
kira_system::swapon(SWAP_PARTLABLE_DEV)?;
Ok(()) Ok(())
} }