Ubuntu

Packages using DKMS should make use of /usr/lib/dkms/common.postinst

Reported by Mario Limonciello on 2009-12-15
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
batman-adv-kernelland (Ubuntu)
Undecided
Unassigned
batmand (Ubuntu)
Undecided
Unassigned
bcmwl (Ubuntu)
Low
Alberto Milone
dahdi-linux (Ubuntu)
Undecided
Unassigned
dkms (Ubuntu)
Low
Mario Limonciello
drbd8 (Ubuntu)
Low
Unassigned
fglrx-installer (Ubuntu)
Undecided
Unassigned
kqemu (Ubuntu)
Undecided
Unassigned
lirc (Ubuntu)
Undecided
Unassigned
nouveau-kernel-source (Ubuntu)
Undecided
Unassigned
nvidia-graphics-drivers-173 (Ubuntu)
Low
Alberto Milone
nvidia-graphics-drivers-180 (Ubuntu)
Undecided
Unassigned
nvidia-graphics-drivers-96 (Ubuntu)
Low
Alberto Milone
openafs (Ubuntu)
Undecided
Unassigned
sl-modem (Ubuntu)
Wishlist
Unassigned
virtualbox-ose (Ubuntu)
Undecided
Unassigned

Bug Description

Packages in Debian & Ubuntu that are using their own postinstall script should remove the logic from there and instead use /usr/lib/dkms/common.postinst . This script contains sufficient logic to figure out the correct kernels to build for and accounts for allowing builds on a buildd (if a package is ever included in a live media build).

The following sample template is sufficient to use instead:

http://linux.dell.com/git/?p=dkms.git;a=blob;f=template-dkms-mkdeb/debian/postinst;hb=HEAD

description: updated
Changed in dahdi-linux (Ubuntu):
status: New → Fix Released
Changed in lirc (Ubuntu):
status: New → Fix Released
Changed in nvidia-graphics-drivers-180 (Ubuntu):
status: New → Fix Released
deleted (to-delete) wrote :

Never seen such an idiotic architecture detection for a Debian package. Fix this and nobody should use that template in Debian package.

Anders Kaseorg (anders-kaseorg) wrote :

What’s wrong with ‘uname -m’? (Is this somehow related to allowing builds on a buildd?)

But in any event, why can’t /usr/lib/dkms/common.postinst do the architecture detection itself? There’s no reason the module package itself should have to care about that detail.

Excuse me? What's wrong with dpkg --print-architecture?

On Tue, Dec 15, 2009 at 17:21, Moshroum <email address hidden> wrote:

> Never seen such an idiotic architecture detection for a Debian package.
> Fix this and nobody should use that template in Debian package.
>
> --
> Packages using DKMS should make use of /usr/lib/dkms/common.postinst
> https://bugs.launchpad.net/bugs/497149
> You received this bug notification because you are a member of Mythbuntu
> Developers, which is subscribed to lirc in ubuntu.
>

--
Mario Limonciello
<email address hidden>

Mario Limonciello (superm1) wrote :

ARCH is an optional argument anyway to common.postinst.

uname -m is not reliable in a buildd environment. If you don't provide ARCH
it does fall back to uname -m

On Tue, Dec 15, 2009 at 17:45, Anders Kaseorg <email address hidden> wrote:

> What’s wrong with ‘uname -m’? (Is this somehow related to allowing
> builds on a buildd?)
>
> But in any event, why can’t /usr/lib/dkms/common.postinst do the
> architecture detection itself? There’s no reason the module package
> itself should have to care about that detail.
>
> --
> Packages using DKMS should make use of /usr/lib/dkms/common.postinst
> https://bugs.launchpad.net/bugs/497149
> You received this bug notification because you are a member of Mythbuntu
> Developers, which is subscribed to lirc in ubuntu.
>

--
Mario Limonciello
<email address hidden>
Sent from Manchester, NH, United States

deleted (to-delete) wrote :

Not the `dpkg --print-architecture`, but the stuff bellow. If it is really needed then move it to /usr/lib/dkms/common.postinst and not as part of each package were it needs mass bug fillings to add updates.

Anders Kaseorg (anders-kaseorg) wrote :

I assume his complaint is that you hard code a map {amd64 → x86_64, lpia → i686, i386 → i686} that is neither complete nor obviously correct, and if this map ever _does_ need to change, that will currently require shipping more updates to every package that uses dkms. It would be better to keep all that logic contained in the dkms package.

deleted (to-delete) wrote :

