I have an old serial card which I use to talk to my UPS. It requires a kernel module. I last installed it a few months ago on Leap 15.3 and have to recompile the module with every new kernel - which has worked over several kernel versions. It will not compile in 15.4.
david@localhost:~/projects/UPS/perle_serial_card/perle-serial-3.9.2/pserial> sudo make
[sudo] password for root:
make -C /lib/modules/5.14.21-150400.22-default/build SUBDIRS=/home/david/projects/UPS/perle_serial_card/perle-serial-3.9.2/pserial modules
make[1]: Entering directory '/usr/src/linux-5.14.21-150400.22-obj/x86_64/default'
GEN Makefile
make[3]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by 'arch/x86/include/generated/uapi/asm/unistd_32.h'. Stop.
make[2]: *** [/usr/src/linux-5.14.21-150400.22/arch/x86/Makefile:231: archheaders] Error 2
make[1]: *** [/usr/src/linux-5.14.21-150400.22/Makefile:220: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-5.14.21-150400.22-obj/x86_64/default'
make: *** [Makefile:34: all] Error 2
I’m well out of my depth here. Something has changed and it’s possible that a small tweak will make it work again. Any suggestions - apart from to buy a USB-serial adapter?
which has been the standard way to build external module for as long as I remember. But it fails to build anyway, it needs quite some efforts to make it compatible with current kernel. Like
/home/bor/src/perle-serial-3.9.2/pserial/perle-serial.c: In function ‘transmit_chars’:
/home/bor/src/perle-serial-3.9.2/pserial/perle-serial.c:971:17: error: ‘struct tty_struct’ has no member named ‘stopped’; did you mean ‘hw_stopped’?
info->tty->stopped || info->tty->hw_stopped) {
^~~~~~~
hw_stopped
Well, ->stopped member was replaced by ->flow.stopped in kernel 5.14.
You broke kernel devel packages. At this point you should remove kernel-default-devel and kernel-devel, delete all remaining directories (they may not have been removed due to make writing extraneous files there) and reinstall these packages.
I’ll go through it when I have some time. Why have all these errors appeared between 5.3.18 and 5.14.21? The module source hasn’t been updated since 2018. Has something major changed recently in the compile system?
Yes, obviously, I know the module hadn’t changed for years and the kernel has. But it’s not as if it hasn’t compiled and worked since kernel v4 - it worked with whatever kernel was last released in 15.3.
So I was just wondering what particular change to the kernel - or, I suspect, to the compiler defaults - broke the camel’s back.
I applied that patch (something new to learn about) and some of it worked:
david@localhost:~/projects/UPS/perle_serial_card/leap_15.4/perle-serial-3.9.2/pserial> patch perle-serial.c patch_1.patch
patching file perle-serial.c
Hunk #1 succeeded at 934 (offset -13 lines).
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 2186 with fuzz 1 (offset -13 lines).
It added 12 lines, which reduced the number of error from 33 to 27. Some of the additions in the patch are, I think, already in my source.
Anyway, the original 33 errors are of only 7 different types, I think, so it’s not an insuperable job, even though I don’t know C. The serial card is not required often. I’m going on holiday. When I return I’ll look for more patch files and google each type of error.
That does not look right (actually it looks very wrong). While this makes driver compile, those definitions are no more used by kernel, so it is unpredictable how driver will behave. This really needs porting to the current kernel API, not sweeping the problem under the carpet.