common: Make U-Boot's auxiliary environment accessable from Infix

This is not the full environment used by U-Boot, just the bits needed
for U-Boot to know which slot to boot and for Infix to know how the
boot process went.

U-Boot will selectively import/export only these keys during boot,
which avoids a malicious user from altering the boot in a way that
might bypass signature validation.
This commit is contained in:
Tobias Waldekranz
2023-02-28 11:01:04 +01:00
committed by Joachim Wiberg
parent dd8bcca180
commit d8c529a2a7
6 changed files with 14 additions and 0 deletions
+1
View File
@@ -18,6 +18,7 @@ hostfs /host 9p nofail,cache=none,msize=16384 0 0
# /home, /root, and /var, are determined dynamically by /lib/infix/mnt
# depending on the available devices.
mnttmp /mnt/tmp tmpfs defaults 0 0
LABEL=aux /mnt/aux auto noatime,nodiratime,noauto 0 0
LABEL=var /mnt/var auto noatime,nodiratime,noauto 0 0
LABEL=cfg /mnt/cfg auto noatime,nodiratime,noauto 0 0
/lib/infix/mnt# /cfg helper none 0 0
+1
View File
@@ -0,0 +1 @@
/mnt/aux/uboot.env 0 0x4000
+5
View File
@@ -77,6 +77,11 @@ if ! logger -? |grep -q "Log to kernel"; then
opt="-c"
fi
if ! mount_rw aux >/dev/null 2>&1; then
logger $opt -p user.warn -t "$nm" \
"No auxiliary partition found, software updates not supported."
fi
varsrc=/mnt/var
if ! mount_rw var >/dev/null 2>&1; then
logger $opt -p user.warn -t "$nm" \
View File
+4
View File
@@ -0,0 +1,4 @@
BOOT_ORDER=primary secondary net
BOOT_primary_LEFT=1
BOOT_secondary_LEFT=1
BOOT_net_LEFT=1
+3
View File
@@ -115,6 +115,9 @@ BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE=y
BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE="$(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/aux-env.txt"
BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE="0x4000"
BR2_PACKAGE_CLIXON_RESTCONF_FCGI=y
BR2_PACKAGE_FACTORY=y
BR2_PACKAGE_FINIT_SULOGIN=y