dagargo / emu3fs

Linux kernel module for the E-Mu EIII and EIV sampler filesystems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Having trouble building, Linux 5.13.22 kernel.

Philippe593 opened this issue · comments

Hi,

I've been trying to build emu3fs to no avail so far. This is what I get :

philippe@philippe-studio:~/emu3fs-master$ make make -C /lib/modules/uname -r/build M=$PWD make[1] : on entre dans le répertoire « /usr/src/linux-headers-5.13.0-22-lowlatency » CC [M] /home/philippe/emu3fs-master/super.o CC [M] /home/philippe/emu3fs-master/inode.o CC [M] /home/philippe/emu3fs-master/file.o /home/philippe/emu3fs-master/file.c: In function ‘emu3_setattr’: /home/philippe/emu3fs-master/file.c:114:31: error: passing argument 1 of ‘setattr_prepare’ from incompatible pointer type [-Werror=incompatible-pointer-types] 114 | err = setattr_prepare(dentry, attr); | ^~~~~~ | | | struct dentry * In file included from /home/philippe/emu3fs-master/emu3_fs.h:21, from /home/philippe/emu3fs-master/file.c:21: ./include/linux/fs.h:3474:21: note: expected ‘struct user_namespace *’ but argument is of type ‘struct dentry *’ 3474 | int setattr_prepare(struct user_namespace *, struct dentry *, struct iattr *); | ^~~~~~~~~~~~~~~~~~~~~~~ /home/philippe/emu3fs-master/file.c:114:39: error: passing argument 2 of ‘setattr_prepare’ from incompatible pointer type [-Werror=incompatible-pointer-types] 114 | err = setattr_prepare(dentry, attr); | ^~~~ | | | struct iattr * In file included from /home/philippe/emu3fs-master/emu3_fs.h:21, from /home/philippe/emu3fs-master/file.c:21: ./include/linux/fs.h:3474:46: note: expected ‘struct dentry *’ but argument is of type ‘struct iattr *’ 3474 | int setattr_prepare(struct user_namespace *, struct dentry *, struct iattr *); | ^~~~~~~~~~~~~~~ /home/philippe/emu3fs-master/file.c:114:15: error: too few arguments to function ‘setattr_prepare’ 114 | err = setattr_prepare(dentry, attr); | ^~~~~~~~~~~~~~~ In file included from /home/philippe/emu3fs-master/emu3_fs.h:21, from /home/philippe/emu3fs-master/file.c:21: ./include/linux/fs.h:3474:5: note: declared here 3474 | int setattr_prepare(struct user_namespace *, struct dentry *, struct iattr *); | ^~~~~~~~~~~~~~~ /home/philippe/emu3fs-master/file.c:133:22: error: passing argument 1 of ‘setattr_copy’ from incompatible pointer type [-Werror=incompatible-pointer-types] 133 | setattr_copy(inode, attr); | ^~~~~ | | | struct inode * In file included from /home/philippe/emu3fs-master/emu3_fs.h:21, from /home/philippe/emu3fs-master/file.c:21: ./include/linux/fs.h:3476:19: note: expected ‘struct user_namespace *’ but argument is of type ‘struct inode *’ 3476 | void setattr_copy(struct user_namespace *, struct inode *inode, | ^~~~~~~~~~~~~~~~~~~~~~~ /home/philippe/emu3fs-master/file.c:133:29: error: passing argument 2 of ‘setattr_copy’ from incompatible pointer type [-Werror=incompatible-pointer-types] 133 | setattr_copy(inode, attr); | ^~~~ | | | struct iattr * In file included from /home/philippe/emu3fs-master/emu3_fs.h:21, from /home/philippe/emu3fs-master/file.c:21: ./include/linux/fs.h:3476:58: note: expected ‘struct inode *’ but argument is of type ‘struct iattr *’ 3476 | void setattr_copy(struct user_namespace *, struct inode *inode, | ~~~~~~~~~~~~~~^~~~~ /home/philippe/emu3fs-master/file.c:133:9: error: too few arguments to function ‘setattr_copy’ 133 | setattr_copy(inode, attr); | ^~~~~~~~~~~~ In file included from /home/philippe/emu3fs-master/emu3_fs.h:21, from /home/philippe/emu3fs-master/file.c:21: ./include/linux/fs.h:3476:6: note: declared here 3476 | void setattr_copy(struct user_namespace *, struct inode *inode, | ^~~~~~~~~~~~ /home/philippe/emu3fs-master/file.c: At top level: /home/philippe/emu3fs-master/file.c:158:20: error: initialization of ‘int (*)(struct user_namespace *, struct dentry *, struct iattr *)’ from incompatible pointer type ‘int (*)(struct dentry *, struct iattr *)’ [-Werror=incompatible-pointer-types] 158 | .setattr = emu3_setattr, | ^~~~~~~~~~~~ /home/philippe/emu3fs-master/file.c:158:20: note: (near initialization for ‘emu3_inode_operations_file.setattr’) cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:281 : /home/philippe/emu3fs-master/file.o] Erreur 1 make[1]: *** [Makefile:1879 : /home/philippe/emu3fs-master] Erreur 2 make[1] : on quitte le répertoire « /usr/src/linux-headers-5.13.0-22-lowlatency » make: *** [Makefile:8 : all] Erreur 2

Here's what I'm working with :

philippe@philippe-studio:~/emu3fs-master$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.2.0-7ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2)
philippe@philippe-studio:~/emu3fs-master$ apt list --installed linux* En train de lister... Fait linux-base/impish,impish,now 4.5ubuntu9 all [installé, automatique] linux-firmware/impish-updates,impish-updates,now 1.201.1 all [installé, automatique] linux-headers-5.13.0-22-lowlatency/impish-updates,impish-security,now 5.13.0-22.22 amd64 [installé, automatique] linux-headers-5.13.0-22/impish-updates,impish-updates,impish-security,impish-security,now 5.13.0-22.22 all [installé, automatique] linux-headers-lowlatency/impish-updates,impish-security,now 5.13.0.22.33 amd64 [installé, automatique] linux-image-5.13.0-22-lowlatency/impish-updates,impish-security,now 5.13.0-22.22 amd64 [installé, automatique] linux-image-lowlatency/impish-updates,impish-security,now 5.13.0.22.33 amd64 [installé, automatique] linux-libc-dev/impish-updates,impish-security,now 5.13.0-22.22 amd64 [installé, automatique] linux-libc-dev/impish-updates,impish-security,now 5.13.0-22.22 i386 [installé, automatique] linux-lowlatency/impish-updates,impish-security,now 5.13.0.22.33 amd64 [installé] linux-modules-5.13.0-22-lowlatency/impish-updates,impish-security,now 5.13.0-22.22 amd64 [installé, automatique] linux-sound-base/impish,impish,now 1.0.25+dfsg-0ubuntu7 all [installé, automatique] linuxsampler-dssi/bionic,now 5:2.1.1-1kxstudio5 amd64 [installé, automatique]

So, what am I doing wrong ?

TIA

I've just pushed 9d8e7ba, which adds compatibility for Linux 5.13. I think you weren't doping anything wrong.

Let me know if it works for you.

Also, consider starring or following the project to keep track of the changes. Also, take a look at https://github.com/dagargo/emu3bm.

Building works fine now, installing's causing me trouble.

make -C /lib/modules/uname -r`/build M=$PWD modules_install
make[1] : on entre dans le répertoire « /usr/src/linux-headers-5.13.0-22-generic »
arch/x86/Makefile:148: CONFIG_X86_X32 enabled but no binutils support
INSTALL /lib/modules/5.13.0-22-generic/extra/emu3_fs.ko
SIGN /lib/modules/5.13.0-22-generic/extra/emu3_fs.ko
At main.c:163:

  • SSL error:0909006C:PEM routines:get_name:no start line: ../crypto/pem/pem_lib.c:745
    sign-file: certs/signing_key.pem: Success
    DEPMOD /lib/modules/5.13.0-22-generic
    Warning: modules_install: missing 'System.map' file. Skipping depmod.
    make[1] : on quitte le répertoire « /usr/src/linux-headers-5.13.0-22-generic »`

I was however able to load the module by using

sudo modprobe emu3_fs

I had the same problem yesterday. Looks like if the kernel sources or headers had been configured to sign kernel modules, so make install will try to run those steps.

Don't know which system are you working with but mine with 5.13 is a VM running a fresh installation of Ubuntu 21.10.
With these steps, it works there.

$ make
$ sudo cp emu3_fs.ko /lib/modules/5.13.0-22-generic/extra/
$ sudo depmod -a
$ sudo modprobe emu3_fs

However, the module signing is not used on Debian stable (bullseye) eand the standard method works.

Besides this, is the module working for you?

I've tried it with iso images so far and it's working fine, next step will be SD cards from my SCSI2CD.
The 2 computers I'm using both work on Ubuntu 21.10, no secure boot, so I'm a bit surprised by this module signing issue popping up like this.

I've tried it with iso images so far and it's working fine, next step will be SD cards from my SCSI2CD.

Nice. I use a SCSI2CD V5 too and works flawlessly, just slightly slow but way much better than the old Zip drive I had. Do you mind sharing your sampler? Mine is a ESI-2000.

The 2 computers I'm using both work on Ubuntu 21.10, no secure boot, so I'm a bit surprised by this module signing issue popping up like this.

I think secure boot (UEFI) is totally different from module signing although they are based on the same principle. Module signing is just a kernel thing meant to avoid running malicious kernel code inserted via modprobe or the like.

Mine's an ESI-32, so as far as I know it has a lot in common with your ESI-2000 structurally.
I've just tried mounting SD cards, both straight and through loop device, the first disk shows up nicely.
Now is there a way I can also see the other 3 ? (my cards are partitioned as 4 Gb disks).

AFAIK, SCSI2SD partitions are not disk partitions in the sense that the partitions information is not stored physically.

But you can use losetup to add an offset and a length when mounting a loop device as this. This is in the man page of `losetup, BTW.

losetup [-o offset] [--sizelimit size] [--sector-size size] [-Pr] [--show] -f loopdev file

Feel free to create a PR with an example in the README.md if you want.

Good idea, I'm getting on it immediately.

The latest Raspberry Pi OS uses a 5.10.63 kernel, and these changes are not backwards compatible with that. Prior versions work, but require a 64 bit division to be removed (see #5) otherwise the symbol __aeabi_ldivmod is unresolved.

Thanks for pointing this out, Ray.