From b414330bc83e99f9a34514f9335b36df27355a6c Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Sat, 15 Apr 2023 02:49:10 -0400 Subject: [PATCH] installer.sh: show_partitions: Display configured fstypes if available If a user configures the partitions the installer displays the fstypes after the installation with the current configuration instead of the current fstypes. fixes #130 Co-authored-by: dateiexplorer --- installer.sh.in | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/installer.sh.in b/installer.sh.in index 19bcae5..4a5f81b 100644 --- a/installer.sh.in +++ b/installer.sh.in @@ -360,6 +360,15 @@ show_disks() { done } +get_partfs() { + # Get fs type from configuration if available. This ensures + # that the user is shown the proper fs type if they install the system. + local part="$1" + local default="${2:-none}" + local fstype=$(grep "MOUNTPOINT ${part}" "$CONF_FILE"|awk '{print $3}') + echo "${fstype:-$default}" +} + show_partitions() { local dev fstype fssize p part @@ -377,7 +386,7 @@ show_partitions() { [ "$fstype" = "LVM2_member" ] && continue fssize=$(lsblk -nr /dev/$part|awk '{print $4}'|head -1) echo "/dev/$part" - echo "size:${fssize:-unknown};fstype:${fstype:-none}" + echo "size:${fssize:-unknown};fstype:$(get_partfs "/dev/$part")" fi done done @@ -391,7 +400,7 @@ show_partitions() { fstype=$(lsblk -nfr $p|awk '{print $2}'|head -1) fssize=$(lsblk -nr $p|awk '{print $4}'|head -1) echo "${p}" - echo "size:${fssize:-unknown};fstype:${fstype:-none}" + echo "size:${fssize:-unknown};fstype:$(get_partfs "$p")" done # Software raid (md) for p in $(ls -d /dev/md* 2>/dev/null|grep '[0-9]'); do @@ -402,7 +411,7 @@ show_partitions() { [ "$fstype" = "LVM2_member" ] && continue fssize=$(lsblk -nr /dev/$part|awk '{print $4}') echo "$p" - echo "size:${fssize:-unknown};fstype:${fstype:-none}" + echo "size:${fssize:-unknown};fstype:$(get_partfs "$p")" fi done # cciss(4) devices @@ -412,13 +421,13 @@ show_partitions() { [ "$fstype" = "LVM2_member" ] && continue fssize=$(lsblk -nr /dev/cciss/$part|awk '{print $4}') echo "/dev/cciss/$part" - echo "size:${fssize:-unknown};fstype:${fstype:-none}" + echo "size:${fssize:-unknown};fstype:$(get_partfs "/dev/cciss/$part")" done if [ -e /sbin/lvs ]; then # LVM lvs --noheadings|while read lvname vgname perms size; do echo "/dev/mapper/${vgname}-${lvname}" - echo "size:${size};fstype:lvm" + echo "size:${size};fstype:$(get_partfs "/dev/mapper/${vgname}-${lvname}" lvm)" done fi } @@ -479,6 +488,7 @@ menu_filesystems() { echo "MOUNTPOINT $dev $1 $2 $3 $4" >>$CONF_FILE fi done + FILESYSTEMS_DONE=1 } menu_partitions() {