Ant the template also contains copyright stuff without a license. Just forget it. Your bug should be ignored by Debian people

Anders Kaseorg (anders-kaseorg) wrote :

Moshroum: thank you for your feedback, but please remember to follow the code of conduct <http://www.ubuntu.com/community/conduct/> to maintain a respectful atmosphere. Bug reports are handled by humans, the majority of whom are volunteers, so please bear this in mind.

deleted (to-delete) wrote :

Why I am bound to something which I have never signed or accepted? I will never accept that unless the part is removed where it is stated that Mr. Shuttleworth aka Mr. sexist dictator of Ubuntu is a perfect person.

{{{
nobody is expected to be perfect in the Ubuntu community (except of course the SABDFL)
}}}

Everybody who signed the document "Ubuntu Code of Conduct - 1.0.1" or "Ubuntu Code of Conduct - 1.0" has either not read it or didn't understand what was written there. Don't expect that I sign or agree with that document.

And btw, you mentioned that this bug is also for Debian packages. Where is the announcement to debian-devel and/or
debian-devel-announce? And were is the discussion about that bug in Debian (normally done in debian-devel when it affects many packages)?

And again to that mapping stuff. It is extreme wrong to only support only that amount of architectures and i386 doesn't mean i686 in Debian.

Alberto Milone (albertomilone) wrote :

There's no excuse for being disrespectful, whether you signed the code of conduct or not.

If you want to carry the message across, you can do it politely.

