$ARCH in common.postinst breaks everything

Bug #785937 reported by Ryan Lovett
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkms (Ubuntu)
Expired
Low
Unassigned

Bug Description

Binary package hint: dkms

I was experiencing a problem trying to install virtualbox that reminded me of a very similar problem with the nvidia driver package. Some errors indicated that dkms failed while trying to find a directory named "-a". I tracked this down to a problem with /usr/lib/dkms/common.postinst. I've attached the diff that fixed my virtualbox-ose-dkms problems.
---
Architecture: amd64
DistroRelease: Ubuntu 10.04
Package: dkms 2.1.1.2-2fakesync1
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-31.61-generic 2.6.32.32+drm33.14
Tags: lucid
Uname: Linux 2.6.32-31-generic x86_64
UserGroups: adm app operator source src sudo upush
---
Architecture: amd64
DistroRelease: Ubuntu 10.04
Package: dkms 2.1.1.2-2fakesync1
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-31.61-generic 2.6.32.32+drm33.14
Tags: lucid
Uname: Linux 2.6.32-31-generic x86_64
UserGroups: upush

Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote :
tags: added: patch
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The patch dkms.diff seems incorrect for a few reasons:

1. It's a patch against the local filesystem, not against the dkms source.

2. I can't see it fixing the problem. In fact, the patch should introduce the bug or make it worse. Because $ARCH is an optional variable, it can be empty. That means your changes to the various dkms commands would probably cause more problems than they solve by passing -a without subsequent parameters.

More likely, it sounds like your problem is that $4 to common.postinst has been passed spaces " ".

But the most likely cause of what you're experiencing is a broken shell. To test this theory:
  sh -c 'A="b c"; sh -c "echo \$#" $A'
The output should be 1, but I suspect your shell gives 0. And that's a bug in the shell. Such a bug does not seem to exist in bash or dash under ubuntu 11.04 though.

Finally, please execute the following command, as it will automatically gather debugging information, in a terminal:
apport-collect 785937
When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Changed in dkms (Ubuntu):
status: New → Incomplete
tags: added: patch-needswork
removed: patch
Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote : Dependencies.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote :

Regarding your comments:

1. The patch can be trivially reworked to be against the dkms source. Let me know if you need help with this.

2. The patch fixed the problem while unpatched it was erroring out.

If ARCH is not supplied to the script, the script itself sets it.

/bin/sh on this machine is the standard lucid shell (dash). The output to your test code was 1.

What happens when you try to install nvidia-current on a Lucid machine?

Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote :

apport information

description: updated
Revision history for this message
Mario Limonciello (superm1) wrote :

It actually only sets it explicitly on Ubuntu. The way that logic was put together was to prevent breaking on RHEL.

If it's causing an error on your scenario, can you please provide the output of the error? The -a is a supported parameter and shouldn't be treated as a directory.

Changed in dkms (Ubuntu):
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for dkms (Ubuntu) because there has been no activity for 60 days.]

Changed in dkms (Ubuntu):
status: Incomplete → Expired
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.