You are not logged in.

#1 2014-12-14 14:27:19

SysGhost
Member
From: Stockholm
Registered: 2012-11-09
Posts: 62

[SOLVED] dkms think "make" fails despite that it exits successfully.

Greetings. I have a laptop with my own kernel module that I update every now and then.
So far I made it compile just fine.
Next I did create a PKGBUILD and a dkms config for it. It worked flawlessly as well, and it has been working for a while.

But recently, with the latest updates. dkms starts to spit out errors about my dkms package.
I go in and check what's up.

Now some strange things starts happening:

if I try to make dkms to update my module, it ends with an error:

Command:

sudo dkms install asus_oled-sg/r103 -k $(uname -r)

Output:

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.17.4-1-ARCH -C /var/lib/dkms/asus_oled-sg/r103/build/....
Error!  Build of asus_oled-sg.ko failed for: 3.17.4-1-ARCH (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/asus_oled-sg/r103/build/ for more information.

The content of /var/lib/dkms/asus_oled-sg/r103/build/make.log :

DKMS make.log for asus_oled-sg-r103 for kernel 3.17.4-1-ARCH (x86_64)
Sun 14 Dec 15:22:45 CET 2014
make: Entering directory '/var/lib/dkms/asus_oled-sg/r103/build'
make[1]: Entering directory '/usr/lib/modules/3.17.4-1-ARCH/build'
  CC [M]  /var/lib/dkms/asus_oled-sg/r103/build/asus_oled.o
In file included from include/linux/thread_info.h:11:0,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from include/linux/preempt.h:18,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/linux/stat.h:18,
                 from include/linux/module.h:10,
                 from /var/lib/dkms/asus_oled-sg/r103/build/asus_oled.c:39:
include/linux/bug.h:33:45: warning: initialization from incompatible pointer type
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:849:3: note: in expansion of macro ‘BUILD_BUG_ON_ZERO’
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro ‘VERIFY_OCTAL_PERMISSIONS’
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
include/linux/device.h:426:46: note: in expansion of macro ‘__ATTR’
  struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store)
                                              ^
/var/lib/dkms/asus_oled-sg/r103/build/asus_oled.c:765:8: note: in expansion of macro ‘CLASS_ATTR’
 static CLASS_ATTR(version, S_IRUGO, version_show, NULL);
        ^
include/linux/bug.h:33:45: warning: (near initialization for ‘class_attr_version.show’)
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:849:3: note: in expansion of macro ‘BUILD_BUG_ON_ZERO’
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro ‘VERIFY_OCTAL_PERMISSIONS’
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
include/linux/device.h:426:46: note: in expansion of macro ‘__ATTR’
  struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store)
                                              ^
/var/lib/dkms/asus_oled-sg/r103/build/asus_oled.c:765:8: note: in expansion of macro ‘CLASS_ATTR’
 static CLASS_ATTR(version, S_IRUGO, version_show, NULL);
        ^
In file included from include/linux/printk.h:5:0,
                 from include/linux/kernel.h:13,
                 from /var/lib/dkms/asus_oled-sg/r103/build/asus_oled.c:38:
/var/lib/dkms/asus_oled-sg/r103/build/asus_oled.c: In function ‘__inittest’:
include/linux/init.h:329:4: warning: return from incompatible pointer type
  { return initfn; }     \
    ^
/var/lib/dkms/asus_oled-sg/r103/build/asus_oled.c:805:1: note: in expansion of macro ‘module_init’
 module_init(asus_oled_init);
 ^
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /var/lib/dkms/asus_oled-sg/r103/build/asus_oled.mod.o
  LD [M]  /var/lib/dkms/asus_oled-sg/r103/build/asus_oled.ko
make[1]: Leaving directory '/usr/lib/modules/3.17.4-1-ARCH/build'
make: Leaving directory '/var/lib/dkms/asus_oled-sg/r103/build'

So it contains a few notes and warnings, but it compiles just fine. It has generated a .ko file.
Yet dkms thinks "make" failed. Why?


If try this, it works:

cd /var/lib/dkms/asus_oled-sg/r103/build/
sudo make clean
sudo make

No errors, same set of notes and warnings. exit status 0, as it should be.
Then why do dkms think it has failed?



This is my dkms.conf file:

PACKAGE_NAME="@_PKGBASE@"
PACKAGE_VERSION="@PKGVER@"
MAKE[0]='make -C /var/lib/dkms/@_PKGBASE@/@PKGVER@/build/'
CLEAN='make -C /var/lib/dkms/@_PKGBASE@/@PKGVER@/build/ clean'
BUILT_MODULE_NAME[0]="@_PKGBASE@"
DEST_MODULE_LOCATION[0]="/extra"
AUTOINSTALL="yes"

Last edited by SysGhost (2014-12-15 10:05:47)

Offline

#2 2014-12-15 09:49:30

SysGhost
Member
From: Stockholm
Registered: 2012-11-09
Posts: 62

Re: [SOLVED] dkms think "make" fails despite that it exits successfully.

Well I finally solved it.
I had to make some adjustments in the given examples at https://wiki.archlinux.org/index.php/Dy … le_Support
Looks like I tried to overdo it. Old versions of PKGBUILD and dkms.conf that previously worked, led me astray.
This is how the files now look like: (slightly different from what the wiki page above gives. I had to make some adjustments.)

PKGBUILD:

_pkgbase=asus_oled
pkgname=asus_oled-dkms
pkgver=r103
pkgrel=6
pkgdesc="Driver for small OLED displays found in some older Asus laptops. Ugly-patched for >3.14 kernels."
url="http://lapsus.berlios.de/asus_oled.html"
arch=('x86_64' 'i686')
license=('GPL2')
depends=('dkms')
makedepends=('sed')
provides=("${_pkgbase}")
conflicts=("${_pkgbase}")
install="${pkgname}.install"
source=("${pkgname}.tar.gz"
        "dkms.conf")
md5sums=('SKIP'
         'SKIP')

build() {
  cd "${_pkgbase}-${pkgver}"
  make clean
  make
  rm modules.order
}

package() {
  # Prepare Makeile
  sed -i 's/depmod/\#depmod/g' "${_pkgbase}-${pkgver}"/Makefile

  # Install
  msg2 "Starting make install..."
  make -C "${_pkgbase}-${pkgver}" PREFIX="${pkgdir}/usr" DESTDIR="${pkgdir}/usr" INSTALL_MOD_PATH="/usr/lib/modules/$(uname -r)/extra" install

  # Copy dkms.conf
  install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

  # Set name and version
  sed -e "s/@_PKGBASE@/${_pkgbase}/" \
      -e "s/@PKGVER@/${pkgver}/" \
      -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

  # Copy sources (including Makefile)
  cp -r "${_pkgbase}-${pkgver}"/* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/
}

dkms.conf:

PACKAGE_NAME="@_PKGBASE@"
PACKAGE_VERSION="@PKGVER@"
MAKE[0]='make'
CLEAN='make clean'
BUILT_MODULE_NAME[0]="@_PKGBASE@"
DEST_MODULE_LOCATION[0]="/extra"
AUTOINSTALL="yes"

asus_oled-dkms.install:

post_install() {
    dkms install asus_oled/${1%%-*}
}

pre_upgrade() {
    pre_remove ${2%%-*}
}

post_upgrade() {
    post_install ${1%%-*}
}

pre_remove() {
    dkms remove asus_oled/${1%%-*} --all
}

Seems this was more like a package problem than a problem with the kernel module itself, as I first thought. Hence the thread placement.
I am now marking this as solved.

Offline

Board footer

Powered by FluxBB