dkms module is not automatically rebuild when installing new linux-image package

Bug #962189 reported by Ralf Heiringhoff
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
openvswitch (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Fix Released
High
James Page

Bug Description

[Impact]
Users of the openvswitch + openvswitch DKMS modules are broken after kernel upgrades without manual intervention. DKMS modules should be auto-rebuilt.

[Test Case]
Install Ubuntu 12.04 (without any kernel updates)
sudo apt-get install openvswitch-datapath-dkms
sudo apt-get install openvswitch-switch
Upgrade to new 3.2 kernel update (or even the new 3.5 kernel for 12.04.2)
Reboot
sudo service openvswitch-switch start
(will fail as DKMS modules not found for new kernel)

[Regression Potential]
The fix for this is minimal (single line) and just impacts the auto-rebuild config for dkms.

However its bundled with the 3.5 kernel compatibility fixes which also remove the _mod suffix from the DKMS built modules. This has the effect that if the DKMS modules are not built openvswitch will fall-back to the less feature-full native openvswitch module provided by the kernel itself (this is aligned to behavior in quantal and raring).

[Original Bug Report]
Hello all,

I've noticed that the openvswitch_mod and brcompat_mod modules are not automatically rebuild when I've upgraded to the latest linux-image-3.2.0-20-generic, thus rendering my openvswitch config unusable after a reboot to said new kernel.

Manual rebuilding and installation worked as expected:
---------------cut---------
root@d02-spi-2:~# uname -a
Linux d02-spi-2 3.2.0-20-generic #32-Ubuntu SMP Thu Mar 22 02:22:46 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

root@d02-spi-2:~# dpkg -l | egrep 'linux-(image|headers)'
ii linux-headers-3.2.0-19 3.2.0-19.31 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-19-generic 3.2.0-19.31 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii linux-headers-3.2.0-20 3.2.0-20.32 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-20-generic 3.2.0-20.32 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii linux-headers-server 3.2.0.20.22 Linux kernel headers on Server Equipment.
ii linux-image-3.2.0-19-generic 3.2.0-19.31 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-20-generic 3.2.0-20.32 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-server 3.2.0.20.22 Linux kernel image on Server Equipment.

root@d02-spi-2:~# dkms status -m openvswitch
openvswitch, 1.4.0, 3.2.0-19-generic, x86_64: installed
root@d02-spi-2:~# dkms build -m openvswitch -v 1.4.0

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area....(bad exit status: 2)
./configure --with-linux=/usr/src/linux-headers-3.2.0-20-generic ; make -C datapath/linux..........
cleaning build area....(bad exit status: 2)

DKMS: build completed.
root@d02-spi-2:~# dkms install -m openvswitch -v 1.4.0

openvswitch_mod:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.2.0-20-generic/updates/dkms/

brcompat_mod.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.2.0-20-generic/updates/dkms/

depmod......

DKMS: install completed.
root@d02-spi-2:~# dkms status -m openvswitch
openvswitch, 1.4.0, 3.2.0-19-generic, x86_64: installed
openvswitch, 1.4.0, 3.2.0-20-generic, x86_64: installed
---------------cut---------

Regards,
Ralf

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: openvswitch-datapath-dkms 1.4.0-1ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-20.32-generic 3.2.12
Uname: Linux 3.2.0-20-generic x86_64
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
Date: Thu Mar 22 14:42:27 2012
PackageArchitecture: all
SourcePackage: openvswitch
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ralf Heiringhoff (frosty-geek) wrote :
James Page (james-page)
Changed in openvswitch (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in openvswitch (Ubuntu):
status: New → Confirmed
Revision history for this message
Kirill Kabardin (kkabardin) wrote :

Still not fixed. Any ideas how to fix this manually? Workaround?

Revision history for this message
Kirill Kabardin (kkabardin) wrote :

It seems I found a fix for this.

dkms.conf in openvswitch module sources lacks «AUTOINSTALL="yes"» entry, so this module won't rebuild on kernel updates.

Go to /usr/src/openvswitch-1.4.0 and add 'AUTOINSTALL=yes' to the end of the file. It should look like this:

==================================================

PACKAGE_NAME="openvswitch"
PACKAGE_VERSION="1.4.0"
MAKE="./configure --with-linux=/usr/src/linux-headers-`uname -r` ; make -C datapath/linux"
BUILT_MODULE_NAME[0]=openvswitch_mod
BUILT_MODULE_NAME[1]=brcompat_mod
BUILT_MODULE_LOCATION[0]=datapath/linux/
BUILT_MODULE_LOCATION[1]=datapath/linux/
DEST_MODULE_LOCATION[0]=/kernel/drivers/net/openvswitch/
DEST_MODULE_LOCATION[1]=/kernel/drivers/net/openvswitch/
AUTOINSTALL="yes"

==================================================

You can do it faster with this command:

# echo 'AUTOINSTALL="yes"' >> /usr/src/openvswitch-1.4.0/dkms.conf

This should fix module building on kernel updates.

Revision history for this message
Ben Pfaff (blp-nicira) wrote :

> It seems I found a fix for this.

Thanks, I sent out a patch to ovs-dev: http://openvswitch.org/pipermail/dev/2012-June/018075.html

With luck, it will be committed to the OVS repository today and then go into Debian in a day or two.

Thank you very much!

Revision history for this message
Kirill Kabardin (kkabardin) wrote :

Ben, thank you for help. I just really didn't know where I should send this. I glad I could help a little.

James Page (james-page)
Changed in openvswitch (Ubuntu):
status: Confirmed → Fix Released
Changed in openvswitch (Ubuntu Precise):
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → James Page (james-page)
James Page (james-page)
Changed in openvswitch (Ubuntu Precise):
status: Triaged → In Progress
James Page (james-page)
description: updated
Changed in openvswitch (Ubuntu Precise):
importance: Medium → High
Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Hello Ralf, or anyone else affected,

Accepted openvswitch into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/openvswitch/1.4.0-1ubuntu1.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 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, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Changed in openvswitch (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
James Page (james-page) wrote :

Kernel upgrades now trigger a rebuild of this module.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been 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 regresssions.

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

This bug was fixed in the package openvswitch - 1.4.0-1ubuntu1.4

---------------
openvswitch (1.4.0-1ubuntu1.4) precise-proposed; urgency=low

  * Fix compatibility with 3.5 kernel (LP: #1116382):
    - d/p/000*.patch: Cherry picked fixes from upstream VCS for kernel 3.5
      support, including removing the _mod suffix from DKMS built modules.
    - d/dkms.conf.in,rule.modules: Drop _mod suffix from built modules.
  * Ensure DKMS modules are automatically re-built with kernel upgrades
    (LP: #962189):
    - d/dkms.conf.in: Use AUTOINSTALL=yes.
 -- James Page <email address hidden> Wed, 06 Feb 2013 09:41:27 +0000

Changed in openvswitch (Ubuntu Precise):
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.