lcgamboa / tty0tty

Linux null-modem emulator
GNU General Public License v2.0
59 stars 18 forks source link

ubuntu 24.04 auto-update conflicts with driver building #24

Open moefear85 opened 1 month ago

moefear85 commented 1 month ago

contents of /var/lib/dkms/tty0tty/1.41/build/make.log:

DKMS make.log for tty0tty-1.41 for kernel 6.8.0-35-generic (x86_64)
Di 4. Jun 15:53:34 CEST 2024
make: Entering directory '/usr/src/linux-headers-6.8.0-35-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  CC [M]  /var/lib/dkms/tty0tty/1.41/build/tty0tty.o
/var/lib/dkms/tty0tty/1.41/build/tty0tty.c:847:18: error: initialization of ‘ssize_t (*)(struct tty_struct *, const u8 *, size_t)’ {aka ‘long int (*)(struct tty_struct *, const unsigned char *, long unsigned int)’} from incompatible pointer type ‘int (*)(struct tty_struct *, const unsigned char *, int)’ [-Werror=incompatible-pointer-types]
  847 |         .write = tty0tty_write,
      |                  ^~~~~~~~~~~~~
/var/lib/dkms/tty0tty/1.41/build/tty0tty.c:847:18: note: (near initialization for ‘serial_ops.write’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:243: /var/lib/dkms/tty0tty/1.41/build/tty0tty.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.8.0-35-generic/Makefile:1926: /var/lib/dkms/tty0tty/1.41/build] Error 2
make: *** [Makefile:240: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.8.0-35-generic'

seems one of those cases where gcc decides to treat a previously fine code construct as an error-warning & fail. Is it possible to properly cast the type to avoid this (I wouldn't know exactly what to cast to)? Otherwise ubuntu apt upgrade (04.06.2024) fails:

Hit:1 http://de.archive.ubuntu.com/ubuntu noble InRelease                                                                                                                                                   
Hit:2 http://archive.ubuntu.com/ubuntu noble InRelease                                    
Hit:3 http://security.ubuntu.com/ubuntu noble-security InRelease    
Hit:4 http://de.archive.ubuntu.com/ubuntu noble-updates InRelease   
Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:6 http://de.archive.ubuntu.com/ubuntu noble-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://dl.google.com/linux/chrome/deb stable InRelease' doesn't support architecture 'i386'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-image-6.5.0-35-generic linux-modules-6.5.0-35-generic linux-modules-extra-6.5.0-35-generic
Use 'sudo apt autoremove' to remove them.
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
  libcjson1 libavdevice60 ffmpeg libpostproc57 libavcodec60 libavcodec60
  libavutil58 libavutil58 libswscale7 libswresample4 libswresample4
  libavformat60 libavfilter9
Learn more about Ubuntu Pro at https://ubuntu.com/pro
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-headers-6.8.0-35-generic (6.8.0-35.35) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.8.0-35-generic
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.41/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.41/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/etc/dkms/framework.conf)
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.41/source/dkms.conf)

Building module:
Cleaning build area...
make -j12 KERNELRELEASE=6.8.0-35-generic -C /lib/modules/6.8.0-35-generic/build M=/var/lib/dkms/tty0tty/1.41/build...(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/tty0tty-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.8.0-35-generic (x86_64)
Consult /var/lib/dkms/tty0tty/1.41/build/make.log for more information.
dkms autoinstall on 6.8.0-35-generic/x86_64 succeeded for lttng-modules
dkms autoinstall on 6.8.0-35-generic/x86_64 failed for tty0tty(10)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
 * dkms: autoinstall for kernel 6.8.0-35-generic
   ...fail!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
dpkg: error processing package linux-headers-6.8.0-35-generic (--configure):
 installed linux-headers-6.8.0-35-generic package post-installation script subprocess returned error exit status 11
Setting up linux-image-6.8.0-35-generic (6.8.0-35.35+1) ...
dpkg: dependency problems prevent configuration of linux-headers-generic:
 linux-headers-generic depends on linux-headers-6.8.0-35-generic; however:
  Package linux-headers-6.8.0-35-generic is not configured yet.

dpkg: error processing package linux-headers-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-headers-generic (= 6.8.0-35.35); however:
  Package linux-headers-generic is not configured yet.

No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
      dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
Processing triggers for linux-image-6.8.0-35-generic (6.8.0-35.35+1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.8.0-35-generic
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.41/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.41/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/etc/dkms/framework.conf)
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/1.41/source/dkms.conf)

Building module:
Cleaning build area...
make -j12 KERNELRELEASE=6.8.0-35-generic -C /lib/modules/6.8.0-35-generic/build M=/var/lib/dkms/tty0tty/1.41/build...(bad exit status: 2)
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/tty0tty-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.8.0-35-generic (x86_64)
Consult /var/lib/dkms/tty0tty/1.41/build/make.log for more information.
dkms autoinstall on 6.8.0-35-generic/x86_64 succeeded for lttng-modules
dkms autoinstall on 6.8.0-35-generic/x86_64 failed for tty0tty(10)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
 * dkms: autoinstall for kernel 6.8.0-35-generic
   ...fail!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.8.0-35-generic (--configure):
 installed linux-image-6.8.0-35-generic package post-installation script subprocess returned error exit status 11
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-headers-6.8.0-35-generic
 linux-headers-generic
 linux-generic
 linux-image-6.8.0-35-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
apt failed with exit status 100.

this appears to be the same issue as 6.6 DKMS build problem, and it appears to be fixed (by you). However, it seems the changes aren't reflected in the ubuntu repository, meaning sudo apt install tty0tty-dkms still installs the old version.

I tried manually modifying line 847 in /var/lib/dkms/tty0tty/1.41/build/tty0tty.c but the file seems auto-generated, meaning any changes aren't picked up, hence the error remains. What would be the correct original path to modify (when installed from the repo)?

lcgamboa commented 1 month ago

I tried to contact the package maintainer to find out how to update it. You can use the scripts dkms-remove.sh and dkms-install.sh to update dkms source using this repo.

epsilonrt commented 1 month ago

The distribution versions supported by the piduino.org repository are indicated in the README file and Ubuntu 24.04 is not yet one of them. Under Ubuntu 22.04, the update is done correctly, for the moment, the quickest solution is to use the dkms-*.sh scripts. As soon as I have time available I will see to integrating version 24.04.

Paramétrage de linux-headers-6.5.0-35-generic (6.5.0-35.35~22.04.1) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.5.0-35-generic
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
make -j4 KERNELRELEASE=6.5.0-35-generic -C /lib/modules/6.5.0-35-generic/build M=/var/lib/dkms/tty0tty/1.41/build...
Signing module:
 - /var/lib/dkms/tty0tty/1.41/6.5.0-35-generic/x86_64/module/tty0tty.ko
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
cleaning build area...
tty0tty.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.5.0-35-generic/updates/dkms/
depmod......
Warning: Unable to find an initial ram disk that I know how to handle.
Will not try to make an initrd.
   ...done.