Skip to content

Mtl release downstream#16

Draft
filipleple wants to merge 990 commits into
masterfrom
mtl_release_downstream
Draft

Mtl release downstream#16
filipleple wants to merge 990 commits into
masterfrom
mtl_release_downstream

Conversation

@filipleple
Copy link
Copy Markdown
Member

No description provided.

tlaurion and others added 30 commits April 24, 2025 14:37
…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>
…yboard mappings for this board

TODO: Would need patching

Error:
user@localhost:~/heads$ cat /home/user/heads/build/ppc64/log/kbd.log
make -C "/home/user/heads/build/ppc64/kbd-2.6.1" -j12 --load-average=18  CC=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-gcc -fdebug-prefix-map=/home/user/heads=heads -gno-record-gcc-switches -D__MUSL__ --sysroot /home/user/heads/install/ppc64 -isystem /home/user/heads/install/ppc64/include -L/home/user/heads/install/ppc64/lib  AR=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-ar LD=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-ld STRIP=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-strip NM=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-nm OBJCOPY=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-objcopy OBJDUMP=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-objdump PKG_CONFIG_PATH= PKG_CONFIG_LIBDIR=/home/user/heads/install/ppc64/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=/home/user/heads/install/ppc64
make[1]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1'
make  all-recursive
make[2]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1'
Making all in src
make[3]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
Making all in libcommon
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libcommon'
  CC       getfd.o
  CC       error.o
  CC       version.o
  AR       libcommon.a
/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-ar: `u' modifier ignored since `D' is the default (see `U')
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libcommon'
Making all in libkbdfile
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkbdfile'
  CC       init.lo
  CC       kbdfile.lo
  CCLD     libkbdfile.la
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkbdfile'
Making all in libkfont
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkfont'
  CC       psffontop.lo
  CC       psfxtable.lo
  CC       utf8.lo
  CC       kdmapop.lo
  CC       context.lo
  CC       unicode.lo
  CC       kdfontop.lo
  CC       loadunimap.lo
  CC       mapscrn.lo
  CC       setfont.lo
setfont.c: In function 'try_loadfont':
setfont.c:102:14: warning: conversion from 'int' to 'unsigned char' may change value [-Wconversion]
  102 |        b2 |= 3 << (j * 2);
      |              ^
mapscrn.c: In function 'kfont_load_consolemap':
mapscrn.c:161:13: warning: conversion from 'int' to 'short unsigned int' may change value [-Wconversion]
  161 |   ubuf[i] = (0xf000 + i);
      |             ^
loadunimap.c: In function 'parseline':
loadunimap.c:220:24: warning: conversion from 'int' to 'short unsigned int' may change value [-Wconversion]
  220 |    unsigned short un = un0 - fp0;
      |                        ^~~
loadunimap.c:221:38: warning: conversion from 'int' to 'short unsigned int' may change value [-Wconversion]
  221 |    if ((ret = add_unipair(ctx, i, un + i, list, listsz, listct)) < 0)
      |                                   ~~~^~~
  CCLD     libkfont.la
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkfont'
Making all in libkeymap
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
make  all-am
make[5]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
  CC       array.lo
  CC       common.lo
  CC       dump.lo
  CC       kernel.lo
  CC       kmap.lo
  CC       func.lo
  CC       diacr.lo
  CC       loadkeys.lo
  CC       summary.lo
  CC       parser.lo
  CC       modifiers.lo
  CC       analyze.lo
