Entware Installation on DD-WRT: Difference between revisions

No edit summary
No edit summary
Line 24: Line 24:
*Run the script: ./generic.sh (it should download all of the necessary files and install it in the /opt directory (which is your disk or flash drive).  Be patient as it might take a couple of minutes, depending on your router's CPU speed, to unpack everything and install it.
*Run the script: ./generic.sh (it should download all of the necessary files and install it in the /opt directory (which is your disk or flash drive).  Be patient as it might take a couple of minutes, depending on your router's CPU speed, to unpack everything and install it.
*And now it works.  NOT!  One of the final output lines of the installation script says something like "Congratulations...", but before that is are a couple of lines about changing or adding to the $PATH variable.  If you check the $PATH variable after installation it will show that the "/opt paths" where Entware is installed are in the path.  But there's a problem.  They're at the end of the path which means any binaries or programs that are included with the DD-WRT firmware will be used before the Entware versions.  The result is that stuff just doesn't work from the command line properly.  Even changing the $PATH variable with: export PATH=/opt/bin:/opt/sbin:/opt/usr/sbin:/opt/usr/bin will not help the situation after a reboot.  Simply setting the $PATH variable in a startup script via the GUI won't help either in terms of issuing Entware commands at the command line.  WTF!?  It has to do with the "profile" variable (DD-WRT default path: /etc/profile).
*And now it works.  NOT!  One of the final output lines of the installation script says something like "Congratulations...", but before that is are a couple of lines about changing or adding to the $PATH variable.  If you check the $PATH variable after installation it will show that the "/opt paths" where Entware is installed are in the path.  But there's a problem.  They're at the end of the path which means any binaries or programs that are included with the DD-WRT firmware will be used before the Entware versions.  The result is that stuff just doesn't work from the command line properly.  Even changing the $PATH variable with: export PATH=/opt/bin:/opt/sbin:/opt/usr/sbin:/opt/usr/bin will not help the situation after a reboot.  Simply setting the $PATH variable in a startup script via the GUI won't help either in terms of issuing Entware commands at the command line.  WTF!?  It has to do with the "profile" variable (DD-WRT default path: /etc/profile).
*Solution for the above mentioned problem? Create a file in the /opt Directory named ModifiedProfile (or anything you want) using VI (and copy and paste the below code) or copy an existing script file, then edit the contents (erase original contents and paste the below code) and save it.  I share the /opt directory, access it via Windows, and edit it with TextPad.  But do NOT create a script file via a Windows share (see Other Thoughts below), because it won't work with BASH.
*Solution for the above mentioned problem? Create a file in the /opt Directory named ModifiedProfile (or any other name you want) using VI (and copy and paste the below code) or copy an existing script file, then edit the contents (erase original contents and paste the below code) and save it.  I share the /opt directory, access it via Windows, and edit it with TextPad.  But do NOT create a script file via a Windows share (see Other Thoughts below), because it won't work with BASH.
<syntaxhighlight>
<syntaxhighlight>
export PATH=/opt/bin:/opt/sbin:/opt/usr/sbin:/opt/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin
export PATH=/opt/bin:/opt/sbin:/opt/usr/sbin:/opt/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin
Line 57: Line 57:
}
}
</syntaxhighlight>
</syntaxhighlight>
The above script does three things.  The top several lines set environment variables.  The reboot and service subroutines can be used as commands at the command prompt.  The reboot subroutine gracefully shuts down any Entware services and the Service subroutine controls services installed by Entware


*Next, save the following as a StartUp Script
*Next, save the following as a StartUp Script
Line 64: Line 65:
/opt/etc/init.d/rc.unslung start
/opt/etc/init.d/rc.unslung start
</syntaxhighlight>I know I said I wouldn't explain things, but it needs to be said for the above short script.  The mount command effectively replaces the DD-WRT version of the profile file (this is the BASH login script for users).  The rc.unslung start command is what the Entware installation script said to add to the Startup Script.  RC.UNSLUNG starts all the installed services for Entware.
</syntaxhighlight>I know I said I wouldn't explain things, but it needs to be said for the above short script.  The mount command effectively replaces the DD-WRT version of the profile file (this is the BASH login script for users).  The rc.unslung start command is what the Entware installation script said to add to the Startup Script.  RC.UNSLUNG starts all the installed services for Entware.
=== BusyBox ===


*The first useful item to install is an updated version of BusyBox (Google it).  Use the below commands<syntaxhighlight lang="abap">
*The first useful item to install is an updated version of BusyBox (Google it).  Use the below commands<syntaxhighlight lang="abap">
opkg update
opkg update
opkg install busybox
opkg install busybox
</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.  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.
 
=== Other Really Useful Basic Command Additions ===
<syntaxhighlight lang="abap">
opkg install coreutils-dir
opkg install kmod
</syntaxhighlight>The coreutils-dir


*
*