init: Fixes for legacy-flash boards

Fix `[ -a` to POSIX `[ -e`.  Only run cbfs-init, key-init on normal
boards with bash.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
Jonathon Hall 2023-03-13 12:52:06 -04:00
parent 0c4fdf343b
commit 5c33130ddc
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114

View File

@ -34,10 +34,10 @@ if [ ! -r /dev/ptmx ]; then
fi fi
# Needed by bash # Needed by bash
[ -a /dev/stdin ] || ln -s /proc/self/fd/0 /dev/stdin [ -e /dev/stdin ] || ln -s /proc/self/fd/0 /dev/stdin
[ -a /dev/stdout ] || ln -s /proc/self/fd/1 /dev/stdout [ -e /dev/stdout ] || ln -s /proc/self/fd/1 /dev/stdout
[ -a /dev/stderr ] || ln -s /proc/self/fd/2 /dev/stderr [ -e /dev/stderr ] || ln -s /proc/self/fd/2 /dev/stderr
[ -a /dev/fd ] || ln -s /proc/self/fd /dev/fd [ -e /dev/fd ] || ln -s /proc/self/fd /dev/fd
# Recovery shells will erase anything from here # Recovery shells will erase anything from here
mkdir -p /tmp/secret mkdir -p /tmp/secret
@ -78,7 +78,7 @@ if [ "$CONFIG_TPM2_TOOLS" = "y" ]; then
fi fi
if [ "$CONFIG_COREBOOT" = "y" ]; then if [ "$CONFIG_COREBOOT" = "y" ]; then
/bin/cbfs-init [ -x /bin/bash ] && /bin/cbfs-init
fi fi
if [ "$CONFIG_LINUXBOOT" = "y" ]; then if [ "$CONFIG_LINUXBOOT" = "y" ]; then
/bin/uefi-init /bin/uefi-init
@ -87,7 +87,7 @@ fi
# Set GPG_TTY before calling gpg in key-init # Set GPG_TTY before calling gpg in key-init
export GPG_TTY=/dev/console export GPG_TTY=/dev/console
/bin/key-init [ -x /bin/bash ] && /bin/key-init
# Setup recovery serial shell # Setup recovery serial shell
if [ ! -z "$CONFIG_BOOT_RECOVERY_SERIAL" ]; then if [ ! -z "$CONFIG_BOOT_RECOVERY_SERIAL" ]; then