From c82761fe3352294ef644a9b614cc2677f8f2e339 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 23 May 2026 09:40:30 -0500 Subject: refactor: drop the dead duplicate disk_in_use from common.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit common.sh and disk.sh both defined disk_in_use. archangel sources common.sh first, then disk.sh, so disk.sh's thorough version (mount, active swap, imported zpool, md array) won at runtime everywhere — including list_available_disks, the common.sh function that calls it. common.sh's older mount-and-holders version was dead. I deleted it. list_available_disks now resolves disk_in_use to disk.sh's, which is what already happened at runtime. The disk.sh unit tests cover the surviving version. Suite stays at 245, lint clean. --- installer/lib/common.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/installer/lib/common.sh b/installer/lib/common.sh index 7998eeb..8f44170 100644 --- a/installer/lib/common.sh +++ b/installer/lib/common.sh @@ -253,14 +253,6 @@ get_disk_model() { lsblk -dno MODEL "$disk" 2>/dev/null | tr -d ' ' | head -c 20 } -# Check if disk is in use (mounted or has holders) -disk_in_use() { - local disk="$1" - [[ -n "$(lsblk -no MOUNTPOINT "$disk" 2>/dev/null | grep -v '^$')" ]] && return 0 - [[ -n "$(ls /sys/block/"$(basename "$disk")"/holders/ 2>/dev/null)" ]] && return 0 - return 1 -} - # Install a systemd drop-in for $service under $root, reading its body # from stdin. Creates $root/etc/systemd/system/$service.service.d/ at # mode 755 (idempotent) and writes $dropin_name.conf there. Intended -- cgit v1.2.3