mirror of
https://git.sr.ht/~nabijaczleweli/tzpfms
synced 2025-04-11 09:30:02 +03:00
use :? to early-exit instead of :- and hope for a good error
This commit is contained in:
parent
1f9fe814fe
commit
a20c275ceb
@ -6,8 +6,8 @@
|
||||
PREREQ
|
||||
|
||||
# tcsd exits if it doesn't have tss group and user
|
||||
grep tss /etc/group >> "${TARGET_DIR:-MUST_EXIST}/etc/group"
|
||||
grep tss /etc/passwd >> "${TARGET_DIR:-MUST_EXIST}/etc/passwd"
|
||||
grep tss /etc/group >> "${TARGET_DIR:?must exist}/etc/group"
|
||||
grep tss /etc/passwd >> "${TARGET_DIR:?must exist}/etc/passwd"
|
||||
|
||||
for f in /lib/udev/rules.d/*tpm*; do
|
||||
INST_UDEV "$f"
|
||||
@ -15,13 +15,13 @@
|
||||
|
||||
if [ -e /etc/tcsd.conf ]; then
|
||||
INST_CFG /etc/tcsd.conf
|
||||
chown root:tss "${TARGET_DIR:-MUST_EXIST}/etc/tcsd.conf"
|
||||
chown root:tss "${TARGET_DIR:?must exist}/etc/tcsd.conf"
|
||||
system_ps_file="$(awk -F '[[:space:]]*=[[:space:]]*' '!/^[[:space:]]*#/ && !/^$/ && $1 ~ /system_ps_file$/ {gsub(/[[:space:]]*$/, "", $2); print $2}' /etc/tcsd.conf)"
|
||||
system_ps_file="${system_ps_file:-/var/lib/tpm/system.data}"
|
||||
fi
|
||||
|
||||
# tcsd can't find SRK if state not present, refuses to start if it doesn't have parent to tss dir
|
||||
mkdir -p "${TARGET_DIR:-MUST_EXIST}/$(dirname "$(dirname "$system_ps_file")")"
|
||||
mkdir -p "${TARGET_DIR:?must exist}/$(dirname "$(dirname "$system_ps_file")")"
|
||||
[ -f "$system_ps_file" ] && INST_STATE "$system_ps_file"
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user