Skip to content

Conversation

@igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Feb 1, 2026

Summary

  • Add kernel_version field to armbian-images.json output
  • Extract kernel version from image filename using regex
  • Example: 6.6.62 extracted from Armbian_24.11.1_Bananapi_bookworm_current_6.6.62_xfce_desktop.img.xz

This allows users to filter and identify images by their kernel version.

Test plan

  • Run the script and verify kernel_version field is populated correctly
  • Check JSON output includes kernel_version for all image types

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 1, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

The PR modifies scripts/generate-armbian-images-json.sh to add a new JSON column kernel_version and populate it for each asset. It extracts KERNEL_VERSION from image filenames (handling Armbian and community variants, stripping suffixes and extensions) and inserts kernel_version between file_extension and platinum in the header. The script updates both main board asset lines and reusable-board outputs to include the computed kernel version while keeping existing fields and output structure intact.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding a kernel_version field to the JSON output for Armbian images.
Description check ✅ Passed The description is clearly related to the changeset, providing context about the kernel_version field extraction and including a test plan for verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kernel_ver

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added 02 Milestone: First quarter release size/small PR with less then 50 lines Needs review Seeking for review labels Feb 1, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@scripts/generate-armbian-images-json.sh`:
- Around line 552-557: The regex used to set KERNEL_VERSION from IMAGE_NAME
shifts fields when the version has a suffix (e.g., -trunk); update the pattern
in the if [[ "$IMAGE_NAME" =~ ... ]] so the version token allows an optional
suffix (consume any non-underscore chars after the numeric version) and make the
kernel capture the correct group (adjust BASH_REMATCH index accordingly);
specifically modify the regex to include an optional non-capturing segment after
the numeric version so the kernel field is always in the same capture group,
then set KERNEL_VERSION from that stable BASH_REMATCH entry (replace the current
pattern and the BASH_REMATCH[2] usage with the new group index).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@scripts/generate-armbian-images-json.sh`:
- Around line 552-568: The KERNEL_VERSION extraction is being truncated to the
major version by the parameter expansion KERNEL_VERSION="${KERNEL_VERSION%%.*}";
replace that truncation by first removing any image file extension using the
existing strip_img_ext helper and keep the full semantic version (e.g.,
"6.6.62") — i.e., after selecting the token into KERNEL_VERSION (from IMAGE_NAME
via the f array) call KERNEL_VERSION="$(strip_img_ext "$KERNEL_VERSION")" and
keep the existing variant-stripping KERNEL_VERSION="${KERNEL_VERSION%%-*}" but
remove the erroneous KERNEL_VERSION="${KERNEL_VERSION%%.*}" line so the full
version is preserved.

Extract kernel version from image filename and include it as a
separate field in the generated JSON. This allows users to filter
and identify images by their kernel version.

Handles both standard and community image filename patterns:
- Standard: Armbian_24.11.1_Board_Distro_Branch_6.6.62_...
  → kernel at array index 5

- Community: Armbian_community_26.2.0-trunk.357_Board_Distro_Branch_6.1.115_...
  → kernel at array index 6

The extraction properly strips:
- Variant suffixes (e.g., "6.6.62-gnome" → "6.6.62")
- File extensions (e.g., "6.6.62.img.xz" → "6.6.62")
- RC suffixes (e.g., "6.19.0-rc7" → "6.19.0")

While preserving version number dots (e.g., "6.6.62", "6.12.58").

Signed-off-by: Igor Pecovnik <igor@armbian.com>
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Feb 1, 2026
@igorpecovnik igorpecovnik merged commit 597c825 into main Feb 1, 2026
4 of 5 checks passed
@igorpecovnik igorpecovnik deleted the kernel_ver branch February 1, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants