Add a command line flag to specify the boot partition size (fix #79)

This commit is contained in:
Roey Darwish Dror 2021-12-07 21:21:30 +00:00 committed by Philip Mueller
parent 60438bac5c
commit 3f89061369
2 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,10 @@ pub struct CreateCommand {
#[structopt(long = "aur-packages", value_name = "aurpackage")] #[structopt(long = "aur-packages", value_name = "aurpackage")]
pub aur_packages: Vec<String>, 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 /// Enter interactive chroot before unmounting the drive
#[structopt(short = "i", long = "interactive")] #[structopt(short = "i", long = "interactive")]
pub interactive: bool, pub interactive: bool,

View File

@ -162,12 +162,14 @@ fn create(command: args::CreateCommand) -> anyhow::Result<()> {
info!("Partitioning the block device"); info!("Partitioning the block device");
debug!("{:?}", disk_path); debug!("{:?}", disk_path);
let boot_size = command.boot_size.unwrap_or(300);
sgdisk sgdisk
.execute() .execute()
.args(&[ .args(&[
"-Z", "-Z",
"-o", "-o",
"--new=1::+250M", &format!("--new=1::+{}M", boot_size),
"--new=2::+1M", "--new=2::+1M",
"--largest-new=3", "--largest-new=3",
"--typecode=1:EF00", "--typecode=1:EF00",