• DKMS build of ZFS and SPL kernel modules fails after kernel update


    After upgrading linux kernel package to 4.8.2.0-1-ARCH today, zfs (Version 0.6.5.7) and spl (Version 0.6.5.7 too) kernel modules fail to build with dkms. When trying to build the spl module, it just fails an error, but I can’t figure out why. In the make.log file, it just says “ERROR”. The ZFS build then fails too of course, it is based on the correct building of the spl part. At the moment my system is unbootable because i dont have the kernel modules for zfs for the current kernel installed. What can I do to get the compilation working? (linux-headers package is installed)

    /var/lib/dkms/spl/0.6.5.7/build/make.log:

    DKMS make.log for spl-0.6.5.7 for kernel 4.8.2.0-1-ARCH (x86_64)
    Wed Oct 19 13:28:41 CEST 2016
    make  all-recursive
    make[1]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build'
    Making all in include
    make[2]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include'
    Making all in fs
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/fs'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/fs'
    Making all in linux
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/linux'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/linux'
    Making all in rpc
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/rpc'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/rpc'
    Making all in sharefs
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/sharefs'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/sharefs'
    Making all in sys
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys'
    Making all in fm
    make[4]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys/fm'
    make[4]: Nothing to be done for 'all'.
    make[4]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys/fm'
    Making all in fs
    make[4]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys/fs'
    make[4]: Nothing to be done for 'all'.
    make[4]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys/fs'
    Making all in sysevent
    make[4]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys/sysevent'
    make[4]: Nothing to be done for 'all'.
    make[4]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys/sysevent'
    make[4]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys'
    make[4]: Nothing to be done for 'all-am'.
    make[4]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys'
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/sys'
    Making all in util
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/util'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/util'
    Making all in vm
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include/vm'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include/vm'
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/include'
    make[3]: Nothing to be done for 'all-am'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include'
    make[2]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/include'
    Making all in rpm
    make[2]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/rpm'
    Making all in generic
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/rpm/generic'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/rpm/generic'
    Making all in redhat
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/rpm/redhat'
    make[3]: Nothing to be done for 'all'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/rpm/redhat'
    make[3]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/rpm'
    make[3]: Nothing to be done for 'all-am'.
    make[3]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/rpm'
    make[2]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/rpm'
    Making all in module
    make[2]: Entering directory '/var/lib/dkms/spl/0.6.5.7/build/module'
    make -C /usr/lib/modules/4.8.2.0-1-ARCH/build SUBDIRS=`pwd`  CONFIG_SPL=m modules
    make[3]: Entering directory '/usr/lib/modules/4.8.2-1-ARCH/build'
      CC [M]  /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-proc.o
      CC [M]  /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-kmem.o
      CC [M]  /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-kmem-cache.o
      CC [M]  /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-vmem.o
      CC [M]  /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-thread.o
      CC [M]  /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-taskq.o
      CC [M]  /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.o
    In file included from ./arch/x86/include/asm/atomic.h:7:0,
                     from ./arch/x86/include/asm/msr.h:66,
                     from ./arch/x86/include/asm/processor.h:20,
                     from ./arch/x86/include/asm/cpufeature.h:4,
                     from ./arch/x86/include/asm/thread_info.h:52,
                     from ./include/linux/thread_info.h:54,
                     from ./arch/x86/include/asm/preempt.h:6,
                     from ./include/linux/preempt.h:59,
                     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/spl/0.6.5.7/build/include/sys/sysmacros.h:28,
                     from /var/lib/dkms/spl/0.6.5.7/build/include/sys/types.h:29,
                     from /var/lib/dkms/spl/0.6.5.7/build/include/sys/rwlock.h:28,
                     from /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.c:27:
    /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.c: In function '__rwsem_tryupgrade':
    ./arch/x86/include/asm/cmpxchg.h:87:29: error: invalid initializer
      __typeof__(*(ptr)) __old = (old);    \
                                 ^
    ./arch/x86/include/asm/cmpxchg.h:133:2: note: in expansion of macro '__raw_cmpxchg'
      __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
      ^~~~~~~~~~~~~
    ./arch/x86/include/asm/cmpxchg.h:148:2: note: in expansion of macro '__cmpxchg'
      __cmpxchg(ptr, old, new, sizeof(*(ptr)))
      ^~~~~~~~~
    /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.c:55:8: note: in expansion of macro 'cmpxchg'
      val = cmpxchg(&rwsem->count, SPL_RWSEM_SINGLE_READER_VALUE,
            ^~~~~~~
    ./arch/x86/include/asm/cmpxchg.h:88:29: error: invalid initializer
      __typeof__(*(ptr)) __new = (new);    \
                                 ^
    ./arch/x86/include/asm/cmpxchg.h:133:2: note: in expansion of macro '__raw_cmpxchg'
      __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
      ^~~~~~~~~~~~~
    ./arch/x86/include/asm/cmpxchg.h:148:2: note: in expansion of macro '__cmpxchg'
      __cmpxchg(ptr, old, new, sizeof(*(ptr)))
      ^~~~~~~~~
    /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.c:55:8: note: in expansion of macro 'cmpxchg'
      val = cmpxchg(&rwsem->count, SPL_RWSEM_SINGLE_READER_VALUE,
            ^~~~~~~
    /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.c:57:14: error: invalid operands to binary == (have 'atomic_long_t {aka struct <anonymous>}' and 'long int')
      return (val == SPL_RWSEM_SINGLE_READER_VALUE);
                  ^~
    /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.c:58:1: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
    make[5]: *** [scripts/Makefile.build:290: /var/lib/dkms/spl/0.6.5.7/build/module/spl/spl-rwlock.o] Error 1
    make[4]: *** [scripts/Makefile.build:440: /var/lib/dkms/spl/0.6.5.7/build/module/spl] Error 2
    make[3]: *** [Makefile:1471: _module_/var/lib/dkms/spl/0.6.5.7/build/module] Error 2
    make[3]: Leaving directory '/usr/lib/modules/4.8.2-1-ARCH/build'
    make[2]: *** [Makefile:11: modules] Error 2
    make[2]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build/module'
    make[1]: *** [Makefile:588: all-recursive] Error 1
    make[1]: Leaving directory '/var/lib/dkms/spl/0.6.5.7/build'
    make: *** [Makefile:469: all] Error 2
    
    

    Another point:
    The first time, dkms searched the kernel headers in /usr/lib/modules/4.8.2.0-1-ARCH/build, which didn’t exist although the latest linux-header package was installed. As a solution I made a symlink from /usr/lib/modules/4.8.2.1-ARCH to /usr/lib/modules/4.8.2.0-1-ARCH which solved the issue, but didn’t make the build work.

    EDIT:
    I searched for a solution in two other forum threads:

  • Just out of interest, am I the only one experiencing trouble with this update and dkms/ ZFS kernel modules?

    (If I’m the only one, just forget about it and I will reinstall, just setup this yesterday evening / night, but if this is a bigger problem I would be happy to find a better solution than reinstalling, not just for me, but for anyone also having this problem.)

  • @liketechnik2000 No, I’ve got the same problem and got a similar problem before, which could be solved by manually running:

     mkinitcpio -p linux
    

    But this didn’t help this time so I’m also interested since rebooting would mean a broken system my only option so far would be a clean reinstall without zfs root (I know zfs root was not a good idea to begin with)

  • @hm_ I ran mkinitcpio in the hope it would fix it and rebooted. What I have now is an unbootable system, so it’s not that easy:disappointed_relieved:

    Also reinstalling linux-headers and all dkms / ZFS / spl related packages did not help. It’s a pity the ZFS kernel modules can’t be shipped in the traditional way into the kernel, just because of different licenses:grin:

    But you are right, maybe I should have really not installed on a ZFS root partition.

  • Thanks to user @NanoSector, a solution was found (on official Antergos IRC):
    Uninstall zfs-dkms, zfs-utils, spl and spl-utils (yaourt -R). Then install the newer version of ZFS from AUR:
    $ yaourt -S aur/zfs-dkms-git aur/zfs-utils-dkms-git aur/spl-dkms aur/spl-utils-dkms-git

    Yaourt will complain about file /etc/hostid was existing, which is right and good. To install the packages, you need to temporarily remove it. Do this by typing
    # mv /etc/hostid /etc/hostid.bak / $ sudo mv /etc/hostid /etc/hostid.bak
    in a terminal. Then install the packages as instructed above. After that, put your old hostid file in place:
    # mv /etc/hostid.bak /etc/hostid / $ sudo mv /etc/hostid.bak /etc/hostid

    Then you finally need to rebuild your initcpio with the following command:
    # mkinitcpio -p linux / $ sudo mkinitcpio -p linux

    After this you can safely reboot your system without getting into any trouble:smiley:

    EDIT (for people who already rebooted):

    • Reboot a rescue system, best is the official livecd-iso of Antergos.
    • Open up the standard gnome terminal
    • Gain root privileges: sudo su
    • Import your pool: zpool import -N 'poolname'
    • Create mount directory for your pool: mkdir /mnt
    • Change mountpoint of your pool: zfs set mountpoint=/mnt 'poolname'
    • Mount your pool: zfs mount 'poolname'
    • Mount your boot partition: mount /dev/sdxX /mnt/boot
    • Chroot into your system: arch-chroot /mnt
    • Proceed with the above steps (Take care, yaourt must and can not be run as root, use su 'your username')
    • If you have finished with the steps, exit the chroot
    • Unmount your boot partition: umount /mnt/boot
    • Unmount your pool: zfs unmount 'poolname'
    • Change mountpoint of your pool back to default: zfs set mountpoint=/ 'poolname'
    • Export your pool: zpool export 'poolname'
    • Reboot into your normal system
    • Be happy:joy:
  • @liketechnik2000 i tried your approach but it left me with an unbootable system since mkinitcpio built the images without errors the reason maybe my tinkering before trying your solution, so im going for a clean install anyways now since the reason i used zfs was to minimise wearleveling on my ssd, compiling zfs from git seems to negate that reason so i’ll try ex4 for now

    Edit: Seems my try to fix the problem collided with a downtime of the AUR breaking some stuff, however instead of a clean install i mounted the zfs pool on another machine copied its contents with

    cp -ax /zfs /backup
    

    formatted the zfs partition to ext4 and changed the uuid entry in /boot/grub/grub.cfg to the uuid of the ext4 partition stripped the grubcfg of the zfs hook same for /etc/mkinitcpio.conf then copied it back on the new partition chrooted in the system, with

    sudo mount /bootpartition /boot
    
    sudo arch-chroot /newpartition
    
    sudo mkinitcpio -p linux
    
    sudo grub-mkconfig -o /boot/grub/grub.conf
    

    and now im running the same system just with ext4 instead of zfs so far no problems

spl1 dkms5 zfs31 kernel update4 Posts 6Views 1665
Log in to reply