Commit Graph

596 Commits

Author SHA1 Message Date
Thierry Laurion a2a027f661 circleci: implement hierarchical cache model with fork-specific caches
Implements a new cache-based pipeline that dramatically improves build times
through hierarchical caching with fork-specific caches.

Key changes:
- Add executor, commands, and job definitions for cache-based builds
- Add create_hashes job to generate cache digest files
- Add x86_blobs job for blob downloads with cache support
- Add x86_musl_cross_make job for toolchain builds with cache save
- Add x86_coreboot job per fork, each saves both modules and coreboot caches
- Add ppc64_musl_cross_make and ppc64_coreboot jobs (decoupled from single job)
- Add glossary documenting fan-in, workspace chain, cache layers

Fixes for cache invalidation issues:
- Remove .circleci/config.yml from cache key hashes (prevents cache invalidation
  on CI config changes - was causing full rebuilds on every pipeline)
- Fix musl-cross-make module to auto-detect existing crossgcc using wildcard check
- Exclude .circleci/config.yml from all_modules_and_patches.sha256sums and
  coreboot_musl-cross-make.sha256sums

Test results (multiple pipeline runs):

Pipeline 3789 (first run, cold cache):
- x86-musl-cross-make: 30 min
- ppc64-musl-cross-make: 16 min
- Result: Cache saved

Pipeline 3790 (second run, cache hit):
- x86-musl-cross-make: 4.5 min (6.6x faster than first run)
- ppc64-musl-cross-make: 4.5 min (3.5x faster than first run)
- Result: Beats baseline (14.5 min) by 3.2x

Pipeline 3791 (third run, cache hit):
- x86-musl-cross-make: ~6 min (27s Make Board + spin up variance)
- ppc64-musl-cross-make: 4.5 min
- Result: Still beats baseline

The wildcard fix for musl-cross-make module detects existing crossgcc from
cache and skips rebuild entirely (Make Board takes only 27s vs 26 min cold).

Add tests/circle-ci-simulation/ for local cache behavior verification:
- test_cache_hash.sh, test_musl_skip.sh, simulate_cold_cache.sh, etc.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 21:10:10 -04:00
Thierry Laurion 562f9e70ec modules/coreboot: purism fork builds its own toolchain
Previously coreboot-purism depended on coreboot-24.02.01's toolchain
to avoid duplicate toolchain builds. However, no maintained boards
actually use 24.02.01 directly (only unmaintained x230-legacy boards),
so this dependency was unnecessary complexity.

Now coreboot-purism builds its complete toolchain independently,
making it consistent with all other coreboot forks (Dasharo variants,
talos_2) which also build their own toolchains.

This simplifies the cache strategy: each fork's cache contains only
its own coreboot directory, with no hidden dependencies.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:51:29 -04:00
Thierry Laurion 664c1fd6c7 modules/coreboot: add helper to save defconfig alongside original .config
Add coreboot.save_in_defconfig_format_backup target that runs savedefconfig
and saves the result as .config_defconfig alongside the original .config file.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:51:17 -04:00
Filip Lewiński 382379b7b4 modules/coreboot: remove redundant sed
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:50:47 -04:00
Filip Lewiński 3f4f40f0f5 modules/coreboot: split dasharo base revisions
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:50:00 -04:00
Filip Lewiński e10bdb7eab MTL release: coreboot revision and updated configs
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:49:54 -04:00
Filip Lewiński 0735351bb6 modules/dasharo-ec: address review feedback and add nv4x_adl/ns50 support
- config/coreboot-novacustom-v560tu.config: switch EC from SYSTEM76_EC
  to DASHARO_EC (CONFIG_EC_DASHARO_EC=y, _UPDATE=y, _UPDATE_FILE="ec.rom"),
  matching the v540tu change already in this branch

- modules/dasharo-ec: strip UNTESTED_/EOL_ board name prefixes before
  the board model mapping so that boards not yet promoted (e.g.
  UNTESTED_nitropad-ns50) resolve correctly without a separate entry

- modules/dasharo-ec: add board model mappings for novacustom-nv4x_adl
  (ns5x_adl - nv4x_adl) and nitropad-ns50 (ns5x_adl)

- modules/dasharo-ec: drop redundant sh -c wrapper from cp recipe;
  Make already invokes recipe lines via the shell

- modules/dasharo-ec: replace dd seek-based padding with
  truncate --size=128KiB, as suggested in review (ec.rom is always
  smaller than 128 KiB)

- modules/dasharo-ec: indent ifeq variable assignments with a tab for
  readability

Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:49:42 -04:00
Filip Lewiński ff6f3a6109 modules/dasharo-ec: fix build system and address review feedback
- Remove leading tabs from ifeq variable assignments (Make parse error)
- Move post-build steps (cp, dd, touch) out of dasharo-ec_target into
  a proper Make rule; _target is now only make arguments
