-
-
Notifications
You must be signed in to change notification settings - Fork 14
json: add kernel_version field to images output #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe PR modifies scripts/generate-armbian-images-json.sh to add a new JSON column Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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).
There was a problem hiding this 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.
5ac3a31 to
3d2b921
Compare
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>
3d2b921 to
9d4a432
Compare
Summary
kernel_versionfield to armbian-images.json output6.6.62extracted fromArmbian_24.11.1_Bananapi_bookworm_current_6.6.62_xfce_desktop.img.xzThis allows users to filter and identify images by their kernel version.
Test plan