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

Commit

Permalink
Add a command line flag to specify the boot partition size (fix #79)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-darwish committed Dec 7, 2021
1 parent e7a5fe7 commit f819e9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ pub struct CreateCommand {
#[structopt(long = "aur-packages", value_name = "aurpackage")]
pub aur_packages: Vec<String>,

/// Boot partition size in megabytes
#[structopt(long = "boot-size")]
pub boot_size: Option<u32>,

/// Enter interactive chroot before unmounting the drive
#[structopt(short = "i", long = "interactive")]
pub interactive: bool,
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
info!("Partitioning the block device");
debug!("{:?}", disk_path);

let boot_size = command.boot_size.unwrap_or(300);

sgdisk
.execute()
.args(&[
"-Z",
"-o",
"--new=1::+250M",
&format!("--new=1::+{}M", boot_size),
"--new=2::+1M",
"--largest-new=3",
"--typecode=1:EF00",
Expand Down

1 comment on commit f819e9a

@foundObjects
Copy link

Choose a reason for hiding this comment

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

Thank you, this is fantastic 👍

Please sign in to comment.