Commit graph

669 commits

Author SHA1 Message Date
bunnie
213a011051 apply a clean patch of the changes required to fix ci 2026-05-06 08:45:15 +08:00
yoda
fa7e34d87a
Resolve relative --config paths in xtask
Problem: relative .toml config paths don't resolve
when cargo is invoked from a subdirectory like kernel/.

Solution: convert relative paths to absolute against
the project root in the cargo() helper.
2026-03-19 01:53:42 +09:00
bunnie
e548696757
Merge pull request #834 from sbellem/cargo-manifest-dir
fix: use runtime CARGO_MANIFEST_DIR
2026-03-18 11:05:39 +08:00
Sylvain Bellemare
fa14fa78c6
feat(xtask): add --config flag for cargo config
Problem: there is no way to pass extra cargo config
(e.g. vendored sources) through xtask to the
underlying cargo invocations.

Solution: accept --config flags in cargo xtask and
thread them through all internal cargo invocations.
The cargo() helper now returns a Command with the
config flags already applied.
2026-03-18 11:06:04 +09:00
Sylvain Bellemare
b83800ba5a
fix: use runtime CARGO_MANIFEST_DIR
Problem: env!() bakes the path at compile time,
so it breaks when the binary runs from a different
location (e.g. a Guix/Nix sandbox or container).

Solution: use std::env::var() to read it at runtime.
2026-03-18 10:50:09 +09:00
bunnie
9be2cbf99e remove baobit commit command line argument
the baobit commit will be injected at final file packaging time
2026-02-16 18:07:01 +08:00
bunnie
2c7150bc9b
Baobit version refinements
- add a function we can re-use to check if a file needs updating
- change the wording of the baobit commit when it's not specified
to "unspecified" vs. "unknown"
2026-02-16 01:33:06 +08:00
Sylvain Bellemare
3ea92d3bad
Add --baobit-commit flag for build provenance
Adds BAOBIT_COMMIT constant to boot0/boot1 version.rs, allowing
the Guix build channel commit to be embedded in firmware for
reproducibility verification.

- Add --baobit-commit CLI flag to xtask
- Generate BAOBIT_COMMIT in boot version files
- Display in audit command output
- Simplify versioning.rs to always write files
2026-02-16 08:24:55 +09:00
bunnie
414cff252f chore: fix formatting
somehow some formatting regressions snuck in despite previously
being CI-clean on formatting.

I suspect this might have to do with the Rust 1.93.1 bump
that happened just recently, sometimes new versions of Rust
introduce small formatting changes.
2026-02-14 19:47:50 +08:00
Sylvain Bellemare
c98f846970
Fix swap image signing with --git-describe
Pass semver from --git-describe to swap image signing code path.

PR #817 added --git-describe and --git-rev support but the swap
image code path in xous-create-image was not updated to use the
semver for signing.

Changes:
- swap_writer.rs: Add semver parameter to encrypt_to()
- xous-create-image.rs: Parse --git-describe and pass to encrypt_to()
- xous-app-uf2.rs: Same changes for consistency
- builder.rs: Pass --git-describe to xous-create-image

Fixes #818
2026-02-13 16:27:21 +09:00
Sylvain Bellemare
a052cafb8f
Add --git-describe and --git-rev CLI args
Enable reproducible builds without git state by accepting
version info as CLI arguments:

- --git-describe: version string for signing (e.g., v0.10.0-19-g0d934e1)
- --git-rev: commit hash for swap nonce (last 16 hex chars used)

Renames xtask --gitrev to --git-describe for clarity.
2026-02-13 03:44:37 +09:00
Sylvain Bellemare
171e32e834
Fix git describe abbrev length for reproducibility
Signed-off-by: Sylvain Bellemare <sbellem@gmail.com>
2026-02-12 19:30:10 +09:00
bunnie
8930579580
Merge pull request #809 from betrusted-io/release-bump
add --gitrev argument to xtask
2026-02-11 01:59:15 +08:00
bunnie
4aba11df5f
Merge branch 'main' into source-date-epoch 2026-02-11 01:27:12 +08:00
bunnie
41ea75953d make toolchain matching more strict
this picks a toolchain that matches the actual target we're building
instead of just the first toolchain in the list (which with the addition
of -emc toolchain causes things to break).
2026-02-11 01:02:13 +08:00
Sylvain Bellemare
5c424fa678
xtask: deterministic builds with SOURCE_DATE_EPOCH
When SOURCE_DATE_EPOCH is set, use it instead of Local::now() for the
embedded build timestamp. This enables deterministic builds via Guix,
Nix, and other reproducible build systems.

