Skip to content
GitLab
Explore
Sign in
Luker
dfim
Compare revisions
745ca32ce8844b1b67ef020566f344a3b3a3c08e to 92e138accf668d2d389d61ba9785a49c81725bf8
Hide whitespace changes
Inline
Side-by-side
libdfim/src/state/mod.rs
View file @
92e138ac
/*
* Copyright (c) 2021, Luca Fulchir <luker@fenrirproject.org>
* Copyright (c) 2021
-2022
, Luca Fulchir <luker@fenrirproject.org>
*
* This file is part of dfim.
*
...
...
libdfim/src/state/s_trgt/mod.rs
View file @
92e138ac
/*
* Copyright (c) 2021, Luca Fulchir <luker@fenrirproject.org>
* Copyright (c) 2021
-2022
, Luca Fulchir <luker@fenrirproject.org>
*
* This file is part of dfim.
*
...
...
libdfim/src/state/s_trgt/s_exec.rs
View file @
92e138ac
/*
* Copyright (c) 2021, Luca Fulchir <luker@fenrirproject.org>
* Copyright (c) 2021
-2022
, Luca Fulchir <luker@fenrirproject.org>
*
* This file is part of dfim.
*
...
...
libdfim/src/state/s_trgt/s_gpt.rs
View file @
92e138ac
/*
* Copyright (c) 2021, Luca Fulchir <luker@fenrirproject.org>
* Copyright (c) 2021
-2022
, Luca Fulchir <luker@fenrirproject.org>
*
* This file is part of dfim.
*
...
...
@@ -223,7 +223,12 @@ impl GPT {
};
let
p
=
Partition
{
label
:
disk_p
.name
.clone
(),
number
:
*
num
,
number
:
::
std
::
num
::
NonZeroU32
::
new
(
*
num
)
.ok_or
(
::
std
::
io
::
Error
::
new
(
::
std
::
io
::
ErrorKind
::
InvalidData
,
"Found partition id 0 on drive"
,
),
)
?
,
part_type
:
PartId
::
UUID
(
::
uuid
::
Uuid
::
parse_str
(
&
disk_p
.part_type_guid.guid
)
.unwrap
(),
...
...
@@ -282,7 +287,11 @@ impl GPT {
assert!
(
false
,
"Partition without sys number?"
);
continue
;
}
Some
(
partnum
)
=>
partnum
as
u32
,
Some
(
partnum
)
=>
::
std
::
num
::
NonZeroU32
::
new
(
partnum
as
u32
)
.ok_or
(::
std
::
io
::
Error
::
new
(
::
std
::
io
::
ErrorKind
::
InvalidData
,
"dev num 0 but we can't have partition 0"
,
))
?
,
};
let
p
=
match
cfg
.partitions
.iter
()
.find
(|
x
|
x
.number
==
partnum
)
{
Some
(
p
)
=>
p
,
...
...
@@ -414,7 +423,7 @@ impl super::TargetApply for GPT {
flags
:
conf_p
.flag_bits
(),
name
:
conf_p
.label
.clone
(),
};
disk_parts
.insert
(
conf_p
.number
,
p
);
disk_parts
.insert
(
conf_p
.number
.get
()
,
p
);
}
match
disk
.update_partitions_embedded
(
disk_parts
,
self
.0
.max_partitions
)
...
...
Prev
1
2
Next