[SRU] --no-oem option is broken

Bug #1966413 reported by eoli3n
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-drivers-common (Ubuntu)
Fix Released
High
Alberto Milone
Focal
New
Undecided
Unassigned
Jammy
Fix Released
Undecided
Alberto Milone
Kinetic
Won't Fix
Undecided
Unassigned
Lunar
Fix Released
Undecided
Alberto Milone

Bug Description

[Impact]
* ubuntu-drivers supports the --no-oem option, which is meant to filter-out the OEM metapackages when running on certified hardware.

* When ubuntu-drivers is invoked with --no-oem as a global option (i.e., `ubuntu-drivers --no-oem list` or `ubuntu-drivers --no-oem install`, the script crashes with the following exception:
  NameError: name 'install_oem_meta' is not defined

* When ubuntu-drivers is invoked with --no-oem as a sub-option of "install" (i.e., `ubuntu-drivers install --no-oem`), the script does not crash but the option is silently ignored - resulting in an OEM metapackage to be installed if we are running on certified hardware. This defeats the purpose of the option.

* Today, the --no-oem option can be passed to ubuntu-drivers by ubiquity as a suboption of `ubuntu-drivers install`. By default, the option is not passed to ubuntu-drivers but the users can opt-in using preseeds. If they do, their decision is essentially ignored since the OEM metapackage will still be installed:
https://git.launchpad.net/ubiquity/tree/scripts/simple-plugins#n20

* As part of the 23.10 cycle, subiquity will start replacing the functionality from ubiquity for OEM installs. At the moment, subiquity relies on the version of ubuntu-drivers-common from the system being installed. But going forward, we might have to ship ubuntu-drivers-common in the subiquity snap. This means we will fetch the deb from jammy-updates since subiquity is a core22-based snap.

[Test plan]
1. We will compare the result of the following commands with and without the patch (both on certified and on un-certified hardware):
  * ubuntu-drivers --no-oem list
      -> crashes without the patch. Should not crash with the patch. The list returned should not include the OEM metapackage.
  * ubuntu-drivers --no-oem install
      -> crashes without the patch. Should not crash with the patch. The list of packages installed should not include the OEM metapackage.
  * ubuntu-drivers install --no-oem
      -> without the patch, the OEM metapackage gets installed on certified hardware. With the patch, it should not.

2. We will ensure ubiquity stills manages to install ubuntu on certified hardware. We will also ensure that the OEM metapackage does not get installed when it should not.

[Where problems could occur]
* When used as a global option, --no-oem currently makes the script crash unconditionally. Therefore, the change should be very low risk in that regard.
* When used as a suboption of "install", the --no-oem option currently gets ignored silently. If people have been automating ubuntu deployment in one way or another and have used --no-oem, they might be surprised to notice that fewer packages get installed on their target system, after the option is fixed. This is theoretically a good thing, but might require some adjustments on their end.

[Original description]
$ ubuntu-drivers --no-oem install
Traceback (most recent call last):
  File "/usr/bin/ubuntu-drivers", line 490, in <module>
    greet()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1134, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/bin/ubuntu-drivers", line 376, in greet
    config.no_oem = install_oem_meta
NameError: name 'install_oem_meta' is not defined

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: ubuntu-drivers-common 1:0.9.0~0.20.04.1
ProcVersionSignature: Ubuntu 5.13.0-37.42~20.04.1-generic 5.13.19
Uname: Linux 5.13.0-37-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.18
Architecture: amd64
CasperMD5CheckResult: skip
Date: Fri Mar 25 11:44:15 2022
InstallationDate: Installed on 2022-03-25 (0 days ago)
InstallationMedia: Ubuntu 20.04.3 LTS "Focal Fossa" - Release amd64 (20210819)
ProcEnviron:
 TERM=xterm-kitty
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: ubuntu-drivers-common
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
eoli3n (eoli3neoli3n) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-drivers-common (Ubuntu):
status: New → Confirmed
Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

We might need to use this option in subiquity and it indeed seems broken.

There are actually two possible usages:

$ ubuntu-drivers --no-oem install => which results in an exception
$ ubuntu-drivers install --no-oem => which does not result in an exception but ignores the option

I've opened a PR to fix it: https://github.com/tseliot/ubuntu-drivers-common/pull/82

Olivier Gayot (ogayot)
description: updated
description: updated
description: updated
Changed in ubuntu-drivers-common (Ubuntu):
importance: Undecided → High
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:0.9.7.2

---------------
ubuntu-drivers-common (1:0.9.7.2) mantic; urgency=medium

  [ Olivier Gayot ]
  * ubuntu-drivers:
    - Fix --no-oem option stored in wrong config variable (LP: #1966413).

 -- Alberto Milone <email address hidden> Fri, 26 May 2023 14:17:38 +0000

Changed in ubuntu-drivers-common (Ubuntu):
status: Confirmed → Fix Released
Changed in ubuntu-drivers-common (Ubuntu Kinetic):
status: New → Won't Fix
Olivier Gayot (ogayot)
summary: - --no-oem option is broken
+ [SRU] --no-oem option is broken
Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

Adding debdiff for lunar.

Package is available in PPA https://launchpad.net/~ogayot/+archive/ubuntu/lunar-proposed (with ~ppa1 suffix)

Revision history for this message
Olivier Gayot (ogayot) wrote :
Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

Package for jammy is available in PPA: https://launchpad.net/~ogayot/+archive/ubuntu/jammy-proposed (with ~ppa1 suffix)

Changed in ubuntu-drivers-common (Ubuntu Jammy):
assignee: nobody → Alberto Milone (albertomilone)
Changed in ubuntu-drivers-common (Ubuntu Lunar):
assignee: nobody → Alberto Milone (albertomilone)
status: New → In Progress
Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: New → In Progress
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello eoli3n, or anyone else affected,

Accepted ubuntu-drivers-common into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1:0.9.7.1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-drivers-common (Ubuntu Lunar):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-lunar
Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello eoli3n, or anyone else affected,

Accepted ubuntu-drivers-common into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1:0.9.6.2~0.22.04.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

The concern about people possibly relying on the old broken behavior of --no-oem is valid, but in this case I think the option itself is 'clear enough' in meaning that if anyone relied on --no-oem not doing anything, it's a bit on them. Accepted.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (ubuntu-drivers-common/1:0.9.7.1.1)

All autopkgtests for the newly accepted ubuntu-drivers-common (1:0.9.7.1.1) for lunar have finished running.
The following regressions have been reported in tests triggered by the package:

software-properties/0.99.35 (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/lunar/update_excuses.html#ubuntu-drivers-common

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Graham Inggs (ginggs) wrote (last edit ):

I retried the software-properties/0.99.35 (armhf) autopkgtest and it passed.

Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

I successfully ran the testing described in the test plan 1.
All tests are green and I only had one observation:

* on lunar, `ubuntu-drivers install --no-oem` has the same behavior before and after the patch. This came to me as a surprise, but on second thought, this is expected because OEM meta-packages are not available in the archive on non-LTS releases.

I need to find a way to test ubiquity as described in test plan 2 (this isn't as straightforward as I had anticipated) and then I will mark verification-done.

Revision history for this message
Olivier Gayot (ogayot) wrote (last edit ):

I was able to run a ubiquity jammy install on certified hardware (actually not on certified hardware but using umockdev to simulate certified hardware) using a jammy daily build. Looks all green to me.

tags: added: verification-done-jammy verification-done-lunar
removed: verification-needed-jammy verification-needed-lunar
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ubuntu-drivers-common has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:0.9.7.1.1

---------------
ubuntu-drivers-common (1:0.9.7.1.1) lunar; urgency=medium

  * ubuntu-drivers:
    - Fix --no-oem option stored in wrong config variable (LP: #1966413)

 -- Olivier Gayot <email address hidden> Fri, 16 Jun 2023 12:28:43 +0200

Changed in ubuntu-drivers-common (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:0.9.6.2~0.22.04.4

---------------
ubuntu-drivers-common (1:0.9.6.2~0.22.04.4) jammy; urgency=medium

  * ubuntu-drivers:
    - Fix --no-oem option stored in wrong config variable (LP: #1966413).

 -- Olivier Gayot <email address hidden> Fri, 16 Jun 2023 11:49:53 +0200

Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.