From 3f89061369d125d5287705adb4f7d2c48d4c97a8 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Tue, 7 Dec 2021 21:21:30 +0000 Subject: [PATCH] Add a command line flag to specify the boot partition size (fix #79) --- src/args.rs | 4 ++++ src/main.rs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/args.rs b/src/args.rs index ab8a0f4..909c77c 100644 --- a/src/args.rs +++ b/src/args.rs @@ -52,6 +52,10 @@ pub struct CreateCommand { #[structopt(long = "aur-packages", value_name = "aurpackage")] pub aur_packages: Vec, + /// Boot partition size in megabytes + #[structopt(long = "boot-size")] + pub boot_size: Option, + /// Enter interactive chroot before unmounting the drive #[structopt(short = "i", long = "interactive")] pub interactive: bool, diff --git a/src/main.rs b/src/main.rs index e33466b..8d3298a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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",