Skip to content

OOT Modules -> Add kernel version and release nb into release nb #13645

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 14 commits into from
May 29, 2025

Conversation

nicogbg
Copy link
Contributor

@nicogbg nicogbg commented Apr 30, 2025

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

OOT Modules -> Add kernel version and release nb into release nb

Change Log
  • Change
  • Change
  • Change
Does this affect the toolchain?

NO

Associated issues
  • #xxxx
Links to CVEs
Test Methodology
  • Pipeline build id: xxxx

@nicogbg nicogbg requested a review from a team as a code owner April 30, 2025 14:07

%global KVERSION %{target_kernel_version_full}

%{!?_name: %define _name isert}

Summary: %{_name} Driver
Name: %{_name}-signed
Name: %{_name}-signed
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-pick:

Suggested change
Name: %{_name}-signed
Name: %{_name}-signed


%global KVERSION %{target_kernel_version_full}
%define _name mft_kernel

Name: %{_name}-signed
Summary: %{_name} Kernel Module for the %{KVERSION} kernel
Version: 4.30.0
Release: 16%{?dist}
Release: 17%{release_suffix}%{?dist}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Release: 17%{release_suffix}%{?dist}
Release: 17%{release_suffix}%{?dist}

@microsoft-github-policy-service microsoft-github-policy-service bot added Tools 3.0-dev PRs Destined for AzureLinux 3.0 labels Apr 30, 2025
@nicogbg nicogbg force-pushed the nicogbg/OOT-Modules-Add-KernelVersion-In-Release-Nb branch from 305d255 to 4b532e4 Compare May 16, 2025 12:06
Copy link
Contributor

@binujp binujp left a comment

Choose a reason for hiding this comment

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

Looks good, I focused on the spec changes and less so on the validation scripts.

@binujp
Copy link
Contributor

binujp commented May 20, 2025

Thanks for all the efforts in pushing this change, Nicolas! Have we made sure the new version schema is upgradable from the existing one? i.e. "rpm upgrade" of the new versioned package replaces the existing one.

@christopherco christopherco requested a review from Copilot May 29, 2025 07:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates several SPEC files and related workflow scripts to incorporate dynamic kernel version extraction and release suffix generation. The changes replace hardcoded kernel version strings with dynamically queried values using RPM macros and update dependent package declarations and changelogs accordingly.

  • Updated kernel version extraction macros in SPEC files.
  • Updated BuildRequires/Requires fields to use the new computed macro (_mofed_full_version).
  • Adjustments to GitHub workflow scripts to handle chroot environments for cgmanifest validation.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

File Description
SPECS/* Updated kernel version extraction and release suffix macros in multiple SPEC files.
.github/workflows/* Adjusted workflow scripts to incorporate chroot-based spec parsing and improved error handling.
Others Changelog and dependency changes for new kernel version details.
Comments suppressed due to low confidence (1)

.github/workflows/validate-cg-manifest.sh:194

  • Ensure that the alternate source URL variable is consistently named (e.g. 'source0_alt') throughout the script to improve code clarity and avoid confusion with any legacy variable names.
+  source0_alt=""

%if 0%{azl}
%global target_kernel_version_full %(/bin/rpm -q --queryformat '%{VERSION}-%{RELEASE}' kernel-headers)
%global target_kernel_version_full %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel-headers))
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

Consider refactoring the repeated kernel version extraction macros (including target_kernel_version_full, target_azl_build_kernel_version, target_kernel_release, and release_suffix) into a common include file to reduce duplication across the SPEC files and ease future maintenance.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@christopherco christopherco left a comment

Choose a reason for hiding this comment

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

Generally looks fine. Please consider my comments on consolidating duplicated version and release values into individual macros/defines within spec so that it reduces the probability of desync due to human error on update.


%global KVERSION %{target_kernel_version_full}

%{!?_name: %define _name fwctl}
%{!?_mofed_full_version: %define _mofed_full_version 24.10-17%{release_suffix}%{?dist}}
Copy link
Contributor

Choose a reason for hiding this comment

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

If the release number were to get incremented due to a change to the spec, this value would need to change too, correct?
If so, would it make sense to make the release number also a %define so there is only one spot to update in the spec when incrementing the release number? I can see someone inadvertently missing this, and causing the requires _mofed_full_version go out of sync with the package itself.

@@ -64,7 +66,7 @@
Summary: %{_name} Driver
Name: isert
Version: 24.10
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this use %{_version} so this value is controlled by one define?

@nicogbg nicogbg force-pushed the nicogbg/OOT-Modules-Add-KernelVersion-In-Release-Nb branch from 489c40b to dd0ebb4 Compare May 29, 2025 16:56
@nicogbg nicogbg merged commit 5459e6c into 3.0-dev May 29, 2025
17 checks passed
@nicogbg nicogbg deleted the nicogbg/OOT-Modules-Add-KernelVersion-In-Release-Nb branch May 29, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0-dev PRs Destined for AzureLinux 3.0 Packaging Tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants