Entware Installation on DD-WRT: Difference between revisions
No edit summary |
No edit summary |
||
Line 22: | Line 22: | ||
*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. 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 versions of BASH and BusyBox (Google them) running when one connects into a router via the command line. | *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. 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 versions of BASH and BusyBox (Google them) running when one connects into a router via the command line. | ||
*Solution for the above mentioned problem? Create a file in the /opt Directory named ModifiedProfile (or anything you want) and | *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.<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 | ||
export LD_LIBRARY_PATH=/opt/lib:/opt/usr/lib:/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/jffs/usr/local/lib:/mmc/lib:/mmc/usr/lib | export LD_LIBRARY_PATH=/opt/lib:/opt/usr/lib:/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/jffs/usr/local/lib:/mmc/lib:/mmc/usr/lib | ||
Line 66: | Line 66: | ||
===Other Thoughts=== | ===Other Thoughts=== | ||
If you're like me and working from Windows and also like to take advantage of all those nice little GUI perks like network file sharing (SAMBA in the linux) world, there's one thing (well, lots, but just pointing out one here) to watch out for. Do not create a script file in Windows via a shared network directory on the router and expect it to run as a bash login script. It won't work. Also there are differences in text files including 'carriage return / line feed' in Windows and just 'line feed' in Linux among several others that will prevent the Linux OS from "reading" the script file properly, so don't edit in notepad. Once the file is created in Linux (or copied from another Linux OS) editors like TextPad work great. | |||
Even though it never seems to be explicitly stated, NVRAM and JFFS sizes are determined by the hardware's capabilities and set in the firmware. Both NVRAM (where startup scripts and commands are stored) and JFFS content are stored on the flash chips inside the router. But what if I don't want to use JFFS and want to increase available NVRAM. I haven't found a way to decrease the amount of flash memory allocated or reserved for to / for JFFS (even if it isn't utilized) and reallocate it to NVRAM. Both are stored on the flash chips in the router, so this is completely valid thought from a technical perspective. However, because the size of each storage area seems to be hard coded in the firmware (which I sort of confirmed by researching and finding anecdotal comments that implied these limits are set in firmware, but nothing explicit), one is SOL if one wants to change the settings. For my WZR-600DHP router, there is 64 KB of NVRAM and just under 20 MB of JFFS storage space available. 64K of storage is all of the RAM my Commodore 64K had. It seemed like so much then, and thinking about it now, they really made efficient use of that small amount of RAM (large in those days). Ah, the good 'ole days, but I digress. | Even though it never seems to be explicitly stated, NVRAM and JFFS sizes are determined by the hardware's capabilities and set in the firmware. Both NVRAM (where startup scripts and commands are stored) and JFFS content are stored on the flash chips inside the router. But what if I don't want to use JFFS and want to increase available NVRAM. I haven't found a way to decrease the amount of flash memory allocated or reserved for to / for JFFS (even if it isn't utilized) and reallocate it to NVRAM. Both are stored on the flash chips in the router, so this is completely valid thought from a technical perspective. However, because the size of each storage area seems to be hard coded in the firmware (which I sort of confirmed by researching and finding anecdotal comments that implied these limits are set in firmware, but nothing explicit), one is SOL if one wants to change the settings. For my WZR-600DHP router, there is 64 KB of NVRAM and just under 20 MB of JFFS storage space available. 64K of storage is all of the RAM my Commodore 64K had. It seemed like so much then, and thinking about it now, they really made efficient use of that small amount of RAM (large in those days). Ah, the good 'ole days, but I digress. | ||