- Set dasharo-ec_output to ec.rom (the actual artifact, not .built)
- Add -$(BOARD) suffix to dasharo-ec_base_dir and dasharo-ec_dir so
  v540tu and v560tu maintain independent build trees and ec.rom files
- Add explicit rule to copy and zero-pad ec.rom to 128 KB
- Fix coreboot copy rule: use FORCE + cmp so the recipe always runs
  but only updates the destination (and its mtime) when content differs,
  preventing the mtime race between boards sharing coreboot_base_dir

Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:49:36 -04:00
Maciej Pijanowski 7053945fb1 modules/dasharo-ec: new module
Squashed from:
https://github.com/tlaurion/heads/commit/2df1c8b5bdfd7999ebaa65140a92e0df061a930f
https://github.com/tlaurion/heads/commit/447d464043cb69126420c06eb280c1746dccae31

then, updated EC revision as per:
https://github.com/Dasharo/ec/pull/82#issuecomment-4048416056

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-20 10:49:19 -04:00
Thierry Laurion a02203e72c boards/qemu, Makefile: update coreboot configs and fix build tracking
- Add prod_quiet board variants to QEMU coreboot configs
- Fix cpio dependency tracking to correctly rebuild initrd when root
  files change
- Sync board configs and root file references

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-04-06 20:42:49 -04:00
Thierry Laurion 6b7939f9ae Add CBFS/IFD validation for coreboot builds
Introduce validation to ensure coreboot CBFS size matches IFD BIOS region:

- Add bin/validate_cbfs_ifd_fit.sh: New script to validate CBFS size against
  Intel Flash Descriptor (IFD) BIOS region and provide space usage statistics
- Add Makefile targets: validate_cbfs_ifd and fix_cbfs_ifd for manual validation
  and automatic fixes
- Integrate validation into coreboot module build process to catch misconfigs
  at compile time
- Add validation to final ROM image generation step
- Add informational hint to Makefile when V=1 verbose flag is not set

This prevents shipping firmware with CBFS sizes that exceed the available
BIOS region, catching configuration errors early in the build process.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2026-01-04 22:30:26 -05:00
Thomas Clarke 54373d0292 msi: bump to v1.1.6 / v0.9.4
note: no changes to board coreboot config's required.

Signed-off-by: Thomas Clarke <tonux@riseup.net>
2025-12-04 19:57:24 +00:00
Thomas Clarke 39211964a4 Merge remote-tracking branch 'upstream/master' into msi-dasharo-upstream 2025-11-11 09:05:47 +00:00
gaspar-ilom b9a08613bd update coreboot 24.12 to 25.09
-bump the coreboot version 25.09 for all boards on 24.12
- get rid of libreboot and our own hacky patches for the T480
as this board is now supported upstream
- include the unmerged Thunderbolt patches for the T480 from:
https://review.coreboot.org/c/coreboot/+/75286/18 and
https://review.coreboot.org/c/coreboot/+/88490/1
- keep the patches for PR0 flash protection
https://review.coreboot.org/c/coreboot/+/85278
and for clearing tpm log area
https://review.coreboot.org/c/coreboot/+/84927/1

Signed-off-by: gaspar-ilom <gasparilom@riseup.net>
2025-10-31 00:43:05 +01:00
Thomas Clarke 7493d8def6 msi: bump to v1.1.5 / v0.9.3
Signed-off-by: Thomas Clarke <tonux@riseup.net>
2025-09-26 22:34:54 +01:00
Thomas Clarke f83092eaf6 msi: add dasharo MSI release fork in coreboot module
Signed-off-by: Thomas Clarke <tonux@riseup.net>
2025-08-27 23:43:13 +01:00
Thierry Laurion d343c53bdc initrd/bin/reboot bugfix: switch from sysrq instant reset to busybox's reboot kernel syscall (so tpm2.0 does not increment TPM DA counter by one)
config/busybox.config:	add reboot command under busybox
initrd/bin/reboot:	use 'busybox reboot -f' instead of 'echo b > /proc/sysrq-trigger'
modules/busybox:	remove /sbin/reboot symlink to busybox so that our /bin/reboot is called, which calls busybox for reboot

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2025-07-16 10:03:04 -04:00
Thierry Laurion 50dbda2498 Makefile: initrd creation refactoring to seperate mktemp initrd dir for tools.cpio dir (initrd_tmp_dir/tools/bin+lib) and data (initrd_tmp_dir/data) so that wiping tools don't wipe data
There was an issue where initrd_tmp_dir was used to create tools.cpio and wipe that dir, while data.cpio was subdirectory of initrd_tmp_dir.
This seperates tools.cpio temp dir from data.cpio temp dir:
- tools.cpio:	initrd_tmp_dir/tools/{bin,lib}
- data.cpio:	initrd_tmp_dir/data

So that when wiping happens of a subdir, this doesn't affect others:
- initrd_tmp_dir = mktemp -d
- initrd_tools_dir = initrd_tmp_dir/tools
- initrd_bin_dir = initrd_tools_dir/bin
- initrd_lib_dir = initrd_tools_dir/lib
- initrd_data_dir = initrd_tmp_dir/data

This commit:
- Use proper variable names everywhere, no more initrd_tmp_dir.
  - initrd_tools_dir, initrd_lib_dir, initrd_bin_dir, initrd_data_dir
- change to busybox (initrd_tmp_dir/bin -> initrd_bin_dir) as well and review all other modules

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2025-05-16 13:34:31 -04:00
Thierry Laurion ef2da59d23 Merge remote-tracking branch 'osresearch/master' into HEAD 2025-05-05 13:10:03 -04:00
Jonathon Hall 2af1305b53 linux: Ship the default keymap if loadkeys is included
This is the actual default keymap the kernel loads by default (it is
different from any of the keymaps provided by kbd, although possibly
not in any way anyone would care about).

This makes loadkeys --default work.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
2025-05-02 17:41:21 -04:00
Thierry Laurion 4eb038c7cc modules/musl-cross-make: use $(MAKE) correctly at configure step (what generating error since $$$$(MAKE) was resolved to MAKE in configure.log, but was still working correctly)
See: https://app.circleci.com/pipelines/github/tlaurion/heads/3314/workflows/e588480d-d13a-49e0-a1b6-78fed839b70b/jobs/67601?invite=true#step-102-1420_53

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2025-05-02 15:29:14 -04:00
Thierry Laurion 03cff4588d modules/kbd: deploy keymaps under usr/lib/kbd/keymaps
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2025-04-24 14:38:01 -04:00
Thierry Laurion d3bfc2ff75 PoC: Makefile + kbd : add kbd inconditionally (loadkeys) and all kbd source keyboard keymaps under data.cpio
user@localhost:~/heads$ ls -alh /home/user/heads/build/x86/qemu-coreboot-whiptail-tpm2/data.cpio
-rw-r--r-- 1 root root 2.4M Apr 23 12:33 /home/user/heads/build/x86/qemu-coreboot-whiptail-tpm2/data.cpio
user@localhost:~/heads$ sudo xz --check=crc32 --lzma2=dict=1MiB build/x86/qemu-coreboot-whiptail-tpm2/data.cpio -z -9
user@localhost:~/heads$ ls -alh build/x86/qemu-coreboot-whiptail-tpm2/data.cpio.xz
-rw-r--r-- 1 root root 158K Apr 23 12:33 build/x86/qemu-coreboot-whiptail-tpm2/data.cpio.xz

So adding all source based keymaps add 158Kb compressed to initrd.cpio.xz

TODO:
- init: if exported keymap_path and file exists: loadkeys it; otherwise ontinue as of now and defaults to default US keymap
- Configurator deitor: show filelist, loadkeys keymap, test input with user, confirm keymap selection, persist setting
- Add to oem-factory-reset (but adds another step: in default steps? in non-default? Desired workflow?)
  - This is desired for a long time since OEM customize keyboard selected by end user prior of shipping: so should customize keymap under Heads and OS install.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2025-04-24 14:37:50 -04:00
Thierry Laurion a92a07daa6 Makefile / modules/ncurses: add data.cpio logic to seperate data files (terminfo/l/linux -> /etc/terminfo/l/linux previously under tools.cpio)
TODO: detail work done here prior of merge
For the moment, see this uncleaned branch https://github.com/tlaurion/heads/tree/transition_to_data_cpio

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2025-04-24 14:37:44 -04:00
Thierry Laurion c627965397 bugfix: modules/coreboot + blobs/xx80: rely on github for git, not review.coreboot.org
https://review.coreboot.org is having HTTPS issue. Reported on coreboot matrix channel, but need to build.

Log from CircleCI failing when trying to pull deguard: https://app.circleci.com/pipelines/github/tlaurion/heads/3267/workflows/588f8aeb-4d73-4f71-9e6e-fd286e46353e/jobs/66442/parallel-runs/0/steps/0-111

Reasoning:
We might dislike GitHub, but when comes maintaining a project and using free systems for bandwidth and CI because no money, we need to rely on systems that don't randomly fall.
Using github does that purpose here

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
2025-04-03 11:09:17 -04:00