Skip to content

Automate regular x86-64 stable RT kernel Upgrade#345

Merged
chaitu236 merged 3 commits into
ni:nilrt/master/scarthgapfrom
jatinjb444:dev
May 29, 2026
Merged

Automate regular x86-64 stable RT kernel Upgrade#345
chaitu236 merged 3 commits into
ni:nilrt/master/scarthgapfrom
jatinjb444:dev

Conversation

@jatinjb444
Copy link
Copy Markdown
Contributor

@jatinjb444 jatinjb444 commented Apr 9, 2026

Changes

#work item - 3181494
https://dev.azure.com/ni/DevCentral/_workitems/edit/3181494

This PR automates fetching and merging the latest stable‑RT kernel tags into the NI Linux Real‑Time branch. It includes clean repository setup, RT merge, kernel build, deployment, and driver rebuild integration using SSHFS and DKMS. Additionally it also include defconfig regeneration and PR creation automatically once the script ran sucessfully and also sends an email to notify the user about the result status.

Justification

The RT kernel upgrade process involves multiple manual steps and is error-prone. This automation streamlines the workflow, improves reliability, and ensures consistent execution across runs.

Testing

  • Verified RT tag detection and merge
  • Successfully built and installed kernel on target
  • Confirmed reboot and kernel update using uname -r
  • Validated network functionality post-reboot
  • Verified SSHFS mount, header preparation, and DKMS rebuild
  • Confirmed driver status using dkms status

Process

Suggested Reviewers:
@rajendra-desai-ni
@Shreejit-03
@ni/rtos

@Shreejit-03
Copy link
Copy Markdown
Contributor

Please run flake8 ( python3 -m flake8 ) on all the python files and fix all the issues we can. Some of them could be fixed by running black (python3 -m black ).

@jatinjb444 jatinjb444 force-pushed the dev branch 6 times, most recently from dbeefde to e0fcb85 Compare May 5, 2026 05:45
@jatinjb444 jatinjb444 changed the title Finalized fetch and merge script for rt-tags Finalized Automation scripts for x86-64 RT kernel Upgrade May 7, 2026
@jatinjb444 jatinjb444 force-pushed the dev branch 4 times, most recently from 4709c45 to 34fd7ec Compare May 11, 2026 05:59
Comment thread scripts/dev/upstream_merge/json_config.py
Comment thread scripts/dev/upstream_merge/json_config.py
Comment thread scripts/dev/upstream_merge/json_config.py Outdated
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py Outdated
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py Outdated
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py Outdated
@jatinjb444 jatinjb444 marked this pull request as ready for review May 21, 2026 09:27
@jatinjb444 jatinjb444 requested a review from a team as a code owner May 21, 2026 09:27
Copy link
Copy Markdown
Contributor

@rajendra-desai-ni rajendra-desai-ni left a comment

Choose a reason for hiding this comment

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

  • This commit doesn't have a proper title.
  • Remove "Finalized" word from the PR title.
  • Add AB work item in the PR description.
  • You don't have to add 'Updates' section in the PR description. All the updates should go into their respective work items.
  • Try to follow 'Summary', 'Justification', and 'Testing' section in the PR description which is cleaner compared to existing sections.

Comment thread scripts/dev/upstream_merge/utils/build.py Outdated
Comment thread scripts/dev/upstream_merge/utils/build.py
Comment thread scripts/dev/upstream_merge/automation_conf.json Outdated
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py Outdated
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py Outdated
Comment thread scripts/dev/upstream_merge/copy_toolchain_from_server.py
Comment thread scripts/dev/upstream_merge/copy_toolchain_from_server.py
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py
@jatinjb444 jatinjb444 changed the title Finalized Automation scripts for x86-64 RT kernel Upgrade Automate regular x86-64 stable RT kernel Upgrade May 23, 2026
Comment thread scripts/dev/upstream_merge/copy_toolchain_from_server.py Outdated
Comment thread scripts/dev/upstream_merge/copy_toolchain_from_server.py Outdated
Copy link
Copy Markdown
Contributor

@chaitu236 chaitu236 left a comment

Choose a reason for hiding this comment

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

Convention for commit message header is "recipe/subsystem: commit header". This lets us know just by looking at a commit header which files/subsystem/recipe a commit is touching.

Please edit the commit messages to follow this pattern.

E.g., like
upstream_merge: Refactor build logic and clean up scripts

Also we try to keep commit header not too long (50 chars is ideal but we regularly go beyond that if we can't fit in 50 chars).
Following commit will become too long though, try to see if we can shorten it.

upstream_merge: Merge stable RT patches, build kernel, and validate target deployment this will become very long.

- Add automation for stable RT kernel merge from upstream
- Implement kernel build, module install and target deployment
- Integrate toolchain setup and environment initialization
- Add kernel version verification using uname after reboot
- Add driver rebuild flow with DKMS and SSHFS support

Signed-off-by: Jatin Bharti <jatin.bharti@emerson.com>
- Add defconfig regeneration with change detection logic
- Implement gated PR creation after successful workflow
- Add PR metadata generation including work item and summary
- Ensure PR creation only on successful merge and validation

Signed-off-by: Jatin Bharti <jatin.bharti@emerson.com>
- Extract driver rebuild into dedicated helper function
- Move PR creation logic into separate function
- Remove redundant variables and unify toolchain handling
- Improve logging, validation and error handling
- Align code and commit structure with project conventions

Signed-off-by: Jatin Bharti <jatin.bharti@emerson.com>
@jatinjb444 jatinjb444 requested a review from chaitu236 May 29, 2026 09:02
@chaitu236 chaitu236 merged commit 3127e52 into ni:nilrt/master/scarthgap May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants