mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
refactor: derive OsPartitionInfo from fstab instead of config.yaml
Replace the serialized os_partitions field in ServerConfig with runtime fstab parsing. OsPartitionInfo::from_fstab() resolves PARTUUID/UUID/LABEL device specs via blkid and discovers the BIOS boot partition by scanning for its GPT type GUID via lsblk. Also removes the efibootmgr-based boot order management (replaced by GRUB-based USB detection in a subsequent commit) and adds a dedicated bios: Option<PathBuf> field for the unformatted BIOS boot partition.
This commit is contained in:
@@ -197,11 +197,19 @@ pub async fn partition(
|
||||
.invoke(crate::ErrorKind::DiskManagement)
|
||||
.await?;
|
||||
|
||||
let mut extra_boot = std::collections::BTreeMap::new();
|
||||
let bios;
|
||||
if efi {
|
||||
extra_boot.insert("efi".to_string(), partition_for(&disk_path, 1));
|
||||
bios = None;
|
||||
} else {
|
||||
bios = Some(partition_for(&disk_path, 1));
|
||||
}
|
||||
Ok(OsPartitionInfo {
|
||||
efi: efi.then(|| partition_for(&disk_path, 1)),
|
||||
bios: (!efi).then(|| partition_for(&disk_path, 1)),
|
||||
bios,
|
||||
boot: partition_for(&disk_path, 2),
|
||||
root: partition_for(&disk_path, 3),
|
||||
extra_boot,
|
||||
data: data_part,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user