Closed akiradeveloper closed 2 years ago
I cannot compile the dm-writeboost module with dkms for Linux 5.18.1, and get this error (using gcc 9.3.0) /var/lib/dkms/dm-writeboost/2.2.15/build/dm-writeboost-target.c: In function ‘writeboost_status’: /var/lib/dkms/dm-writeboost/2.2.15/build/dm-writeboost-target.c:1899:2: error: enumeration value ‘STATUSTYPE_IMA’ not handled in switch [-Werror=switch] 1899 | switch (type) {
With 5.17, I emits a warning and I guess it is granted as an error based on gcc's setting.
$ make
make -C /lib/modules/5.17.0/build M=/home/akira/dm-writeboost/src modules
make[1]: Entering directory '/home/akira/linux'
CC [M] /home/akira/dm-writeboost/src/dm-writeboost-target.o
/home/akira/dm-writeboost/src/dm-writeboost-target.c: In function 'writeboost_status':
/home/akira/dm-writeboost/src/dm-writeboost-target.c:1899:2: warning: enumeration value 'STATUSTYPE_IMA' not handled in switch [-Wswitch]
switch (type) {
^~~~~~
CC [M] /home/akira/dm-writeboost/src/dm-writeboost-metadata.o
CC [M] /home/akira/dm-writeboost/src/dm-writeboost-daemon.o
LD [M] /home/akira/dm-writeboost/src/dm-writeboost.o
MODPOST /home/akira/dm-writeboost/src/Module.symvers
CC [M] /home/akira/dm-writeboost/src/dm-writeboost.mod.o
LD [M] /home/akira/dm-writeboost/src/dm-writeboost.ko
make[1]: Leaving directory '/home/akira/linux'
I can compile in 5.17.
# make install
cp -r src /usr/src/dm-writeboost-2.2.15
dkms add -m dm-writeboost -v 2.2.15
Creating symlink /var/lib/dkms/dm-writeboost/2.2.15/source ->
/usr/src/dm-writeboost-2.2.15
DKMS: add completed.
dkms build -m dm-writeboost -v 2.2.15
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.17.0 all KERNEL_TREE=/lib/modules/5.17.0/build.....
cleaning build area...
DKMS: build completed.
dkms install -m dm-writeboost -v 2.2.15
dm-writeboost.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.17.0/updates/dkms/
depmod...
Backing up initrd.img-5.17.0 to /boot/initrd.img-5.17.0.old-dkms
Making new initrd.img-5.17.0
(If next boot fails, revert to initrd.img-5.17.0.old-dkms image)
update-initramfs.......
DKMS: install completed.
@tanantharaman Please copy and paste all the procedures and messages so I can reproduce the error.
https://elixir.bootlin.com/linux/v5.15/source/drivers/md/dm-dust.c
the switch has appeared in 5.15 and the easiest fix for now is to add a switch that does nothing.
case
*result = '\0';
break;
}
If someone needs a detailed implementation of this switch I leave him the task.
Here are more details of my failed 5.18.1 build. After upgrading kernel from 5.14.5 to 5.18.1 I ran:
Deprecated feature: REMAKE_INITRD
Building module: cleaning build area... make -j48 KERNELRELEASE=5.18.1-1.el7.elrepo.x86_64 all KERNEL_TREE=/lib/modules/5.18.1-1.el7.elrepo.x86_64/build...(bad exit status: 2) Error! Bad return status for module build on kernel: 5.18.1-1.el7.elrepo.x86_64 (x86_64) Consult /var/lib/dkms/dm-writeboost/2.2.15/build/make.log for more information. -----End of stdout----
I had previously modified the Makefile for Linux 5.14.5 to use gcc 9.3.0 (instead of my Centos7 system default gcc 4.8) so the Makefile used was -------Makefile----- KERNEL_SOURCE_VERSION ?= $(shell uname -r) KERNEL_TREE ?= /lib/modules/$(KERNEL_SOURCE_VERSION)/build
CC = /opt/gcc-9.3.0/bin/gcc -B/opt/binutils-2.34 -v
obj-m := dm-writeboost.o dm-writeboost-objs := \ dm-writeboost-target.o \ dm-writeboost-metadata.o \ dm-writeboost-daemon.o
all: export PATH=/opt/binutils-2.34/bin:/sbin:/bin:/usr/sbin:/usr/bin; $(MAKE) -C $(KERNEL_TREE) M=$(PWD) modules
clean: $(MAKE) -C $(KERNEL_TREE) M=$(PWD) clean ------End of Makefile---------
The earlier lines of make.log had no errors : let me know if you need them. Sorry for the strange formating.
I tried adding the fix you suggested to dm-writeboost-target.c, but now I get a different error about missing dm-writeboost.ko
----last few lines of new make.log----
...
LD [M] /var/lib/dkms/dm-writeboost/2.2.15/build/dm-writeboost.o
MODPOST /var/lib/dkms/dm-writeboost/2.2.15/build/Module.symvers
ERROR: modpost: "mcount" [/var/lib/dkms/dm-writeboost/2.2.15/build/dm-writeboost.ko] undefined!
make[3]: [/var/lib/dkms/dm-writeboost/2.2.15/build/Module.symvers] Error 1
make[3]: Deleting file /var/lib/dkms/dm-writeboost/2.2.15/build/Module.symvers' make[2]: *** [modules] Error 2 make[1]: *** [__sub-make] Error 2 make[1]: Leaving directory
/usr/src/kernels/5.18.1-1.el7.elrepo.x86_64'
make: *** [all] Error 2
-----End of make.log---
Writeboost should handle STATUSTYPE_IMA
I actually don't know what this is but seems to better handle appropriately.