From 1e5e34949b7ea4e70a97f9e662ff69a2613694b5 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Fri, 23 Jun 2023 14:54:33 +0200 Subject: [PATCH] fix detect_disk --- usr/lib/archboot/installer/partition.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr/lib/archboot/installer/partition.sh b/usr/lib/archboot/installer/partition.sh index bf4602fb8..66d792dfd 100644 --- a/usr/lib/archboot/installer/partition.sh +++ b/usr/lib/archboot/installer/partition.sh @@ -2,14 +2,14 @@ # SPDX-License-Identifier: GPL-2.0-only # created by Tobias Powalowski _detect_disk() { - if [[ -z "${_DISK}" ]] || ! echo "${_DISK}" | grep -q '/dev/' || findmnt -vno SOURCE "${_DESTDIR}/boot"; then - if findmnt -vno SOURCE "${_DESTDIR}/boot" | grep -qw systemd-1; then - _DISK="$(${_LSBLK} PKNAME "$(findmnt -vno SOURCE "${_DESTDIR}/boot" | grep -vw systemd-1)")" - else - _DISK="$(${_LSBLK} PKNAME "$(findmnt -vno SOURCE "${_DESTDIR}/boot")")" - fi - fi if [[ -z "${_DISK}" ]]; then + if findmnt -vno SOURCE "${_DESTDIR}/boot"; then + if findmnt -vno SOURCE "${_DESTDIR}/boot" | grep -qw systemd-1; then + _DISK="$(${_LSBLK} PKNAME "$(findmnt -vno SOURCE "${_DESTDIR}/boot" | grep -vw systemd-1)")" + else + _DISK="$(${_LSBLK} PKNAME "$(findmnt -vno SOURCE "${_DESTDIR}/boot")")" + fi + fi _DISK="$(${_LSBLK} PKNAME "$(findmnt -vno SOURCE "${_DESTDIR}/")")" fi }