-
Notifications
You must be signed in to change notification settings - Fork 81
Automate Regular x64 stable-rt kernel upgrade #325
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
base: nilrt/master/scarthgap
Are you sure you want to change the base?
Automate Regular x64 stable-rt kernel upgrade #325
Conversation
pratheekshasn
left a 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.
Please do test options like skip-merge and dry-run before you push the code. It may be difficult to generate conflicts to test the skip-merge option, but running the dry-run option at least should be sufficient.
| @@ -0,0 +1,19 @@ | |||
| { | |||
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.
This if fine for now, but you may need to move some of these values to the pipeline in the future.
| "target_host": "10.152.8.54", | ||
| "target_user": "admin", | ||
| "arch": "x86_64", | ||
| "temp_modules_dir": "nilrt-kernel-build/linux/tmp-glibc/modules", |
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.
Isn't this just .tmp-modules according to the README? Typically you would build this path with the kernel source directory in your code, and keep the config minimal.
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.
You should not be adding this to the nilrt repo. You can clone the repo within this path (if and only if necessary) for merging the new kernel code, but you should not be submitting this change to your PR.
| kernel_parent_dir = os.path.dirname(config.kernel_src_dir) | ||
| os.chdir(kernel_parent_dir) | ||
| try: | ||
| kernel_version = config.target_branch.split('/')[-1] if config.target_branch else "6.12" |
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.
It might be safer to not have to fallback to 6.12 when the config file doesn't specify it. If someone forgets to update the config file when they run this later, we shouldn't keep using 6.12 even though there may be later versions present.
| print(f"[INFO] Would clone kernel repository from {repo_url} to: {kernel_src_dir}") | ||
|
|
||
| # === Step 2: Robust Upstream Merge with Conflict Handling === | ||
| def run_upstream_merge_script(args): |
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.
You might want to consider renaming this function. You're not running a script as part of your function.
Changes
This pull request introduces a consolidated script that fully automates the process of fetching, merging, building, and deploying an updated kernel to a controller. The changes focus on reusing robust utilities from the existing upstream merge framework for improved consistency and maintainability.
https://dev.azure.com/ni/DevCentral/_workitems/edit/3181560
https://dev.azure.com/ni/DevCentral/_workitems/edit/3181567
Testing
Verified the transfer and installation of the new kernel components on the target controller, followed by a successful reboot. Confirmed the target boots with the new kernel version by executing uname -r on the controller via SSH. Tested the send_email_report function to ensure proper success/failure notifications are sent to the configured recipients
Process
TODO: Check boxes that apply to this PR and are complete. Remove boxes that do not apply.
next/ref.