Skip to content

Commit 8c49b4d

Browse files
committed
initrd+boards: harden rollback UX and integrity reporting
- enforce earlier rollback-counter preflight handling and clearer reset-only remediation in initrd/etc/functions and initrd/bin/gui-init - align TPM/TOTP/HOTP paths and reseal-related messaging across initrd/bin/tpmr, initrd/bin/seal-totp, initrd/bin/unseal-totp, initrd/bin/unseal-hotp, and initrd/bin/oem-factory-reset - centralize measured integrity reporting in initrd/etc/gui_functions, reuse in oem-factory-reset while rerouting menu actions directly without hidden interactive prompts - preserve related DUK/config UX fixes in initrd/bin/kexec-sign-config and initrd/bin/kexec-seal-key - add qemu TPM1/TPM2 prod_quiet board configs and corrected *_hotp-prod_quiet board-name exports - clarify comments and behavior consistency in initrd/etc/functions (counter increment stdout handling and disk size GB/TB output documentation) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent f782c9d commit 8c49b4d

15 files changed

Lines changed: 704 additions & 140 deletions

File tree

boards/qemu-coreboot-fbwhiptail-tpm1-hotp-prod_quiet/qemu-coreboot-fbwhiptail-tpm1-hotp-prod_quiet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export CONFIG_BOOT_REQ_ROLLBACK=n
9191
export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0"
9292
export CONFIG_BOOT_KERNEL_ADD="console=ttyS0 console=tty systemd.zram=0"
9393
export CONFIG_BOOT_KERNEL_REMOVE="quiet rhgb splash"
94-
export CONFIG_BOARD_NAME="qemu-coreboot-fbwhiptail-tpm1-hotp"
94+
export CONFIG_BOARD_NAME="qemu-coreboot-fbwhiptail-tpm1-hotp-prod_quiet"
9595
#export CONFIG_FLASH_OPTIONS="flashprog --progress --programmer internal"
9696

9797
export CONFIG_KEYBOARD_KEYMAP="/usr/lib/kbd/keymaps/i386/qwerty/us.map"
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Configuration for building a coreboot ROM that works in
2+
# the qemu emulator in console mode thanks to Whiptail
3+
#
4+
# TPM can be used with a qemu software TPM (TIS, 1.2).
5+
export CONFIG_COREBOOT=y
6+
export CONFIG_COREBOOT_VERSION=25.09
7+
export CONFIG_LINUX_VERSION=6.1.8
8+
9+
CONFIG_COREBOOT_CONFIG=config/coreboot-qemu-tpm1-prod.config
10+
CONFIG_LINUX_CONFIG=config/linux-qemu.config
11+
12+
#Enable only one RESTRICTED/BASIC boot modes below to test them manually (we cannot inject config under QEMU (no internal flashing)
13+
#export CONFIG_RESTRICTED_BOOT=y
14+
#export CONFIG_BASIC=y
15+
16+
#Enable HAVE_GPG_KEY_BACKUP to test GPG key backup drive (we cannot inject config under QEMU (no internal flashing))
17+
#export CONFIG_HAVE_GPG_KEY_BACKUP=y
18+
19+
#On-demand hardware support (modules.cpio)
20+
CONFIG_LINUX_USB=y
21+
CONFIG_LINUX_E1000=y
22+
#CONFIG_MOBILE_TETHERING=y
23+
#Runtime on-demand additional hardware support (modules.cpio)
24+
export CONFIG_LINUX_USB_COMPANION_CONTROLLER=y
25+
26+
27+
28+
#Modules packed into tools.cpio
29+
ifeq "$(CONFIG_UROOT)" "y"
30+
CONFIG_BUSYBOX=n
31+
else
32+
#Modules packed into tools.cpio
33+
CONFIG_CRYPTSETUP2=y
34+
CONFIG_FLASHPROG=y
35+
CONFIG_FLASHTOOLS=y
36+
CONFIG_GPG2=y
37+
CONFIG_KEXEC=y
38+
CONFIG_UTIL_LINUX=y
39+
CONFIG_LVM2=y
40+
CONFIG_MBEDTLS=y
41+
CONFIG_PCIUTILS=y
42+
#Runtime tools to write to MSR
43+
#CONFIG_MSRTOOLS=y
44+
#Remote attestation support
45+
# TPM2 requirements
46+
#CONFIG_TPM2_TSS=y
47+
#CONFIG_OPENSSL=y
48+
#Remote Attestation common tools
49+
CONFIG_POPT=y
50+
CONFIG_QRENCODE=y
51+
CONFIG_TPMTOTP=y
52+
#HOTP based remote attestation for supported USB Security dongle
53+
#With/Without TPM support
54+
#CONFIG_HOTPKEY=y
55+
#Nitrokey Storage admin tool (deprecated)
56+
#CONFIG_NKSTORECLI=n
57+
#GUI Support
58+
#Console based Whiptail support(Console based, no FB):
59+
#CONFIG_SLANG=y
60+
#CONFIG_NEWT=y
61+
#FBWhiptail based (Graphical):
62+
CONFIG_CAIRO=y
63+
CONFIG_FBWHIPTAIL=y
64+
#Additional tools (tools.cpio):
65+
#SSH server (requires ethernet drivers, eg: CONFIG_LINUX_E1000E)
66+
CONFIG_DROPBEAR=y
67+
endif
68+
69+
#Runtime configuration
70+
#Automatically boot if HOTP is valid
71+
export CONFIG_AUTO_BOOT_TIMEOUT=5
72+
#TPM2 requirements
73+
#export CONFIG_TPM2_TOOLS=y
74+
#export CONFIG_PRIMARY_KEY_TYPE=ecc
75+
#TPM1 requirements
76+
export CONFIG_TPM=y
77+
#Enable DEBUG output
78+
export CONFIG_DEBUG_OUTPUT=n
79+
export CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT=n
80+
#Enable TPM2 pcap output under /tmp
81+
export CONFIG_TPM2_CAPTURE_PCAP=n
82+
#Enable quiet mode: technical information logged under /tmp/debug.log
83+
export CONFIG_QUIET_MODE=y
84+
export CONFIG_BOOTSCRIPT=/bin/gui-init
85+
#text-based original init:
86+
#export CONFIG_BOOTSCRIPT=/bin/generic-init
87+
export CONFIG_BOOT_REQ_HASH=n
88+
export CONFIG_BOOT_REQ_ROLLBACK=n
89+
export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0"
90+
export CONFIG_BOOT_KERNEL_ADD="console=ttyS0 console=tty systemd.zram=0"
91+
export CONFIG_BOOT_KERNEL_REMOVE="quiet rhgb splash"
92+
export CONFIG_BOARD_NAME="qemu-coreboot-fbwhiptail-tpm1-prod_quiet"
93+
#export CONFIG_FLASH_OPTIONS="flashprog --progress --programmer internal"
94+
95+
export CONFIG_KEYBOARD_KEYMAP="/usr/lib/kbd/keymaps/i386/qwerty/us.map"
96+
97+
BOARD_TARGETS := qemu

