Commit Graph

11 Commits

Author SHA1 Message Date
Yonatan Schachter 00800d4818 bindesc: Add support for reading binary descriptors
This commit adds support for reading and parsing binary descriptors.
It can be used for reading the descriptors of another image, or for
iterating over one's own descriptors.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Yonatan Schachter fd68fc486c bindesc: Add maximum data size and assertion
Add a Kconfig symbol to limit the maximum size of a descriptor's
data, enforced by a build assertion.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Yonatan Schachter c8c25b5c52 bindesc: Fix placing of the descriptors end tag
Prior to this fix the descriptors end tag was placed in the binary
using LONG. This was wrong because the tag is of type short, and
the size of the descriptor (0), should have also been placed.
It so happened that on little endian machines the incorrect linker
script yielded correct results, as the extra zeros added to make
the value a long ended up as the correct byte sequence
(FF FF 00 00). On big endian machines however, the wrong sequence
is generated (00 00 FF FF).
This patch correct this issue.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Attie Grande e6dc930322 bindesc: Add support for the build version values
This patch adds bindesc support for the build version values for the
kernel and application - BUILD_VERSION and APP_BUILD_VERSION.

The kernel's BUILD_VERSION can be overridden at build time.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2024-09-04 07:03:47 -04:00
Jordan Yates 91f8c1aea9 everywhere: replace `#if IS_ENABLED()` as per docs
Replace `#if IS_ENABLED()` with `#if defined()` as recommended by the
documentation of `IS_ENABLED`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-28 07:20:32 -04:00
Yong Cong Sin bbe5e1e6eb build: namespace the generated headers with `zephyr/`
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Pieter De Gendt 3102fdc8c1 bindesc: Update build time without re-running cmake entirely
With CONFIG_BINDESC_BUILD_TIME_ALWAYS_REBUILD a re-run was called for
the entire project.
This can result in issues with the zephyr linker mechanism.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-29 15:08:39 +00:00
Alberto Escolar Piedras 4a0dec6a5a subsys/bindesc: Fix kconfig dependency
BINDESC can be used with any POSIX arch based target,
not just native_posix.
Fix the kconfig filter and the sample yaml filter.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-20 12:02:48 +01:00
Pieter De Gendt 0156593221 bindesc: Use zephyr_library_add_dependencies
Replace usage of add_dependencies(${ZEPHYR_CURRENT_LIBRARY} ...)

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2023-11-20 09:19:34 +01:00
Yonatan Schachter 23b977d1c4 bindesc: Use UTC time by default and comply with ISO-8601
Use UTC time by default, and add the option to use local time.
Also, change the default formats to comply with ISO-8601.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-10-06 13:37:02 +03:00
Yonatan Schachter 5508b17fb4 bindesc: Add initial support for binary descriptor definition
Binary descriptors are data objects stored at a known location
of a binary image. They can be read by an external tool or image,
and are used mostly for build information: version, build time,
host information, etc.
This commit adds initial support for defining such descriptors.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00