Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initramfs: Avoid noise due to /proc race
The askpass pid we've found may exit before we try to read its environ file. When that happens, we'll see some ugly messages on the console: /scripts/local-top/clevis: line 135: local: `': not a valid identifier /scripts/local-top/clevis: line 135: /proc/361/environ: No such file or directory /scripts/local-top/clevis: line 135: local: `': not a valid identifier /scripts/local-top/clevis: line 135: /proc/361/environ: No such file or directory /scripts/local-top/clevis: line 135: local: `': not a valid identifier /scripts/local-top/clevis: line 135: /proc/361/environ: No such file or directory /scripts/local-top/clevis: line 135: local: `': not a valid identifier Avoid this by using cat to read the file and prevent it from emitting an error to the console if the /proc file has vanished by redirecting its stderr to /dev/null. Also use an explicit assignment so $CRYPTTAB_SOURCE gets set to "" if the race is hit, and restart in the loop in that case. The latter check is functionally redundant with the [ -b ] that follows, but I felt it safer to be explicit.
- Loading branch information