boards/qemu-coreboot-fbwhiptail-tpm2-hotp-prod_quiet/qemu-coreboot-fbwhiptail-tpm2-hotp-prod_quiet.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CONFIG_LINUX_CONFIG=config/linux-qemu.config
1717
#Enable HAVE_GPG_KEY_BACKUP to test GPG key backup drive (we cannot inject config under QEMU (no internal flashing))
1818
#export CONFIG_HAVE_GPG_KEY_BACKUP=y
1919

20+
2021
#On-demand hardware support (modules.cpio)
2122
CONFIG_LINUX_USB=y
2223
CONFIG_LINUX_E1000=y
@@ -90,7 +91,7 @@ export CONFIG_BOOT_REQ_ROLLBACK=n
9091
export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0"
9192
export CONFIG_BOOT_KERNEL_ADD="console=ttyS0 console=tty systemd.zram=0"
9293
export CONFIG_BOOT_KERNEL_REMOVE="quiet rhgb splash"
93-
export CONFIG_BOARD_NAME="qemu-coreboot-fbwhiptail-tpm2-hotp"
94+
export CONFIG_BOARD_NAME="qemu-coreboot-fbwhiptail-tpm2-hotp-prod_quiet"
9495
#export CONFIG_FLASH_OPTIONS="flashprog --progress --programmer internal"
9596

