SMBFS support for Fedora Core 5 Linux aka FC5

Motivation

Unfortunately, SMBFS support was dropped for the official FC5 distribution. If you try to mount SMB shares that do not support CIFS (the successor to SMBFS), you may run into mount errors like this one:

mount error 20 = Not a directory

For this and other reasons, you might want to have SMBFS support (smbmnt, smbmount, smbumount and the kernel module smbfs.ko) back in FC5. The good news is that SMBFS support is still there - in the FC5 source rpms. I figured out how to build them, and here they are.

Have fun!


Download the binaries + install script here (~800 kByte).
The kernel module is for the original FC5 kernel version 2.6.15-1.2054_FC5.

Addendum 2006-12-11:
I got a mail on pre-built smbfs-enabled RPMs at samba.org. Find the message below.


How to install and use it

Just unpack the archive and run the install.sh with root privileges.
If you do not run the standard FC5 kernel (2.6.15-1.2054_FC5) or if not all relevant packages (samba!) are installed, you might have to do some extra work.

You probably already know how to use smbmount; if not, look here or in the man pages that are inside the archive.


How I built the binaries

  1. I took advice from the FC5 Release Notes on the Web, especially the section "Preparing for Kernel Development". I copied a lot of text from there to this page.
  2. You need yum configured and working to follow these steps. Enable core-source by editing the file /etc/yum.repos.d/fedora-core.repo, setting the option enabled=1
  3. The GCC and all the other tools required to compile and link the source must be working properly.
  4. If not mentioned otherwise, I did the following steps with normal user privileges.

Prepare for download/build steps

    cd
    su -c 'yum install fedora-rpmdevtools yum-utils' # root password required
    fedora-buildrpmtree
    

The Samba Tools

  1. I downloaded samba-3.0.21b-2.src.rpm to my homedir (${HOME}):
    yumdownloader --source samba
    
  2. I installed the source rpm package using the command:
    rpm -Uvh samba-3.0.21b-2.src.rpm
    
    This command writes the RPM contents into ${HOME}/rpmbuild/SOURCES and ${HOME}/rpmbuild/SPECS, where ${HOME} is your home directory.
  3. I prepared the samba sources (unpacking the sources and applying any patches) using the commands:
    cd ~/rpmbuild/SPECS
    rpmbuild -bp --target $(uname -m) samba.spec
    
    In my case rpmbuild complained about missing rpm cups-devel, which I installed from the FC5 DVD (cups-1.1.23-30.2.i386.rpm) and ran the rpmbuild again.
  4. The samba source tree is located in the ${HOME}/rpmbuild/BUILD/samba-3.0.21b/ directory. Now I ran configure and make to build the samba binaries (this took a few minutes on my 1400 MHz P4 machine):
    cd ~/rpmbuild/BUILD/samba-3.0.21b/source
    ./configure --prefix='' --with-fhs --with-smbmount
    make # see next paragraph
    
    I was able to find smbmnt, smbmount and smbumount inside ${HOME}/rpmbuild/BUILD/samba-3.0.21b/source/bin

Addendum:
Later I thought I should be able to speed up the build process if I'd only build the targets I need. I found out that I could use the following command instead of the 'make' above:

     make include/proto.h bin/smbmnt bin/smbmount bin/smbumount
    

Addendum 2006-11-27:
I got a mail on how to rebuild the samba RPMs so that they include the smbmount binaries. Find the message below.

