Compiling kernel modules for F series

Here for general support for F series TVs, request and problem solve area.

allajex
Posts: 4
Joined: Thu Aug 15, 2013 4:26 pm

Compiling kernel modules for F series

Post by allajex » Sun Aug 18, 2013 5:47 pm

juuso, help with kernel modules compilation please.

I spent 2 days with Cygwin and Sourcery CodeBench but built nothing. Samsung's toolchain is unusable on Windows, with ARM Linux Toolchain for Cygwin I got and didn't solve EABI errors, with Sourcery CodeBench - errors with paths and symlinks.

Then I installed CentOS 5.9 and tried to use original Samsung's toolchain:

Code: Select all

tar -xvzf VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630.tgz
tar -xzvf VDLinux_3.0.20.tgz

export PATH=$PATH:/root/src/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin
export ARCH=arm
export CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi-

cd /root/src/VDLinux_3.0.20/linux-3.0.20
cp -ar arch/arm/configs/X12_defconfig_release .config

make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- oldconfig
make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- prepare
make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- prepare scripts
make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- Image
make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- prepare modules
make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- modules
With last 2 make commands I got errors and building stopped:

Code: Select all

[root@localhost linux-3.0.20]# make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- modules
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' ?? ??????? ??????????.
  CALL    scripts/checksyscalls.sh
  Building modules, stage 2.
  MODPOST 62 modules
ERROR: "authnull_ops" [fs/nfs/nfs.ko] undefined!
Then I decided to build single modules:

Code: Select all

[root@localhost linux-3.0.20]# make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- M=fs/cifs
  Building modules, stage 2.
  MODPOST 1 modules
  CC      fs/cifs/cifs.mod.o
  LD [M]  fs/cifs/cifs.ko
[root@localhost linux-3.0.20]# make ARCH=arm CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- M=fs/nfs
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "authnull_ops" [fs/nfs/nfs.ko] undefined!
  CC      fs/nfs/nfs.mod.o
  LD [M]  fs/nfs/nfs.ko
Same text, but only warning, not error now. And desired modules were built.

Then I stripped my modules of unnecessary symbols:

Code: Select all

arm-v7a8v2r2-linux-gnueabi-strip -g fs/nfs/nfs.ko
arm-v7a8v2r2-linux-gnueabi-strip -g fs/cifs/cifs.ko
Then I tried to install modules on TV:

Code: Select all

insmod: can't insert '/dtv/usb/sda1/nfs.ko': invalid module format
I tried to rebuild everything 2 or 3 times, result was the same. What am I doing wrong?

And one more question. Is it possible to enable normal command output in telnet? I don't get any information or error messages with such commands:

Code: Select all

insmod /dtv/usb/sda1/nfs.ko
mount -o soft,tcp,nolock -t nfs 192.168.253.3:/nfs /dtv/usb/sda1/nfs
I have to use something like this to get the command result:

Code: Select all

insmod /dtv/usb/sda1/nfs.ko >/dtv/usb/sda1/log.txt 2>/dtv/usb/sda1/err.txt
mount -o soft,tcp,nolock -t nfs 192.168.253.3:/nfs /dtv/usb/sda1/nfs >/dtv/usb/sda1/log.txt 2>/dtv/usb/sda1/err.txt

User avatar
juusso
SamyGO Moderator
Posts: 10125
Joined: Sun Mar 07, 2010 6:20 pm

Re: How to get root access on F series

Post by juusso » Sun Aug 18, 2013 6:13 pm

Don`t use cygwin for kernel compilation. Always use original toolchains from samsung/(SamyGO...:))
I`m not sure if this is a problem, but you`re using wrong toolchain.
For your F series i think should be used
VDLinux-arm-v7a9v3r1 or VDLinux-arm-v7a15v3r1, which you can either compile by yourself from sources, or do svn checkout from SamyGO svn:

Code: Select all

svn checkout svn://svn.code.sf.net/p/samygo/code/develop/toolchains/T-MST12
What is your error. Try insmod your module and then check debug output (Check and show us all result of commands below)

Code: Select all

dmesg | tail
Hope you`re using defconfig for X12? (linux-3.0.20/arch/arm/config/X12_defconfig_release ) and copied it to toolchains root as .config and .config.old, made oldconfig + menuconfig, marked required modules, made full kernel compilation with prepared scripts...

What are your modules version.

Code: Select all

cat /.version
Set proper modules version (edit file) in /linux-3.0.20/include/linux/@vdlp_version_h (which is symlink of vdlp_versionX12.h)
For example, if your kernel supports modules version 0109, you have to keep file like this:

Code: Select all

#define DTV_KERNEL_VERSION "0109, release"
#define DTV_LAST_PATCH "1137, DTV, X12, release, MAIN"
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE

levi
Posts: 24
Joined: Tue Oct 01, 2013 11:27 pm

Re: Compiling kernel modules for F series

Post by levi » Sun Oct 20, 2013 10:03 pm

Hi,
I also trying to compile the nfs module, and sure enough faced troubles with

Code: Select all

ERROR: "authnull_ops" [fs/nfs/nfs.ko] undefined!
I've followed juuso's sujjestions while compiling and was able to successfully build and insert a bunch of other modules which are needed for nfs to work (auth_rpcgss.ko, exportfs.ko, lockd.ko, sunrpc.ko) but still no success with nfs.ko.
So basically i am stuck with nfs.ko to build without warnings/errors to gain much anticipated nfs to work.
Here is my configuration:

