-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
installer: Add boot + system partition differentiation
Signed-off-by: Ikey Doherty <[email protected]>
- Loading branch information
Showing
4 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-FileCopyrightText: Copyright © 2024 Serpent OS Developers | ||
// | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
//! A higher abstraction over partitions for the purposes of | ||
//! installer usage. | ||
//! Quite simply we only care about the difference in a regular | ||
//! partition, and a boot partition. | ||
use system::disk; | ||
|
||
/// A boot partition is an EFI System Partition which may or may | ||
/// not be paired with an `XBOOTLDR` partition, relative to its location | ||
/// on the same GPT disk. | ||
/// This is a requirement per the Boot Loader Specification. | ||
#[derive(Debug)] | ||
pub struct BootPartition { | ||
pub(crate) esp: disk::Partition, | ||
pub(crate) xbootldr: Option<disk::Partition>, | ||
} | ||
|
||
/// A system partition is simply a regular partition with a specified mountpoint | ||
/// within the root. | ||
#[derive(Debug)] | ||
pub struct SystemPartition { | ||
pub(crate) partition: disk::Partition, | ||
|
||
/// Where will it be mounted | ||
pub(crate) mountpoint: Option<String>, | ||
} | ||
|
||
impl AsRef<disk::Partition> for SystemPartition { | ||
fn as_ref(&self) -> &disk::Partition { | ||
&self.partition | ||
} | ||
} |