Skip to content

Conversation

@DIVYANSHIKAUSHHIK
Copy link

@DIVYANSHIKAUSHHIK DIVYANSHIKAUSHHIK commented Nov 12, 2025

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.

  • This PR should be cherry-picked to the next/ ref.

@DIVYANSHIKAUSHHIK DIVYANSHIKAUSHHIK marked this pull request as ready for review November 12, 2025 09:54
@DIVYANSHIKAUSHHIK DIVYANSHIKAUSHHIK requested a review from a team as a code owner November 12, 2025 09:54
@DIVYANSHIKAUSHHIK DIVYANSHIKAUSHHIK marked this pull request as draft November 12, 2025 09:54
Copy link
Contributor

@pratheekshasn pratheekshasn left a 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 @@
{
Copy link
Contributor

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",
Copy link
Contributor

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.

Copy link
Contributor

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"
Copy link
Contributor

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):
Copy link
Contributor

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.

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.

2 participants