Skip to content

Commit 3edf2a5

Browse files
committed
Fix set -e crash in drive picker grep (ZimaOS)
grep returns exit code 1 on no match, which set -e treats as fatal. The old awk approach always returned 0. Added || true to both grep calls in the lsblk -P lookup.
1 parent ca13627 commit 3edf2a5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,11 @@ pick_drives() {
644644
if [ "$has_lsblk" = "true" ] && [ -n "$lsblk_out" ]; then
645645
local lsblk_line
646646
# Match by NAME="dname" in the pairs output.
647-
lsblk_line=$(echo "$lsblk_out" | grep -m1 "NAME=\"$dname\"")
647+
lsblk_line=$(echo "$lsblk_out" | grep -m1 "NAME=\"$dname\"" || true)
648648
# NVMe: smartctl returns controller path (/dev/nvme0) but lsblk uses
649649
# namespace path (nvme0n1). Fall back to ${name}n1 if exact match fails.
650650
if [ -z "$lsblk_line" ] && [[ "$dname" == nvme* ]]; then
651-
lsblk_line=$(echo "$lsblk_out" | grep -m1 "NAME=\"${dname}n1\"")
651+
lsblk_line=$(echo "$lsblk_out" | grep -m1 "NAME=\"${dname}n1\"" || true)
652652
fi
653653
if [ -n "$lsblk_line" ]; then
654654
# Extract fields from key="value" pairs. Handles spaces in MODEL, empty VENDOR, etc.

0 commit comments

Comments
 (0)