linuxboot / heads

A minimal Linux that runs as a coreboot or LinuxBoot ROM payload to provide a secure, flexible boot environment for laptops, workstations and servers.
https://osresearch.net/
GNU General Public License v2.0
1.43k stars 187 forks source link

Verify presence of CMOS century bit being set in coreboot for all boards #1854

Open tlaurion opened 1 week ago

tlaurion commented 1 week ago

Surprisingly, on Librem 14 (and others IIRC), the clock resets to 2070, not 1970. Maybe if I enable the RTC century bit in CMOS it'll reset to 1970 instead.

Originally posted by @JonathonHall-Purism in https://github.com/linuxboot/heads/pull/1776#issuecomment-2333989789

tlaurion commented 1 week ago

@JonathonHall-Purism checked?

tlaurion commented 1 week ago

With:

user@heads-tests-deb12-nix:~/heads$ grep -Rn "CONFIG_USE_PC_CMOS_ALTCENTURY=y" config/coreboot-*
config/coreboot-librem_11.config:561:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-librem_13v2.config:591:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-librem_13v4.config:591:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-librem_14.config:596:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-librem_15v3.config:591:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-librem_15v4.config:591:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-librem_l1um_v2.config:583:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-optiplex-7019_9010-maximized.config:464:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-optiplex-7019_9010_TXT-maximized.config:467:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-p8z77-m_pro-tpm1.config:487:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-qemu-tpm1.config:379:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-qemu-tpm1-prod.config:378:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-qemu-tpm2.config:373:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-qemu-tpm2-prod.config:372:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-t420.config:503:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-t440p.config:501:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-t520-maximized.config:503:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-w541.config:500:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-x220.config:503:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-x220-maximized.config:505:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-x230-maximized-fhd_edp.config:505:CONFIG_USE_PC_CMOS_ALTCENTURY=y
config/coreboot-z220-cmt.config:482:CONFIG_USE_PC_CMOS_ALTCENTURY=y

Without:

user@heads-tests-deb12-nix:~/heads$ grep -Rn "# CONFIG_USE_PC_CMOS_ALTCENTURY" config/coreboot-*
config/coreboot-librem_mini.config:591:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-librem_mini_v2.config:598:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-nitropad-ns50.config:671:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-novacustom_nv4x_adl.config:672:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-t420-maximized.config:506:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-t430-legacy.config:491:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-t430-legacy-flash.config:485:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-t430-maximized.config:506:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-t530-dgpu-maximized.config:540:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-t530-maximized.config:504:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-w530-dgpu-K1000m-maximized.config:540:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-w530-dgpu-K2000m-maximized.config:540:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-w530-maximized.config:509:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-x230-legacy.config:492:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-x230-legacy-flash.config:492:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set
config/coreboot-x230-maximized.config:503:# CONFIG_USE_PC_CMOS_ALTCENTURY is not set

@JonathonHall-Purism its weird since my testing were on nv41 (now renamed novacustom_nv4x_adl). Librem14 as well has CONFIG_USE_PC_CMOS_ALTCENTURY=y so not sure what to do with this. Enable for all or disable for all or bug?

tlaurion commented 4 days ago

I'm a bit confused @JonathonHall-Purism since #1776 was tested on nv41 and x230-maximized on my side, which didn't have CONFIG_USE_PC_CMOS_ALTCENTURY=y, just like librems....

tlaurion commented 4 days ago

But the discrepency across boards coreboot config is wrong, to say the least!