Skip to content

Add migration spec for kernel -> kernel-clk6.12 namespace transition#1292

Open
bmastbergen wants to merge 4 commits into
ciq-6.12.yfrom
{bmastbergen}_ciq-6.12.y-migrate
Open

Add migration spec for kernel -> kernel-clk6.12 namespace transition#1292
bmastbergen wants to merge 4 commits into
ciq-6.12.yfrom
{bmastbergen}_ciq-6.12.y-migrate

Conversation

@bmastbergen
Copy link
Copy Markdown
Collaborator

Migration metapackage that transitions users from old non-namespaced CIQ kernel 6.12.x packages to the new kernel-clk6.12 namespace.

How it works

Each subpackage shim carries Obsoletes: <old-name> < 6.12.86 (so dnf upgrade discovers it automatically) and Requires: <namespaced-replacement> (to pull in the new package). Shims have no Provides for the old name, which avoids triggering the Conflicts directives on the namespaced packages.

Migration happens automatically via dnf upgrade. Each shim is discovered independently by the DNF solver via its Obsoletes.

What gets migrated

  • Non-installonly packages (kernel-headers, kernel-tools, kernel-tools-libs, kernel-devel, kernel-devel-matched, perf, python3-perf, libperf, libperf-devel, rtla, rv, kernel-doc, kernel-cross-headers, kernel-selftests-internal, kernel-ipaclones-internal, kernel-abi-stablelists, kernel-uki-virt-addons) are replaced in the transaction via Obsoletes
  • Installonly packages (kernel-core, kernel-modules, kernel-modules-core) are handled by a systemd oneshot cleanup service on reboot. We can't use Obsoletes for these because if the user is currently booted into the old 6.12 kernel, DNF refuses to remove kernel-core (it's a protected package), and the entire transaction fails. The cleanup service skips the running kernel and retries on subsequent boots until all old kernels are gone.
  • kernel-clk6.12-default is pulled in to set DEFAULTKERNEL=kernel-clk6.12-core in /etc/sysconfig/kernel, ensuring future namespaced kernel installs become the default boot entry
  • The cleanup script dynamically finds non-namespaced 6.12.x kernel-core packages (no hardcoded version list)
  • Per-subpackage %posttrans runs dnf mark install on each namespaced replacement so they survive shim removal

Prerequisite

The old non-namespaced repo (ciq-kernel-lt-6_12) must be disabled before migration. If both repos are enabled, DNF prefers same-name upgrades (e.g., kernel-headers 6.12.85 -> 6.12.88) over Obsoletes-based shims.

Known limitation

The kernel-clk6.12 meta-package does not get installed because kernel-clk6.12-core provides the kernel-clk6.12 virtual, letting DNF satisfy the dependency without the meta-package. All real packages (core, modules, modules-core) are installed and functional.

Tested scenarios

  • dnf upgrade discovers shims and migrates all packages
  • Only installed packages get migrated (selective)
  • No-op when no old packages installed
  • dnf install kernel-headers after migration says "already installed"
  • glibc-devel dependency on kernel-headers satisfied by namespaced package
  • Shim removal preserves all namespaced packages
  • dnf upgrade with old repo re-enabled: nothing to do (Conflicts blocks regression)
  • Explicit install of old package names blocked by Conflicts
  • Cleanup script handles multiple installed kernel versions (tested with 6.12.63, 6.12.74, 6.12.85 all installed simultaneously, all removed correctly)
  • Cleanup script self-removes migration shims after cleanup
  • Second dnf upgrade is a clean no-op
  • Full two-reboot cycle tested with multiple old kernels:
    • Boot 1 (into old 6.12.85): cleanup removed 6.12.74, skipped 6.12.85 (running), service stayed enabled, shims kept
    • Boot 2 (into namespaced 6.12.87+clk6.12): cleanup removed 6.12.85, removed all migration shims, disabled service
    • Final state: zero old packages, zero shims, all namespaced packages intact
  • dnf autoremove does not touch any namespaced packages (dnf mark install working)
  • kernel-clk6.12-default installed, DEFAULTKERNEL updated from kernel-core to kernel-clk6.12-core

RPM spec that transitions users from old non-namespaced CIQ kernel 6.12.x
packages to the new kernel-clk6.12 namespace. Uses rich deps to only
migrate packages the user actually has installed. Includes a systemd
oneshot service to clean up old installonly packages on next boot (can't
rpm -e from %posttrans due to RPM db lock).

Migration shims intentionally avoid Provides for non-namespaced names
(e.g. kernel-headers) since the namespaced packages already carry those
Provides, and adding them to the shims would trigger the corresponding
Conflicts directives.
…ich deps

Switch shims from version-pinned Obsoletes to a version ceiling
(< 6.13) so dnf upgrade automatically discovers them as replacements
for installed non-namespaced packages. Remove Provides for old names
on shims to avoid triggering Conflicts on the namespaced packages.
Drop rich deps from base package since dnf upgrade discovers each shim
independently via Obsoletes.

Base package requires kernel-clk6.12-modules (to ensure the full kernel
is installed, not just core) and kernel-clk6.12-default (to set
DEFAULTKERNEL=kernel-clk6.12-core so future kernel installs become the
default boot entry).

Move dnf-mark-install to per-subpackage posttrans so namespaced packages
survive shim removal. Rewrite cleanup script to dynamically find
non-namespaced 6.12.x kernel-core packages instead of using a hardcoded
version list. Fix cleanup script to only disable itself when all
non-namespaced kernels are gone, not just when some were removed.

Note: the kernel-clk6.12 meta-package does not get installed because
kernel-clk6.12-core provides the kernel-clk6.12 virtual, letting DNF
satisfy the dependency without the meta-package. All real packages
(core, modules, modules-core) are installed and functional.
@PlaidCat
Copy link
Copy Markdown
Collaborator

PlaidCat commented Jun 4, 2026

I will test this tomorrow

Comment thread ciq/SPECS/kernel-clk6.12-migrate.spec Outdated
%package abi-stablelists
Summary: Migrate kernel-abi-stablelists to kernel-clk6.12-abi-stablelists
Obsoletes: kernel-abi-stablelists < %{obs_ceil}
Requires: kernel-clk6.12-abi-stablelists
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this cause a problem since we don't produce this some we dont have a stable list?

and never provided it previously for clk?

kernel-abi-stablelists.noarch : The Rocky Linux kernel ABI symbol stablelists

I will install it as a part of my test tomorrow (actually I'll install most of these)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a good catch. I've removed this, along with a few other packages we've never built.

Remove migration shims for kernel-cross-headers, kernel-ipaclones-internal,
kernel-abi-stablelists, and kernel-uki-virt-addons. The CLK 6.12 kernel
spec doesn't produce namespaced equivalents for these (with_cross_headers,
with_ipaclones, and with_efiuki are all disabled, and abi-stablelists
isn't in the spec at all). If a user had any of these installed, the shim's
Requires on a non-existent package would fail the transaction.
@PlaidCat
Copy link
Copy Markdown
Collaborator

PlaidCat commented Jun 5, 2026

I ran into some issues.
As a part of the trying to make CLK more consistent with the EL modules we probalby want to add kernel-modules as when i upgraded I had no network access (granted it was a usb nic but I also couldn't load the wifi driver)

[jmaple@devbox build_files]$ sudo dnf install kernel-clk6.12-migrate.noarch
[sudo] password for jmaple:
CIQ LT 6.12 Linux Kernel for Rocky 9 (source)                                                                                                                                                              10 kB/s | 1.5 kB     00:00
CIQ LT 6.12 Linux Kernel for Rocky 9 (x86_64)                                                                                                                                                              12 kB/s | 1.5 kB     00:00
Dependencies resolved.
==========================================================================================================================================================================================================================================
 Package                                                                 Architecture                                 Version                                               Repository                                               Size
==========================================================================================================================================================================================================================================
Installing:
 kernel-clk6.12-migrate                                                  noarch                                       1.0-12.el9                                            custom-local-repo                                        11 k
     replacing  kernel.x86_64 6.12.63-1.1.el9_clk
     replacing  kernel.x86_64 6.12.74-1.1.0.0.el9_clk
     replacing  kernel.x86_64 6.12.85-1.1.0.0.el9_clk
Installing dependencies:
 kernel-clk6.12-core                                                     x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        17 M
 kernel-clk6.12-debug-core                                               x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        31 M
 kernel-clk6.12-debug-modules                                            x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        63 M
 kernel-clk6.12-debug-modules-core                                       x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        45 M
 kernel-clk6.12-default                                                  x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        17 k
 kernel-clk6.12-modules-core                                             x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        28 M

Transaction Summary
==========================================================================================================================================================================================================================================
Install  7 Packages

Total size: 185 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                  1/1
  Installing       : kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                        1/10
  Installing       : kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                2/10
  Running scriptlet: kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                2/10
  Installing       : kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                              3/10
  Installing       : kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                      4/10
  Running scriptlet: kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                      4/10
  Running scriptlet: kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                   5/10
  Installing       : kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                   5/10
  Installing       : kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                             6/10
  Running scriptlet: kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                             6/10
  Installing       : kernel-clk6.12-migrate-1.0-12.el9.noarch                                                                                                                                                                        7/10
  Obsoleting       : kernel-6.12.85-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           8/10
  Running scriptlet: kernel-6.12.85-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           8/10
  Obsoleting       : kernel-6.12.74-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           9/10
  Running scriptlet: kernel-6.12.74-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           9/10
  Obsoleting       : kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                              10/10
  Running scriptlet: kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                              10/10
  Running scriptlet: kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                       10/10
  Running scriptlet: kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                               10/10
  Running scriptlet: kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                             10/10
  Running scriptlet: kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                     10/10
  Running scriptlet: kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                  10/10
The default is /boot/loader/entries/b878c3770755464795ffc4975d537920-6.12.92-1.1.el9.x86_64+clk6.12.conf with index 1 and kernel /boot/vmlinuz-6.12.92-1.1.el9.x86_64+clk6.12

  Running scriptlet: kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                            10/10
  Running scriptlet: kernel-clk6.12-migrate-1.0-12.el9.noarch                                                                                                                                                                       10/10
  Running scriptlet: kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                              10/10
  Verifying        : kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                      1/10
  Verifying        : kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                2/10
  Verifying        : kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                             3/10
  Verifying        : kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                        4/10
  Verifying        : kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                   5/10
  Verifying        : kernel-clk6.12-migrate-1.0-12.el9.noarch                                                                                                                                                                        6/10
  Verifying        : kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                               7/10
  Verifying        : kernel-6.12.74-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           8/10
  Verifying        : kernel-6.12.85-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           9/10
  Verifying        : kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                             10/10

Installed:
  kernel-clk6.12-core-6.12.92-1.1.el9.x86_64           kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64        kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64        kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64
  kernel-clk6.12-default-6.12.92-1.1.el9.x86_64        kernel-clk6.12-migrate-1.0-12.el9.noarch                kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64

Complete!
[jmaple@devbox build_files]$ sudo reboot
[jmaple@devbox ~]$ find /lib/modules/$(uname -r)/ | grep asix
/lib/modules/6.12.92-1.1.el9.x86_64+clk6.12/kernel/drivers/net/usb/asix.ko.xz

[jmaple@devbox ~]$ rpm -q --whatprovides /lib/modules/6.12.92-1.1.el9.x86_64+clk6.12/kernel/drivers/net/usb/asix.ko.xz
kernel-clk6.12-modules-6.12.92-1.1.el9.x86_64

@bmastbergen
Copy link
Copy Markdown
Collaborator Author

I ran into some issues. As a part of the trying to make CLK more consistent with the EL modules we probalby want to add kernel-modules as when i upgraded I had no network access (granted it was a usb nic but I also couldn't load the wifi driver)

[jmaple@devbox build_files]$ sudo dnf install kernel-clk6.12-migrate.noarch
[sudo] password for jmaple:
CIQ LT 6.12 Linux Kernel for Rocky 9 (source)                                                                                                                                                              10 kB/s | 1.5 kB     00:00
CIQ LT 6.12 Linux Kernel for Rocky 9 (x86_64)                                                                                                                                                              12 kB/s | 1.5 kB     00:00
Dependencies resolved.
==========================================================================================================================================================================================================================================
 Package                                                                 Architecture                                 Version                                               Repository                                               Size
==========================================================================================================================================================================================================================================
Installing:
 kernel-clk6.12-migrate                                                  noarch                                       1.0-12.el9                                            custom-local-repo                                        11 k
     replacing  kernel.x86_64 6.12.63-1.1.el9_clk
     replacing  kernel.x86_64 6.12.74-1.1.0.0.el9_clk
     replacing  kernel.x86_64 6.12.85-1.1.0.0.el9_clk
Installing dependencies:
 kernel-clk6.12-core                                                     x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        17 M
 kernel-clk6.12-debug-core                                               x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        31 M
 kernel-clk6.12-debug-modules                                            x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        63 M
 kernel-clk6.12-debug-modules-core                                       x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        45 M
 kernel-clk6.12-default                                                  x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        17 k
 kernel-clk6.12-modules-core                                             x86_64                                       6.12.92-1.1.el9                                       custom-local-repo                                        28 M

Transaction Summary
==========================================================================================================================================================================================================================================
Install  7 Packages

Total size: 185 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                  1/1
  Installing       : kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                        1/10
  Installing       : kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                2/10
  Running scriptlet: kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                2/10
  Installing       : kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                              3/10
  Installing       : kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                      4/10
  Running scriptlet: kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                      4/10
  Running scriptlet: kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                   5/10
  Installing       : kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                   5/10
  Installing       : kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                             6/10
  Running scriptlet: kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                             6/10
  Installing       : kernel-clk6.12-migrate-1.0-12.el9.noarch                                                                                                                                                                        7/10
  Obsoleting       : kernel-6.12.85-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           8/10
  Running scriptlet: kernel-6.12.85-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           8/10
  Obsoleting       : kernel-6.12.74-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           9/10
  Running scriptlet: kernel-6.12.74-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           9/10
  Obsoleting       : kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                              10/10
  Running scriptlet: kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                              10/10
  Running scriptlet: kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                       10/10
  Running scriptlet: kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                               10/10
  Running scriptlet: kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                             10/10
  Running scriptlet: kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                     10/10
  Running scriptlet: kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                  10/10
The default is /boot/loader/entries/b878c3770755464795ffc4975d537920-6.12.92-1.1.el9.x86_64+clk6.12.conf with index 1 and kernel /boot/vmlinuz-6.12.92-1.1.el9.x86_64+clk6.12

  Running scriptlet: kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                            10/10
  Running scriptlet: kernel-clk6.12-migrate-1.0-12.el9.noarch                                                                                                                                                                       10/10
  Running scriptlet: kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                              10/10
  Verifying        : kernel-clk6.12-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                      1/10
  Verifying        : kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64                                                                                                                                                                2/10
  Verifying        : kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64                                                                                                                                                             3/10
  Verifying        : kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                        4/10
  Verifying        : kernel-clk6.12-default-6.12.92-1.1.el9.x86_64                                                                                                                                                                   5/10
  Verifying        : kernel-clk6.12-migrate-1.0-12.el9.noarch                                                                                                                                                                        6/10
  Verifying        : kernel-6.12.63-1.1.el9_clk.x86_64                                                                                                                                                                               7/10
  Verifying        : kernel-6.12.74-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           8/10
  Verifying        : kernel-6.12.85-1.1.0.0.el9_clk.x86_64                                                                                                                                                                           9/10
  Verifying        : kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64                                                                                                                                                             10/10

Installed:
  kernel-clk6.12-core-6.12.92-1.1.el9.x86_64           kernel-clk6.12-debug-core-6.12.92-1.1.el9.x86_64        kernel-clk6.12-debug-modules-6.12.92-1.1.el9.x86_64        kernel-clk6.12-debug-modules-core-6.12.92-1.1.el9.x86_64
  kernel-clk6.12-default-6.12.92-1.1.el9.x86_64        kernel-clk6.12-migrate-1.0-12.el9.noarch                kernel-clk6.12-modules-core-6.12.92-1.1.el9.x86_64

Complete!
[jmaple@devbox build_files]$ sudo reboot
[jmaple@devbox ~]$ find /lib/modules/$(uname -r)/ | grep asix
/lib/modules/6.12.92-1.1.el9.x86_64+clk6.12/kernel/drivers/net/usb/asix.ko.xz

[jmaple@devbox ~]$ rpm -q --whatprovides /lib/modules/6.12.92-1.1.el9.x86_64+clk6.12/kernel/drivers/net/usb/asix.ko.xz
kernel-clk6.12-modules-6.12.92-1.1.el9.x86_64

We moved netfilter and qdisc schedulers from -extra to -core. that should be the only module packaging change.

I think you found a different bug. I think kernel-clk6.12-debug-modules is Providing kernel-clk6.12-modules and that got installed instead of the actual kernel-clk6.12-modules package. That is a kernel-clk6.12.spec bug, not a migration bug.

The kernel_modules_package and kernel_modules_core_package macros
provided the generic package name (e.g. kernel-clk6.12-modules) even
for debug variants. This caused DNF to treat kernel-clk6.12-debug-modules
as a valid provider of kernel-clk6.12-modules, pulling in the entire
debug kernel when only the non-debug modules were intended.

Include the variant name in the Provides so debug-modules only provides
kernel-clk6.12-debug-modules, not the generic kernel-clk6.12-modules.
For non-debug builds the expansion is unchanged.
@PlaidCat
Copy link
Copy Markdown
Collaborator

PlaidCat commented Jun 5, 2026

I'm good with shipping this with the debug stuff updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants