Finalized Automation scripts for x86-64 RT kernel Upgrade #345
Open
jatinjb444 wants to merge 3 commits into
Open
Finalized Automation scripts for x86-64 RT kernel Upgrade #345jatinjb444 wants to merge 3 commits into
jatinjb444 wants to merge 3 commits into
Conversation
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 ). |
dbeefde to
e0fcb85
Compare
5328398 to
4709c45
Compare
- Install kernel on target with reboot and SSH readiness checks. - Rebuild out-of-tree drivers automatically using DKMS. - Kernel source is mounted via SSHFS to avoid local copy. - Fix build/source symlinks and prepare kernel headers. Verified on real NI RT target with DKMS-managed drivers. Signed-off-by: Jatin Bharti <jatin.bharti@emerson.com>
Shreejit-03
reviewed
May 12, 2026
Shreejit-03
reviewed
May 12, 2026
Shreejit-03
reviewed
May 12, 2026
Shreejit-03
reviewed
May 12, 2026
| return 1 | ||
|
|
||
|
|
||
| def run_cmd(cmd): |
Contributor
There was a problem hiding this comment.
Is run_cmd any different from run_command in its usage and implementation? It would be better to use run_command .
Author
There was a problem hiding this comment.
Yes—run_cmd differs intentionally. run_command relies on shlex.split, which breaks SSH commands that include shell operators (||, &&, pipes, quoted remote commands). The rebuild/install steps depend on shell semantics, so run_cmd executes via the shell to preserve existing behavior.
Shreejit-03
reviewed
May 12, 2026
Shreejit-03
reviewed
May 12, 2026
Shreejit-03
reviewed
May 12, 2026
- Automated defconfig regeneration process - Integrated gated kernel PR creation workflow - Pulled latest upstream changes for consistency - Improved SSH connection handling logic - Cleaned and formatted json.config structure - Enhanced overall script reliability and clarity Signed-off-by: Jatin Bharti <jatin.bharti@emerson.com>
- Moved build functions into build.py module - Centralized reusable build utilities - Removed redundant code across scripts - Cleaned up unused and inconsistent files - Improved modularity and maintainability Signed-off-by: Jatin Bharti <jatin.bharti@emerson.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR introduces automation to fetch and merge the latest stable‑RT kernel tags into the target NI Linux Real‑Time branch.
Key changes:
Automatically clone the NI Linux kernel repository in a clean workspace.
Fetch upstream stable‑RT tags from the RT kernel repository.
Identify and merge the latest applicable RT tag into the configured target branch.
Ensure a deterministic and clean git state before merging to support re‑runs and CI usage.
Send notification emails on successful merge or on merge failure with relevant details.
This automation is focused only on the fetch and merge workflow.
Kernel build and deployment steps will be added in follow‑up changes.
Update: April 14th , 2026
Get the Cross Compile toolchain from the nirvana path and set it
Build and install the kernel on the NI's target
Copied the modules to the target
Check the network configurations working fine after reboot
Update: May 5th , 2026
Automates out‑of‑tree driver rebuild after kernel installation.
Mounts kernel source on the target via SSHFS (no local copy).
Fixes build and source symlinks under /lib/modules/.
Prepares kernel headers and invokes dkms auto install.
Integrated into the existing kernel build and test flow
Update: May 7th , 2026
Implements US‑4 and US‑5 automation:
Regenerates nati_x86_64_defconfig when required
Adds gated kernel PR creation after successful RT merge, build, install, and driver rebuild
Failure paths send immediate notification; success sends a single final summary email
Kernel PR creation is guarded behind --skip-push-and-pr and is intended to be enabled only after review.
Testing
The changes were validated by:
Running the script in a fresh workspace to verify repository cloning and RT tag discovery.
Verifying that the latest stable‑RT tag is correctly detected and merged.
After the target reboot , was able to check the latest kernel version using - { uname -r }
Verified the network modules working fine after reboot.
Confirmed SSHFS mount, header preparation, and DKMS rebuild.
Validated rebuilt drivers using dkms status.
Process
Suggested Reviewers:
@rajendra-desai-ni
@Shreejit-03