Skip to content

Proposed Change - Add Kernel Version Parsing and Custom Description #8152

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

Merged
merged 3 commits into from
May 29, 2025

Conversation

Grippy98
Copy link
Contributor

@Grippy98 Grippy98 commented May 5, 2025

Proposed change may not be ideal in how it's written - especially the helper function - so open to cleanup/discussion.

Description

This PR adds the option to set custom descriptions to kernel options inside the build system. If no custom description is given inside family.conf, the default descriptions are still used.

It also adds parsing and displaying the KERNEL_MAJOR_MINOR to the description from the family.conf.

Example -

Screenshot 2025-05-04 at 12 23 17 PM

Documentation summary for feature / change

  • short description - Kernel Version Parsing and Custom Description
  • summary - set custom description for kernel build options
  • example of usage - Declare KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION for kernel options inside family.conf

How Has This Been Tested?

  • Run build and check with both EXPERT=yes & no that standards descriptions do not break
  • Run build with k3.conf modified to have KERNEL_DESCRIPTION option set for all kernels

Checklist:

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@Grippy98 Grippy98 added Needs review Seeking for review Needs Documentation New feature needs documentation entry Feature Request Feature suggestion labels May 5, 2025
@Grippy98 Grippy98 requested a review from a team as a code owner May 5, 2025 03:43
Copy link
Contributor

coderabbitai bot commented May 5, 2025

"""

Walkthrough

The changes introduce and utilize a new configuration variable, KERNEL_DESCRIPTION, across several scripts and configuration files. The track_general_config_variables function now tracks KERNEL_DESCRIPTION alongside other kernel-related variables. A new function, get_kernel_info_for_branch, is added to extract both kernel version and description from the board family configuration for a given branch. The interactive kernel branch selection logic is updated to dynamically display these descriptions. The k3 family configuration is updated to provide descriptions for existing branches.

Suggested labels

ready to merge

Suggested reviewers

  • igorpecovnik
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce95b07 and c994eef.

📒 Files selected for processing (3)
  • config/sources/families/k3.conf (2 hunks)
  • lib/functions/configuration/change-tracking.sh (1 hunks)
  • lib/functions/configuration/interactive.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • lib/functions/configuration/change-tracking.sh
  • config/sources/families/k3.conf
  • lib/functions/configuration/interactive.sh
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines 05 Milestone: Second quarter release Framework Framework components labels May 5, 2025
@coderabbitai coderabbitai bot added the Ready to merge Reviewed, tested and ready for merge label May 5, 2025
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

🧹 Nitpick comments (1)
lib/functions/configuration/interactive.sh (1)

179-207: Add robust parsing for kernel version & description
The new get_kernel_info_for_branch() function cleanly extracts KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION via awk. Consider adding a guard for a missing or unreadable config file:

if [[ ! -r "$conf_file" ]]; then
  echo "|"
  return 0
fi

to avoid an awk error when ${BOARDFAMILY}.conf is absent.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec34878 and 61e0a7f.

📒 Files selected for processing (3)
  • lib/functions/configuration/change-tracking.sh (1 hunks)
  • lib/functions/configuration/interactive.sh (1 hunks)
  • lib/library-functions.sh (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
lib/functions/configuration/interactive.sh (1)
.github/generate_CODEOWNERS.sh (1)
  • display_alert (6-6)
🔇 Additional comments (4)
lib/functions/configuration/change-tracking.sh (1)

43-45: Track new KERNEL_DESCRIPTION variable
Including KERNEL_DESCRIPTION in the track_config_variables call aligns change‐tracking with the new interactive parsing logic. This ensures that changes to custom kernel descriptions are properly displayed.

lib/library-functions.sh (3)

103-111: Verify relocation of artifact-uboot.sh sourcing
Moving the U-Boot artifact script immediately after artifact-rootfs.sh may be necessary if U-Boot packaging depends on rootfs variables. Please run a full U-Boot build to confirm no unintended side effects.


477-489: Confirm patch order for drivers_network vs drivers-harness
Swapping these two may impact interdependent patches. Ensure that network patches still apply cleanly when harness patches are loaded next.


697-705: Approve moving github-actions.sh after git.sh
Loading GitHub-Actions helpers immediately after core git.sh is logical, as those functions likely depend on Git operations being available.

@github-actions github-actions bot removed the Ready to merge Reviewed, tested and ready for merge label May 14, 2025
@coderabbitai coderabbitai bot added the Ready to merge Reviewed, tested and ready for merge label May 14, 2025
@igorpecovnik
Copy link
Member

Good idea! For the implementation part - looks decent, can be done better sure. Perhaps adding real-world example (or two) in a separate commit within this PR?

lib/library-functions.sh probably doesn't need to be changed?

@github-actions github-actions bot removed the Ready to merge Reviewed, tested and ready for merge label May 23, 2025
@Grippy98
Copy link
Contributor Author

Grippy98 commented May 23, 2025

@igorpecovnik I reverted the change to library-functions since that was auto generated.

There's already a few examples since it parses any family that declared KERNEL_MAJOR_MINOR in its kernel versions.

I did also add custom kernel descriptions to k3.conf as an example - will be more relevant once a PR like this gets merged (so we do more build options and plan is to show both vendor and upstream options) - Grippy98#1

Screenshot 2025-05-23 at 3 39 19 PM

I'm not sure where to best document it. I can do a separate PR to documentation if you want, if you have a preferred spot let me know - just struggling to see where it fits best right now.

Otherwise it will automatically start showing for any family that did declare that variable -

Marvel -

Screenshot 2025-05-23 at 3 24 16 PM

Samsung -

Screenshot 2025-05-23 at 3 25 00 PM

Rockchip-rk3588

Screenshot 2025-05-23 at 3 28 15 PM

@Grippy98 Grippy98 requested a review from igorpecovnik as a code owner May 23, 2025 20:37
@github-actions github-actions bot added the Hardware Hardware related like kernel, U-Boot, ... label May 23, 2025
@coderabbitai coderabbitai bot added the Ready to merge Reviewed, tested and ready for merge label May 23, 2025
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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44d8f5d and e715774.

📒 Files selected for processing (1)
  • config/sources/families/k3.conf (1 hunks)
🔇 Additional comments (2)
config/sources/families/k3.conf (2)

27-27: LGTM! Clear and descriptive kernel branch labeling.

The addition of KERNEL_DESCRIPTION provides useful context for the current branch, making it easier for users to understand the purpose of this kernel option.


35-36: LGTM! Consistent description format.

The KERNEL_DESCRIPTION addition follows the same pattern as the current branch and provides clear identification of the edge branch purpose.

@Grippy98 Grippy98 force-pushed the build-extensions branch from e715774 to d97bab5 Compare May 23, 2025 20:41
@github-actions github-actions bot removed the Ready to merge Reviewed, tested and ready for merge label May 23, 2025
@coderabbitai coderabbitai bot added the Ready to merge Reviewed, tested and ready for merge label May 23, 2025
@github-actions github-actions bot removed the Ready to merge Reviewed, tested and ready for merge label May 27, 2025
@coderabbitai coderabbitai bot added the Ready to merge Reviewed, tested and ready for merge label May 27, 2025
Grippy98 added 3 commits May 29, 2025 12:22
Adds ability to set custom descriptions for kernel inside family config and parses for kernel version.
@Grippy98 Grippy98 force-pushed the build-extensions branch from a118c55 to c994eef Compare May 29, 2025 17:26
@github-actions github-actions bot removed the Ready to merge Reviewed, tested and ready for merge label May 29, 2025
@coderabbitai coderabbitai bot added the Ready to merge Reviewed, tested and ready for merge label May 29, 2025
@igorpecovnik igorpecovnik merged commit 85e5e23 into armbian:main May 29, 2025
12 checks passed
@Grippy98 Grippy98 deleted the build-extensions branch May 31, 2025 15:45
@coderabbitai coderabbitai bot mentioned this pull request Jun 3, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 Milestone: Second quarter release Feature Request Feature suggestion Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Needs Documentation New feature needs documentation entry Needs review Seeking for review Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines
Development

Successfully merging this pull request may close these issues.

2 participants