Skip to content

WIP: refactor: made function get_partition_info() matching disk label language agnostic #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refactor: made function get_partition_info() matching disk label lang…
…uage agnostic

Signed-off-by: Harry Waschkeit <[email protected]>
  • Loading branch information
HarryWaschkeit committed Nov 25, 2024
commit 4d57d262e912e5296a68df59431c8f00a87a6d31
2 changes: 1 addition & 1 deletion src/file/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ fn get_partition_info(image_file: &str, partition: &Partition) -> Result<Partiti
Partition::boot => 1,
Partition::rootA => 2,
p @ (Partition::factory | Partition::cert) => {
let re = Regex::new(r"Disklabel type: (\D{3})").unwrap();
let re = Regex::new(r": (dos|gpt)").unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to don't use fdisk (we don't know if it is installed, and which version, e.g. busybox and so on).
We should look into crates which read partition tables.


let matches = re
.captures(&fdisk_out)
Expand Down
Loading