mirror of
https://github.com/philmmanjaro/alma.git
synced 2025-07-26 06:59:28 +02:00
Add a flag for installing extra packages (fix #11)
This commit is contained in:
parent
1ded17b500
commit
b325104190
@ -32,6 +32,9 @@ this tool will refuse to work with drive paths which don't start with `/dev/disk
|
||||
After the installation is done you can either boot from it immediately or use `arch-chroot` to
|
||||
perform further customizations before your first boot.
|
||||
|
||||
### Flags
|
||||
* `-p / --extra-packages` - Specify extra packages to install. For example: `-p htop tmux`
|
||||
|
||||
## What exactly does it do?
|
||||
|
||||
This tool doesn't aspire to be a generic installer for Arch Linux. Instead, it does the minimum
|
||||
|
23
src/main.rs
23
src/main.rs
@ -37,12 +37,23 @@ HOOKS=(base udev block filesystems keyboard fsck)";
|
||||
enum App {
|
||||
#[structopt(name = "create", about = "Create a new Arch Linux USB")]
|
||||
Create {
|
||||
#[structopt(parse(from_os_str))]
|
||||
#[structopt(
|
||||
parse(from_os_str),
|
||||
help = "Path starting with /dev/disk/by-id for the USB drive"
|
||||
)]
|
||||
disk: PathBuf,
|
||||
|
||||
#[structopt(
|
||||
short = "p",
|
||||
long = "extra-packages",
|
||||
value_name = "package",
|
||||
help = "Additional pacakges to install"
|
||||
)]
|
||||
extra_packages: Vec<String>,
|
||||
},
|
||||
}
|
||||
|
||||
fn create(disk: PathBuf) -> Result<(), Error> {
|
||||
fn create(disk: PathBuf, extra_packages: Vec<String>) -> Result<(), Error> {
|
||||
let sgdisk = Tool::find("sgdisk")?;
|
||||
let sync = Tool::find("sync")?;
|
||||
let pacstrap = Tool::find("pacstrap")?;
|
||||
@ -125,7 +136,8 @@ fn create(disk: PathBuf) -> Result<(), Error> {
|
||||
"networkmanager",
|
||||
"btrfs-progs",
|
||||
"broadcom-wl",
|
||||
]).run(ErrorKind::Pacstrap)?;
|
||||
]).args(extra_packages)
|
||||
.run(ErrorKind::Pacstrap)?;
|
||||
|
||||
let fstab = genfstab
|
||||
.execute()
|
||||
@ -189,7 +201,10 @@ fn main() {
|
||||
}
|
||||
|
||||
let result = match app {
|
||||
App::Create { disk } => create(disk),
|
||||
App::Create {
|
||||
disk,
|
||||
extra_packages,
|
||||
} => create(disk, extra_packages),
|
||||
};
|
||||
|
||||
match result {
|
||||
|
Loading…
x
Reference in New Issue
Block a user