Difference between revisions of "Entware Installation on DD-WRT"

Line 73: Line 73:
</syntaxhighlight>One thing to keep in mind is that when a user logs in, the DD-WRT version of BusyBox is what starts things off, so it will report a different version than what Entware installs and is actively running.  Just type: busybox  That will display the version of BusyBox currently running.
</syntaxhighlight>One thing to keep in mind is that when a user logs in, the DD-WRT version of BusyBox is what starts things off, so it will report a different version than what Entware installs and is actively running.  Just type: busybox  That will display the version of BusyBox currently running.


=== OPKG Note ===
===OPKG Note===
Unlike yum, the OPKG command doesn't seem to allow one to install packages by using a wildcard.  For instance, if one wanted to install all the PERL packages, this won't work: opkg install perl*  But [https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-a-package-using-opkg-from-a-piped-search-result-4175580790/ someone] wrote this cool little script;<syntaxhighlight lang="abap">
Unlike yum, the OPKG command doesn't seem to allow one to install packages by using a wildcard.  For instance, if one wanted to install all the PERL packages, this won't work: opkg install perl*  But [https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-a-package-using-opkg-from-a-piped-search-result-4175580790/ someone] wrote this cool little script;<syntaxhighlight lang="abap">
opkg list | grep WhatEverNamePackagesBeginWith| awk '{print $1}' | xargs opkg install
opkg list | grep WhatEverNamePackagesBeginWith| awk '{print $1}' | xargs opkg install
Line 79: Line 79:


===Other Really Useful Basic Command Additions===
===Other Really Useful Basic Command Additions===
<syntaxhighlight lang="abap">
Sometimes it's nice to type DIR instead of using the LS command, so install coreutils-dir.  For an enhanced version of lsmod, kmod.  For a text editor that makes way more sense than VI, nano.  And for an enhanced version of TOP that's essentially equivalent to a text version of Task Manager in Windows, htop. <syntaxhighlight lang="abap">
opkg install coreutils-dir
opkg install coreutils-dir
opkg install kmod
opkg install kmod
opkg install nano
opkg install htop
</syntaxhighlight>Remember, DD-WRT is designed to fit into limited storage space on routers.  The key word here is 'limited'.  But with a USB Drive, space isn't so much of an issue, so why not install the full version of all utilities that come with BusyBox and DD-WRT? <syntaxhighlight lang="abap">
</syntaxhighlight>Remember, DD-WRT is designed to fit into limited storage space on routers.  The key word here is 'limited'.  But with a USB Drive, space isn't so much of an issue, so why not install the full version of all utilities that come with BusyBox and DD-WRT? <syntaxhighlight lang="abap">
opkg list | grep coreutils- | awk '{print $1}' | xargs opkg install
opkg list | grep coreutils- | awk '{print $1}' | xargs opkg install
</syntaxhighlight>
</syntaxhighlight>
=== What about Virtual RAM (AKA, Swap, PageFile, etc.)? ===
There's usually a limited amount of RAM available in a small router, so if you're using it for any intense stuff like OpenVPN and SOCKS, it will use the RAM up fast.  If it gets used up the router generally just reboots, and the cycle starts again.
The starting point for creating a swap file is the following command which creates a file filled with "zeros" that is 64K (65536 bytes) big, 1024 bytes at a time;<syntaxhighlight lang="abap">
dd if=/dev/zero of=/tmp/mnt/sda_part2/SwapFile bs=1024 count=65536
</syntaxhighlight>Next, install the necessary software;<syntaxhighlight>
opkg install swap-utils
</syntaxhighlight>The following command "formats" / prepares the RAW / Blank file as a swap file with the label SwapFile and the 'swap program' recommends the permissions be changed too;<syntaxhighlight lang="abap">
mkswap /tmp/mnt/sda_part2/SwapFile --label SwapFile
chmod 600 /tmp/mnt/sda_part2/SwapFile
</syntaxhighlight>And finally, add the following command to your Startup Script (use the swapoff command if you want to turn the swap file off);<syntaxhighlight lang="abap">
/tmp/mnt/sda_part2/sbin/swapon /tmp/mnt/sda_part2/SwapFile
</syntaxhighlight>All of the above paths are the ones in my environment, adjust them to suit yours.
To check the swap file, HTOP displays used / available swap file space.  Oh, and don't be misled by HTOP indicating the swap file is "OK" (oh kay).  It's actually displaying 0K (zero kay).  So if you see OK displayed by HTOP, the swap file isn't working.
Note, this creates a swap file, not a swap partition.  There are other tutorials on that (Google it).  In terms of speed, I haven't read anything about there being an advantage to one or the other on a flash drive.  On a mechanical disk drive, if a swap partition is created at the beginning / inner part of the disk, it will perform faster (although there are some arguments that point out the middle of the disk is the best compromise).  However, more than likely speed will be limited by the USB bus, flash, or disk drive speed. 


*
*