1
0
Fork 0

fix getopts

pull/1/head
dazmaks 2 years ago
parent efbc72aceb
commit 5603ae93db
No known key found for this signature in database
GPG Key ID: E134C13C29978673

@ -15,7 +15,7 @@ please don't be mad at me if this script deletes something important
0. Choose a [custom script](./custom) (optional)
1. Boot into the Arch installer image
2. `mkcd /tmp/rach`
3. `curl overli.st/rach | tar -xz && ./rach.sh base <disk>`
3. `curl overli.st/rach | tar -xz && ./rach.sh base <disk>` ( for NVMe disk use `-p <prefix>`)
4. [Configure the timezone, locales and the hostname](https://wiki.archlinux.org/title/Installation_guide#Time_zone)
5. Ctrl + D
6. Log in as `root`

@ -20,8 +20,24 @@ function task() {
cd "$oldpwd"
}
while getopts ":p:" opt; do
case $opt in
p)
part_prefix=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
if [ $1 = "base" ]; then
task iso partitions $2
task iso partitions $2 $part_prefix
task iso packages
task iso fstab
task iso usr_rach

@ -1,22 +1,8 @@
### iso
# $1 - disk device
# $2 - partition prefix
function iso_partitions() {
while getopts ":p:" opt; do
case $opt in
p)
part_prefix=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
efi_part=1
root_part=2
@ -46,12 +32,12 @@ function iso_partitions() {
fdisk_commands | fdisk -W always $1 # -W gets rid of that annoying y/n prompt
mkfs.vfat $1$part_prefix$efi_part
mkfs.ext4 $1$part_prefix$root_part -L archroot
mkfs.vfat $1$2$efi_part
mkfs.ext4 $1$2$root_part -L archroot
mount $1$part_prefix$root_part /mnt
mount $1$2$root_part /mnt
mkdir /mnt/boot
mount $1$part_prefix$efi_part /mnt/boot
mount $1$2$efi_part /mnt/boot
}
function iso_packages() {

Loading…
Cancel
Save