From 9071e82051e22dc605600dc971ad07fc9a5999fd Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 24 Jan 2023 10:09:25 +0100 Subject: [PATCH] check on filesystem for btrfs options --- usr/lib/archboot/installer/autoprepare.sh | 3 ++- usr/lib/archboot/installer/mountpoints.sh | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/usr/lib/archboot/installer/autoprepare.sh b/usr/lib/archboot/installer/autoprepare.sh index 1dfb810e3..c13eb199a 100644 --- a/usr/lib/archboot/installer/autoprepare.sh +++ b/usr/lib/archboot/installer/autoprepare.sh @@ -259,11 +259,12 @@ _autoprepare() { _MP="$(echo "${fsspec}" | tr -d ' ' | cut -f3 -d:)" _LABEL_NAME="$(echo "${fsspec}" | tr -d ' ' | cut -f4 -d:)" _FS_OPTIONS="" - _BTRFS_DEVS="${_DEV}" + _BTRFS_DEVS="" _BTRFS_LEVEL="" _BTRFS_SUBVOLUME="" _BTRFS_COMPRESS="" if [[ "${_FSTYPE}" == "btrfs" ]]; then + _BTRFS_DEVS="${_DEV}" [[ "${_MP}" == "/" ]] && _BTRFS_SUBVOLUME="root" [[ "${_MP}" == "/home" ]] && _BTRFS_SUBVOLUME="home" _BTRFS_COMPRESS="compress=zstd" diff --git a/usr/lib/archboot/installer/mountpoints.sh b/usr/lib/archboot/installer/mountpoints.sh index f3a2b1ee8..c2e1ee402 100644 --- a/usr/lib/archboot/installer/mountpoints.sh +++ b/usr/lib/archboot/installer/mountpoints.sh @@ -321,8 +321,8 @@ _mkfs() { # lazytime Do not synchronously update access or modification times. Improves IO performance and flash durability. [[ "${2}" == "f2fs" ]] && _F2FS_MOUNTOPTIONS="compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime" # prepare btrfs mount options - [[ -n "${10}" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} subvol=${10}" - [[ -n "${11}" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} ${11}" + [[ "${2}" == "btrfs" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} subvol=${10}" + [[ "${2}" == "btrfs" ]] && _MOUNTOPTIONS="${_MOUNTOPTIONS} ${11}" _MOUNTOPTIONS="${_MOUNTOPTIONS} ${_SSD_MOUNT_OPTIONS} ${_F2FS_MOUNTOPTIONS}" # eleminate spaces at beginning and end, replace other spaces with , _MOUNTOPTIONS="$(echo "${_MOUNTOPTIONS}" | sed -e 's#^ *##g' -e 's# *$##g' | sed -e 's# #,#g')" @@ -397,6 +397,4 @@ _mkfs() { echo -n "${_DEV} ${5} ${2} defaults,${_MOUNTOPTIONS} 0 " >>/tmp/.fstab _check_filesystem_fstab $@ fi - # clear values - unset "${7}" "${8}" "${9}" "${10}" "${11}" }