unipi-kernel-modules-dkms does not generate modules on upgrade

  • administrators

    Hi @achilleas-kotsis, thank you for such a detailed explanation. We have merged your patch into unipi-common 1.2.17.test.20191219101434 available in our testing repository. If you have recent image, all you have to do is: apt install unipi-common=1.2.17.test.20191219101434. After some testing we will merge it into master branch.

    As a small reward, you have a discount of 50EUR for your next purchase. We have set it for your account, but please remind it in the order of the description as well.

    Thank you and have a nice day,

  • Hi @martin-kudláček,
    thanks for the reward.

    Can't find the testing repository url, can you please send it?


  • administrators

    Hi @achilleas-kotsis,
    the change has been merged to the 1.2.18.

    The testing repository has the same url, just make sure to add component test:

    deb https://repo.unipi.technology/debian buster main test

    To prefer packages from main, add file /etc/apt/preferences.d/10-unipi-prefer-main with this content:

    Package: *
    Pin: release o=unipi,c=main
    Pin-Priority: 900

    All of that is preconfigured in our images.

  • One more patch against the latest version that renames the old file during package configuration, because if it gets upgraded on a live system, the previously inserted code is not executed (script exits early if devices are found)

    --- setbootconfig.sh.orig	2019-12-19 21:39:51.490185707 +0200
    +++ setbootconfig.sh	2019-12-19 22:04:27.094799784 +0200
    @@ -9,6 +9,10 @@
     if [ "$1" = "--noreboot" -o -n "${DESTDIR}" ]; then
         ## called from package install
    +    # Move old file using '-' instead of '_'
    +    [ -f "${MNTDIR}/config-unipi.inc" ] && mv -f "${MNTDIR}/config-unipi.inc" "${MNTDIR}/config_unipi.inc"
    +    # Change include using '-' instead of '_'
    +    sed -i "s/include config-unipi\.inc/include config_unipi.inc/" "${MNTDIR}/config.txt"
         # check if running from "real" Neuron system
         grep -q '^/dev/mmcblk[[:digit:]]p1 /boot ' /proc/mounts && IS_REAL_SYSTEM=1

    This cleaned up my system perfectly doing a dpkg-reconfigure unipi-common so I suppose it should be working on the package being upgraded also. I can test one of my systems if you generate a testing package to see if it applies cleanly.

  • administrators

    Hi @achilleas-kotsis,
    thank you for the testing. Your patch is included in the testing version 1.2.19.test.20191220083937 available in the testing repository.

    Best regards,

  • @martin-kudláček said in unipi-kernel-modules-dkms does not generate modules on upgrade:


    I can confirm the package works as intended on my systems.


  • Hi @Martin-Kudláček,

    found another issue on latest rpi kernel.

    Building initial module for 4.19.93+
    Error!  Build of unipi.ko failed for: 4.19.93+ (armv7l)
    Consult the make.log in the build directory
    /var/lib/dkms/unipi/1.36/build/ for more information.
    root@vkplc-home:~# cat /var/lib/dkms/unipi/1.36/build/make.log 
    DKMS make.log for unipi-1.36 for kernel 4.19.93+ (armv7l)
    Wed 22 Jan 2020 12:33:22 PM EET
    make: Entering directory '/usr/src/linux-headers-4.19.93+'
      CC [M]  /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_spi.o
      CC [M]  /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_iio.o
      CC [M]  /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_gpio.o
      CC [M]  /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_uart.o
    /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_uart.c: In function ‘neuronspi_uart_handle_rx’:
    /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_uart.c:320:31: error: passing argument 1 of ‘uart_handle_sysrq_char’ from incompatible pointer type [-Werror=incompatible-pointer-types]
        if (uart_handle_sysrq_char(port, ch))
    In file included from /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_common.h:36,
                     from /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_uart.h:22,
                     from /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_uart.c:19:
    ./include/linux/serial_core.h:514:42: note: expected ‘struct uart_port *’ but argument is of type ‘struct neuronspi_port *’
     uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) { return 0; }
      CC [M]  /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_sysfs.o
    cc1: some warnings being treated as errors
    make[1]: *** [scripts/Makefile.build:303: /var/lib/dkms/unipi/1.36/build/unipi/src/unipi_uart.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make: *** [Makefile:1522: _module_/var/lib/dkms/unipi/1.36/build/unipi] Error 2
    make: Leaving directory '/usr/src/linux-headers-4.19.93+'
    make: Entering directory '/usr/src/linux-headers-4.19.93+'
      CC [M]  /var/lib/dkms/unipi/1.36/build/rtc-unipi/rtc-unipi.o
    /var/lib/dkms/unipi/1.36/build/rtc-unipi/rtc-unipi.c: In function ‘rtc_unipi_probe’:
    /var/lib/dkms/unipi/1.36/build/rtc-unipi/rtc-unipi.c:666:6: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
          struct nvmem_config nvmem_cfg = {
      Building modules, stage 2.
      MODPOST 1 modules
      CC      /var/lib/dkms/unipi/1.36/build/rtc-unipi/rtc-unipi.mod.o
      LD [M]  /var/lib/dkms/unipi/1.36/build/rtc-unipi/rtc-unipi.ko
    make: Leaving directory '/usr/src/linux-headers-4.19.93+'```

    Line 320 in unipi_uart.c

    if (uart_handle_sysrq_char(port, ch))

    passes "port" as an arqument to uart_handle_sysrq_char, which is of type "struct neuronspi_port", but uart_handle_sysrq_char expects a type of "struct uart_port", which is part of struct neuronspi_port as seen on unipi_common.h.

    Changing line 320 as below seems to fix the issue.

    if (uart_handle_sysrq_char(&port->port, ch))

  • administrators

    Hi @achilleas-kotsis,
    thanks again for the fix:) We have merged it into a testing repository alongside with fix of the Makefile, which masked this error to the Gitlab CI and allowed building it in the first place. We will test it and soon merge into the master branch.

  • Hi @achilleas-kotsis , @Martin-Kudláček ,

    has it been fixed in the master branch? I am facing to the same problem.

    Thank you

  • administrators

  • Thank you

Log in to reply