Chuck Short (zulcss) on 2009-12-16
Changed in drbd8 (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Nick Barcet (nijaba) wrote :

Please see bug #53843 about the "joke" that has already been deemed not to be understood by everyone.

Can you please add some information how that above mentioned problems will be handled? I see them as an important blocker for that bug and will fix it after above mentioned problems are solved.

I see the idea behind it as an important benefit, but don't think that the template mentioned in the bug report is the way to go (also with some changes I saw Tuesday in the git repository). It is ok for me to call `dpkg --print-architecture` and send that information to the dkms-postinst script, but I don't feel comfortable by adding that architecture mapping code . It should be quite easy and more future safe to add it to the dkms-postinst script.

Changed in batman-adv-kernelland (Ubuntu):
status: New → Incomplete
Changed in batmand (Ubuntu):
status: New → Incomplete
Felix Geyer (debfx) wrote :

Fixed in virtualbox-ose 3.1.2-dfsg-1ubuntu1

Changed in virtualbox-ose (Ubuntu):
status: New → Fix Released

The new virtualbox-ose-dkms postinst passes an empty arch argument to common.postinst. Mario, is this what you are recommending, or are you planning to fix the hard-coded architecture map in some other way?

Changed in nvidia-graphics-drivers-96 (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
importance: Undecided → Low
status: New → In Progress
Changed in nvidia-graphics-drivers-173 (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
importance: Undecided → Low
status: New → Fix Committed
Changed in nvidia-graphics-drivers-96 (Ubuntu):
status: In Progress → Fix Committed
Mario Limonciello (superm1) wrote :

This is just a template. The architecture mapping code makes sense in Ubuntu, but may not in Debian,so I'll add the mapping stuff to common.postinst and update the template (cd2d0388fb64e63e5cb69663f3f53df828915a14)

Changed in dkms (Ubuntu):
assignee: nobody → Mario Limonciello (superm1)
importance: Undecided → Low
status: New → Fix Committed
description: updated

I don't understand those lines:

14: for POSTINST in /usr/lib/dkms/common.postinst /usr/share/$PACKAGE_NAME/postinst

Is the package supposed to have a /usr/share/$PACKAGE_NAME/postinst ?

16: $POSTINST $NAME $CVERSION /usr/share/$PACKAGE_NAME $ARCH $2

What is /usr/share/$PACKAGE_NAME for ? Is that package supposed to have
that dir ?

--
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

That allows the package to be used on older versions of DKMS that didn't
include common.postinst. It's optional, but not necessary.

2010/1/13 أحمد المحمودي (Ahmed El-Mahmoudy) <
<email address hidden>>

> I don't understand those lines:
>
> 14: for POSTINST in /usr/lib/dkms/common.postinst
> /usr/share/$PACKAGE_NAME/postinst
>
> Is the package supposed to have a /usr/share/$PACKAGE_NAME/postinst ?
>
> 16: $POSTINST $NAME $CVERSION /usr/share/$PACKAGE_NAME $ARCH $2
>
> What is /usr/share/$PACKAGE_NAME for ? Is that package supposed to have
> that dir ?
>
> --
> ‎أحمد المحمودي (Ahmed El-Mahmoudy)
> Digital design engineer
> GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
> GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7
>
> --
> Packages using DKMS should make use of /usr/lib/dkms/common.postinst
> https://bugs.launchpad.net/bugs/497149
> You received this bug notification because you are a member of Mythbuntu
> Developers, which is subscribed to lirc in ubuntu.
>

--
Mario Limonciello
<email address hidden>
Sent from York, ME, United States

Mario Limonciello wrote:
> That allows the package to be used on older versions of DKMS that didn't
> include common.postinst. It's optional, but not necessary.

Which version is it? I cannot find a good reference inside the dkms changelog,
but would guess v2.1.0.0. Maybe the dependency line in debian/control should
be changed from (>= 1.95) to (>= 2.1.0.0) when a package doesn't provide a
backward compatibility script.

PS: the tag for v2.1.1.0 is missing inside the git repository.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package batman-adv-kernelland - 0.2-5

---------------
batman-adv-kernelland (0.2-5) unstable; urgency=low

  * Correct spelling errors found by lintian
  * Use dkms postinst script for batman-adv-dkms (Closes LP: #497149)
 -- Ubuntu Archive Auto-Sync <email address hidden> Mon, 25 Jan 2010 03:42:13 +0000

Changed in batman-adv-kernelland (Ubuntu):
status: Incomplete → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dkms - 2.1.1.1-0ubuntu1

---------------
dkms (2.1.1.1-0ubuntu1) lucid; urgency=low

  [ Mario Limonciello ]
  * dkms_common.postinst: Add some missing quotes around strings used in comparisons
    to make sure that this is safe on more shells.
  * Makefile, debian/rules: Only copy the init script in for redhat targets.
  * kernel_postinst.d: Make sure that dkms_autoinstaller is executable (LP: #480055)
  * Move the architecture mapping logic out of the DKMS template and into
    common.postinst for Ubuntu only. (LP: #497149)
  * template-dkms-mkdeb/debian/control: Build-depends on dkms (LP: #506959)

  [ Thomas Chenault ]
  * Fix parsing in find_external_dependencies(). The existing code behaves improperly
    when a driver disk module has more than two dependencies.
 -- Mario Limonciello <email address hidden> Mon, 25 Jan 2010 17:42:40 -0600

Changed in dkms (Ubuntu):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package batmand - 0.3.2-5

---------------
batmand (0.3.2-5) unstable; urgency=low

  * Remove shlibs:Depends for binary packages without shared libs dependencies
  * Add missing ${misc:Depends} debhelper for batmand-gateway-source
  * Use dkms postinst script for batmand-gateway-dkms (Closes LP: #497149)
  * Correct spelling errors found by lintian
 -- Ubuntu Archive Auto-Sync <email address hidden> Mon, 01 Feb 2010 23:57:15 +0000

Changed in batmand (Ubuntu):
status: Incomplete → Fix Released

I noticed while putting together an updated package for bcmwl that the template postinst does exit $? after running common.postinst, which skips the rest of the package postinst including any autogenerated #DEBHELPER# scripts.

Mario, can I get you to review this patch, which fixes that and does some additional cleanup of the template postinst?

tags: added: patch
Changed in dkms (Ubuntu):
status: Fix Released → New
Rolf Leggewie (r0lf) on 2010-02-12
Changed in sl-modem (Ubuntu):
importance: Undecided → Wishlist
status: New → Fix Committed
Changed in bcmwl (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
importance: Undecided → Low
status: New → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bcmwl - 5.60.48.36+bdcom-0ubuntu1

---------------
bcmwl (5.60.48.36+bdcom-0ubuntu1) lucid; urgency=low

  * New upstream release (LP: #432780):
    - Support up to linux kernel 2.6.31. 2.6.32 support is there
      also but not tested (although reports from users suggests it
      works fine).
    - Support for hidden networks.
    - Support for rfkill in kernels < 2.6.31.
    - Setting power level via 'iwconfig eth1 txpower X' is now
      operational
    - Add support for 4313.
    - Additional channels in both 2.4 and 5 Ghz bands.
    - Fix issue with tkip group keys that caused the following
      message to repeat often:
      TKIP: RX tkey->key_idx=2 frame keyidx=1 priv=ffff8800cf80e840
    - Fix a continuous assoc/disassoc loop (in Ubuntu 8.04)
      with suspend/resume with WPA2 and wpa_supplicant.
    - Fix bug affecting Ubuntu 8.04 which prevented from pinging when
      Linux STA is IBSS creator with WEP.
    - Fix bug affecting Ubuntu 9.04 which prevented from connecting to
      hidden networks after suspend/resume.
    - Fix bug which prevented the driver from associating to AP with
      when transitioning from AES to TKIP encryption.
  * debian/patches/0002-Makefile.patch:
    - Refresh patch.
  * debian/patches/0003-DEV_WL_IF.patch,
    0004-broadcom-sta-5.10.91.9-linux-2.6.30.patch,
    0005-NET_DEVICE_OPS.patch,
    0006-broadcom-sta-5.10.91.9-linux-2.6.32.patch:
    - Drop patches as they are now part of the upstream code.
  * debian/dkms.conf.in:
    - Remove the lines about the above mentioned patches.
  * debian/bcmwl-kernel-source.postinst:
    - Make use of /usr/lib/dkms/common.postinst (LP: #497149).
  * Bump compat to 5.
 -- Alberto Milone <email address hidden> Sun, 14 Feb 2010 19:58:58 +0100

Changed in bcmwl (Ubuntu):
status: In Progress → Fix Released

Alberto, you failed to note the patch I posted above here (dkms-template-postinst-cleanup.patch), as well as the source package I posted to bug 432780, and so your new bcmwl package completely skips creating the blacklist file:

case "$1" in
        configure)
        # Build the kernel module
        /usr/lib/dkms/common.postinst $PACKAGE_NAME $CVERSION /usr/share/$PACKAGE_NAME $ARCH $2
        exit $?

        # Create a blacklist file
        …

Can we please get this fixed in both dkms and bcmwl?

Mario Limonciello (superm1) wrote :

I've merged in Anders' patch, it will be in the next DKMS release. We'll also be seeing support for "dh --with-dkms" for dh7 packages from a few commits from Debian in that release. Packages will be free to use either way to support DKMS.

Changed in dkms (Ubuntu):
status: New → Fix Committed
Changed in fglrx-installer (Ubuntu):
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dkms - 2.1.1.2-0ubuntu1

---------------
dkms (2.1.1.2-0ubuntu1) lucid; urgency=low

  [ Mario Limonciello ]
  * dkms_autoinstaller:
    - Fix a mismatched if/elif.
  * dkms:
    - Make sure to start up depmod from /sbin/
  * Pull in changes from debian to support dh_dkms.

  [ Anders Kaseorg ]
  * Don't fail to run other debhelper steps in postinst if we fail. (LP: #497149)
 -- Mario Limonciello <email address hidden> Tue, 16 Feb 2010 16:28:14 -0600

Changed in dkms (Ubuntu):
status: Fix Committed → Fix Released

On 15 February 2010 01:46, Anders Kaseorg <email address hidden> wrote:
> Alberto, you failed to note the patch I posted above here (dkms-
> template-postinst-cleanup.patch), as well as the source package I posted
> to bug 432780, and so your new bcmwl package completely skips creating
> the blacklist file:
>
> case "$1" in
>        configure)
>        # Build the kernel module
>        /usr/lib/dkms/common.postinst $PACKAGE_NAME $CVERSION /usr/share/$PACKAGE_NAME $ARCH $2
>        exit $?
>
>        # Create a blacklist file
>        …
>
> Can we please get this fixed in both dkms and bcmwl?
>
> --
> Packages using DKMS should make use of /usr/lib/dkms/common.postinst
> https://bugs.launchpad.net/bugs/497149
> You received this bug notification because you are a bug assignee.
>

Anders, on Monday I fixed that in the following way:
/usr/lib/dkms/common.postinst $PACKAGE_NAME $CVERSION
/usr/share/$PACKAGE_NAME $ARCH $2 || exit $?

Regards,

--
Alberto Milone
Sustaining Engineer (system)
Foundations Team
Canonical OEM Services

Mathias Gug (mathiaz) wrote :

Unsubscribing ubuntu-main-sponsors as I don't see anything that needs to be sponsored for now.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package drbd8 - 2:8.3.7-1ubuntu1

---------------
drbd8 (2:8.3.7-1ubuntu1) lucid; urgency=low

  * Merge from Debian, remaining Ubuntu changes:
    - switch to DKMS:
      + debian/control: drbd8-utils depends on drbd8-source
      + debian/control: drbd8-source depends on dkms and kernel headers
      + debian/dkms.conf
      + debian/drbd8-source.postinst
      + debian/drbd8-source.prerm
      + debian/rules
      + removed 10_different-kernels.dpatch; not needed with DKMS
      + debian/drbd8-source.dirs: removed modass directory
  * Use /usr/lib/dkms/common.postinst in debian/drbd8-source.postinst
    (LP: #497149)
 -- Ante Karamatic <email address hidden> Wed, 27 Jan 2010 17:57:54 +0000

Changed in drbd8 (Ubuntu):
status: Confirmed → Fix Released
Changed in sl-modem (Ubuntu):
status: Fix Committed → Fix Released

openafs in Debian is using dh_dkms now, so this will be fixed in the next sync.

Changed in openafs (Ubuntu):
status: New → Fix Committed
Changed in nvidia-graphics-drivers-96 (Ubuntu):
status: Fix Committed → Fix Released
Changed in nvidia-graphics-drivers-173 (Ubuntu):
status: Fix Committed → Fix Released
Changed in fglrx-installer (Ubuntu):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openafs - 1.4.12+dfsg-3

---------------
openafs (1.4.12+dfsg-3) unstable; urgency=low

  * Apply upstream deltas:
    - [135e196b] Create missing root directory when ORPH_ATTACH
    - [190ef2cb] volmonitor keep vtrans lock
    - [812dcc2c] Increase the maximum number of sysnames
    - [a123d4ab] Print rxdebug statistics as unsigned values
  * If the user configures openafs-client to use AFSDB records for VLDB
    server location, don't prompt the user for VLDB servers for the local
    cell even if they're not present in CellServDB and don't try to add an
    entry for the local cell to CellServDB. (Closes: #575299)

openafs (1.4.12+dfsg-2) unstable; urgency=low

  * Apply upstream deltas:
    - [4ca7b6fc] Remove lih_r
    - [f3899ac3] Allow GetSomeSpace_r to select an optimal host
    - [94a43966] h_TossStuff_r: check held-ness after lock
    - [b78eeb0c] h_TossStuff_r: make sure host does not go away
    - [0583af32] volmonitor copy link before calling free
    - [eb799d07] Move non-executable stack assembly code to end of file
  * Build with -fno-strict-aliasing. The upstream development branch has
    a better fix that selectively enables this for specific files with
    known problems, but be conservative for the stable release.

openafs (1.4.12+dfsg-1) unstable; urgency=low

  * New upstream release.
    - Enable weak encryption types in aklog and klog.krb5.
    - Build support for Linux 2.6.33.
    - Improvements to host tracking safety in the file server.
    - Fall back to current kernel credentials if we can't use stored ones.
    - Fix truncation handling in some large file situations.
    - Further fixes to mmap handling.
    - Avoid double-free in some FetchData64 error situations.
    - Stop warning about system call hooks when keyrings are in use.
    - Flush vcaches when a mount fails to avoid inconsistent data.
    - New dump tag and length standard for vos dump.
    - Fix stack executability for programs containing assembly code.
    - Various salvager robustness fixes.
  * Use dh_dkms from the DKMS package to handle creation of the maintainer
    scripts for openafs-modules-dkms rather than rolling our own.
    (LP: #497149)
  * Update init script to require $remote_fs be started first and stopped
    after OpenAFS. This won't be the case in the long run, but for now
    some important boot-time options need /usr/bin/fs to set them.
  * List $syslog in Should-Start for the openafs-client init script, since
    otherwise if loading the module causes a kernel panic, it won't be
    logged to disk.
  * Update CellServDB to the 2010-02-28 version.
  * Add README.source explaining maintenance procedures and a
    debian/import-upstream script to do a Git-aware merge of a new
    upstream release that will allow us to cherry-pick upstream patches
    and do proper merges.
  * Stop linking the openafs-fileserver doc directory to openafs-client so
    that we can provide a separate NEWS.Debian.
  * Update standards version to 3.8.4 (no changes required).
 -- Achim Bohnet <email address hidden> Mon, 12 Apr 2010 11:51:51 +0100

Changed in openafs (Ubuntu):
status: Fix Committed → Fix Released
Chris Halse Rogers (raof) wrote :

nouveau-kernel-source was removed from the archive in Lucid as the kernel modules have been merged with the mainline kernel. Marking the nouveau-kernel-source task as invalid.

Changed in nouveau-kernel-source (Ubuntu):
status: New → Invalid

kqemu isn't part of Ubuntu since lucid

Changed in kqemu (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers