lcgamboa / tty0tty

Linux null-modem emulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

6.6 DKMS build problem

huseyinkozan opened this issue · comments

Hi,

I got below error after dkms autoinstall;

DKMS make.log for tty0tty-r51.8af6894 for kernel 6.6.2-1-MANJARO (x86_64)
Sal 28 Kas 2023 10:53:16 +03
make -C /lib/modules/6.6.2-1-MANJARO/build M=/var/lib/dkms/tty0tty/r51.8af6894/build modules
make[1]: Entering directory '/usr/lib/modules/6.6.2-1-MANJARO/build'
  CC [M]  /var/lib/dkms/tty0tty/r51.8af6894/build/tty0tty.o
/var/lib/dkms/tty0tty/r51.8af6894/build/tty0tty.c:847:18: hata: 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/r51.8af6894/build/tty0tty.c:847:18: bilgi: ('serial_ops.write' için near ilklendirme)
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/tty0tty/r51.8af6894/build/tty0tty.o] Error 1
make[2]: *** [/usr/lib/modules/6.6.2-1-MANJARO/build/Makefile:1913: /var/lib/dkms/tty0tty/r51.8af6894/build] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.6.2-1-MANJARO/build'
make: *** [Makefile:30: all] Error 2

But, works at 6.5. Here the dkms status;

$ sudo dkms status                                     
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/tty0tty/r51.8af6894/source/dkms.conf)
tty0tty/r51.8af6894, 6.5.12-1-MANJARO, x86_64: installed
vboxhost/7.0.12_OSE, 6.5.12-1-MANJARO, x86_64: installed
vboxhost/7.0.12_OSE, 6.6.2-1-MANJARO, x86_64: installed

Apparently, there were changes in the new kernel version.
Due to the error, simply change the return type of the tty0tty_write function from int to ssize_t fix the problem.
As soon as I have time I will modify the code to do this automatically.
Thanks for reporting the problem

I have change the line mentioned from int to ssize_t

static ssize_t tty0tty_write(struct tty_struct *tty, const unsigned char *buffer, int count)

and still give error in kernel 6.6.8

/home/me/tty0tty/module/tty0tty.c:855: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 ‘ssize_t (*)(struct tty_struct *, const unsigned char *, int)’ {aka ‘long int (*)(struct tty_struct *, const unsigned char *, int)’} [-Werror=incompatible-pointer-types]
  855 |         .write = tty0tty_write,

Hi,

I can build with below diff, but did not try to install;

diff --git a/module/tty0tty.c b/module/tty0tty.c
index 4212dab..bd7d66e 100644
--- a/module/tty0tty.c
+++ b/module/tty0tty.c
@@ -318,7 +318,11 @@ static void tty0tty_close(struct tty_struct *tty, struct file *file)
                do_close(tty0tty);
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
+static ssize_t tty0tty_write(struct tty_struct *tty, const u8 *buffer, size_t count)
+#else
 static int tty0tty_write(struct tty_struct *tty, const unsigned char *buffer, int count)
+#endif
 {
        struct tty0tty_serial *tty0tty = tty->driver_data;
        struct tty0tty_serial *shadow;

Patch works fine in kernel 6.7, module load
Next days I will try if works with a modem simulation "work"

Fixed in 355b051.