Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
feat(disk): only display primary and logical disk in select patit…
Browse files Browse the repository at this point in the history
…ion view
  • Loading branch information
eatradish committed Jan 10, 2024
1 parent 91ee9e8 commit f96f5b8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/disks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const DEFAULT_FS_TYPE: &str = "ext4";
const MBR_NON_PRIMARY_PART_ERROR: &str = r#"Installer has detected that you are attempting to install AOSC OS on an MBR extended partition. This is not allowed as it may cause startup issues.
Please select a primary partition instead."#;
const SUPPORT_PARTITION_TYPE: &[&str] = &["primary", "logical"];

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Partition {
Expand Down Expand Up @@ -239,12 +240,14 @@ fn loop_device_get_parts(
None
};

partitions.push(Partition {
path: part.get_path().map(|path| path.to_owned()),
parent_path: Some(device_path.clone()),
size: sector_size * part_length,
fs_type,
});
if SUPPORT_PARTITION_TYPE.contains(&part.type_get_name()) {
partitions.push(Partition {
path: part.get_path().map(|path| path.to_owned()),
parent_path: Some(device_path.clone()),
size: sector_size * part_length,
fs_type,
});
}
}
}
}
Expand Down

0 comments on commit f96f5b8

Please sign in to comment.