1

I'm packaging a Debian package which is supposed to simply install some source code in /usr/src/bcm5974-4.2 and an X configuration file in /usr/share/X11/xorg.conf.d. It unpacks the configuration file properly, but it doesn't seem to install the /usr/src/bcm5974-4.2 directory at all.

My project is available on GitHub here. I'm using fpm to package it with a pretty simple Makefile:

#!/usr/bin/make -f

PKG_NAME=bcm5974-4.2-dkms
PKG_VERSION=1.0.0
PKG_DESCRIPTION="Backported BCM-5974 module from kernel 4.2 including new MacBook hardware support."

MAINTAINER="NOPE"

all:
    test -d build || mkdir build
    fpm -f -s dir -t deb -n $(PKG_NAME) -v $(PKG_VERSION) -a all -p build/ \
        -d dkms -d build-essential -d linux-headers-generic-lts-vivid \
        -m $(MAINTAINER) --description $(PKG_DESCRIPTION) \
        --post-install scripts/post-install.sh --pre-uninstall scripts/pre-uninstall.sh \
        --post-uninstall scripts/post-uninstall.sh \
        --deb-changelog CHANGELOG \
        --exclude '.git*' usr/

This creates a nice little Debian package for me in build/:

$ dpkg-deb -c build/bcm5974-4.2-dkms_1.0.0_all.deb 
drwx------ 0/0               0 2015-11-04 13:41 ./
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/share/
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/share/X11/
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/share/X11/xorg.conf.d/
-rw-rw-r-- 0/0             755 2015-11-04 13:40 ./usr/share/X11/xorg.conf.d/52-synaptics-bcm5974.conf
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/share/doc/
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/share/doc/bcm5974-4.2-dkms/
-rw-r--r-- 0/0             157 2015-11-04 13:41 ./usr/share/doc/bcm5974-4.2-dkms/changelog.Debian.gz
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/src/
drwxrwxr-x 0/0               0 2015-11-04 13:41 ./usr/src/bcm5974-4.2/
-rw-rw-r-- 0/0             237 2015-11-03 14:50 ./usr/src/bcm5974-4.2/Makefile
-rw-rw-r-- 0/0           32171 2015-11-03 14:50 ./usr/src/bcm5974-4.2/bcm5974.c
-rw-rw-r-- 0/0             246 2015-11-03 15:42 ./usr/src/bcm5974-4.2/dkms.conf

It seems to have everything I'd want, but it doesn't install the sources to /usr/src. How can I get it to install the sources to /usr/src properly?

9
  • Using proper Debian packaging is an option. I'm not familiar with fpm. Building packages using dh for example, it not terribly hard, and can be quite easy if the package in question has a sane build system and install targets. Commented Nov 4, 2015 at 22:28
  • I've debated doing that. I spent a couple hours last night toying with it, but fpm is just so much easier. Better: is there a Debian control file which instructs the package where to install things? I find it strange that my conf files are installed but not the DKMS source packages. Commented Nov 4, 2015 at 22:32
  • A lot happened in between the makefile and the list of directories. Usually building APT packages generates tons of log output. Any clues there?
    – RobertL
    Commented Nov 4, 2015 at 22:39
  • It's really weird, I see all of the files in the debian package, and even see their md5 sums, but they're just not installed for some reason. Commented Nov 4, 2015 at 22:44
  • The X config file goes to a directory that currently exists, the /usr/src/bcm5974-4.2/ directory won't exist until after this package is installed. I'd try creating a pre-install script and put mkdir -p /usr/src/bcm5974-4.2/ and assign the correct permissions with chmod. You could post a link to the .deb file.
    – RobertL
    Commented Nov 4, 2015 at 22:49

1 Answer 1

0

It turns out that there was a bug in my pre/post install/uninstall scripts which caused things to be removed at the wrong times.

See, for instance, this:

rm -fr "/usr/src/$dkms_name-$dkms_version"

The Debian prerm hook is called during package updates too, so it seems like this script was removing my source directory during installation.

2
  • Some details would be helpful here. Commented Nov 5, 2015 at 19:14
  • Details given above. Commented Nov 5, 2015 at 19:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .