Optware/zh cn - Revision history http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&action=history Revision history for this page on the wiki en MediaWiki 1.10.1 Thu, 28 Mar 2024 19:22:31 GMT Glenn: catchg http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&diff=46998&oldid=prev <p>catchg</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 11:13, 31 May 2014</td> </tr> <tr><td colspan="2" align="left"><strong>Line 891:</strong></td> <td colspan="2" align="left"><strong>Line 891:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">[[User:Oleo|Oleo]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[User:Oleo|Oleo]]</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">[[Category:Optware| ]]</td><td>+</td><td style="background: #cfc; font-size: smaller;">[[Category:Optware<ins style="color: red; font-weight: bold; text-decoration: none;">/zh cn</ins>| ]]</td></tr> </table> Sat, 31 May 2014 11:13:30 GMT Glenn http://wiki.dd-wrt.com/wiki/index.php/Talk:Optware/zh_cn Leangjia: /* Remarks */ http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&diff=35984&oldid=prev <p><span class="autocomment">Remarks</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 08:02, 20 September 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 880:</strong></td> <td colspan="2" align="left"><strong>Line 880:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">--[[User:Disk Crasher|Disk Crasher]] 02:44, 29 October 2009 (CET)</td><td> </td><td style="background: #eee; font-size: smaller;">--[[User:Disk Crasher|Disk Crasher]] 02:44, 29 October 2009 (CET)</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">== <del style="color: red; font-weight: bold; text-decoration: none;">Remarks </del>==</td><td>+</td><td style="background: #cfc; font-size: smaller;">== <ins style="color: red; font-weight: bold; text-decoration: none;">备注 </ins>==</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">* DD-WRT provided /bin/ipkg is not full feature ipkg but it can do the job for installing ipkg-opt. It could also be used for installing other packages, but this is not recommended any more.</td><td> </td><td style="background: #eee; font-size: smaller;">* DD-WRT provided /bin/ipkg is not full feature ipkg but it can do the job for installing ipkg-opt. It could also be used for installing other packages, but this is not recommended any more.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">* DD-WRT kernel lacks many &quot;server&quot; features like NFS, NBD support, ... Provided samba, mysql, thttp-php and other applications can do the job if enough space is provided. This means that external storage is required for memory hungry applications. Experience from nslu2 and Oleg firmware showed that 512MB swap space is recommended if external USB hard disk is available. See [[USB]] page for instructions how to initialize USB kernel modules and harddisk.</td><td> </td><td style="background: #eee; font-size: smaller;">* DD-WRT kernel lacks many &quot;server&quot; features like NFS, NBD support, ... Provided samba, mysql, thttp-php and other applications can do the job if enough space is provided. This means that external storage is required for memory hungry applications. Experience from nslu2 and Oleg firmware showed that 512MB swap space is recommended if external USB hard disk is available. See [[USB]] page for instructions how to initialize USB kernel modules and harddisk.</td></tr> </table> Mon, 20 Sep 2010 08:02:11 GMT Leangjia http://wiki.dd-wrt.com/wiki/index.php/Talk:Optware/zh_cn Leangjia: /* Known bugs */ http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&diff=35983&oldid=prev <p><span class="autocomment">Known bugs</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 07:59, 20 September 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 708:</strong></td> <td colspan="2" align="left"><strong>Line 708:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> tune2fs -C 100 /dev/discs/disc0/part1</td><td> </td><td style="background: #eee; font-size: smaller;"> tune2fs -C 100 /dev/discs/disc0/part1</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">== <del style="color: red; font-weight: bold; text-decoration: none;">Known bugs </del>==</td><td>+</td><td style="background: #cfc; font-size: smaller;">== <ins style="color: red; font-weight: bold; text-decoration: none;">已知的bugs </ins>==</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">=== <del style="color: red; font-weight: bold; text-decoration: none;">ngrep doesn't work </del>===</td><td>+</td><td style="background: #cfc; font-size: smaller;">=== <ins style="color: red; font-weight: bold; text-decoration: none;">ngrep不起作用 </ins>===</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">ngrep <del style="color: red; font-weight: bold; text-decoration: none;">is compiled with IPV6 support and ddwrt doesn't provide IPV6 support.</del></td><td>+</td><td style="background: #cfc; font-size: smaller;">ngrep <ins style="color: red; font-weight: bold; text-decoration: none;">是IPV6的编译支持但,ddwrt不支持IPV6。</ins></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">If ngrep is recompiled without IPV6 support, it works ok after adding the nobody user to /etc/passwd</td><td> </td><td style="background: #eee; font-size: smaller;">If ngrep is recompiled without IPV6 support, it works ok after adding the nobody user to /etc/passwd</td></tr> </table> Mon, 20 Sep 2010 07:59:54 GMT Leangjia http://wiki.dd-wrt.com/wiki/index.php/Talk:Optware/zh_cn Leangjia: /* Running at startup */ http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&diff=35982&oldid=prev <p><span class="autocomment">Running at startup</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 07:56, 20 September 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 576:</strong></td> <td colspan="2" align="left"><strong>Line 576:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> log file = /tmp/samba/sambalog.%m</td><td> </td><td style="background: #eee; font-size: smaller;"> log file = /tmp/samba/sambalog.%m</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">== <del style="color: red; font-weight: bold; text-decoration: none;">Running at startup </del>==</td><td>+</td><td style="background: #cfc; font-size: smaller;">== <ins style="color: red; font-weight: bold; text-decoration: none;">开机启动 </ins>==</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">With dd-wrt.V24 the difference between system and OpenWRT Whiterussian R6 uClibc is so big, that running even simple programs causes segmentation fault. Optware also uses its own uClibc that resides in /opt/lib but all programs have built-in rpath to /opt/lib. This means that it is simpler to use Optware packages under DD-WRT than OpenWRT packages.</td><td> </td><td style="background: #eee; font-size: smaller;">With dd-wrt.V24 the difference between system and OpenWRT Whiterussian R6 uClibc is so big, that running even simple programs causes segmentation fault. Optware also uses its own uClibc that resides in /opt/lib but all programs have built-in rpath to /opt/lib. This means that it is simpler to use Optware packages under DD-WRT than OpenWRT packages.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> </table> Mon, 20 Sep 2010 07:56:15 GMT Leangjia http://wiki.dd-wrt.com/wiki/index.php/Talk:Optware/zh_cn Leangjia: /* Installing Samba2 */ http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&diff=35981&oldid=prev <p><span class="autocomment">Installing Samba2</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 07:55, 20 September 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 365:</strong></td> <td colspan="2" align="left"><strong>Line 365:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">fetch would be &quot;download in browser and then upload to server (accessing server using samba, ftp or scp)&quot;.</td><td> </td><td style="background: #eee; font-size: smaller;">fetch would be &quot;download in browser and then upload to server (accessing server using samba, ftp or scp)&quot;.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">=== <del style="color: red; font-weight: bold; text-decoration: none;">Installing Samba2 </del>===</td><td>+</td><td style="background: #cfc; font-size: smaller;">=== <ins style="color: red; font-weight: bold; text-decoration: none;">安装Samba2 </ins>===</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td colspan="2" align="left"><strong>Line 409:</strong></td> <td colspan="2" align="left"><strong>Line 409:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">one wants to manually edit /opt/etc/samba/smb.conf</td><td> </td><td style="background: #eee; font-size: smaller;">one wants to manually edit /opt/etc/samba/smb.conf</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">==== <del style="color: red; font-weight: bold; text-decoration: none;">Setting up smb</del>.conf ====</td><td>+</td><td style="background: #cfc; font-size: smaller;">==== <ins style="color: red; font-weight: bold; text-decoration: none;">设置smb</ins>.conf ====</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Setting the &quot;correct&quot; (read: usable) settings in the ''/opt/etc/samba/smb.conf'' file seems to be an art all to itself.</td><td> </td><td style="background: #eee; font-size: smaller;">Setting the &quot;correct&quot; (read: usable) settings in the ''/opt/etc/samba/smb.conf'' file seems to be an art all to itself.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td colspan="2" align="left"><strong>Line 557:</strong></td> <td colspan="2" align="left"><strong>Line 557:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">:: use command: ''cat /opt/etc/samba/smb.conf | grep 'log file' '' - to see if special log path is specified in smb.conf</td><td> </td><td style="background: #eee; font-size: smaller;">:: use command: ''cat /opt/etc/samba/smb.conf | grep 'log file' '' - to see if special log path is specified in smb.conf</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">==== <del style="color: red; font-weight: bold; text-decoration: none;">Protect your FLASH memory </del>====</td><td>+</td><td style="background: #cfc; font-size: smaller;">==== <ins style="color: red; font-weight: bold; text-decoration: none;">保护您的FLASH存储器 </ins>====</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">A long term problem that could happen when running samba on FLASH memory like jffs, mmc or USB stick is</td><td> </td><td style="background: #eee; font-size: smaller;">A long term problem that could happen when running samba on FLASH memory like jffs, mmc or USB stick is</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">FLASH wear. Such use could destroy FLASH if log files and browsing databases are constantly updated. Use of /tmp partition is recommended for such use. Amend startup script with:</td><td> </td><td style="background: #eee; font-size: smaller;">FLASH wear. Such use could destroy FLASH if log files and browsing databases are constantly updated. Use of /tmp partition is recommended for such use. Amend startup script with:</td></tr> </table> Mon, 20 Sep 2010 07:55:32 GMT Leangjia http://wiki.dd-wrt.com/wiki/index.php/Talk:Optware/zh_cn Leangjia: /* Installing Throttling HTTP server */ http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&diff=35980&oldid=prev <p><span class="autocomment">Installing Throttling HTTP server</span></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 07:54, 20 September 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 335:</strong></td> <td colspan="2" align="left"><strong>Line 335:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">This will tell you if your port is OK.</td><td> </td><td style="background: #eee; font-size: smaller;">This will tell you if your port is OK.</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">=== <del style="color: red; font-weight: bold; text-decoration: none;">Installing Throttling HTTP server </del>===</td><td>+</td><td style="background: #cfc; font-size: smaller;">=== <ins style="color: red; font-weight: bold; text-decoration: none;">安装轻量级HTTP服务器 </ins>===</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">For our purposes [http://www.acme.com/software/thttpd/ thttpd WEB server] will handle most requirements like browsing directories and runing CGI program located at /opt/share/www/cgi-bin/transmission.cgi</td><td> </td><td style="background: #eee; font-size: smaller;">For our purposes [http://www.acme.com/software/thttpd/ thttpd WEB server] will handle most requirements like browsing directories and runing CGI program located at /opt/share/www/cgi-bin/transmission.cgi</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"> ~ # /opt/bin/ipkg-opt install thttpd</td><td> </td><td style="background: #eee; font-size: smaller;"> ~ # /opt/bin/ipkg-opt install thttpd</td></tr> </table> Mon, 20 Sep 2010 07:54:16 GMT Leangjia http://wiki.dd-wrt.com/wiki/index.php/Talk:Optware/zh_cn Leangjia: New page: {{languages|Optware}} == 介绍 == 更多更新的教程,详见 Optware, the Right Way 。 With the latest DD-WRT (v23 SP2 and v24 SP1), it is possible to install [http://www.ns... http://wiki.dd-wrt.com/wiki/index.php?title=Optware/zh_cn&diff=35979&oldid=prev <p>New page: {{languages|Optware}} == 介绍 == 更多更新的教程,详见 <a href="/wiki/index.php/Optware%2C_the_Right_Way" title="Optware, the Right Way">Optware, the Right Way</a> 。 With the latest DD-WRT (v23 SP2 and v24 SP1), it is possible to install [http://www.ns...</p> <p><b>New page</b></p><div>{{languages|Optware}}<br /> == 介绍 ==<br /> <br /> <br /> 更多更新的教程,详见 [[Optware, the Right Way]] 。<br /> <br /> <br /> <br /> With the latest DD-WRT (v23 SP2 and v24 SP1), it is possible to install [http://www.nslu2-linux.org/wiki/Unslung/Packages Optware packages] from [http://www.nslu2-linux.org NSLU2-Linux] project. This port of Optware is tailored for DD-WRT and extends the router to full feature linux if enough storage ([[Journalling_Flash_File_System|jffs]], [http://kiel.kool.dk/ SD/MMC Card], [[USB]]) is provided for packages. <br /> <br /> The main feature of this package is that it installs all required files under /opt with 1000 ported applications. With buildroot toolchain, system library independence is also added. This means that packages now depend on /opt/lib/uClibc.so and dynamic loader also in /opt/lib with separate /opt/etc/ld-opt.so.conf for custom .so cache.<br /> Applications are built with wchar and locale support which makes uClibc library somewhat greater than other uClibc packages, but still far smaller than glibc based aplications. <br /> <br /> Buildroot toolchain features:<br /> * GCC 4.1.1<br /> * uClibc 0.9.28 with many patches<br /> * uClibc++ 0.2.2<br /> * [http://www.linuxinsight.com/ols2006_native_posix_threads_library_nptl_support_for_uclibc.html Native POSIX Threads Library (NPTL) Support for uClibc]<br /> <br /> Some packages (perl, python, Transmission, buildroot, ...) are so memory hungry that swap is needed for normal operation. Buildroot package or optware-devel meta package provides complete development toolchain for compiling programs on router itself with gcc, gdb, make, g++ , svn, ...<br /> <br /> Basic preparation of /jffs is required (enable, clean). On WRT54GS there is room for some aplications. SD card (/mmc) may give enough space for many applications. For testing purposes also smbmount can be used. If a non /jffs filesystem is available, it is recommended to unmount /jffs and then mount eg. mmc in place of /jffs.<br /> <br /> === 先决条件 ===<br /> 一如往常这里有三个先决条件。<br /> * 硬件<br /> # Recommended are routers with USB support (Asus WL-500g Deluxe|Premium, Linksys WRTSL54GS).<br /> # WRT54g routers with hardware modification for MMC/SD card<br /> # 32MB of RAM may not be enough for some application and thus swap is recommended<br /> # USB hard disk for storage and swap or USB key without swap<br /> # Routers with 8MB flash can also fit some applications in /jffs without the need for swap (e.g. WRT54GS v1.1) <br /> * 软件<br /> # DD-WRT v23 SP2 mini or standard when MMC is used<br /> # You should be able to [[Telnet/SSH_and_the_Command_Line | use telnet and the command line]].<br /> # DD-WRT v24 SP1 Mega (or eko special version with built-in USB drivers) when USB is used <br /> * ''/opt'' 文件夹权限为可读写,可将驱动及其他载入于此<br /> # jffs 驱动<br /> # USB 驱动<br /> # CIFS - Client Samba drive<br /> # mmc Flash drive<br /> <br /> == 比如一些安装于WRT54GS (v1.0 .. v3.0)的软件包 ==<br /> <br /> === 创建你的Optware包驱动器空间 ===<br /> Prerequisite for optware is writable /opt partition/drivespace. Required size depends on packages installed. Three options to create writable partition/drivespace is listed here. A fourth option could be the [[SD/MMC_mod|SDmod]].<br /> <br /> ==== 选项A: 准备 /jffs for /opt ====<br /> Depending on the dd-wrt firmware version you choose, you may have enough space on the /jffs drive. &lt;br&gt;<br /> Example: WRT54GS with 8MB flash and DD-WRT v23SP2 Mini leaves 5248k blocks for /jffs which can be binded to /opt. <br /> <br /> ~ # mkdir /jffs/opt<br /> ~ # mount -o bind /jffs/opt /opt<br /> <br /> Read more about built-in flash drive option [[jffs|jffs2]]<br /> <br /> Use command '''''df''''' to keep track of how much space is left on your /jffs and /opt &quot;drives&quot;<br /> <br /> ==== 选项B: Preparing USB drive for /opt ====<br /> Read [[USB_storage|USB storage]] wiki for guide to enable, partition, format and mount a USB drive. Note that /opt must be mounted on an ext2/3 filesystem for linking to work which is required by the Optware installer.<br /> <br /> ==== 选项C: Partition-in-a-file on CIFS for /opt ====<br /> For a detailed example of how to create a partition-in-a-file, on a CIFS drive, and mount /opt to that partition, goto section [[Optware#Optware_on_CIFS_-_Partition_in_a_file|Optware on CIFS - Partition in a file]] below.<br /> <br /> === 安装ipkg-opt 及 uclibc-opt === <br /> First we will install uClibc library required by all packages and better ipkg-opt packager.<br /> Recommended way for installing basic two packages is with installation script that will also check for<br /> possible network problems and /opt directory availability. To install (or reinstall) issue the following<br /> command:<br /> &lt;nowiki&gt;wget http://www.wlan-sat.com/boleo/optware/optware-install-ddwrt.sh -O - | tr -d '\r' &gt; /tmp/optware-install.sh&lt;/nowiki&gt;<br /> Or<br /> &lt;nowiki&gt;wget http://pastebin.ca/raw/1031954 -O - | tr -d '\r' &gt; /tmp/optware-install.sh&lt;/nowiki&gt; <br /> <br /> Or<br /> &lt;nowiki&gt;lamsao: the above links seem to be dead. I found this link and it works.<br /> <br /> wget http://www.3iii.dk/linux/optware/optware-install-ddwrt.sh -O - | tr -d '\r' &gt; /tmp/optware-install.sh&lt;/nowiki&gt;<br /> <br /> then run: sh /tmp/optware-install.sh<br /> <br /> 输出信息类似如下:<br /> &lt;nowiki&gt;Checking system config ...<br /> Using 192.168.1.1 as default gateway.<br /> Using the following nameserver(s):<br /> nameserver 192.168.1.30<br /> Warning: local nameserver is different than gateway!<br /> Check config or enter:<br /> sed -i s/192.168.*/192.168.1.1/ /tmp/resolv.conf<br /> to correct this.<br /> Installing package uclibc-opt_0.9.28-13_mipsel.ipk ...<br /> Connecting to ipkg.nslu2-linux.org[140.211.166.82]:80<br /> uclibc-opt_0.9.28-12 100% |***********************************************| 832 KB 00:00:00 ETA<br /> Updating /opt/etc/ld.so.cache<br /> /opt/sbin/ldconfig: can't create /opt/etc/ld.so.cache~ (No such file or directory)<br /> Installing package ipkg-opt_0.99.163-9_mipsel.ipk ...<br /> Connecting to ipkg.nslu2-linux.org[140.211.166.82]:80<br /> ipkg-opt_0.99.163-9_ 100% |***********************************************| 75896 00:00:00 ETA<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/Packages.gz<br /> Inflating http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/Packages.gz<br /> Updated list of available packages in /opt/lib/ipkg/lists/optware<br /> Successfully terminated.<br /> Installing uclibc-opt (0.9.28-12) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk<br /> package uclibc-opt suggests installing ipkg-opt<br /> Configuring uclibc-opt<br /> Updating /opt/etc/ld.so.cache<br /> Successfully terminated.<br /> Installing ipkg-opt (0.99.163-9) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk<br /> Configuring ipkg-opt<br /> Successfully terminated.&lt;/nowiki&gt;<br /> <br /> Besides pre-installing fundamental packages, there are also [[Optware-ByHand | Optware manual installation instructions]]. <br /> This are now somewhat deprecated due to large number of user miss-understandings.<br /> <br /> === /opt 备份 ===<br /> <br /> Now we have prepared /opt for adding more packages. We can also create backup of the whole /opt tree<br /> in case of router upgrade, to give preinstalled /opt to a friend or just safety backup. We will create<br /> such backup with <br /> ~ # tar czf /tmp/opt-backup.tar.gz /opt<br /> Destination for /tmp/opt-backup.tar.gz should be large enough! Beware that /tmp is RAM. Destination should be disk or remote smbfs partition. Extracting /opt backup could be:<br /> cd /<br /> rm -rf opt/*<br /> tar xvzf /tmp/opt-backup.tar.gz<br /> <br /> If /opt space is tight and no packages requiring libstdc++ will be used (like Amule) then removing this large<br /> shared library is recommended<br /> ~ # rm /opt/lib/libstdc\*<br /> will remove<br /> /opt/lib/libstdc++.so /opt/lib/libstdc++.so.6 /opt/lib/libstdc++.so.6.0.8 <br /> <br /> ipkg-opt downloads packages into /opt directory and erases them after installing. If you have enough free RAM and /jffs only then adding --tmp-dir /tmp is recommended instead of default /opt<br /> <br /> === 搜索 PATH ===<br /> '''Note:''' as of EKO svn11218 (dec 2008) it is no longer necessary to add to path or profile. As the mentioned changes are already added to the default path and profile.&lt;br&gt;<br /> For your scripts it may however still be beneficial to adjust LD_LIBRARY_PATH and PATH, as shown below, and as used in [[Optware#Startup_for_external_USB_Disk|Startup for external USB Disk]] example.<br /> <br /> Adding /opt/bin to search PATH will save us from tedious typing of /opt/bin for each command from /opt/bin. For running applications from /opt tree search path should be expanded with<br /> ~# export PATH=/opt/bin:/opt/sbin:$PATH <br /> <br /> Now we can install any package from a list of available packages. <br /> ~# ipkg-opt list | more<br /> or less or this [[Quick list of Optware packages]]<br /> <br /> '''Note:''' DD-WRT sets LD_LIBRARY_PATH in /etc/profile that can cause library loading clash. Unset this variable with<br /> unset LD_LIBRARY_PATH<br /> <br /> === 安装 ncFTP 客户端 ===<br /> We want to get list of packages containing name ftp<br /> ~ # /opt/bin/ipkg-opt list '*ftp*'<br /> atftp - 0.7-6 - Advanced TFTP server and client<br /> ftpcopy - 0.6.7-3 - A simple FTP client written to copy files or directories (recursively) from a FTP server.<br /> ftpd-topfield - 0.6.10-2 - FTPD for the Topfield TF5000PVRt<br /> ncftp - 3.2.0-2 - Nice command line FTP client<br /> proftpd - 1.3.0a-1 - Highly configurable FTP server with SSL-TLS<br /> tftp-hpa - 0.45-1 - A tftp package<br /> tnftp - 20050625-1 - tnftp (formerly lukemftp) is what many users affectionately call the enhanced ftp client in NetBSD.<br /> tnftpd - 20061217-2 - tnftpd (formerly lukemftpd) is a port of the NetBSD FTP server to other systems.<br /> vsftpd - 2.0.1-7 - ftp daemon with an emphasis on speed and security<br /> Successfully terminated.<br /> <br /> <br /> For example we will install ncFTP client with:<br /> ~ # /opt/bin/ipkg-opt --tmp-dir /tmp install ncftp <br /> Installing ncftp (3.2.0-2) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/ncftp_3.2.0-2_mipsel.ipk<br /> Installing ncurses (5.6-1) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/ncurses_5.6-1_mipsel.ipk<br /> Configuring ncftp<br /> Configuring ncurses<br /> Successfully terminated.<br /> <br /> and run it <br /> ~ # /opt/bin/ncftp ftp.si.debian.org <br /> NcFTP 3.2.0 (Aug 05, 2006) by Mike Gleason (http://www.NcFTP.com/contact/).<br /> <br /> Copyright (c) 1992-2005 by Mike Gleason.<br /> All rights reserved.<br /> <br /> Connecting to 164.8.6.249... <br /> CAMTP Debian mirror [ftp.si.debian.org]<br /> Logging in... <br /> Anonymous access granted, restrictions apply.<br /> Logged in to ftp.si.debian.org. <br /> ncftp / &gt; ls<br /> backports/ debian-cd/ debian-sl/ openoffice/<br /> debian/ debian-non-US/ favicon.ico robots.txt<br /> ncftp / &gt; bye<br /> <br /> <br /> You have not saved a bookmark for this site.<br /> <br /> Would you like to save a bookmark to:<br /> ftp://ftp.si.debian.org<br /> <br /> Save? (yes/no) yes<br /> Enter a name for this bookmark, or hit enter for &quot;si&quot;: debian<br /> Bookmark &quot;debian&quot; saved.<br /> <br /> Always check available size of your /opt partition with ''df'' command<br /> ~ # df<br /> Filesystem 1k-blocks Used Available Use% Mounted on<br /> /dev/root 1984 1984 0 100% /<br /> /dev/mtdblock/4 5248 3860 1388 74% /jffs<br /> /dev/mtdblock/4 5248 3860 1388 74% /opt<br /> <br /> Remove unneeded packages with<br /> ~ # /opt/bin/ipkg-opt remove ncftp<br /> Removing package ncftp from /opt/...<br /> Successfully terminated.<br /> You will notice that ncurses as depended package will not get removed. To correct this issue<br /> ~ # /opt/bin/ipkg-opt remove ncurses<br /> Removing package ncurses from /opt/...<br /> Successfully terminated.<br /> unless some other package require this package.<br /> <br /> === 安装torrent 客户端 ===<br /> <br /> Of course there are many more packages which should run on router without a problem. All binaries have built in /opt/lib search path and there should be no problem with libraries clash like problems with OpenWRT packages. All packages have builtin package dependencies and will install required libraries automagically. Lets show this on installing torrent clients enhanced-ctorrent (Stopped developing since June 2008), Enhanced CTorrent is a revised version of CTorrent:<br /> ~ # /opt/bin/ipkg-opt -t /tmp install enhanced-ctorrent <br /> Installing enhanced-ctorrent (dnh2.2-6) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/enhanced-ctorrent_dnh2.2-6_mipsel.ipk<br /> Installing libuclibc (0.2.2-4) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/libuclibc _0.2.2-4_mipsel.ipk<br /> Installing openssl (0.9.7l-3) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/openssl_0.9.7l-3_mipsel.ipk<br /> Configuring enhanced-ctorrent<br /> Configuring libuclibc <br /> Configuring openssl<br /> Successfully terminated.<br /> <br /> We will not show running example for this clients as normally huge amount of storrage is required.<br /> <br /> <br /> Another torrent client with WWW interface is Transmission. Now it has two branches listed in Optware. &lt;br&gt;<br /> ; Transmissiond : Lightweight BitTorrent daemon with CGI WWW interface, has a rich-functional web interface watching daemon state and controlling its work, transmission_watchdog can automatically watch and process torrent files in a directory. This one has lower memory footprint, but the development has stopped.&lt;br&gt;<br /> <br /> ; Transmission : Joshe created completely different &quot;daemon&quot; from scratch and maintained as one branch of transmission. Now it has merged the Clutch web interface, and listed as transmission in the list of Optware. The Clutch has better look but less function.The daemon can watch a directory for new torrent files now but you need to config this via it's setting file. Also the current build v1.93-1 (transmission-daemon, transmisison-remote, transmissioncli) seems bugy.<br /> <br /> Below is a example of installing transmissiond (the old transmission). For example of installing the one with Clutch web interface please hit [[Transmission_daemon|Transmission (v1.93-1)]] Note the config file between the two daemons are not compatible.<br /> <br /> <br /> Installing transmissiond (v1.42-1) is simple as<br /> &lt;pre&gt;<br /> ~ # /opt/bin/ipkg-opt install transmissiond<br /> Installing transmissiond (1.42-1) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/transmissiond_1.42-1_mipsel.ipk<br /> package transmissiond suggests installing gnuplot<br /> package transmissiond suggests installing logrotate<br /> package transmissiond suggests installing thttpd<br /> package transmissiond suggests installing mini-sendmail<br /> package transmissiond suggests installing transmission<br /> Configuring transmissiond<br /> Please note that /opt/etc/init.d/S80busybox_httpd is installed for<br /> running CGI interface at http://localhost:8008/cgi-bin/transmission.cgi<br /> See instructions for daemon and WWW interface in /opt/share/doc/transmissiond<br /> Configure daemon with /opt/etc/transmission.conf<br /> Successfully terminated.&lt;/pre&gt;<br /> <br /> Here you don't need to install the 'transmission', cause transmissiond is good enough. You can read /opt/share/doc/transmissiond/README.daemon for instructions. Here are quick steps:<br /> <br /> After creating directories with <br /> ~ # mkdir /opt/torrent<br /> ~ # mkdir /opt/torrent/source<br /> ~ # mkdir /opt/torrent/work<br /> ~ # mkdir /opt/torrent/target<br /> we will configure transmisisond itself by editing /opt/etc/transmisison.conf by using <br /> ~ # sed -i -e 's|/tmp/harddisk|/opt|' /opt/etc/transmission.conf<br /> to change default path from /tmp/harddisk to /opt. So your transmission.conf will look like<br /> <br /> &lt;pre&gt;~ # cat /opt/etc/transmission.conf<br /> SOURCE=/opt/torrent/source<br /> WORK=/opt/torrent/work<br /> TARGET=/opt/torrent/target<br /> ACTIVE=/opt/torrent/active-torrents.txt<br /> HOME=/opt/torrent<br /> .....&lt;/pre&gt;<br /> Also user should be changed from admin to root. (Change USER=root in /opt/etc/transmission.conf)<br /> <br /> After changing config transmission_watchdog should be run every half an hour with cron. We will start it manually and check if it is running <br /> ~ # /opt/sbin/transmission_watchdog<br /> ~ # ps |grep transmission<br /> 10621 root 808 S transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /opt/torrent/active-torrents.txt<br /> 10624 root 808 S transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /opt/torrent/active-torrents.txt<br /> 10625 root 808 S transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /opt/torrent/active-torrents.txt<br /> <br /> Transmissiond installation comes with /opt/etc/init.d/S80busybox_httpd to run its web interface. However, we will configure &quot;Throttling HTTP server&quot; (see next section) to show the startup page at port 8008. Although dd-wrt v23SP2 uses /opt/sbin/httpd (httpd -&gt; /opt/bin/busybox) for its WEB interface, this httpd server cannot be reused as it has serioius problems running CGI programs and showing index.html files.<br /> <br /> For public trackers CGI interface provides 'Fetch' button which downloads .torrent file into /opt/torrent/source directory. Private trackers use passkey which means that .torrent file should be saved with browser itself.<br /> <br /> After seeing .torrent file in Queued list, one can press Watchdog button to force queue processing. This will move .torrent file from source into work directory and notify daemon for the change to start processing the file. After download finishes, transmission_watchdog will automaticly move torrent from work to target. Meanwhile, user can press Update button to see status of active torrents.<br /> <br /> <br /> Besides transmissiond two other daemons are required for normal queue processing. Both are provided by dd-wrt if enabled in the web-GUI. &quot;Cron&quot; is enabled under Admin control panel. &quot;Syslogd&quot; is enabled under Services tab.<br /> <br /> Cron should regulary run /opt/sbin/transmisison_watchdog with sample /opt/etc/crontab<br /> */30 * * * * root /opt/bin/nice /opt/sbin/transmission_watchdog<br /> Visit [[CRON]] page to see where this line should be included. I recommend <br /> cat /opt/etc/crontab &gt;&gt; /tmp/crontab <br /> at startup,<br /> <br /> Syslog will collect cumulative reports from transmisisond and CGI will show it when <br /> Log or Update is pressed. If gnuplot is installed then also transfer graph is showed when Log is pressed. SYSLOG line in /opt/etc/transmission.conf must be changed to<br /> SYSLOG=/opt/var/log/messages<br /> to be able to see Log messages from daemon when Log button is pressed.<br /> <br /> By default after enabled syslogd in the dd-wrt web-GUI, syslogd logs messages to /tmp/var/log/messages which is in ram. You can create S05syslogd in /opt/etc/init.d/ as below so it will log messages into disk everytime the router is rebooted.<br /> &lt;pre&gt;<br /> #!/bin/sh<br /> # startup script for syslogd<br /> #stop meself if running<br /> if [ -n &quot;`pidof syslogd`&quot; ]; then<br /> killall syslogd 2&gt;/dev/null<br /> fi<br /> # remove old syslog.log<br /> rm /tmp/var/log/messages<br /> # add symlink so log is available at old location(e.g for webinterface)<br /> ln -s /opt/var/log/messages /tmp/var/log/messages<br /> /sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7<br /> &lt;/pre&gt;<br /> Make it executable by chmod +x /opt/etc/init.d/S05syslogd<br /> <br /> <br /> Opening default listening port 65534 for Transmission is another required task<br /> which can be solved by DD-WRT control panel or adding <br /> /usr/sbin/iptables -I INPUT 1 -p tcp --dport 65534 -j logaccept<br /> to startup file.<br /> <br /> <br /> To test if the listening port has been opened properly and can accept incoming connections:<br /> First install the text based browser: lynx<br /> &lt;pre&gt;ipkg-opt install lynx&lt;/pre&gt;<br /> then issue (assume your port is 65534)<br /> &lt;pre&gt;lynx http://www.utorrent.com:16000/testport2.php?port=65534&lt;/pre&gt;<br /> This will tell you if your port is OK.<br /> <br /> === Installing Throttling HTTP server ===<br /> For our purposes [http://www.acme.com/software/thttpd/ thttpd WEB server] will handle most requirements like browsing directories and runing CGI program located at /opt/share/www/cgi-bin/transmission.cgi<br /> ~ # /opt/bin/ipkg-opt install thttpd<br /> Installing thttpd (2.25b-4) to /opt/...<br /> Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/thttpd_2.25b-4_mipsel.ipk<br /> Configuring thttpd<br /> <br /> <br /> To complete the installation, you must edit /opt/etc/thttpd.conf,<br /> and then run /opt/etc/init.d/S80thttpd to start thttpd.<br /> <br /> Successfully terminated.<br /> <br /> Edit /opt/etc/thttpd.conf with vi (or nano) and add cgipat, change user to root, change port to 8008 to see the following contents:<br /> dir=/opt/share/www<br /> port=8008<br /> user=root<br /> nochroot<br /> nosymlink<br /> novhost<br /> logfile=/var/log/thttpd.log<br /> pidfile=/var/run/thttpd.pid<br /> cgipat=cgi-bin/*<br /> <br /> Manually start thttpd with <br /> ~ # /opt/etc/init.d/S80thttpd start<br /> <br /> After that you will be able to see default index.html page at http://192.168.1.1:8008/ assuming that your router is at 192.168.1.1 . There is also link to CGI page http://192.168.1.1:8008/cgi-bin/transmission.cgi which is preaty empty with several buttons for controlling daemon. Fetch command is useful only for fetching torrent files without passkey as there is no possibility to pass cookies to server. Use with care. Proper <br /> fetch would be &quot;download in browser and then upload to server (accessing server using samba, ftp or scp)&quot;.<br /> <br /> === Installing Samba2 ===<br /> <br /> <br /> '''Samba2 the easy way'''<br /> <br /> See [[Slim_samba2|Slim Samba2]] - a stripped down version of Optware Samba 2 for use on USB drives, just unpack a .tar.gz file, adjust a few settings in the web-GUI, and you are up and runnig.<br /> <br /> See [[HDsamba2]] - a fully automated install and boot script for installing Optware Samba2 with SWAT, and more... on a USB HD. Format you HD, adjust a few settings in the web-GUI, run the install script, and you are up and running.<br /> <br /> <br /> '''Samba2 the step-by-step way'''<br /> <br /> It looks like Samba 3 is too big for all &quot;swapless&quot; routers. Normally Samba 3 will use 10M RAM when up and will use more RAM when new connections established and it forks new threads. Samba 2 will roughly use half of this amount of RAM. For this reason I have prepared Samba 2 packages with Samba Web Admin Tool (SWAT) which will ease config and admin for samba newcomers. &lt;br&gt;<br /> :But with Samba 2, you will get a slower data transfer speed (1.5M for Samba 3 and 1.3M/s for Samba 2 over wireless), this is a trade off for the RAM. If you have 64M RAM and have a external hard disk for swap, you can go for Samba 3. Also, you can run Samba as a xinetd service instead of a daemon, so it will only up on request. [http://www.nslu2-linux.org/wiki/Optware/Samba2 Running Samba 2 with xinetd, not as Daemon]<br /> <br /> <br /> <br /> <br /> SWAT interface looks like:<br /> &lt;gallery&gt;<br /> Image:swat-globals.png |SWAT globals<br /> Image:swat-shares.png |SWAT shares <br /> Image:swat-status.png |SWAT status <br /> &lt;/gallery&gt;<br /> <br /> Installation of samba 2 is done by the following commands:<br /> <br /> /opt/bin/ipkg-opt update <br /> /opt/bin/ipkg-opt remove samba<br /> /opt/bin/ipkg-opt install samba2<br /> /opt/bin/ipkg-opt install xinetd<br /> <br /> '''Note about optware xinetd on dd-wrt:''' If you get a &quot;can't resolve symbol '__ctype_b_loc' &quot;error, means xinetd doesn't load the right lib from your environment setting. You could try: ''/opt/sbin/xinetd -d''. &lt;br&gt;The recommended approach is adding this line at the top of ''/opt/etc/init.d/S10xinetd'' to override the environment setting for xinetd :<br /> export LD_PRELOAD=/opt/lib/libuClibc-0.9.28.so<br /> <br /> Now run Xinetd and Samba<br /> <br /> /opt/etc/init.d/S10xinetd start<br /> /opt/etc/init.d/S80samba start<br /> <br /> Point your browser to http://192.168.1.1:901/ to administer samba.(Here xinetd start the SWAT when there's a request on port 901)&lt;br&gt;<br /> Installation of xinetd is optional and it is not required if <br /> one wants to manually edit /opt/etc/samba/smb.conf<br /> <br /> ==== Setting up smb.conf ====<br /> Setting the &quot;correct&quot; (read: usable) settings in the ''/opt/etc/samba/smb.conf'' file seems to be an art all to itself.<br /> <br /> Here is an example that some have found to work well:<br /> <br /> ## Samba config file created using Notepad++<br /> <br /> ## Global parameters<br /> [global]<br /> ##Change the following three lines as you see fit:<br /> server string = Samba Server<br /> workgroup = workgroup<br /> netbios name = DD-WRT <br /> <br /> ## without this line nmbd won't start and you won't be able to connect using the netbios name<br /> interfaces = 192.168.1.1/255.255.255.0<br /> <br /> ## The security setting seems importent for easy access from Windows <br /> security = SHARE<br /> <br /> ## The encrypt password seems importent for easy access from Mac OS X <br /> encrypt passwords = yes<br /> <br /> smb passwd file = /opt/etc/samba/smbpasswd <br /> null passwords = Yes <br /> # lanman auth = No<br /> # wins support = Yes<br /> # name resolve order = wins hosts lmhosts bcast <br /> <br /> # Setting code page info, seems to allow more of the european letters <br /> # in filenames to be correct. <br /> client code page = 850<br /> character set = ISO8859-1 <br /> <br /> ## The large sockets are usefull on gigabit ethernets<br /> # socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192<br /> <br /> # The logfile path should be adjusted to a better place, but this works out-of-the-box<br /> log file = /tmp/sambalog.%m<br /> #log file = /opt/var/samba/log.*<br /> <br /> max log size = 100<br /> load printers = No<br /> dns proxy = No<br /> hosts allow = 192.168. 127.<br /> <br /> ## Remote announce seems importent for easy access from Linux<br /> ## adjust to the broadcast IP of your LAN<br /> remote announce = 192.168.1.255<br /> <br /> [homes]<br /> comment = Home Directories<br /> read only = No<br /> browseable = No<br /> <br /> [printers]<br /> comment = All Printers<br /> path = /opt/var/spool/samba<br /> printable = Yes<br /> browseable = No<br /> <br /> [data]<br /> comment = Common user data space<br /> path = /mnt/data<br /> read only = No<br /> guest ok = Yes<br /> <br /> #[tmp]<br /> # comment = Temporary file space<br /> # path = /tmp<br /> # read only = No<br /> # guest ok = Yes<br /> <br /> #[jffs]<br /> # path = /jffs<br /> # read only = No<br /> # guest ok = Yes<br /> <br /> #[mmc]<br /> # path = /mmc<br /> # read only = No<br /> # guest ok = Yes<br /> ## The following options can be added to any of the shares if you like<br /> # force user = root<br /> # inherit permissions = Yes<br /> # inherit acls = Yes<br /> # status = Yes<br /> <br /> #[root]<br /> # path = /<br /> # read only = No<br /> # guest ok = Yes<br /> For the above smb.conf settings to work, you need to add <br /> grep -q nobody /etc/passwd || echo &quot;nobody:*:65534:65534:nobody:/var:/bin/false&quot; &gt;&gt; /etc/passwd<br /> to your startup script, or to the top of the ''/opt/etc/init.d/S80samba'' script<br /> <br /> <br /> You can read more about smb.conf [http://oreilly.com/catalog/samba/chapter/book/appb.pdf here] - especially interresting for speed optimizing<br /> <br /> You can read more about Code pages in Samba2 here: http://www.faqs.org/docs/samba/ch11.html<br /> <br /> If you prefere &quot;security=user&quot; settings, then the following settings in windows might still let you have access to your samba shares<br /> <br /> If you are using Vista/Windows 7 Beta, with the stock security settings of the OS, you won't be able to log in into Samba 2's share when your Samba 2 share mode set to USER. The issue is related to an incompatible authentication protocol that runs between Vista/Windows 7 Beta and Samba 2 (lot's of NAS running it). This can be overcome by editing the security settings in windows. See also [http://www.arkko.com/linux/vistanas.html Instructions for Using Windows Vista with a Network File Server (NAS)] Also, Samba 3 doesn't have this issue.<br /> # Goto Start &gt; Run<br /> # Type &quot;gpedit.msc&quot; and push enter.<br /> # Goto Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options. <br /> # Find Network Security: LAN Manager authentcation level<br /> # Change settings from: ''SendNTLMv2 response only'' to: ''Send LM &amp; NTLM - use NTLMv2 session security if negotiated''<br /> Or you can edit it directly using regedit:<br /> # start | run | regedit<br /> # Find the key KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa<br /> # Set LmCompatibilityLevel to 1<br /> <br /> ==== Adding user &quot;nobody&quot; to DD-WRT passwd file ====<br /> DD-WRT does not include user nobody at startup (user nobody is the Linux default for &quot;guest&quot;)<br /> <br /> This can be overcome with adding this at startup<br /> with ''/opt/etc/init.d/S80samba'' script like:<br /> #!/bin/sh<br /> [ -d /tmp/samba ] || mkdir /tmp/samba<br /> grep -q nobody /etc/passwd || echo &quot;nobody:*:65534:65534:nobody:/var:/bin/false&quot; &gt;&gt; /etc/passwd<br /> killall smbd<br /> killall nmbd<br /> /opt/sbin/nmbd -D<br /> /opt/sbin/smbd -D <br /> <br /> ==== Setup other users to use the Samba Share ====<br /> '''[http://www.comptechdoc.org/os/linux/manual4/sambausers.html Adding users to samba]'''<br /> ''The username need to be already in your /tmp/etc/passwd.'' And need to use the tool /opt/bin/smbpasswd to add that user into the Samba password file which by default is /opt/etc/samba/smbpasswd (configured in smb.conf). For example, add user root will be:<br /> &lt;pre&gt;/opt/bin/smbpasswd -a root&lt;/pre&gt;<br /> <br /> ==== Check the Samba log files ====<br /> Try to look at the log files created by Samba, and check what happens. <br /> * Default location of log files are: /opt/var/samba/log.*<br /> :: use command: ''ls /opt/var/samba/log.*'' - to see names of all log files<br /> :: use command: ''cat /opt/var/log/samba/log.nmbd'' - to have one log file displayed<br /> :: use command: ''cat /opt/var/log/samba/log.nmbd | more'' - to have one log file displayed, one page at a time<br /> :: use command: ''vi /opt/var/log/samba/log.nmbd'' - to use vi editor be able to move curser up and down through the log file. <br /> :::Type: '':q!'' to exit vi editor<br /> <br /> * Other location of log files can be specified in smb.conf <br /> :: in section ''[global]'' <br /> :: use line: ''log file = /tmp/sambalog.%m''<br /> <br /> * Default location of smb.conf file is: ''/opt/etc/samba/smb.conf''<br /> :: use command: ''cat /opt/etc/samba/smb.conf | grep 'log file' '' - to see if special log path is specified in smb.conf<br /> <br /> ==== Protect your FLASH memory ====<br /> A long term problem that could happen when running samba on FLASH memory like jffs, mmc or USB stick is<br /> FLASH wear. Such use could destroy FLASH if log files and browsing databases are constantly updated. Use of /tmp partition is recommended for such use. Amend startup script with:<br /> echo &quot;Starting smbd:&quot;<br /> if [ ! -d /tmp/samba ]; then<br /> mkdir /tmp/samba<br /> mkdir /tmp/samba/log<br /> rm -rf /opt/var/log/samba<br /> ln -s /tmp/samba/log /opt/var/log/samba<br /> rm -rf /opt/var/samba<br /> ln -s /tmp/samba /opt/var/samba<br /> fi<br /> <br /> or <br /> <br /> if you have the line ''[ -d /tmp/samba ] || mkdir /tmp/samba'' in your samba start script, then simply add ''log file = /tmp/samba/sambalog.%m'' to ''smb.conf'' under [global], like:<br /> [global]<br /> log file = /tmp/samba/sambalog.%m<br /> <br /> == Running at startup ==<br /> With dd-wrt.V24 the difference between system and OpenWRT Whiterussian R6 uClibc is so big, that running even simple programs causes segmentation fault. Optware also uses its own uClibc that resides in /opt/lib but all programs have built-in rpath to /opt/lib. This means that it is simpler to use Optware packages under DD-WRT than OpenWRT packages.<br /> <br /> DD-WRT provides user startup files in /jffs/etc/config . To create optware startup<br /> file do<br /> ~ # mkdir /jffs/etc<br /> ~ # mkdir /jffs/etc/config<br /> ~ # vi /jffs/etc/config/optware.startup<br /> with the following contents<br /> <br /> #!/bin/sh<br /> <br /> mount -o bind /jffs/opt /opt<br /> <br /> unset LD_LIBRARY_PATH<br /> unset LD_PRELOAD<br /> <br /> [ -e /opt/etc/profile ] &amp;&amp; mount -o bind /opt/etc/profile /etc/profile<br /> <br /> if [ -d /opt/etc/init.d ]; then<br /> for f in /opt/etc/init.d/S* ; do<br /> [ -x $f ] &amp;&amp; $f start<br /> done<br /> fi <br /> <br /> and mark it as executable with<br /> ~ # chmod +x /jffs/etc/config/optware.startup<br /> After reboot this file will be executed. I recommed first trying it manually<br /> ~ # /jffs/etc/config/optware.startup<br /> <br /> Creating /opt/etc/profile with the following contents <br /> export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin<br /> export PS1='\u@\h:\w\$ '<br /> <br /> [ -x /opt/bin/less ] || alias less=more<br /> [ -x /opt/bin/vim ] || alias vim=vi<br /> <br /> <br /> arp() { cat /proc/net/arp; }<br /> ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }<br /> reboot() { killall nmbd<br /> killall smbd<br /> killall xinetd<br /> killall thttpd<br /> sleep 1<br /> umount /opt<br /> /sbin/reboot <br /> }<br /> <br /> is also recommended as this will unset LD_LIBRARY_PATH provided by <br /> stock /etc/profile<br /> <br /> Although ext3 filesystem uses journaling that prevents major corruption and faster recover during crash, it is recommended that one writes its shutdown scrtipt as alias for /etc/profile that kills all optware daemons, umounts filesystems and then issue /sbin/reboot. This is what we call ''clean shutdown''.<br /> <br /> '''Note:''' as of EKO svn11218 (dec 2008) it is no longer necessary to add to path or profile. As the mentioned changes are already added to the default path and profile. &lt;br&gt;<br /> For your scripts it may however still be beneficial to adjust LD_LIBRARY_PATH and PATH, as [[Optware#Startup_for_external_USB_Disk|Startup for external USB Disk]] example shows below.<br /> <br /> For more Startup options with dd-wrt see: [[Startup Scripts]] and [[Script Execution]]<br /> <br /> === Startup for external USB Disk ===<br /> The following script is recommended when using external USB hard disk. The main feature of this script is prevention of disk corruption and automatic replacement. <br /> <br /> It also shows how LD_LIBRARY_PATH can be used to compensate uClibc incompatibility between dd-wrt /lib and OpenWRT /jffs/lib . <br /> <br /> The following script relies on two OpenWRT packages just to provide filesystem checking and enabling swap at startup. Besides reguired USB kernel modules, two disk related packages were installed: e2fsprogs and swap-utils. All others packages could be used from Optware.<br /> <br /> #!/bin/sh<br /> # /jffs/etc/config/optware.startup script for USB disk support<br /> # Recommended ext3 partitions:<br /> # /dev/discs/disc0/part1 for /opt 1GB<br /> # /dev/discs/disc0/part2 for swap 512MB<br /> # /dev/discs/disc0/part3 /mmc for user files aka MultiMediaCenter<br /> # Tune partition checks to max 10 counts disregarding last check time<br /> # tune2fs -i 0 -c 10 /dev/discs/disc0/part1 <br /> # tune2fs -i 0 -c 10 /dev/discs/disc0/part3<br /> # Required OpenWrt packages: /bin/ipkg install swap-utils e2fsprogs <br /> ( <br /> unset LD_PRELOAD <br /> export PATH=/bin:/usr/bin:/sbin:/usr/sbin<br /> export LD_LIBRARY_PATH=/lib:/usr/lib<br /> <br /> echo &quot;Inserting modules for USB disk support...&quot;<br /> insmod /jffs/lib/modules/2.4.30/usbcore.o <br /> insmod /jffs/lib/modules/2.4.30/ehci-hcd.o<br /> insmod /jffs/lib/modules/2.4.30/scsi_mod.o <br /> insmod /jffs/lib/modules/2.4.30/usb-storage.o<br /> insmod /jffs/lib/modules/2.4.30/sd_mod.o<br /> insmod /jffs/lib/modules/2.4.30/jbd.o <br /> insmod /jffs/lib/modules/2.4.30/ext3.o<br /> <br /> <br /> echo &quot;Waiting for modules to initialize disk access...&quot;<br /> sleep 20<br /> <br /> # assure correct paths when running OpenWRT programs like e2fsck<br /> export LD_LIBRARY_PATH=/jffs/lib:/jffs/usr/lib <br /> export PATH=/jffs/bin:/jffs/sbin:/jffs/usr/sbin:/jffs/usr/bin:/bin:/sbin<br /> <br /> echo &quot;Activating swap...&quot; <br /> swapon /dev/discs/disc0/part2<br /> <br /> echo &quot;Checking optware partition...&quot;<br /> e2fsck -p /dev/discs/disc0/part1<br /> <br /> echo &quot;Checking user-data partition&quot;<br /> e2fsck -p /dev/discs/disc0/part3<br /> <br /> echo &quot;Mountint disk partitions...&quot; <br /> export LD_LIBRARY_PATH=/lib:/usr/lib <br /> mount -t ext3 -o noatime /dev/discs/disc0/part1 /opt<br /> mount -t ext3 -o noatime /dev/discs/disc0/part3 /mmc<br /> <br /> if [ -e /opt/etc/profile ]; then<br /> cp /opt/etc/profile /tmp <br /> mount -o bind /tmp/profile /etc/profile<br /> fi<br /> <br /> # provide Optware search paths<br /> unset LD_LIBRARY_PATH <br /> export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/sbin:/usr/bin<br /> <br /> echo &quot;Starting Optware programs...&quot;<br /> if [ -d /opt/etc/init.d ]; then <br /> for f in /opt/etc/init.d/S* ; do<br /> [ -x $f ] &amp;&amp; $f start<br /> done<br /> fi <br /> ) &gt; /tmp/optware.log 2&gt;&amp;1<br /> <br /> Forcing filesystem recheck on next boot could be marked with<br /> tune2fs -C 100 /dev/discs/disc0/part1<br /> <br /> == Known bugs ==<br /> === ngrep doesn't work ===<br /> ngrep is compiled with IPV6 support and ddwrt doesn't provide IPV6 support.<br /> <br /> If ngrep is recompiled without IPV6 support, it works ok after adding the nobody user to /etc/passwd<br /> <br /> # grep nobody /etc/passwd <br /> nobody:x:99:99:Nobody:/:<br /> <br /> == Optware on CIFS - Partition in a file ==<br /> [added by --[[User:omegadraconis|omegadraconis]] 02 August 2010&lt;br&gt;<br /> I just took a note from the jffs mount and decided to use mount bind:&lt;br&gt;<br /> &lt;code&gt; mount -o bind /cifs1/Router /opt&lt;/code&gt;<br /> <br /> I am sure there are reasons I should not do it this way but, I couldn't find any and I didn't have to load a bunch of kmods.<br /> <br /> <br /> [added by --[[User:gruad23|gruad23]] 27 June 2010&lt;br&gt;<br /> I prefer using a cifs-share itself as /opt and install optware as to the way Azuretech describes using a loop-mounted ext2-container on the cifs-share. I described the way I did it on [[http://www.goldfisch.at/knowwiki/howtos/optware_on_cifs knowwiki:optware_on_cifs]] <br /> <br /> [added by --[[User:Azuretech|Azuretech]] 19:14, 20 February 2009 (CET)]&lt;br&gt;<br /> I have successfully used a SMB share for /opt, well, actually used a CIFS share, but the technique is the same, regardless. The trick is to create an ext2 partition inside of a file on the CIFS/SMB share, and mount that using the loop device. I have this working on v24. The technique is as follows:<br /> <br /> Update: I discovered since I went to a mega build that this no longer works, because of lack of JFFS on some mega builds. Not to worry, here is a fix for this little problem. First disable JFFS in the GUI on DD-WRT, since it doesn't work anyways, and you can't mount it elsewhere if its active. After mounting a CIFS share, simply create a subdirectory in the CIFS share called jffs then:<br /> <br /> &lt;code&gt;mount --bind /tmp/smbshare/jffs /jffs<br /> nvram set sys_enable_jffs2=1<br /> mkdir -p /jffs/tmp/ipkg<br /> ipkg update&lt;/code&gt; <br /> <br /> First, you must have a successfully mounted SMB or CIFS share.<br /> <br /> After that, you'll have to install two necessary packages.<br /> This is done in two ways, depending on your kernel version.<br /> <br /> '''K2.4'''<br /> <br /> If you are running '''K2.4''', you should use the ipkg way.<br /> &lt;code&gt;ipkg install kmod-loop<br /> ipkg install kmod-ext2&lt;/code&gt;<br /> '''ipkg''' should insert the modules automatically, but just to be sure execute the following commands:<br /> &lt;code&gt;insmod /jffs/lib/modules/2.4.30/loop.o<br /> insmod /jffs/lib/modules/2.4.30/ext2.o&lt;/code&gt;<br /> <br /> '''K2.6'''<br /> <br /> Users running '''Eko K2.6''' have to install the modules manually using the files below (the kernel module extension starting from v2.6 is ''.ko'').<br /> <br /> * [ftp://ftp.dd-wrt.com/others/eko/Public/modules/2.6.24.111/ext2.ko Ext2 (ext2.ko)]<br /> * [http://www.sendspace.com/file/t1eaa2 Loop (loop.ko)]<br /> The modules should be loaded like this:<br /> &lt;code&gt;insmod /jffs/lib/modules/2.6.24.111/loop.ko<br /> insmod /jffs/lib/modules/2.6.24.111/ext2.ko&lt;/code&gt;<br /> <br /> <br /> ----<br /> <br /> <br /> <br /> After loading the modules, create a container file on your cifs share, in my case I'm creating a 10MB file below.<br /> <br /> &lt;code&gt;dd if=/dev/zero of=/tmp/smbshare/opt.ext2 bs=1 count=1 seek=10M&lt;/code&gt;<br /> <br /> Now we need to format the empty file as an ext2 file system<br /> <br /> &lt;code&gt;echo y | mke2fs -L optware /tmp/smbshare/opt.ext2&lt;/code&gt; <br /> <br /> Now that the file is formatted, all we need to do is mount the file:<br /> <br /> &lt;code&gt;mount -o loop /tmp/smbshare/opt.ext2 /opt&lt;/code&gt;<br /> <br /> then get the optware install script:<br /> <br /> &lt;code&gt;&lt;nowiki&gt;wget http://www.3iii.dk/linux/optware/optware-install-ddwrt.sh -O - | tr -d '\r' &gt; /tmp/optware-install.sh&lt;/nowiki&gt;&lt;/code&gt;<br /> <br /> and install it:<br /> <br /> &lt;code&gt;sh /tmp/optware-install.sh&lt;/code&gt;<br /> <br /> And there you have it, optware is installed onto your CIFS or SMB directory.<br /> <br /> Now that this part is complete, so long as you don't wipe your /jffs directory, you won't need to re-complete this every time you boot, since optware is stored safely on your CIFS file system, I simply added the following to a startup script in my CIFS share that will execute once the CIFS share is mounted.<br /> <br /> Copy the appropriate lines for your kernel version.<br /> <br /> '''K2.4'''<br /> <br /> &lt;code&gt;insmod /jffs/lib/modules/2.4.30/loop.o<br /> insmod /jffs/lib/modules/2.4.30/ext2.o<br /> mount -o loop /tmp/smbshare/opt.ext2 /opt&lt;/code&gt;<br /> <br /> '''K2.6'''<br /> <br /> &lt;code&gt;insmod /jffs/lib/modules/2.6.24.111/loop.ko<br /> insmod /jffs/lib/modules/2.6.24.111/ext2.ko<br /> mount -o loop /tmp/smbshare/opt.ext2 /opt&lt;/code&gt;<br /> <br /> <br /> ----<br /> <br /> <br /> And now that you can run all those cool optware apps, you're going to want a swapfile so you don't run out of memory.... This is a bit tricky... You can just create a swap file on the SMB share, swapon will protest, you need to create and mount an ext2 file on the SMB share, and then create the swapfile on that. Here's the sequence I followed on the BS mega builds:<br /> <br /> &lt;code&gt;ipkg install swap-utils<br /> dd if=/dev/zero of=/tmp/smbshare/swap.ext2 bs=1 count=1 seek=64M<br /> echo y | mke2fs -L swap /tmp/smbshare/swap.ext2<br /> mkdir /tmp/swap<br /> mount -o loop /tmp/smbshare/swap.ext2 /tmp/swap<br /> dd if=/dev/zero of=/tmp/swap/swapfile bs=1024 count=65536 &lt;/code&gt;notice this is a bit different 1024x64<br /> &lt;code&gt;mkswap /tmp/swap/swapfile<br /> chmod og=rw /tmp/swap/swapfile &lt;/code&gt;not sure if this is absolutely necessary, but just to be safe<br /> &lt;code&gt;swapon -p1 /tmp/swap/swapfile&lt;/code&gt;<br /> <br /> Once this is done, you just need to add to the end of that CIFS startup script above the following:<br /> <br /> &lt;code&gt;mkdir /tmp/swap<br /> mount -o loop /tmp/smbshare/swap.ext2 /tmp/swap<br /> /jffs/usr/sbin/swapon -p1 /tmp/swap/swapfile&lt;/code&gt;<br /> <br /> So now your swap file will automatically be enabled shortly after boot up. To make sure your swap file is working just issue &lt;code&gt;swapon -s&lt;/code&gt; you should get something like this back:<br /> <br /> &lt;code&gt;Filename Type Size Used Priority&lt;br&gt;<br /> /tmp/swap/swapfile file 65536 0 1&lt;/code&gt;<br /> <br /> UPDATE: Now, I have discovered that aparantly, some builds are not compiled with swap support, and so even though you install the swap-utils package, you get a response of &quot;can't resolve symbol 'swapon'&quot; when you try to activate the swap file with the swapon command. If this should happen to you, you can resolve this by instead of installing the swap-utils package, install the optware busybox package with &lt;code&gt; /opt/bin/ipkg-opt install busybox&lt;/code&gt; then calling swapon as &lt;code&gt;/opt/sbin/swapon /tmp/swap/swapfile&lt;/code&gt; So, the correct sequence to follow in this case is:<br /> <br /> First, make sure you've followed the directions above to install Optware, then:<br /> <br /> &lt;code&gt;/opt/ipkg-opt install busybox<br /> dd if=/dev/zero of=/tmp/smbshare/swap.ext2 bs=1 count=1 seek=64M<br /> echo y | mke2fs -L swap /tmp/smbshare/swap.ext2<br /> mkdir /tmp/swap<br /> mount -o loop /tmp/smbshare/swap.ext2 /tmp/swap<br /> dd if=/dev/zero of=/tmp/swap/swapfile bs=1024 count=65536<br /> /opt/sbin/mkswap /tmp/swap/swapfile<br /> chmod og=rw /tmp/swap/swapfile <br /> /opt/sbin/swapon /tmp/swap/swapfile&lt;/code&gt;<br /> <br /> Special thanks to whoever the contributor of the information at http://forum.x-wrt.org/index.php?topic=428.0;wap2 is, as it was incredibly helpful in figuring out how to accomplish this.<br /> <br /> --[[User:Azuretech|Azuretech]] 06:49, 29 August 2009 (CEST)<br /> <br /> For some reason I had problems creating the '''swap.ext2''' and '''swapfile''' files using the commands above on my router. Instead, I created them on another computer running Linux and then copied them to the router.<br /> <br /> On the Linux PC:<br /> <br /> &lt;code&gt;dd if=/dev/zero of=swap.ext2 bs=1024 count=8192 (8MB swap partition)<br /> scp swap.ext2 root@dd-wrt:/tmp/smbshare&lt;/code&gt;<br /> <br /> Mount it on the router:<br /> <br /> &lt;code&gt;echo y | mke2fs -L swap /tmp/smbshare/swap.ext2<br /> mkdir /tmp/swap<br /> mount -o loop /tmp/smbshare/swap.ext2 /tmp/swap<br /> df (note the reported size of /tmp/swap)&lt;/code&gt;<br /> <br /> Create the swapfile on the Linux computer:<br /> <br /> &lt;code&gt;dd if=/dev/zero of=swapfile bs=1024 count=7509 (no larger than what df showed!)<br /> scp swapfile root@dd-wrt:/tmp/swap&lt;/code&gt;<br /> <br /> Finally, enable swap on the router:<br /> <br /> &lt;code&gt;/opt/sbin/mkswap /tmp/swap/swapfile<br /> chmod og=rw /tmp/swap/swapfile<br /> /opt/sbin/swapon /tmp/swap/swapfile<br /> free (verify swap space is now available)&lt;/code&gt;<br /> <br /> Also see [http://www.dd-wrt.com/wiki/index.php/Linux_SWAP Linux SWAP].<br /> <br /> --[[User:Disk Crasher|Disk Crasher]] 02:44, 29 October 2009 (CET)<br /> <br /> == Remarks ==<br /> * DD-WRT provided /bin/ipkg is not full feature ipkg but it can do the job for installing ipkg-opt. It could also be used for installing other packages, but this is not recommended any more.<br /> * DD-WRT kernel lacks many &quot;server&quot; features like NFS, NBD support, ... Provided samba, mysql, thttp-php and other applications can do the job if enough space is provided. This means that external storage is required for memory hungry applications. Experience from nslu2 and Oleg firmware showed that 512MB swap space is recommended if external USB hard disk is available. See [[USB]] page for instructions how to initialize USB kernel modules and harddisk.<br /> * Do not use VFAT filesystem for /opt. Use ext2 or ext3 instead. Alternatively one can use loop device to mount filesystem in file that resides on VFAT. See http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild for example on doing this on USB stick.<br /> * Optware for DD-WRT is beta-stage feature (as of 2006). Report problems and suggestions in [http://www.dd-wrt.com/phpBB2/ DD-WRT forum] under [http://www.dd-wrt.com/phpBB2/viewtopic.php?t=2189 Optware].<br /> * For instuctions on some other packages look at http://www.nslu2-linux.org/wiki/Unslung/Packages<br /> * Optware [http://trac.nslu2-linux.org/optware package tracking] and repository access<br /> * There is also posibility to install Optware packages under Oleg, X-wrt or OpenWRT Whiterussian firmware. See instructions on http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild<br /> ------<br /> [[User:Oleo|Oleo]]<br /> <br /> [[Category:Optware| ]]</div> Mon, 20 Sep 2010 07:50:08 GMT Leangjia http://wiki.dd-wrt.com/wiki/index.php/Talk:Optware/zh_cn