diff --git a/pkg/de-p1st-installer/de-p1st-installer.sh b/pkg/de-p1st-installer/de-p1st-installer.sh index 2cd48cd..a0bf968 100755 --- a/pkg/de-p1st-installer/de-p1st-installer.sh +++ b/pkg/de-p1st-installer/de-p1st-installer.sh @@ -152,6 +152,51 @@ function choose_mount_options() { get_multi_choice FS_CHOSEN_MOUNT_OPTIONS "Select mount options" TMP1 || return $? } +function run_pacstrap() { + case "${BIOS_TYPE}" in + uefi) + pacstrap /mnt "${KERNEL}" "${KERNEL}-headers" de-p1st-base-efi || return $? + ;; + bios) + echo "Not yet implemented" + return 1 + ;; + *) + echo "Not yet implemented!" + return 1 + ;; + esac +} + +function run_genfstab() { + local fstab + fstab="$(genfstab -U /mnt)" + + case "${FS}" in + BTRFS) + # Remove "subvolid=..." mount option but leave "subvol=..." mount option + fstab=$(printf "%s" "${fstab}" | sed 's/,subvolid=[^,\s]\+//') || return $? + # Check if fstab does still contain subvolid mount option + if printf "%s" "${fstab}" | grep -q 'subvolid='; then + echo "This should not happen!" + return 1 + fi + ;; + EXT4) + true + ;; + F2FS) + true + ;; + *) + echo "Filesystem $FS not yet supported!" + return 1 + ;; + esac + + printf "%s" "${fstab}" > /mnt/etc/fstab || return $? +} + function main() { check_network || return $? get_user_input || return $? @@ -167,26 +212,17 @@ function main() { TMP1=("${FS_DEFAULT_MOUNT_OPTIONS[@]}" "${FS_CHOSEN_MOUNT_OPTIONS[@]}") || return $? # Join array elements by "," join_by "," TMP1 FS_MOUNT_OPTIONS || return $? + echo "Mounting data partition with options: ${FS_MOUNT_OPTIONS}" mount -o "${FS_MOUNT_OPTIONS}" "$DATA_PART" /mnt || return $? - # mount boot partition + + echo "Mounting boot partition ..." mkdir /mnt/boot || return $? mount "$BOOT_PART" /mnt/boot || return $? - case "${BIOS_TYPE}" in - uefi) - pacstrap /mnt "${KERNEL}" "${KERNEL}-headers" de-p1st-base-efi || return $? - ;; - bios) - echo "Not yet implemented" - return 1 - ;; - *) - echo "Not yet implemented!" - return 1 - ;; - esac - + run_pacstrap || return $? + run_genfstab || return $? + echo "${HOSTNAME}" >/mnt/etc/hostname || return $? } main "$@" diff --git a/pkg/de-p1st-installer/installer.cfg b/pkg/de-p1st-installer/installer.cfg index e089042..c2b786b 100644 --- a/pkg/de-p1st-installer/installer.cfg +++ b/pkg/de-p1st-installer/installer.cfg @@ -15,3 +15,5 @@ FS_CHOSEN_MOUNT_OPTIONS=('noatime') CPU_VENDOR=none BIOS_TYPE=uefi + +FOO="xsubvolid=bar"