aboutsummaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-23 06:10:51 -0600
committerCraig Jennings <c@cjennings.net>2026-02-23 06:10:51 -0600
commit396a85ab21d2519e83b59640971dd2b1a130469d (patch)
treea9bf4c0438daa349a5b41b5af015242cc49ef7ea /custom
parent2c27e16a815322bc38f8cbf958db51ce7ff4e755 (diff)
downloadarchangel-396a85ab21d2519e83b59640971dd2b1a130469d.tar.gz
archangel-396a85ab21d2519e83b59640971dd2b1a130469d.zip
fix: resolve remaining SC2155 warnings across all scripts
Declare and assign local variables separately in custom/archangel, scripts/full-test.sh, scripts/test-install.sh, and remove unused variable in custom/lib/zfs.sh.
Diffstat (limited to 'custom')
-rwxr-xr-xcustom/archangel15
-rw-r--r--custom/lib/zfs.sh1
2 files changed, 10 insertions, 6 deletions
diff --git a/custom/archangel b/custom/archangel
index 4150198..023115e 100755
--- a/custom/archangel
+++ b/custom/archangel
@@ -313,14 +313,16 @@ get_disks() {
# Parse selected disks
SELECTED_DISKS=()
while IFS= read -r line; do
- local disk=$(echo "$line" | awk '{print $1}')
+ local disk
+ disk=$(echo "$line" | awk '{print $1}')
SELECTED_DISKS+=("$disk")
done <<< "$selected"
echo ""
warn "Selected ${#SELECTED_DISKS[@]} disk(s):"
for disk in "${SELECTED_DISKS[@]}"; do
- local size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ')
+ local size
+ size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ')
echo " - $disk ($size)"
done
echo ""
@@ -349,7 +351,8 @@ get_raid_level() {
local total_bytes=0
local smallest_bytes=0
for disk in "${SELECTED_DISKS[@]}"; do
- local bytes=$(lsblk -b -d -n -o SIZE "$disk")
+ local bytes
+ bytes=$(lsblk -b -d -n -o SIZE "$disk")
total_bytes=$((total_bytes + bytes))
if [[ $smallest_bytes -eq 0 ]] || [[ $bytes -lt $smallest_bytes ]]; then
smallest_bytes=$bytes
@@ -711,7 +714,8 @@ show_summary() {
echo " Keymap: $KEYMAP"
echo " Disks: ${#SELECTED_DISKS[@]} disk(s)"
for disk in "${SELECTED_DISKS[@]}"; do
- local size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ')
+ local size
+ size=$(lsblk -d -n -o SIZE "$disk" | tr -d ' ')
echo " - $disk ($size)"
done
echo " RAID Level: ${RAID_LEVEL:-single (no RAID)}"
@@ -861,7 +865,8 @@ create_datasets() {
# Main root filesystem
# Reserve 20% of pool or 20G max to prevent pool from filling completely
- local pool_size_bytes=$(zpool get -Hp size "$POOL_NAME" | awk '{print $3}')
+ local pool_size_bytes
+ pool_size_bytes=$(zpool get -Hp size "$POOL_NAME" | awk '{print $3}')
local pool_size_gb=$((pool_size_bytes / 1024 / 1024 / 1024))
local reserve_gb=$((pool_size_gb / 5)) # 20%
[[ $reserve_gb -gt 20 ]] && reserve_gb=20
diff --git a/custom/lib/zfs.sh b/custom/lib/zfs.sh
index bb948fb..feda91d 100644
--- a/custom/lib/zfs.sh
+++ b/custom/lib/zfs.sh
@@ -311,7 +311,6 @@ sync_zfs_efi_partitions() {
step "Syncing EFI partitions for redundancy"
- local primary="${efi_parts[0]}"
for ((i=1; i<${#efi_parts[@]}; i++)); do
local secondary="${efi_parts[$i]}"
local tmp_mount="/tmp/efi_sync_$$"