The smbfs.ko Kernel module

  1. I downloaded kernel-2.6.15-1.2054_FC5.src.rpm to my homedir:
    cd
    yumdownloader --source kernel # make sure you get the right version
    
  2. I installed the source rpm package using the command:
    rpm -Uvh kernel-2.6.15-1.2054_FC5.src.rpm
    
    This command writes the RPM contents into ${HOME}/rpmbuild/SOURCES and ${HOME}/rpmbuild/SPECS, where ${HOME} is your home directory.
  3. I prepared the kernel sources (unpacking the sources and applying any patches) using the commands:
    cd ~/rpmbuild/SPECS
    rpmbuild -bp --target $(uname -m) kernel-2.6.spec
    
    The kernel source tree is located in the ${HOME}/rpmbuild/BUILD/kernel-2.6.15/ directory.
  4. I copied the default kernel config (could be another one for you):
    cd ~/rpmbuild/BUILD/kernel-2.6.15/linux-2.6.15.i686/
    cp ~/rpmbuild/SOURCES/kernel-2.6.15-i686.config .config
    
  5. I opened the file .config, searched for 'SMB' and changed the line as follows:
    CONFIG_SMB_FS=m
    
    Here is my diff/patch for the .config file:
    2914c2914,2915
    < # CONFIG_SMB_FS is not set
    ---
    > CONFIG_SMB_FS=m
    > # CONFIG_SMB_NLS_DEFAULT is not set
    
  6. (see addendum below) I went on with the kernel/module build. During "make silentoldconfig" a few question were raised and I choose all the default answers. The "make" process afterwards took a while to complete. Lots of free disk space required:
    make silentoldconfig
    make
    make SUBDIRS=~/rpmbuild/BUILD/kernel-2.6.15/linux-2.6.15.i686/fs/smbfs modules
    
    Now I got smbfs.ko inside {HOME}/rpmbuild/BUILD/kernel-2.6.15/linux-2.6.15.i686/fs/smbfs

Addendum:
I tried to build this module without having to build the whole kernel first. I came up with the following solution:

  1. do all the steps above, except for step 14
  2. extract the file Module.symvers from kernel-devel-2.6.15-1.2054_FC5.i686.rpm. This rpm is on the FC5 DVD, I simply installed it and copied the Module.symvers to ~/rpmbuild/BUILD/kernel-2.6.15/linux-2.6.15.i686/. The following commands did the job:
    make silentoldconfig
    make prepare scripts
    make SUBDIRS=~/rpmbuild/BUILD/kernel-2.6.15/linux-2.6.15.i686/fs/smbfs modules
    

Appendix

Appendix: Rebuilding the Samba RPM

On 2006-11-22, I received the following message from Travis Groth regarding rebuilding the samba RPM (I didn't try it):

Date: Wed, 22 Nov 2006 10:22:24 -0500
From: Travis Groth
To: TOA
Subject: http://www-user.tu-chemnitz.de/~tott/FC5-smbfs-HOWTO.html

Hi,

Considering you are one of the top results for "fedora smbmount fc5", I figured I'd throw you some better directions for rebuilding the RPM.

at step 5 -

That's it. Far less complex and "the right way".

Thanks, Travis

Date: Mon, 27 Nov 2006 13:01:30 -0500
From: Travis Groth
To: TOA
Subject: Re: http://www-user.tu-chemnitz.de/~tott/FC5-smbfs-HOWTO.html

Glad to help. Actually, I realized you need to update the spec file as well to include the new binaries in the build. During the rebuild, it will tell you which files are missing.

Thanks, Travis

Appendix: Pre-Build Samba RPMs at samba.org

On 2006-12-11, I received the following message from Kurt Eichenberger regarding pre-built smbfs-enabled RPMs at samba.org (I didn't try that):

Date: Mon, 11 Dec 2006 17:07:38 -0500
From: Kurt Eichenberger
To: TOA
Subject: smbfs and FC5 - more info

Thank you for your article about how to add smbfs support back into FC5. It was very helpful to me. You may be interested to know that the samba organization has pre-built binaries in RPM format for FC5 with support for smbfs. Located here.
http://us1.samba.org/samba/ftp/Binary_Packages/Fedora/RPMS/i386/core/5/
I removed the default FC5 samba, samba-common, and samba-client installation with rpm -e --nodeps and then installed the new RPMS after building the new smbfs kernel module. worked like a charm.

I guess a lot of folks have been complaining.

Kind Regards,
Kurt Eichenberger


TOA, 2006-08-16, last edit 2006-12-12 -- you can send me email under t o a 7 d 6 (at) a r c o r . d e