diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-23 09:40:30 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-23 09:40:30 -0500 |
| commit | c82761fe3352294ef644a9b614cc2677f8f2e339 (patch) | |
| tree | 63bead431a428c683b2f12c35e415332b53070b7 | |
| parent | 98fc424f7edb26314ffe124d3bc24549146a06d5 (diff) | |
| download | archangel-c82761fe3352294ef644a9b614cc2677f8f2e339.tar.gz archangel-c82761fe3352294ef644a9b614cc2677f8f2e339.zip | |
refactor: drop the dead duplicate disk_in_use from common.sh
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.
| -rw-r--r-- | installer/lib/common.sh | 8 |
1 files changed, 0 insertions, 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 |