kernel.c: In function 'lk_kernel_diacrs':
kernel.c:101:16: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
  101 |  if (ioctl(fd, request, (unsigned long)&kd)) {
      |                ^~~~~~~
  CC       ksyms.lo
  CCLD     libkeymap.la
make[5]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
Making all in vlock
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/vlock'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/vlock'
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
  CC       mapscrn.o
  CC       loadunimap.o
  CC       dumpkeys.o
  CC       showkey.o
  CC       loadkeys.o
  CC       setfont.o
  CC       showconsolefont.o
  CC       setmetamode.o
  CC       setleds.o
  CC       kbd_mode.o
  CC       psfxtable.o
  CC       fgconsole.o
  CC       kbdrate.o
  CC       chvt.o
  CC       deallocvt.o
  CC       openvt.o
  CC       kbdinfo.o
  CC       getkeycodes.o
  CC       setvtrgb.o
  CC       setkeycodes.o
  CC       resizecons.o
  CCLD     mapscrn
  CCLD     loadunimap
resizecons.c: In function 'main':
resizecons.c:303:19: warning: signed conversion from 'long unsigned int' to 'int' changes value from '2148037735' to '-2146929561' [-Wsign-conversion]
  303 |     if (ioctl(fd, TIOCSWINSZ, &winsize))
      |                   ^~~~~~~~~~
  CCLD     dumpkeys
  CCLD     loadkeys
resizecons.c: In function 'vga_set_cursor':
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
  394 |  __asm__ volatile("outb %0,%1"
      |  ^~~~~~~
resizecons.c:402:2: error: inconsistent operand constraints in an 'asm'
  402 |  __asm__ volatile("inb %1,%0"
      |  ^~~~~~~
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
  394 |  __asm__ volatile("outb %0,%1"
      |  ^~~~~~~
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
  394 |  __asm__ volatile("outb %0,%1"
      |  ^~~~~~~
resizecons.c:402:2: error: inconsistent operand constraints in an 'asm'
  402 |  __asm__ volatile("inb %1,%0"
      |  ^~~~~~~
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
  394 |  __asm__ volatile("outb %0,%1"
      |  ^~~~~~~
  CCLD     showkey
make[4]: *** [Makefile:993: resizecons.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
make[3]: *** [Makefile:1040: all-recursive] Error 1
make[3]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
make[2]: *** [Makefile:489: all-recursive] Error 1
make[2]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1'
make[1]: *** [Makefile:420: all] Error 2
make[1]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1'

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…llback/save to persist across reboots

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…it after usb drivers loaded for optional usb keyboard support

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…ib/kbd/keymaps/i386/qwerty/us.map' explicitely since qemu don't support internal flashing still

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…y/qwertz/azerty) prior of chossing, testing one, rejecting, testing one until confirming ok.

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…ard keymaps) for those boards with insufficient SPI space (8MB)

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
there was a bug where the user was never asked to enter a new passphrase
thus the luks_new_Disk_Recovery_Key_passphrase was not set and an empty file
was used as the key-file
apart from being a serious confidentiality issue as an empty password does not provide any protection
it is also not possible to enter empty passwords from the prompts upon boot in both heads and payload OSes
therefore the user would have to manually change the password once the bug hit them

the bug was triggered because of a weird if else code path in which the else branch would never be taken
because test_luks_current_disk_recovery_key_passphrase would always already set the current passphrase

Signed-off-by: gaspar-ilom <gasparilom@riseup.net>
doc: Start documenting Heads logging and configuration variables
…hrase equiv) + easthetic fixes

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…p_without_firmware_upgrade_boot_wiped-staging

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Asking to press Enter is more forgiving than "any key" and good, but we
also have to actually continue on Enter instead of any key.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
… sleep one second before continuing

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…mpts

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…l selected containers prior of prompting for new DUK

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…nderstanding and debugging

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…d leaves 1 second to the user to read the notice

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…: we add procps+psmisc in flake.nix to be able to troubleshoot processes and /proc related info from docker image

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
… musl-cross-make from x230 to t480 (t480 is part of save_cache, not x230...)

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…t 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>
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>
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Put a board's keymap at /etc/board_keys.map and support it in the
normal logic, instead of with ad-hoc logic in the board init.

Whenever loading a new keymap, reset the current keymap first, and load
the board's override last (if there is one).  This way, the result is
always the same even if the new keymap does not define all keys, and
the board's overridden keys stay overridden.

Use the actual kernel default instead of us.map (which is different,
but possibly not in any way anyone would care about).

Remove some redundant loads of the current keymap when canceling.  We
already restore the current keymap any time a change was made that was
rejected.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
…d_docker_proc_tools

Fix CicleCI cache usage; add docker proc tools for debugging (flake.nix + docker 0.2.5 upload)
…G message where useful, add context in case linux shipped keymap not loading for DO_WITH_DEBUG

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
tlaurion and others added 22 commits April 20, 2026 10:49
…mal changes to build Dasharo-EC

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
- 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>
…port

- 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>
…nges

When the coreboot git commit changes (canary mismatch), remove and recreate
the board-specific build directories to prevent stale artifacts from causing
compilation failures.

This eliminates the need for manual `rm -rf build/x86/BOARD` before rebuilding
after coreboot canary updates in development cycles (when creating patches).

One currently still has to, eg:
echo "bogues repo url + commit hash" | sudo tee /home/user/heads/build/x86/coreboot-25.09/.canary

Current logic then:
1. Detects canary changes and triggers repository cleanup
2. Removes both Heads board directory (build/x86/BOARD) and coreboot board
   directory (build/x86/coreboot-*/BOARD) that contain stale build artifacts
3. Recreates empty board directories for the subsequent build
4. Allows patches to apply cleanly without Ada compilation errors

This ensures Ada builds work correctly after coreboot updates without manual
intervention (resync repo, apply patches, clean artifact dirs and rebuilds only what changed).

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…g (Improve performance by lowering the EPP value from the power-on default of 0xb3 (70%) to 0x73 (45%). Lower value = higher performance.)

Test fix for Dasharo/dasharo-issues#1711

related:

- linuxboot#2039
- Dasharo/dasharo-issues#1711
- linuxboot#1894

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…nreleased

The coreboot module for NovaCustom MTL boards was renamed from
'dasharo' to 'dasharo_v56'. The Heads patch system resolves patch
directories as <module_name>[-<patch_version>], so with module
coreboot-dasharo_v56 and patch_version=unreleased the expected path
is patches/coreboot-dasharo_v56-unreleased/.

Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…nfig

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>
…m Dasharo/mtl_release

Command trail:
  ./docker_repro.sh make BOARD=UNTESTED_nitropad-ns50 coreboot.save_in_oldconfig_format_in_place
  ./docker_repro.sh make BOARD=UNTESTED_nitropad-ns50 coreboot.save_in_defconfig_format_backup
  git difftool -d
  sudo cp config/coreboot-nitropad-ns50.config_defconfig config/coreboot-nitropad-ns50.config
  ./docker_repro.sh make BOARD=UNTESTED_nitropad-ns50 coreboot.save_in_oldconfig_format_in_place
  ./docker_repro.sh make BOARD=UNTESTED_nitropad-ns50 coreboot.save_in_defconfig_format_backup

Preserve smbios strings from origin/master while reducing unnecessary
defconfig changes to only critical deviations:
- Use RaptorLake FSP headers (MTL release)
- Set CONFIG_USE_PC_CMOS_ALTCENTURY=n
- Enable console loglevel/ansi prefixes
- Fix debug output: HWBASE_DEBUG_NULL -> HWBASE_DEBUG_CB

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
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>
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>
@filipleple filipleple force-pushed the mtl_release_downstream branch from a578560 to b422c41 Compare April 22, 2026 06:27
tlaurion and others added 2 commits April 22, 2026 09:36
…01_rc3

REGRESSION TESTING for next Dasharo+Heads:  v560tu/v540tu dasharo tag 1.0.1, have all Dasharo coreboot based boards use their own tags
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
@filipleple filipleple force-pushed the mtl_release_downstream branch from b422c41 to e06ce53 Compare April 23, 2026 06:26
filipleple added 2 commits May 6, 2026 08:05
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
@tlaurion
Copy link
Copy Markdown

Where can I see automated tests results?

@filipleple
Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.