Adding modules to Ubuntu core system

Asked by Stephen Le Bas

This question indirectly relates to another question I have (https://answers.launchpad.net/ubuntu/+source/cifs-utils/+question/192701), however I though it may be clearer if I started this question in a different thread.

I noticed in mu ubuntu core 12.04 installation on PandaBoard ES Rev 1 that there are no modules present and I suspect that this may be causing my problems trying to mount a cifs share where I receive an error along the lines of "mount error: cifs file system not supported by the system". I am assumning tha I shoud have a file "/lib/modules/3.2.0-1416-omap4/kernel/fs/cifs/cifs.ko"

I noticed that no modules were present when I issued the command "modprobe -l" and i received the following error.

FATAL: Could not load /lib/modules/3.2.0-1411-omap4/modules.dep: No such file or directory. Nothing exists in me /lib/modules directory at all.

I have seached high and low and I can't figure out how to install modules into my core linux kernel.

Could someone please assist in directing me in how to install the required modules. I suspect that once I solve this problem then my question 192701 will also be answered.

Thanks,

Regards,

Stephen Le Bas

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu cifs-utils Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Le Bas
Solved:
Last query:
Last reply:
Revision history for this message
Stephen Le Bas (meyevue) said :
#1

Some further information

After installing the ubuntu 12.04 armhf core system, I installed samba, smbclient and smbfs.

I was wonderinfg whethere the installation of smbfs should also have installed the cifs.ko module that I expect I need to get the cifs shar mount to work?

I have tried smbclient and it can access the relevant windows share...?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Run:

sudo depmod -a

Revision history for this message
Stephen Le Bas (meyevue) said :
#3

This, as far as I understand only generates the /lib/modules/modules.dep file and can only do this based on the presence of the relevant modules (.ko or .o files) in the installed distro file system. This, again aa far as I understand, searches beneath the /lib/modules/'<uname -a>' directory tree for the relevant files. In my case the only directory that exists is /lib/modules, the /lib/modules/'<uname -a>' doesn't even exist. Which does make sense to me given that this is a core distro. So - I am assuming thatthere must be some installation utility that I can use to download and add the relevant module and I also imagine that this utility will create the relevant directory structure.

The issue I have is that the actual modules do not exist in the core rootfs distro. ie. if I execute the following command

tar -vtf ubuntu-core-12.04-beta2-core-armhf.tar | grep modules

the only entry I get for the /lib/modules directory is as follows.

drwxr-xr-x root/root 0 2011-11-30 05:41 lib/modules/

If the relevant cifs module was in the distro I would have exptected to see something along the following lines (this comes form the miniaml distroI have successfully used on the BeagleBone)

drwxr-xr-x 0/0 0 2012-02-28 17:16 ./lib/modules/3.2.0-psp3/kernel/fs/cifs/
-rw-r--r-- 0/0 320753 2012-02-28 17:16 ./lib/modules/3.2.0-psp3/kernel/fs/cifs/cifs.ko
drwxr-xr-x 0/0 0 2012-02-27 03:58 ./lib/modules/3.2.7-x5/kernel/fs/cifs/
-rw-r--r-- 0/0 335344 2012-02-27 03:58 ./lib/modules/3.2.7-x5/kernel/fs/cifs/cifs.ko

So at this stage I feel that I have a misunderstanding in terms of how to add the necessary cifs module to my ubuntu core 12.04 armhf - or for that matter, any module that I may require.

I am new to mucking around with embedded linux at this level - so I am sure I am simply missing a vital bit of linux kernel management knowledge.

Thanks.

Regards,

Stephen Le Bas

Revision history for this message
Stephen Le Bas (meyevue) said :
#4

I solved this problem myself, I think, through gaining a better understanding of things linux.

I eventually realised that I had to build the relevant module (in my case cifs) and then load this onto my board and run depmod -a. I had thought that a prebuild version of this module may have existed... but could not find one and to be honest the journey to the solution I found has been very informative and educational...that journey continues.

I realised too that the cifs module also required the building of the crypto modules md4 and dec modules (des_generic.ko and md4.ko).

I found the easiest approach was to download the linux-headers as well as the kernel source and copy the relevant source code into the linus-header directory structrue an then build the relevant .ko modules from the linux header tree. I am not sure whether this was the most efficient or best approach - however it has solved my problem in the initial instance and am not looking to gain a greater understanding of building the kernel and modules.

The link I found most useful in solving my problem above was http://wiki.centos.org/HowTos/BuildingKernelModules. Whilst not an ubuntu link and some of the stuff in this article was not relevant to Ubuntu - the basic guidelines were invaluable in me solving my problem and eventually getting my cifs mount working.

In my next endeavour (learnign more about full kernel builds etc), the most useful and instructive links I have found so far are.

http://marcin.juszkiewicz.com.pl/2012/03/26/ubuntu-12-04-precise-and-cross-compilation-of-arm-kernels/

and the earelier version of this article (has some additional info re. cross compiling that is "not supported by Ubuntu developes", but helps exlain other approaches I have seen elsewhere on the web).

http://marcin.juszkiewicz.com.pl/2010/10/19/how-to-cross-compile-arm-kernel-under-ubuntu-10-10/

Thanks

Regards.

Revision history for this message
Stephen Le Bas (meyevue) said :
#5

oops! - the line above

"however it has solved my problem in the initial instance and am <not> looking to gain a greater understanding of building the kernel and modules."

should have read

however it has solved my problem in the initial instance and am <NOW> looking to gain a greater understanding of building the kernel and modules.