📄 enabling_smb.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="clear"><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#enabling_smb" class="toc">Enabling SMB</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#compiling_smb_into_the_kernel" class="toc">Compiling SMB into the kernel</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#testing_smb" class="toc">Testing SMB</a></span></div></li></ul></li></ul></li></ul></div></div><h2><a name="enabling_smb" id="enabling_smb">Enabling SMB</a></h2><div class="level2"><p>It is fairly easy to get smb working on your target system. This next section will help guide you through the process of enabling smb and mounting and unmounting the filesystem.</p></div><!-- SECTION [1-203] --><h3><a name="compiling_smb_into_the_kernel" id="compiling_smb_into_the_kernel">Compiling SMB into the kernel</a></h3><div class="level3"><ul><li class="level1"><div class="li"> First you want to make sure you have the latest sources from <acronym title="Concurrent Versions System">CVS</acronym> for the toolchain and the kernel. For more information on this please refer to the <a href="version_control_systems.html#cvs_quickstart" class="wikilink1" title="version_control_systems.html">CVS Quickstart</a>.</div></li></ul><ul><li class="level1"><div class="li"> Next you must build and install the toolchain. If you are unsure on how to do this please see <a href="toolchain_build_script.html" class="wikilink1" title="toolchain_build_script.html">Toolchain Build Script</a>.</div></li></ul><ul><li class="level1"><div class="li"> After the toolchain has finished building you must add the toolchain to your <strong>PATH</strong>. Please refer to <a href="installing_the_blackfin_tool_chain.html#setting_the_path_environment_variable" class="wikilink1" title="installing_the_blackfin_tool_chain.html">Setting the PATH Environment</a> for more details.</div></li></ul><ul><li class="level1"><div class="li"> Next <em>cd</em> into the freshly downloaded kernel directory, <strong>uClinux-dist</strong>.</div></li></ul><pre class="code">user@linux:~/checkouts/kernel/uClinux-dist> cd where/you/put/uClinux-dist</pre><ul><li class="level1"><div class="li"> Now enter the command:</div></li></ul><pre class="code">user@linux:~/checkouts/kernel/uClinux-dist> make clean</pre><ul><li class="level1"><div class="li"> Next enter the following command to configure your kernel:</div></li></ul><pre class="code">user@linux:~/checkouts/kernel/uClinux-dist> make menuconfig</pre><ul><li class="level1"><div class="li"> In the make menuconfig menu select the <strong>Kernel/Library/Defaults Selection</strong></div></li></ul><ul><li class="level1"><div class="li"> Here check off the boxes:</div></li></ul><pre class="code">(x) Customize Kernel Settings(x) Customize Vendor/User Settings</pre><ul><li class="level1"><div class="li"> Then select <strong>Exit and Save</strong></div></li></ul><p> </p><ul><li class="level1"><div class="li"> Now you should be in the <strong>Customize Kernel Settings</strong> menu. Here select <strong>File Systems</strong>.</div></li></ul><ul><li class="level1"><div class="li"> Under <strong>File Systems</strong> select <strong>Network File Systems</strong> and the following parameter needs to be enabled:</div></li></ul><pre class="code">(x) SMB file system support (to mount Windows shares etc.)</pre><p> </p><ul><li class="level1"><div class="li"> Then select <strong>Save and Exit</strong>. Next you will be brought to the <strong>Customize Vendor/User Settings</strong> menu. Here select <strong>Filesystem Applications</strong>.</div></li></ul><ul><li class="level1"><div class="li">Under the <strong>Filesystem Applications</strong> menu check off the following options:</div></li></ul><pre class="code">--- SAMBA [ ] samba[ ] smbd [ ] nmbd [x] smbmount[x] smbumount</pre><ul><li class="level1"><div class="li"> Now <strong>Save and Exit</strong></div></li></ul><ul><li class="level1"><div class="li"> When you get back to the command line. Issue a make to create the kernel image.</div></li></ul><pre class="code">user@linux:~/checkouts/kernel/uClinux-dist> make</pre></div><!-- SECTION [204-2544] --><h3><a name="testing_smb" id="testing_smb">Testing SMB</a></h3><div class="level3"><ul><li class="level1"><div class="li"> After the make finishes, copy the linux image to your tftp directory. (For more information setting up a tftp server please see <a href="setting_up_a_tftp_server.html" class="wikilink1" title="setting_up_a_tftp_server.html">Setting up a TFTP Server</a>.)</div></li></ul><pre class="code">user@linux:~/checkouts/kernel/uClinux-dist> cp ./images/linux /tftpboot/linux</pre><ul><li class="level1"><div class="li"> Tftp the file to your target and boot the kernel using U-Boot. (For more information on using U-Boot please see <a href="das_u-boot_on_blackfin.html" class="wikilink1" title="das_u-boot_on_blackfin.html">Das U-Boot on Blackfin</a>.)</div></li></ul><pre class="code">stamp> tftp 0x1000000 linuxstamp> bootelf</pre><ul><li class="level1"><div class="li"> Once the kernel has booted make sure that you are using the correct kernel with smbfs capabilities. If you have compile smb as a module, and it is not loaded, <code>smbfs</code> will not show up in this list. To do this issue the follwoing command:</div></li></ul><pre class="code">root:/mnt> cat /proc/filesystemsnodev sysfsnodev rootfsnodev bdevnodev procnodev sockfsnodev pipefsnodev futexfsnodev eventpollfsnodev devpts ext2nodev ramfsnodev smbfs</pre><ul><li class="level1"><div class="li"> Now make sure that Ethernet is running properly by checking to see if you have an IP address.</div></li></ul><pre class="code">root:~> ifconfig</pre><ul><li class="level1"><div class="li"> If you do not have a valid IP address you can use DHCP to obtain one.</div></li></ul><pre class="code">root:~> dhcpcd &root:~> ifconfig(the ifconfig will ensure that the DHCP request was successful.)</pre><ul><li class="level1"><div class="li"> You should test that you have ethernet connectivity with the machine you are connecting to:</div></li></ul><pre class="code">root:~> ping machinename</pre><p> </p><ul><li class="level1"><div class="li"> Now you are ready to use smbmount to mount a shared system.</div></li></ul><p> </p><ul><li class="level1"><div class="li"> You may want to add some settings to your smb.conf to use smbmount more fluidly. To access this file issue the following command:</div></li></ul><pre class="code">root:~> vi ./etc/config/smb.conf</pre><ul><li class="level1"><div class="li"> In here you can input whatever parameters you desire to suit your specific needs. </div></li></ul><p> If your machine works with group, you can input parameters as below: </p><pre class="code"> [global] workgroup = WORKGROUP encrypt passwords = yes</pre><p>If your machine works with domain,you can input parameters as below: </p><pre class="code"> [global] workgroup = [name of domain] encrypt passwords = yes</pre><ul><li class="level1"><div class="li"> Now issue the following command to mount a drive:</div></li></ul><pre class="code">root:~> smbmount //TESTMACHINE/uClinux /mnt -o username=user</pre><p> </p><ul><li class="level1"><div class="li"> To make sure that the file system was mounted with out any problems issue the mount command:</div></li></ul><pre class="code">root:~> mount</pre><ul><li class="level1"><div class="li"> You should see output similar to this:</div></li></ul><pre class="code">/dev/mtdblock0 on / type ext2 (rw)none on /proc type proc (rw,nodiratime)/dev/ram0 on /var type ramfs (rw)//TESTMACHINE/uClinux on /mnt type smbfs (rw,nodiratime,nosuid,nodev,uid=0,gid=0,file_mode=0755,dir_mode=0755)</pre><ul><li class="level1"><div class="li"> Now if you <em>cd</em> into the location where you mounted the smbfs (/mnt in this example) then you should see the files and directories exactly as they are on original machine if you have appropriate permissions.</div></li></ul><pre class="code">root:~> cd /mntroot:/mnt> lsdumpinit.battestunins.icounins000.datunins000.exe</pre><ul><li class="level1"><div class="li"> Now you can accesses these files/directories and/or create new files/directories (if you have the necessary permissions) as if they were part of the targets file system.</div></li></ul><ul><li class="level1"><div class="li"> To unmount the smb file system issue the following command:</div></li></ul><pre class="code">root:~> smbumount /mnt</pre><ul><li class="level1"><div class="li"> Now when issuing the mount command you will see that the smbfs is no longer there:</div></li></ul><pre class="code">root:~> mount/dev/mtdblock0 on / type ext2 (rw)none on /proc type proc (rw,nodiratime)/dev/ram0 on /var type ramfs (rw)</pre></div><!-- SECTION [2545-] --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -