Skip to content

Fix installation of OEM kernel when installing Ubuntu offline on a certified device#2230

Merged
ogayot merged 2 commits into
canonical:mainfrom
ogayot:oem-fix-kernel-pkgname
Jun 24, 2025
Merged

Fix installation of OEM kernel when installing Ubuntu offline on a certified device#2230
ogayot merged 2 commits into
canonical:mainfrom
ogayot:oem-fix-kernel-pkgname

Conversation

@ogayot

@ogayot ogayot commented Jun 20, 2025

Copy link
Copy Markdown
Member

On certified devices, when we are offline and the OEM metapackage declares that it should be used with the OEM kernel (i.e., Ubuntu-Oem-Kernel-Flavour: oem), we store the name of the kernel package to install in the kernel model.

However, the flavor_to_pkgname() function was used incorrectly. We were meant to give it the name of a flavor (e.g., oem, generic, ...) but instead we gave it the name of the OEM metapackage.

As a consequence, we ended up trying to install kernel package with names such as "linux-oem-somerville-trecko-meta-24.04". Instead it should have been "linux-oem-24.04".

Later in #2034, we attempted to fix the issue by setting the kernel package name to "oem-somerville-treecko-meta". But "oem-somerville-treecko-meta" is not the name of a kernel metapackage, it is the name of the OEM metapackage.

LP:#2114780

This reverts commit 081dc12.

In the above commit, we tried to fix the name of the OEM kernel package stored
in the kernel model. We figured that "linux-oem-somerville-treckoo-meta-24.04"
is not a real package name and replaced it with "oem-somerville-treckoo-meta".

The latter does exist, however, this is still wrong because it isn't a kernel
metapackage, it is an OEM metapackage.

LP: #2114780
Signed-off-by: Olivier Gayot <[email protected]>
kernel_model = self.app.base_model.kernel
kernel_model.metapkg_name_override = pkg.name
kernel_model.metapkg_name_override = flavor_to_pkgname(
"oem", dry_run=self.app.opts.dry_run

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The OEM kernel install is quite confusing. We had to talk about this line quite a lot to be able to explain it. Would you elaborate on the expected behavior in a comment?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks! Added a comment and updated the log line a few lines down.

@ogayot ogayot force-pushed the oem-fix-kernel-pkgname branch from 226952c to 2922b0b Compare June 23, 2025 10:09
On certified devices, when we are offline and the OEM metapackage declares that
it should be used with the OEM kernel (i.e., Ubuntu-Oem-Kernel-Flavour: oem),
we store the name of the kernel package to install in the kernel model.

However, the flavor_to_pkgname() function was used incorrectly. We were meant
to give it the name of a flavor (e.g., oem, generic, ...) but instead we gave
it the name of the OEM metapackage.

As a consequence, we ended up trying to install kernel package with names such
as "linux-oem-somerville-treckoo-meta-24.04". Instead it should have been
"linux-oem-24.04".

LP: #2114780

Signed-off-by: Olivier Gayot <[email protected]>
@ogayot ogayot force-pushed the oem-fix-kernel-pkgname branch from 2922b0b to 0c99776 Compare June 23, 2025 11:27
@ogayot ogayot merged commit 8a39728 into canonical:main Jun 24, 2025
10 checks passed
@ogayot ogayot deleted the oem-fix-kernel-pkgname branch June 24, 2025 07:12
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.

3 participants