interactive pacstrap (fix)

This commit is contained in:
Daniel Langbein 2021-05-04 21:58:57 +02:00
parent aced91deef
commit 31d3d15fbc
2 changed files with 6 additions and 23 deletions

View File

@ -34,7 +34,6 @@ function increase_cow_space() {
function get_user_input() { function get_user_input() {
# @post # @post
# BIOS_TYPE (uefi or bios) # BIOS_TYPE (uefi or bios)
# KERNEL (linux or linux-lts)
# FS (BTRFS, EXT4, F2FS) # FS (BTRFS, EXT4, F2FS)
# HOSTNAME # HOSTNAME
# USERNAME, USER_PWD # USERNAME, USER_PWD
@ -46,9 +45,6 @@ function get_user_input() {
TMP1=('uefi' 'Newer mainboards' 'bios' 'Legacy BIOS on older mainboards') TMP1=('uefi' 'Newer mainboards' 'bios' 'Legacy BIOS on older mainboards')
get_single_choice BIOS_TYPE "Select your bios type" TMP1 || return $? get_single_choice BIOS_TYPE "Select your bios type" TMP1 || return $?
TMP1=('linux-lts' 'Long-Time-Stable Linux kernel' 'linux' 'Latest Linux kernel')
get_single_choice KERNEL "Select kernel version" TMP1 || return $?
TMP1=('BTRFS' 'Allows snapshots and dynamic extension of the FS' 'EXT4' 'Default FS of many distributions' 'F2FS' 'Flash-Friendly-FS for SSD or NVMe') TMP1=('BTRFS' 'Allows snapshots and dynamic extension of the FS' 'EXT4' 'Default FS of many distributions' 'F2FS' 'Flash-Friendly-FS for SSD or NVMe')
get_single_choice FS "Select filesystem to use" TMP1 || return $? get_single_choice FS "Select filesystem to use" TMP1 || return $?
@ -159,25 +155,11 @@ function choose_mount_options() {
function run_pacstrap() { function run_pacstrap() {
# @pre # @pre
# BIOS_TYPE # BIOS_TYPE
# KERNEL
# CPU_VENDOR # CPU_VENDOR
echo "Running pacstrap ..." echo "Running pacstrap ..."
PKGS=() PKGS=()
case "${KERNEL}" in
linux)
PKGS+=("${KERNEL}" "${KERNEL}-headers")
;;
linux-lts)
PKGS+=("${KERNEL}" "${KERNEL}-headers")
;;
*)
echo "Not yet implemented!"
return 1
;;
esac
case "${CPU_VENDOR}" in case "${CPU_VENDOR}" in
amd) amd)
PKGS+=("${CPU_VENDOR}-ucode") PKGS+=("${CPU_VENDOR}-ucode")
@ -340,7 +322,7 @@ function main() {
# installation finished # installation finished
check_network || return $? check_network || return $?
# out: BIOS_TYPE, KERNEL, FS, HOSTNAME, USERNAME, USER_PWD, LUKS_PWD # out: BIOS_TYPE, FS, HOSTNAME, USERNAME, USER_PWD, LUKS_PWD
get_user_input || return $? get_user_input || return $?
# out: CPU_VENDOR # out: CPU_VENDOR
get_cpu_vendor || return $? get_cpu_vendor || return $?
@ -371,7 +353,7 @@ function main() {
mkdir /mnt/boot || return $? mkdir /mnt/boot || return $?
sudo mount "$BOOT_PART" /mnt/boot || return $? sudo mount "$BOOT_PART" /mnt/boot || return $?
# in: BIOS_TYPE, KERNEL, CPU_VENDOR # in: BIOS_TYPE, CPU_VENDOR
run_pacstrap || return $? run_pacstrap || return $?
# in: FS # in: FS
run_genfstab || return $? run_genfstab || return $?

View File

@ -13,8 +13,6 @@ LUKS_PWD=test
# if unset, then USER_PWD will be used for ROOT_PWD # if unset, then USER_PWD will be used for ROOT_PWD
# ROOT_PWD=test # ROOT_PWD=test
KERNEL=linux
TARGET_BLOCK_DEVICE=/dev/sda TARGET_BLOCK_DEVICE=/dev/sda
BOOT_PART_SIZE=500 # MiB BOOT_PART_SIZE=500 # MiB
FS=BTRFS FS=BTRFS
@ -30,3 +28,6 @@ BIOS_TYPE=uefi
LEAVE_MOUNTED=1 LEAVE_MOUNTED=1
PACSTRAP_INTERACTIVE=1 PACSTRAP_INTERACTIVE=1
# TODO: additional pacman packages, e.g.
# ADD_PKGS=('de-p1st-kernel-default')