Smbclient on Colibri iMX6ULL WB, kirkstone 6.4

Hi,

I’d like to ask if there is any news on the issue mentioned in https://community.toradex.com/t/samba-on-verdin-imx8mp-krikstone-6-2/20894 as I am facing the same problem for my custom image.

Added “samba cifs-utils” to IMAGE_INSTALL in my image recipe and enabled cifs /smb support in the kernel using the following fragment created with

bitbake virtual/kernel -c menuconfig,
setting
File systems > Network File Systems -> SMB3 and CIFS support (advanced network filesystem)
and
bitbake virtual/kernel -c diffconfig:

CONFIG_CIFS=y
CONFIG_CIFS_STATS2=y
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
# CONFIG_CIFS_UPCALL is not set
# CONFIG_CIFS_XATTR is not set
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
# CONFIG_CIFS_DFS_UPCALL is not set
# CONFIG_CIFS_SWN_UPCALL is not set
# CONFIG_CIFS_ROOT is not set
CONFIG_SMBFS=y
CONFIG_CRYPTO_MD5=y

Entries

CONFIG_CIFS_SMB2
CONFIG_CIFS_SMB311

are missing, though. Maybe they are outdated in Kernel 6.1.55?

Anyway, image seems to contain samba support, e.g. smbd, smbstatus, etc., even libsmbclient-raw-samba4.so, but smbclient command line tool is missing.

Searching the recipes I found smbclient in layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.14.14.bb, but maybe this has to be enabled somehow?
Some recipes in layers/meta-openembedded/meta-multimedia/recipes-multimedia seem to contain PACKAGECONFIG variables setting some switches for smbclient, but I was not able to find any documentation on that, yet.

Maybe someone can sched some light on that?

Thanks in advance.

Hello @sb.cato,

Regarding the other thread, the solution was to use SFTP instead of SMB.

I will do some research on the problem you are facing and send an update on this thread.

Best Regards,
Bruno

Thanks for your reply, Bruno.

Using SFTP might be a solution. Have to discuss this with the application developer. He requested smbclient.

In the meantime I did some seaching in my Yocto build tree and found, that the smbclient seems to be build in

build/tmp/work/armv7at2hf-neon-tdx-linux-gnueabi/samba/4.14.14-r0.

The binary is located in

build/tmp/work/armv7at2hf-neon-tdx-linux-gnueabi/samba/4.14.14-r0/image/usr/bin

and a package

samba-client_4.14.14-r0_armv7at2hf-neon.ipk

can be found in

build/tmp/work/armv7at2hf-neon-tdx-linux-gnueabi/samba/4.14.14-r0/deploy-ipks/armv7at2hf-neon.

But the binary is not part of the Tezi image, so I think there is something missing to copy it to the final rootfs!?

Hope this helps to get any further.

Best regards
Stephan

Hello @sb.cato,

Upon further investigation, the process to enable SMB is simple, you just need to do the following:

  • Enable the CONFIG_CIFS configuration on the kernel
  • Add the cifs-utils package to your image.

With this, you will be able to mount the SMB share on the module with the mount command:

$ mount -t cifs //<IP address>/<Path of SMB share> /mnt/smbshare -o user=<username>,password=<password>

Please note that the command above is intended for testing, you can use different methods to store the credentials and automate the mounting of the filesystem.

Considering the configurations you have, the command above should already work on your image.

Best regards,
Bruno

Hello Bruno,

tried mounting the share like you suggested. This works as expected.

As our application developer still wants to use smbclient, I tried to copy the binary from
build/tmp/work/armv7at2hf-neon-tdx-linux-gnueabi/samba/4.14.14-r0/image/usr/bin
to the system rootfs via SCP.
smbclient can now be executed as expected, so it seems the only thing missing is copying it in the image rootfs, which should have been done just by selecting the samba package.

I have to find a way now to do this via bitbake recipe.
As I am still learning Yocto: Do you have any suggestions what would be the easiest way?
Adding a do_install() somewhere, maybe in the image recipe where IMAGE_INSTALL is located?

Thank you for your help so far
Stephan

Hello @sb.cato,

To also add the smbclient executable to your image, you can add the samba and smbclient packages to your image in your local.conf file.

Best Regards,
Bruno

Hello Bruno,

Both adding smbclient to IMAGE_INSTALL in local.conf or, alternatively, in my image build recipe worked.

Thought, I already tried that before, but it seems I didn’t. :wink:

Anyway, thank you for your support.

Best regards,
Stephan