[HELP] Trying to add cifs (or nfs) support

Discuss about life, love, interests and modding here!
Post Reply
Mooi
Posts: 1
Joined: Thu May 20, 2021 9:27 pm

#1

Good evening

I am struggling to add CIFS or NFS support with atvX v4, in order to be able to mount a remote drive from my x96 mini.

The initial rom of the box embedded NFS support so I thought this would be quite straightforward with atvX, but from my understanding, it has neither NFS not CIFS module.

No big deal I thought, I will build the modules myself, so I followed some tutorials. Here is the general approach I ended with:
  1. download the Linaro toolchain (apparently the one used for atvX, but I took the latest version of it)
  2. download android 4.9.113 source from googlesource. After some reading, not sure I should use this one: the Amlogic one would be a better option, but is not publicly available.
  3. got the config file from the box /proc/config.gz, added the cifs and nfs as module through "make menuconfig", and tweaked a bit with some compile parameter after some tries (vermagic, stack protection)
  4. compile the modules, send them to the box and try to insmod them
But so far I could not make it work for CIFS (Not speaking about NFS too much as I am struggling with dependency tree)
The first runs gave me errors I was able to understand and correct by tweaking the compile options, but now I am stuck and lost:
  • insmod returns a generic error
  • dmesg only shows "avc denied" messages (see below), but I guess they are not the reason it does not works, as I managed to install another module (grace.ko, needed for NFS)


Would someone see where my mistake is? Or eventually very kindly provide a working cifs.ko for s905w/atvXv4 ;) ?

Thanks in advance

Below the last dmesg trace I got for insmod

Code: Select all

[191893.174782] type=1400 audit(1621430690.836:27497): avc: denied { read } for pid=7079 comm="insmod" name="cifs.ko" dev="mmcblk0p20" ino=134486 scontext=u:r:toolbox:s0 tcontext=u:object_r:app_data_file:s0:c89,c256,c512,c768 tclass=file permissive=1
[191893.197490] type=1400 audit(1621430690.836:27497): avc: denied { read } for pid=7079 comm="insmod" name="cifs.ko" dev="mmcblk0p20" ino=134486 scontext=u:r:toolbox:s0 tcontext=u:object_r:app_data_file:s0:c89,c256,c512,c768 tclass=file permissive=1
[191893.218471] type=1400 audit(1621430690.844:27498): avc: denied { open } for pid=7079 comm="insmod" path="/data/data/org.galexander.sshd/files/cifs.ko" dev="mmcblk0p20" ino=134486 scontext=u:r:toolbox:s0 tcontext=u:object_r:app_data_file:s0:c89,c256,c512,c768 tclass=file permissive=1
[191893.243924] type=1400 audit(1621430690.844:27498): avc: denied { open } for pid=7079 comm="insmod" path="/data/data/org.galexander.sshd/files/cifs.ko" dev="mmcblk0p20" ino=134486 scontext=u:r:toolbox:s0 tcontext=u:object_r:app_data_file:s0:c89,c256,c512,c768 tclass=file permissive=1
[191893.268690] type=1400 audit(1621430690.844:27499): avc: denied { module_load } for pid=7079 comm="insmod" path="/data/data/org.galexander.sshd/files/cifs.ko" dev="mmcblk0p20" ino=134486 scontext=u:r:toolbox:s0 tcontext=u:object_r:app_data_file:s0:c89,c256,c512,c768 tclass=system permissive=1
Post Reply