[DRBD-user] drbd8 and ubuntu 9.10 == :(

Lars Ellenberg lars.ellenberg at linbit.com
Tue Nov 3 23:41:16 CET 2009

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Tue, Nov 03, 2009 at 11:05:53PM +0100, Lars Ellenberg wrote:
> On Tue, Nov 03, 2009 at 02:34:30PM -0600, Andrew Barringer wrote:
> > Thanks for the Classic linux help aka: you are st00pid go bug off and
> > RTFM.
> > 
> > For what's it's worth...
> > 
> > The problem was submitted weeks ago to dkms bug list and it was punted
> > to the drbd8 list and there's been no update from that team.
> 
> You should have said so.
> 
> > I thought it obvious that I would have tried what it suggests.
> 
> You have no idea how many people don't even read
> single line error messages, let alone multi line ones,
> and come complaining right away, without trying what was suggested
> in that message.
> 
> > Okay... I'll go away now as directed.
> 
>  ;)
> 
> apparently dkms and drbd sources and debian rules are somewhat
> incompatible currently.
> I'm sorry, I don't know much about dkms internals,

but I know enough apparently.

session log follows.

	(NFSROOT karmic-amd64) # apt-get install drbd8-source
	Reading package lists... Done
	Building dependency tree
	Reading state information... Done
	The following NEW packages will be installed:
	  drbd8-source
	0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
	Need to get 0B/264kB of archives.
	After this operation, 1044kB of additional disk space will be used.
	Can not write log, openpty() failed (/dev/pts not mounted?)
	Selecting previously deselected package drbd8-source.
	(Reading database ... 413773 files and directories currently installed.)
	Unpacking drbd8-source (from .../drbd8-source_2%3a8.3.3-0ubuntu1_all.deb) ...
	Can not write log, openpty() failed (/dev/pts not mounted?)
	Setting up drbd8-source (2:8.3.3-0ubuntu1) ...
	Removing all [drbd8-8.3.3] DKMS Modules

	Error! There are no instances of module: drbd8
	8.3.3 located in the DKMS tree.
	Done.
	Adding [drbd8-8.3.3] Module to DKMS build system

	*************************************************
	ERROR: Missing kernel headers.

ok, you know that one already.

in this case, it is correct: it triggers on uname -r,
and in that changeroot, uname -r does not match any installed linux header
packages.
but anyways.


	(NFSROOT karmic-amd64) # cat /var/lib/dpkg/info/drbd8-source.postinst
	#!/bin/sh
	set -e

	PKG="drbd8"
	PKGVER=`dpkg-query -W -f='${Version}' "$PKG"-source | cut -d: -f2 | cut -f1 -d-`

	case "$1" in
		configure)
			echo "Removing all [$PKG-$PKGVER] DKMS Modules"
			dkms remove -m $PKG -v $PKGVER --all >/dev/null || true
			echo "Done."
			echo "Adding [$PKG-$PKGVER] Module to DKMS build system"
			dkms add -m $PKG -v $PKGVER >/dev/null
			if ! dpkg --status linux-headers-`uname -r` 2>/dev/null | grep -qs "Status: install ok installed"; then
				flavor=`uname -r | sed "s/.*-//"`
				echo
				echo "*************************************************"
				echo "ERROR: Missing kernel headers."
				echo
				echo "You appear to have at least some kernel headers"
				echo "installed, but you do not have the necessary"
				echo "headers to build $PKG-source against this kernel."
				echo
				echo "You might try installing the meta package:"
				echo " $ sudo apt-get install linux-headers-$flavor"
				echo "or specifically"
				echo " $ sudo apt-get install linux-headers-"`uname -r`
				echo "to obtain the necessary build dependencies."
				echo
				echo "*************************************************"
				echo
				exit 1
			fi
			echo "Doing initial module build"
			dkms build -m $PKG -v $PKGVER >/dev/null

THERE.

			echo "Installing initial module"
			dkms install -m $PKG -v $PKGVER >/dev/null
			echo "Done."
		;;
	esac


lets try this:

	(NFSROOT karmic-amd64) # dkms build --help

	Error!  Unknown option: --help
	Usage: /usr/sbin/dkms [action] [options]
	  [action]  = { add | remove | build | install | uninstall | match
		       | mkdriverdisk | mktarball | ldtarball | mkrpm | mkkmp | mkdeb | status }
	  [options] = [-m module] [-v module-version] [-k kernel-version] [-a arch]
		      [-d distro] [-c dkms.conf-location] [-q] [--force] [--all]
		      [--templatekernel=kernel] [--directive='cli-directive=cli-value']
		      [--config=kernel-.config-location] [--archive=tarball-location]
		      [--kernelsourcedir=source-location] [--no-prepare-kernel]
		      [--binaries-only] [--source-only] [-r release (SuSE)] [--verbose]
		      [--size] [--spec=specfile] [--media=floppy|iso|tar] [--legacy-postinst=0|1]

	(NFSROOT karmic-amd64) # dkms build -m drbd8 -v 8.3.5 -k 2.6.31-14-generic

	Error! DKMS tree does not contain: drbd8-8.3.5
	Build cannot continue without the proper tree.

