Make Used HDD Size Selectable

This commit is contained in:
seiichiro 2021-12-18 21:22:37 +01:00
parent 864bdacaed
commit 77267ba766

View file

@ -14,6 +14,7 @@ function show_help() {
echo " -m <keymap> Console Keymap to use (default: de)" echo " -m <keymap> Console Keymap to use (default: de)"
echo " -t <timezone> Timezone to use (default: Europe/Berlin)" echo " -t <timezone> Timezone to use (default: Europe/Berlin)"
echo " -h <hostname> Set the Target Hostname" echo " -h <hostname> Set the Target Hostname"
echo " -s <hddsize> Only use hddsize for the system partition"
echo " -b Set System Type to BIOS (default: UEFI)" echo " -b Set System Type to BIOS (default: UEFI)"
echo " -c Disable Encryption (default: enabled)" echo " -c Disable Encryption (default: enabled)"
} }
@ -47,9 +48,10 @@ timezone="Europe/Berlin"
systype="x86_64-efi" systype="x86_64-efi"
network=0 network=0
encryption=1 encryption=1
hddsize="100%"
## Get CLI Options ## Get CLI Options
while getopts 'k:d:n:m:l:h:bc?' flag; do while getopts 'k:d:n:m:l:h:s:t:bc?' flag; do
case "${flag}" in case "${flag}" in
k) kernel="${OPTARG}" ;; k) kernel="${OPTARG}" ;;
n) case "${OPTARG}" in n) case "${OPTARG}" in
@ -65,6 +67,7 @@ while getopts 'k:d:n:m:l:h:bc?' flag; do
b) systype="i386-pc" ;; b) systype="i386-pc" ;;
c) encryption=0 ;; c) encryption=0 ;;
h) hostname="${OPTARG}" ;; h) hostname="${OPTARG}" ;;
s) hddsize="${OPTARG}" ;;
?) show_help ;; ?) show_help ;;
*) show_help ;; *) show_help ;;
esac esac
@ -104,7 +107,7 @@ if [[ "${systype}" == "x86_64-efi" ]]; then
mklabel gpt \ mklabel gpt \
mkpart ESP fat32 1MiB 513MiB \ mkpart ESP fat32 1MiB 513MiB \
set 1 esp on \ set 1 esp on \
mkpart arch 514MiB 100% mkpart arch 514MiB ${hddsize}
part_esp="/dev/disk/by-partlabel/ESP" part_esp="/dev/disk/by-partlabel/ESP"
part_root="/dev/disk/by-partlabel/arch" part_root="/dev/disk/by-partlabel/arch"