9697
export CONFIG_KEYBOARD_KEYMAP="/usr/lib/kbd/keymaps/i386/qwerty/us.map"
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Configuration for building a coreboot ROM that works in
2+
# the qemu emulator in graphical mode thanks to FBWhiptail
3+
#
4+
# TPM can be used with a qemu software TPM (TIS, 2.0).
5+
export CONFIG_COREBOOT=y
6+
export CONFIG_COREBOOT_VERSION=25.09
7+
export CONFIG_LINUX_VERSION=6.1.8
8+
9+
CONFIG_COREBOOT_CONFIG=config/coreboot-qemu-tpm2-prod.config
10+
CONFIG_LINUX_CONFIG=config/linux-qemu.config
11+
12+
#Enable only one RESTRICTED/BASIC boot modes below to test them manually (we cannot inject config under QEMU (no internal flashing)
13+
#export CONFIG_RESTRICTED_BOOT=y
14+
#export CONFIG_BASIC=y
15+
16+
#Enable HAVE_GPG_KEY_BACKUP to test GPG key backup drive (we cannot inject config under QEMU (no internal flashing))
17+
#export CONFIG_HAVE_GPG_KEY_BACKUP=y
18+
19+
20+
#On-demand hardware support (modules.cpio)
21+
CONFIG_LINUX_USB=y
22+
CONFIG_LINUX_E1000=y
23+
#CONFIG_MOBILE_TETHERING=y
24+
#Runtime on-demand additional hardware support (modules.cpio)
25+
export CONFIG_LINUX_USB_COMPANION_CONTROLLER=y
26+
27+
28+
29+
#Modules packed into tools.cpio
30+
ifeq "$(CONFIG_UROOT)" "y"
31+
CONFIG_BUSYBOX=n
32+
else
33+
#Modules packed into tools.cpio
34+
CONFIG_CRYPTSETUP2=y
35+
CONFIG_FLASHPROG=y
36+
CONFIG_FLASHTOOLS=y
37+
CONFIG_GPG2=y
38+
CONFIG_KEXEC=y
39+
CONFIG_UTIL_LINUX=y
40+
CONFIG_LVM2=y
41+
CONFIG_MBEDTLS=y
42+
CONFIG_PCIUTILS=y
43+
#Runtime tools to write to MSR
44+
CONFIG_MSRTOOLS=y
45+
#Remote attestation support
46+
# TPM2 requirements
47+
CONFIG_TPM2_TSS=y
48+
CONFIG_OPENSSL=y
49+
#Remote Attestation common tools
50+
CONFIG_POPT=y
51+
CONFIG_QRENCODE=y
52+
CONFIG_TPMTOTP=y
53+
#HOTP based remote attestation for supported USB Security dongle
54+
#With/Without TPM support
55+
#CONFIG_HOTPKEY=y
56+
#Nitrokey Storage admin tool (deprecated)
57+
#CONFIG_NKSTORECLI=n
58+
#GUI Support
59+
#Console based Whiptail support(Console based, no FB):
60+
#CONFIG_SLANG=y
61+
#CONFIG_NEWT=y
62+
#FBWhiptail based (Graphical):
63+
CONFIG_CAIRO=y
64+
CONFIG_FBWHIPTAIL=y
65+
#Additional tools (tools.cpio):
66+
#SSH server (requires ethernet drivers, eg: CONFIG_LINUX_E1000E)
67+
CONFIG_DROPBEAR=y
68+
endif
69+
70+
#Runtime configuration
71+
#Automatically boot if HOTP is valid
72+
export CONFIG_AUTO_BOOT_TIMEOUT=5
73+
#TPM2 requirements
74+
export CONFIG_TPM2_TOOLS=y
75+
export CONFIG_PRIMARY_KEY_TYPE=ecc
76+
#TPM1 requirements
77+
#export CONFIG_TPM=y
78+
#Enable DEBUG output
79+
#export CONFIG_DEBUG_OUTPUT=y
80+
#export CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT=y
81+
#Enable TPM2 pcap output under /tmp
82+
export CONFIG_TPM2_CAPTURE_PCAP=y
83+
#Enable quiet mode: technical information logged under /tmp/debug.log
84+
export CONFIG_QUIET_MODE=y
85+
export CONFIG_BOOTSCRIPT=/bin/gui-init
86+
#text-based original init:
87+
#export CONFIG_BOOTSCRIPT=/bin/generic-init
88+
export CONFIG_BOOT_REQ_HASH=n
89+
export CONFIG_BOOT_REQ_ROLLBACK=n
90+
export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0"
91+
export CONFIG_BOOT_KERNEL_ADD="console=ttyS0 console=tty systemd.zram=0"
92+
export CONFIG_BOOT_KERNEL_REMOVE="quiet rhgb splash"
93+
export CONFIG_BOARD_NAME="qemu-coreboot-fbwhiptail-tpm2-prod_quiet"
94+
#export CONFIG_FLASH_OPTIONS="flashprog --progress --programmer internal"
95+
96+
export CONFIG_KEYBOARD_KEYMAP="/usr/lib/kbd/keymaps/i386/qwerty/us.map"
97+
98+
BOARD_TARGETS := qemu

0 commit comments

Comments
 (0)