See: https://reproducible-builds.org/docs/source-date-epoch/

Design notes:

- Panics on invalid SOURCE_DATE_EPOCH rather than warn-and-fallback,
  because silent fallback would produce non-reproducible output while
  the user expects reproducibility. Build systems should fail loudly
  on misconfiguration.

- Preserves Local::now() fallback when SOURCE_DATE_EPOCH is unset,
  keeping local timezone for developer convenience during debugging.
2026-02-10 23:39:35 +09:00
bunnie
32f9ae1631 add --gitrev argument to xtask
this allows build systems that lack git state to build an image.
The effective git revision must be correctly computed by the build
system or substituted for everything to work correctly.

Note that completely faking the entry will lead to subtle problems
down the road; for example, a purpose of the revision is to check
which versions are compatible for upgrades against each other
(some upgrade paths require a hop through an older version). Faking
this can bypass the mechanism and then lead to instability down
the road.

However, some build systems (such as guix) strip out the git state,
but the revision can be safely generated in the calling environment
and passed as a variable.
2026-02-09 15:08:55 +08:00
bunnie
791068e073 fix regression in app location in dabao build script
apps were accidentally getting stuck in the kernel

very confusing

much strange

wow
2026-01-31 15:36:22 +08:00
bunnie
9a008730f6 add the ability to specify regions for apps; eliminate default apps
Default apps for base xous configs are now eliminated - this
allows third party builds to add their apps without having to
delete the default apps used for initial testing (the upshot is
that the CI scripts elsewhere are now all modified to include the
apps I'm using to test the system; which is fine).

So now, `dabao` and `baosec` build what is a baseline set of
services that I think are expected in either platform. In the case
of dabao, apps get stuck in the detached-app area; in the case of baosec,
apps are stick in swap.

So:

`cargo xtask baosec bao-console vault2`

by default sticks the app `bao-console` and `vault2` into swap.
If you want one of these programs to go into RRAM instead, you would
specify the build like this:

`cargo xtask baosec bao-console~flash vault2`

The `~<region>` syntax indicates that the thing to the left of `~`
is the name of the app; and to the right is a region spec, one of:
[swap, flash, ram].

No checking is done that these regions are valid or even good
for placing these things, the image just tries its best to whack 'em
in there. If you blow out the size of the kernel, at least, a
warning will be emitted.

This change enables more flexible out-of-tree options for
developers who don't want to build the whole Xous kernel, but
at the moment, caveat hacker - things are still in flux and under
heavy development. I think in about 2-3 months things will settle
down enough that we'll cut a release and then the APIs should be
cleaner/more stable, but for now anyone developing with a pre-release
dabao board is recommended to either build kernel from scratch or
at least fetch the latest CI image off of the CI server if things
seem squirrelly.
2026-01-31 02:08:45 +08:00
bunnie
0e4f82cb02 cleanup some hard-coded constants 2026-01-30 04:00:40 +08:00
bunnie
fc6a4179bd modify tools to xous-tools
also add `xous-` prefix to binaries like copy-object

this allows us to publish the tools as a package and allow
people to `cargo install` them with less chance of name space
conflicts.
2026-01-30 02:16:17 +08:00
bunnie
6f71359d18 update all the locks and verifiers 2026-01-29 19:17:40 +08:00
Sylvain Bellemare
81f17fe7fc
Fix #790 2026-01-29 02:47:09 +09:00
bunnie
176fb109f3 update verifier pin and cleanup publisher script 2026-01-28 20:54:48 +08:00
bunnie
cc090eaff8 remove susres from verifier and version bump 2026-01-28 00:36:41 +08:00
bunnie
b37d58fd59 add baosec-lite targets
baosec-lite strategy is to use the OEM board type, and then diff
off of the baosec target.

The assumption is that if you're building for a baosec-lite target,
you're committing to re-doing the bootloader from the stock bootloader
and pivoting into a full-custom baosec-lite build.

This assumption allows us to "hard code" more of the baosec-lite
differences, instead of having to leave other board options available
for a more portable firmware.
2026-01-24 23:06:14 +08:00
bunnie
284e639453 adjust xtask default features
- dabao now includes debug-proc by default
- gdb-stub now passes to both kernel and user programs, so that
uart switching can be achieved
- print-panics activated in the kernel, so we can see the panic
messages. They had disappeared for a while, and didn't notice.
2026-01-14 03:10:17 +08:00
bunnie
8fcb70118a update verifier pins 2026-01-08 03:11:45 +08:00
bunnie
8d8f3f4243 re-enable usb responder in hosted mode 2025-12-24 13:13:50 +08:00
bunnie
bfdea56dff add provisional baosec-lite target
what does it take to fit baosec without swap....
2025-12-22 16:15:34 +08:00
bunnie
5b8c4990d7 bump the pins on the verifiers - forgot to do this earlier 2025-12-18 02:20:22 +08:00
bunnie
5cd165fe8e fix doc comments & safety on std::env manipulation 2025-12-15 18:00:40 +08:00
bunnie
6080667deb
move console into swap
we've run out of space in the main image, so this gives us
some breathing room.
2025-12-06 18:21:14 +08:00
bunnie
7631ad9e20 move bao-video to XIP flash
we've got the space - might as well.

there's about 300k of space left in the xous image after this
modification. This is starting to cut it close, so this is
the last item that makes it into the "fixed" xous image.
2025-11-28 18:43:08 +08:00
bunnie
32aab99e97 clarify missing timestamp 2025-11-27 12:33:26 +08:00
bunnie
f502270b60 remove force-dabao default for altboot1 2025-11-22 13:43:20 +08:00
bunnie
4f2d1215bc add deliberately misordered keystore config
for validating keystore hw protection
2025-11-21 00:58:05 +08:00
bunnie
22fce8bae0 add hosted mode target for bao1x 2025-11-17 17:33:04 +08:00
bunnie
22cfaafce4 add force-dabao to alt-boot1 image generation
at least for now, with dabao being the only board in the field,
this makes sense.
2025-11-13 22:18:37 +08:00
bunnie
c44c63a72b add vault2 to the app list default 2025-11-12 15:27:26 +08:00
bunnie
8c421c6050
Merge branch 'main' into vault2 2025-11-11 08:47:10 +08:00
bunnie
82649e683e align hosted environment to current baosec environment
adds a dummy UUID
2025-11-08 04:21:12 +08:00
bunnie
fe136ff820
Merge branch 'main' into vault2 2025-11-02 10:40:47 +08:00
bunnie
26078dcc7d add keystore to dabao configuration
After some contemplation, we should include the keystore in the
core service set featured by the dabao-xous configuration.

The pros are: any compatibility/sharing of resources
that require access to RRAM, one-way counters, UUIDs, etc.
will either require a wholly separate implementation that is
"insecure" or it could just reuse the baosec work. Furthermore,
as cryptographic accelerators are laid into the keystore,
the APIs become available to the dabao environment

The cons are: more space is used in a space-constrained
dabao environment (roughly 140k "deadweight" at the start, but
as cryptographic APIs get layered in this can grow substantially);
the key slots are "used up" in part by the scheme, which leaves
less key slots available for user-defined purposes.

This is mitigated by the fact that there are a couple thousand
key slots, and so even though we use a couple hundred of them
it's still not the whole range.

Also, the baosec/dabao feature flag can be used to feature-out
cryptographic APIs/accelerators that are too obscure or not
useful for the dabao environment, to "lighten up" the
firmware load.
2025-11-01 22:59:07 +08:00
bunnie
05c9828106
Merge pull request #712 from betrusted-io/dabao-console-default
make dabao-console a default app for the dabao target
2025-11-01 19:08:29 +08:00
bunnie
0bcd861d9c add app deduplication code
this ensures that a given app is not included more than once

significantly, this allows for an app to be in the default list
and also selectable from the menu and you don't end up with
two copies of it in the binary.
2025-11-01 14:19:58 +08:00
bunnie
23f8534d87
Merge pull request #713 from betrusted-io/app2apps
Rename 'app.uf2' to 'apps.uf2'
2025-11-01 02:57:08 +08:00
bunnie
dd144b9446 fix feature tree for dabao build
"usb" is now default for dabao-console, should not be passed
as a universal feature to all apps as not all apps have that
feature
2025-10-31 12:13:54 +08:00
bunnie
f66944990a fix feature tree for dabao build
"usb" is now default for dabao-console, should not be passed
as a universal feature to all apps as not all apps have that
feature
2025-10-31 12:12:52 +08:00
bunnie
0e399e6264 rename detached-app partition to "apps.uf2"
Per @rowr111 suggestion to make it less confusing in that
the app partition can in fact contain more than one app.
2025-10-31 11:27:42 +08:00