7 Commits

Author SHA1 Message Date
Sandeep Gundlupet Raju
8861e85b10 generate-version.py: Add verion and help options
Replace basic sys.argv argument parsing with argparse module to provide:
- Change the Zephyr version argument from a positional argument to an
  explicit -v/--version option, making the intent clearer at the command
  line.
- Proper -h/--help option with usage information.
- Better error messages for invalid version format.
- Usage examples in help text.
- Improved user experience.
- Update README.md with usage.

The script now displays helpful information when called with --help:
  $ generate-version.py --help
  usage: generate-version.py [-h] -v VERSION

  Generate Zephyr kernel source include file for a specific version

  options:
    -h, --help            show this help message and exit
    -v VERSION, --version VERSION
                        Zephyr version in the form x.y.z (e.g., 3.7.0, 4.3.0)

  Example:
    generate-version.py -v 3.7.0
    generate-version.py --version 4.3.0

AI-Generated: GitHub Copilot (Claude Sonnet 4.6)

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
2026-03-09 17:57:27 +08:00
Sandeep Gundlupet Raju
20fdef3ce3 zephyr-kernel-src.inc.jinja: Update script to generate srcrev
Update script to generate correct SRCREV and other info to match
poky variable updates.

Also use "version" instead of "short_version" for SRC_URI_PATCHES.

Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
2025-08-18 07:47:40 +08:00
Peter Hoyes
81babac06d zephyr-core/scripts: Resolve West revisions to SHAs
The West manifest in  Zephyr 3.3 contains a tag (instead of a SHA) for
zcbor [1]. OE standard practice is to always specifiy revisions using
SHAs, so in the Jinja template, use the new resolve_revision filter to
resolve any tags.

[1] https://github.com/zephyrproject-rtos/zephyr/pull/51219#discussion_r998123145

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
2023-04-20 15:02:55 +08:00
Peter Hoyes
0a05d27d14 zephyr-core/scripts: Resolve Zephyr tag using git ls-remote
To simplify the logic to resolve Git tags to SHAs, and so that it works
with non-Github repositories, use git ls-remote instead of the Github
API.

Make the resolve_revision function available as a Jinja filter and move
the version resolution to the template.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
2023-04-20 15:02:55 +08:00
Peter Hoyes
d075b06ade zephyr-core/zephyr-kernel: Remove the downstream "yocto" toolchain
The "yocto" toolchain requires a downstream patch to be carried and
maintained. The upstream "cross-compile" toolchain is equivalent so this
is no longer needed.

Remove the toolchain-specific inc file and the downstream patch.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
2023-02-24 16:24:35 +08:00
Peter Hoyes
1312cb2a19 zephyr-core/zephyr-kernel: Add ZEPHYR namespace to SRC_URI variables
Certain SRC_URI_* variables may collide with other recipes, e.g.
SRC_URI_TRUSTED_FIRMWARE_A. Namespace these variables under
SRC_URI_ZEPHYR so that the SRC_URIs of Zephyr modules can be
independently tweaked from local.conf or the environment.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
2023-01-26 16:45:44 +08:00
Peter Hoyes
f12da18fe0 zephyr-core/scripts: Introduce script to generate new versions
Add a Python script which can be used to automatically generate
configuration for new Zephyr versions. This script:
 * Takes the Zephyr version as a single argument
 * Uses the Github API to find the version tag's SHA1
 * Uses West as a library to parse the version's manifest file
 * Uses a Jinja template to generate a .inc file for the version
 * Outputs the .inc file directly into the zephyr-kernel directory

The generated .inc file includes:
 * SRCREVs for all modules
 * Separate SRC_URI_x variables for each module, to make it easier to
   swap out a specific URL for a fork or mirror
 * A version-specific SRC_URI, containing only the modules defined in
   the release
 * A list of the ZEPHYR_MODULES

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Tested-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
2022-09-21 11:51:20 +08:00