oops.  my fault. not 8.3.5, only 8.3.3 ;-)
again:

	(NFSROOT karmic-amd64) # dkms build --verbose -m drbd8 -v 8.3.3 -k 2.6.31-14-generic

	Kernel preparation unnecessary for this kernel.  Skipping...

	Building module:
	make -C drbd clean KERNELDIR=/lib/modules/2.6.31-14-generic/build
	make: Entering directory `/var/lib/dkms/drbd8/8.3.3/build/drbd'
	rm -rf .tmp_versions
	rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
	make: Leaving directory `/var/lib/dkms/drbd8/8.3.3/build/drbd'

	su nobody -c "make KERNELRELEASE=2.6.31-14-generic -C drbd KERNELDIR=/lib/modules/2.6.31-14-generic/build" >> /var/lib/dkms/drbd8/8.3.3/build/make.log 2>&1
	(bad exit status: 2)

WTF? KERNELDIR? it has always been KDIR with DRBD.

	Error! Bad return status for module build on kernel: 2.6.31-14-generic (x86_64)
	Consult the make.log in the build directory
	/var/lib/dkms/drbd8/8.3.3/build/ for more information.
	0
	0

	(NFSROOT karmic-amd64) /var/lib/dkms/drbd8/8.3.3/build# cat dkms.conf
	PACKAGE_NAME="drbd"
	PACKAGE_VERSION="8.3.3"
	AUTOINSTALL=yes
	CLEAN="make -C drbd clean KERNELDIR=$kernel_source_dir"
	MAKE="make -C drbd KERNELDIR=$kernel_source_dir"

SIC.
that won't work.
at least not with the Makefile from our tarball.
it may _sometimes_ have worked,
because our makefile defaults to use `uname -r`,
if no explicit KDIR was supplied.

	BUILT_MODULE_NAME[0]="drbd"
	BUILT_MODULE_LOCATION[0]="drbd"
	DEST_MODULE_LOCATION[0]="/kernel/updates"
	MODULES_CONF[0]="options drbd cn_idx=7"

	(NFSROOT karmic-amd64) /var/lib/dkms/drbd8/8.3.3# ls -l
	drwxr-xr-x 4 nobody root 4096 2009-11-03 23:18 build
	lrwxrwxrwx 1 root   root   20 2009-11-03 23:12 source -> /usr/src/drbd8-8.3.3

	(NFSROOT karmic-amd64) /var/lib/dkms/drbd8/8.3.3/source# ls -la
	-rw-r--r--  1 root root  307 2009-10-07 19:27 dkms.conf
	drwxr-xr-x  3 root root 4096 2009-11-03 23:12 drbd
	drwxr-xr-x  2 root root 4096 2009-11-03 23:12 scripts

	(NFSROOT karmic-amd64) /var/lib/dkms/drbd8/8.3.3/source# vi dkms.conf
	PACKAGE_NAME="drbd"
	PACKAGE_VERSION="8.3.3"
	AUTOINSTALL=yes
	CLEAN="make -C drbd clean KDIR=$kernel_source_dir"
	MAKE="make -C drbd KDIR=$kernel_source_dir"

Now. THAT should be better.

	BUILT_MODULE_NAME[0]="drbd"
	BUILT_MODULE_LOCATION[0]="drbd"
	DEST_MODULE_LOCATION[0]="/kernel/updates"
	MODULES_CONF[0]="options drbd cn_idx=7"

	(NFSROOT karmic-amd64) /var/lib/dkms/drbd8/8.3.3/source# dkms build --verbose -m drbd8 -v 8.3.3 -k 2.6.31-14-generic

	Kernel preparation unnecessary for this kernel.  Skipping...

	Building module:
	make -C drbd clean KDIR=/lib/modules/2.6.31-14-generic/build
	make: Entering directory `/var/lib/dkms/drbd8/8.3.3/build/drbd'
	rm -rf .tmp_versions
	rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
	make: Leaving directory `/var/lib/dkms/drbd8/8.3.3/build/drbd'

	su nobody -c "make KERNELRELEASE=2.6.31-14-generic -C drbd KDIR=/lib/modules/2.6.31-14-generic/build" >> /var/lib/dkms/drbd8/8.3.3/build/make.log 2>&1

	make -C drbd clean KDIR=/lib/modules/2.6.31-14-generic/build
	make: Entering directory `/var/lib/dkms/drbd8/8.3.3/build/drbd'
	rm -rf .tmp_versions
	rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
	make: Leaving directory `/var/lib/dkms/drbd8/8.3.3/build/drbd'


	DKMS: build Completed.


See.

Now we can go together and complain to the package maintainers.

hth,

> Just cd'ing into the sources, and doing the make, should work fine.
> 
> if you have to do the make yourself anyways,
> I'd suggest using the 8.3.5 tarball, though.

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
__
please don't Cc me, but send to list   --   I'm subscribed



More information about the drbd-user mailing list