Code: Select all

OS is CentOS 5.9
>uname -a
Linux localhost.localdomain 2.6.18-371.el5.centos.plus #1 SMP Mon Oct 7 10:23:12 EDT 2013 i686 athlon i386 GNU/Linux

I am using toolchain from samsung: arm-v7a15v3r1-20121018.tar.

My TV is:

Code: Select all

shell>cat /proc/version
Linux version 3.0.33 (nwlee@sp2) (gcc version 4.6.4 (VDLinux.GA1.2012-10-03) ) #1 SMP PREEMPT Thu Aug 29 10:26:35 KST 2013
shell>cat /.version
"X12 0139" KERNEL MODULE VERSION : "0115.1129, DTV, X12, release, DVB_ISDB_BRANCH" 
Here is the errors i get while trying to load module:

Code: Select all

shell>insmod /dtv/usb/sda1/nfs.ko >/dtv/usb/sda1/nfs.txt 2>/dtv/usb/sda1/nfs_err.txt

shell>dmesg | tail
d 3:0:0:0: [sda] No Caching mode page present
sd 3:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 3:0:0:0: [sda] No Caching mode page present
sd 3:0:0:0: [sda] Assuming drive cache: write through
sd 3:0:0:0: [sda] Attached SCSI removable disk
FAT-fs (sda1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!

mmcblk0p24: Meta: 6156KB     Data: 2028KB

auth_rpcgss mod ld
sunrpc mod ld
exportfs mod ld
lockd mod ld
nfs: Unknown symbol authnull_ops (err 0)
Here is the output of log redirects:

Code: Select all

>cat nfs.txt  << empty file
>cat nfs_err.txt
insmod: can't insert '/dtv/usb/sda1/nfs.ko': unknown symbol in module or invalid parameter
Please help me to figure out what's wrong with this stupid "authnull_ops".

Thanks in advance!

User avatar
bugficks
Official SamyGO Developer
Posts: 1062
Joined: Tue Jun 25, 2013 3:56 pm

Re: Compiling kernel modules for F series

Post by bugficks » Sun Oct 20, 2013 10:18 pm

iirc you dont have to select nfs server, just client. or patch source to export authnull_ops symbol

levi
Posts: 24
Joined: Tue Oct 01, 2013 11:27 pm

Re: Compiling kernel modules for F series

Post by levi » Mon Oct 21, 2013 2:33 pm

bugficks

Thanks for reply.
I know that for NFS client (nfs.ko) there is no need to have NFS server (nfsd.ko), but regardless if i enable or disable nfsd in menuconfig i am getting "authnull_ops" error while compiling/insmod- ing.
Initially i thought that I am missing some checkbox in menuconfig, but now You say that patch is needed.
I had brief look in .h files and compare them with files for other platforms (comparing files from git/svn) but was not able to figure out what exactly is missing.
Unfortunately my programming skills are way to low to figure out what's needed to be patched. :(

Any help is much appreciated.

User avatar
bugficks
Official SamyGO Developer
Posts: 1062
Joined: Tue Jun 25, 2013 3:56 pm

Re: Compiling kernel modules for F series

Post by bugficks » Mon Oct 21, 2013 2:52 pm

it's been long ago when i last was playing w/ building kmods. i remeber i added EXPORT_SYMBOL(authops_null) or something like that to .c file defining that function

User avatar
bugficks
Official SamyGO Developer
Posts: 1062
Joined: Tue Jun 25, 2013 3:56 pm

Re: Compiling kernel modules for F series

Post by bugficks » Mon Oct 21, 2013 3:34 pm

grepped kernel tree, try this
net/sunrpc/auth_null.c:EXPORT_SYMBOL_GPL(authnull_ops);

levi
Posts: 24
Joined: Tue Oct 01, 2013 11:27 pm

Re: Compiling kernel modules for F series

Post by levi » Tue Oct 22, 2013 12:07 pm

Wow, that was an easy fix :-)
I was able to successfully compile everything and even insert the module, so this part is ok. Now i have problems with mounting, when i execute:

Code: Select all

mount share:/folder /local/folder -t nfs
TV just hangs up and not responding to anything (ping, IR remote, even buttons at chassis) only power cycle bring it back to live. So i need to solder an EX-link cable to see what happens in console, but this is whole another story...
Anyway Thank You very much for help!
As soon as i will have a working NFS module i will post it somewhere in the forum...

arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: Compiling kernel modules for F series

Post by arris69 » Tue Oct 22, 2013 4:15 pm

levi wrote:...
My TV is:

Code: Select all

shell>cat /proc/version
Linux version 3.0.33 (nwlee@sp2) (gcc version 4.6.4 (VDLinux.GA1.2012-10-03) ) #1 SMP PREEMPT Thu Aug 29 10:26:35 KST 2013
shell>cat /.version
"X12 0139" KERNEL MODULE VERSION : "0115.1129, DTV, X12, release, DVB_ISDB_BRANCH" 
...
what firmware version has this modules version?

arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: Compiling kernel modules for F series

Post by arris69 » Tue Oct 22, 2013 6:03 pm

bugficks wrote:it's been long ago when i last was playing w/ building kmods. i remeber i added EXPORT_SYMBOL(authops_null) or something like that to .c file defining that function
maybe better to revert the full stupid patch?
http://www.chineselinuxuniversity.net/p ... 4499.shtml

Post Reply

Return to “[F] Support”