Stop pipefail from turning grep -q SIGPIPE exits into false negatives (#6614)
* Stop pipefail from turning grep -q SIGPIPE exits into false negatives grep -q exits at the first match, and when the producer is still writing it dies with SIGPIPE. Under pipefail that 141 becomes the pipeline's status, so hardware checks like lspci | grep -q read as "not found" on exactly the machines they target. The T2 defaults migration hit this and silently skipped real T2 Macs (#6608). Redirect grep to /dev/null instead of -q wherever a pipeline feeds grep in a pipefail context, so grep reads all input and the producer never gets killed. The install-time T2 checks aren't run under pipefail today but are switched too, since they're the same detection line the issue calls out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Re-run the T2 defaults migration its broken hardware check skipped The SIGPIPE bug marked 1785944594 as applied without doing anything on affected T2 Macs. The original migration is idempotent, so a fresh migration can just source it now that the guard is fixed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Address Copilot review: fix OCR grep pipeline and prove the T2 repair screen_contains piped tesseract into grep -Fqi under the acceptance suite's pipefail, the same SIGPIPE false negative the rest of the branch fixes. The T2 test's lspci stub now keeps writing past the pipe buffer after the match so every scenario exercises the SIGPIPE case, and a new case runs the rerun migration against fixtures a bitten install would have. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
667d2d2f31
commit
b85ae70ebd
@@ -120,7 +120,7 @@ tuned_hardware_sink() {
|
||||
}
|
||||
|
||||
tuning_present() {
|
||||
pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -qx "$sink_name"
|
||||
pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -x "$sink_name" >/dev/null
|
||||
}
|
||||
|
||||
# Only real application streams may be moved. A filter-chain's own output is also
|
||||
@@ -151,7 +151,7 @@ tuning_downstream_sink() {
|
||||
}
|
||||
|
||||
easyeffects_running() {
|
||||
pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -qx easyeffects_sink ||
|
||||
pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -x easyeffects_sink >/dev/null ||
|
||||
pgrep -u "$(id -u)" -x easyeffects >/dev/null 2>&1 ||
|
||||
systemctl --user is-active --quiet easyeffects.service 2>/dev/null
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ if ! getent group input >/dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! id -nG "$USER" | tr ' ' '\n' | grep -qx input; then
|
||||
if ! id -nG "$USER" | tr ' ' '\n' | grep -x input >/dev/null; then
|
||||
echo "Adding $USER to the input group. You may need to log out and back in before this applies."
|
||||
pkexec usermod -aG input "$USER"
|
||||
fi
|
||||
|
||||
@@ -574,7 +574,7 @@ EOF
|
||||
while read -r uki; do
|
||||
[[ -n $uki ]] || continue
|
||||
as_root objcopy -O binary --only-section=.cmdline "$uki" /dev/stdout 2>/dev/null |
|
||||
tr -d '\0' | grep -qE '(^|[[:space:]])root=' || missing+=("$uki")
|
||||
tr -d '\0' | grep -E '(^|[[:space:]])root=' >/dev/null || missing+=("$uki")
|
||||
done < <(as_root find /boot/EFI/Linux -maxdepth 1 -name 'omarchy_linux*.efi' 2>/dev/null)
|
||||
fi
|
||||
|
||||
@@ -714,7 +714,7 @@ install_omarchy_quattro_packages() {
|
||||
install_hardware_transition_packages() {
|
||||
local hardware_packages=()
|
||||
|
||||
if lspci | grep -qiE '(Multimedia audio controller|Audio device).*Intel'; then
|
||||
if lspci | grep -iE '(Multimedia audio controller|Audio device).*Intel' >/dev/null; then
|
||||
hardware_packages+=(sof-firmware)
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user