CIFS Support in Legato

Hello,

I’m trying to use an FX30 in a scenario that I need to access a file on a windows network share over the ethernet port. The windows machine is running Windows 7 Professional so I’m not able to install an NFS server or any software on the windows machine - I can only share the folder using CIFS. I’m new to Legato and Yocto but I gather that CIFS support is not built into the kernel. Is there a prebuilt kernel module that can be used? If so, how do I go about installing that? Otherwise, I guess I have to recompile the kernel - not sure if I’m up for that task.

I’m using Ubuntu 16.04 for my development system and have leaf installed using the target “SDK for FX30-CATM (Release 9.1.1.013 + Legato 18.06.1)” which matches the installed system on my FX30. I can build and install all the hello world tutorials so I’m pretty sure my environment is configured correctly.

Any help would be greatly appreciated.

David

I’ve managed to rebuild my linux Distribution from source and add a package (unrelated to my issue) I added nodejs just to make sure I could add a custom package - and that worked. Now I want to add a package that I see in my source tree here:

/yocto/meta-openembedded/meta-filesystems
specifically the smbnetfs found in:
/yocto/meta-openembedded/meta-filesystems/recipes-filesystems

I’ve tried adding the following to the file bblayers.conf at /yocto/build_bin/conf:

/home/myUserName/yocto/meta-openembedded/meta-filesystems \

After running make the distribution builds but when I upload it to my FX30 I still don’t see any smb related tools and I can’t mount a smb share on a connected PC using the mount command.

I then tried adding the following to /yocto/meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc (this was how I built in the nodejs package):

# Add smbnetfs package
IMAGE_INSTALL_append = " smbnetfs"

But make then fails with:
ERROR: cups-2.1.4-r0 do_configure: configure failed
configure: error: Unable to enable SSL support.
ERROR: Task (/home/myUserName/yocto/poky/meta/recipes-extended/cups/cups_2.1.4.bb:do_configure) failed with exit code '1'

Is it possible to build smb support into my Linux distribution for use on the FX30? If so, could someone please point me in the right direction.

Thank you,
David

I’ve made more progress. I managed to add the packages cifs-utils and samba to my distribution and the resulting image runs on my FX30 and I have the mount helper mount.cifs, however when I try to mount the network share I get mount error: cifs filesystem not supported by the system. When I run cat /proc/filesystems on the device cifs is not among the filesystems. Running modprobe cifs returns modprobe: module cifs not found in modules.dep. So bottom line looks like the kernel needs CIFS support.

In the cifs-utils_git.bb recipe there is the line:

RRECOMMENDS_${PN} = "kernel-module-cifs"

Which as I understand will allow the build of the cifs-utils to complete regardless of whether or not the kernel-module-cifs can be found, which in my case it wasn’t.

Is there some documentation that someone can point me to showing how to add the cifs kernel module to my distribution?

Thanks,
David

@JayM2M, I don’t know if you can give the main lines to add the cifs kernel module with Yocto.

You have to build the kernel module for CIFS support and load it, here’re the steps I used for my distribution (you may have to change directory locations, etc. to get to work in your case):

Build factory distribution

  1. Download linux source using leaf:

leaf getsrc swi-linux

  1. This will download and expand distribution source into leaf workspace, should expand into folder:

~/myWorkspace/swi-linux-src

Ensure that ~/myWorkspace/swi-linux-src/Makefile is symbolic linked to ~/myWorkspace/swi-linux-src/meta-columbia-x/external.mk

  1. Run cd ~/myWorkspace/swi-linux-src/poky

  2. Run source ./oe-init-build-env

  3. Run cd ../.. (back to ~/myWorkspace/swi-linux-src)

  4. Build base image by running make (this can take upwards of one hour), when complete, image will be located at:

~/myWorkspace/swi-linux-src/build_bin/tmp/deploy/images/yocto_wp77xx.4k.cwe

Configure Kernel for CIFS File System Support

  1. Run source ./oe-init-build-env from ~/myWorkspace/swi-linux-src/poky then cd ~/myWorkspace/swi-linux-src/build_bin

  2. Run bitbake linux-quic -c menuconfig this will open the kernel config gui in a new terminal window

  3. Enable CIFS support under File Systems --> Network File Systems --> CIFS Support (Press M to build support as a kernel module). Save changes to .config, exit config tool ()

  4. Exit dev mode shell, run exit (should return you to ~/myWorkspace/swi-linux-src)

Configure yocto to include relevant recipes and features in build:

  1. Edit and save file ~/myWorkspace/swi-linux-src/build_bin/conf/local.conf and add the follwoing line under the Additonal Image Features paragraph:
    KERNEL_MODULE_AUTOLOAD += "cifs"

  2. Edit and save file ~/myWorkspace/swi-linux-src/meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image.inc and add the following lines before the line “create_ubinize_config() {”:

     # Add cifs-util package
     IMAGE_INSTALL_append = " cifs-utils"
    

Build Final Custom Linux Distribution

  1. From ~/myWorkspace/swi-linux-src run make again (should take only a few minutes this time), when complete image will be located at:

~/myWorkspace/swi-linux-src/build_bin/tmp/deploy/images/boot-yocto-legato_wp77xx.cwe

@dcchurchill, Thank you for sharing :clap:

How did you fix the SSL problem for cups meta-printing? I’m having the exact problem and I’ve tried adding PACKAGECONFIGS but haven’t been able to get it to work.

Turns out that the cifs_utils and cifs kernel module were all I needed for my application so I ended up not installing the smbnetfs package so I never addressed the cups SSL error. Sorry that probably doesn’t help you.

@mendezj,

How did you do to add PACKAGECONFIGS? with which Yocto version?