Noob-Friendly Customized install.sh for compiling from source

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 00:56, 15 July 2007 (edit)
RvrS2a (Talk | contribs)
m
← Previous diff
Current revision (06:09, 1 May 2010) (edit) (undo)
Glenn (Talk | contribs)
(catchg)
 
(6 intermediate revisions not shown.)
Line 1: Line 1:
-[http://wc1.worldcrossing.com/WebX/.1de60a04 free sonyericsson ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=115 phentermine online] [http://library.cshl.edu/wp/vb/member.php?u=1387 alltel ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a05 sprint ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=167 clonazepam online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30283 didrex online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=157 ultram online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=230 verizon ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30309 celexa online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=348 cheap norco] [http://wc1.worldcrossing.com/WebX/.1de60a11 diethylpropion online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=188 cheap tenuate] [http://news.engin.brown.edu/forums/thread-view.asp?tid=212 verizon ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30308 lipitor online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=82 diazepam online] [http://library.cshl.edu/wp/vb/member.php?u=1380 free verizon ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=163 adipex online] [http://students.hsc.unt.edu/housing/item.cfm?type=2859 meridia online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=209 samsung ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=170 free cingular ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=78 clomid] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30298 lisinopril online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=74 carisoprodol online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=352 paxil online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=227 ericsson ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1386 free mono ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=69 cheap albuterol] [http://wc1.worldcrossing.com/WebX/.1de60a12 free ericsson ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=171 order ambien] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=188 levitra online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=83 didrex online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30358 midi ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2879 clomid online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=186 lipitor online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=215 sagem ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=346 meridia online] [http://students.hsc.unt.edu/housing/item.cfm?type=2923 sony ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30237 cheap valium] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=171 clomid online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=184 hoodia] [http://wc1.worldcrossing.com/WebX/.1de60a1b music ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30264 hydrocodone] [http://wc1.worldcrossing.com/WebX/.1de609db but adipex] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30321 cheap hgh] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=90 cheap hgh] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30263 order levitra] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=133 tracfone ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=226 free sony ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=117 propecia online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=165 vicodin online] [http://library.cshl.edu/wp/vb/member.php?u=1340 cheap soma] [http://students.hsc.unt.edu/housing/item.cfm?type=2909 verizon ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30252 buy meridia] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=221 cheap vicodin] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30347 free verizon ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1354 cheap alprazolam] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30330 nokia ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2903 qwest ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a26 free sharp ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30348 polyphonic ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=345 cheap viagra] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=239 cheap sildenafil] [http://students.hsc.unt.edu/housing/item.cfm?type=2876 didrex online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=142 wellbutrin] [http://students.hsc.unt.edu/housing/item.cfm?type=2872 cyclobenzaprine] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30333 free funny ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a00 cheap rivotril] [http://library.cshl.edu/wp/vb/member.php?u=1356 order paxil] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30357 free sharp ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=123 free sagem ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30268 xenical online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=92 hydrocodone online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=100 cheap lortab] [http://students.hsc.unt.edu/housing/item.cfm?type=2850 cheap phentermine] [http://students.hsc.unt.edu/housing/item.cfm?type=2869 lorazepam online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=116 polyphonic ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1361 order xenical] [http://library.cshl.edu/wp/vb/member.php?u=1362 buy wellbutrin] [http://wc1.worldcrossing.com/WebX/.1de60a2b but ultracet] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=113 paxil online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30279 cheap ultracet] [http://news.engin.brown.edu/forums/thread-view.asp?tid=229 jazz ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2863 buy alprazolam] [http://wc1.worldcrossing.com/WebX/.1de609f4 mono ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1353 vicodin online] [http://students.hsc.unt.edu/housing/item.cfm?type=2880 cheap albuterol] [http://wc1.worldcrossing.com/WebX/.1de609eb free funny ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=181 free free ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2887 cheap pharmacy online] [http://library.cshl.edu/wp/vb/member.php?u=1364 nexium online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=222 cheap vigrx] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=166 ativan online] [http://library.cshl.edu/wp/vb/member.php?u=1381 polyphonic ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=180 flexeril online] [http://wc1.worldcrossing.com/WebX/.1de609fd punk ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=102 midi ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a2c ultram] [http://students.hsc.unt.edu/housing/item.cfm?type=2853 fioricet online] [http://students.hsc.unt.edu/housing/item.cfm?type=2899 free tracfone ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=185 hydrocodone online] [http://library.cshl.edu/wp/vb/member.php?u=1378 free sprint ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1350 meridia online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=152 cheap valium] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=208 cheap phentermine] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=349 cheap vicodin] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=77 free cingular ringtones] [http://wc1.worldcrossing.com/WebX/.1de60a0c buy wellbutrin] [http://students.hsc.unt.edu/housing/item.cfm?type=2860 adipex online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=223 free midi ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=126 sildenafil online] [http://library.cshl.edu/wp/vb/member.php?u=1383 free sagem ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=197 cheap flexeril] [http://students.hsc.unt.edu/housing/item.cfm?type=2898 free free ringtones] [http://wc1.worldcrossing.com/WebX/.1de609ff free real ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30336 qwest ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=343 cialis online] [http://students.hsc.unt.edu/housing/item.cfm?type=2924 ericsson ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=183 albuterol] [http://library.cshl.edu/wp/vb/member.php?u=1342 cheap phentermine] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=220 real ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2883 lipitor online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=203 free funny ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=73 cheap ativan] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=218 free qwest ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=202 tracfone ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=96 cheap levitra] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=105 free mp3 ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1375 free real ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30238 phentermine online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30355 free punk ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30349 cingular ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=199 free music ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2914 sony ericsson ringtones] [http://wc1.worldcrossing.com/WebX/.1de609e7 cheap diazepam] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30315 buy lortab] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=143 wwe ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2906 samsung ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=174 cyclobenzaprine online] [http://wc1.worldcrossing.com/WebX/.1de60a03 sony ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2857 ativan online] [http://wc1.worldcrossing.com/WebX/.1de60a2d valium online] [http://students.hsc.unt.edu/housing/item.cfm?type=2856 cheap cialis] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30242 fioricet online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=160 order adipex] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=232 sony ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2900 free funny ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2870 cheap xenical] [http://news.engin.brown.edu/forums/thread-view.asp?tid=150 tramadol online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30332 tracfone ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30354 free alltel ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=202 nokia ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=134 tramadol online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=167 carisoprodol online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30269 cheap wellbutrin] [http://students.hsc.unt.edu/housing/item.cfm?type=2893 hgh online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=219 cheap viagra] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30240 carisoprodol online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30316 vigrx online] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30351 free sonyericsson ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30350 sagem ringtones] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=332 order tramadol] [http://students.hsc.unt.edu/housing/item.cfm?type=2925 free mtv ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2915 mono ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30359 free wwe ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2849 cheap valium] [http://students.hsc.unt.edu/housing/item.cfm?type=2867 hydrocodone online] [http://wc1.worldcrossing.com/WebX/.1de60a16 levitra online] [http://library.cshl.edu/wp/vb/member.php?u=1379 free music ringtones] [http://students.hsc.unt.edu/housing/item.cfm?type=2919 free sharp ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30338 free motorola ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=174 wellbutrin online] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=84 diethylpropion online] [http://students.hsc.unt.edu/housing/item.cfm?type=2882 cheap zoloft] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=217 free punk ringtones] [http://news.engin.brown.edu/forums/thread-view.asp?tid=220 free punk ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=86 cheap fioricet] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=186 free jazz ringtones] [http://www.e.kth.se/cgi-bin/esekt/discussion?command=read&discussionid=4&id=30253 norco online] [http://students.hsc.unt.edu/housing/item.cfm?type=2920 midi ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=164 buy alprazolam] [http://students.hsc.unt.edu/housing/item.cfm?type=2884 cheap celexa] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=240 soma online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=347 adipex] [http://news.engin.brown.edu/forums/thread-view.asp?tid=180 prozac online] [http://www.psfc.mit.edu/~jinseok/bbse/view.php?id=presentations&no=353 online levitra] [http://wc1.worldcrossing.com/WebX/.1de60a33 prozac online] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=179 fioricet online] [http://students.hsc.unt.edu/housing/item.cfm?type=2926 free jazz ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1384 sonyericsson ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=213 cheap prozac] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=233 free sonyericsson ringtones] [http://wc1.worldcrossing.com/WebX/.1de609de cheap alprazolam] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=183 hgh online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=160 ativan online] [http://news.engin.brown.edu/forums/thread-view.asp?tid=217 free mono ringtones] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=226 cheap tramadol] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=148 cheap zyban] [http://itcweb.ecsu.edu/portal/forums.asp?ForumId=13&TopicId=225 free wwe ringtones] [http://library.cshl.edu/wp/vb/member.php?u=1385 sony ericsson ringtones] [http://www.ees.ufl.edu/alumni/forums.asp?ForumId=5&TopicId=108 cheap nexium] I have heavily modified the original install.sh so that it is more useful and flexible. This script is not 100% complete but it is functional and will simplify the initial process of compiling from source. Because it is still in development, I would recommend that you first follow the steps here [[Compiling DD-WRT Sources]] to lay out the necessary directory structure and required files. You don't have to use install.sh, instead you can use this script to compile the distribution you want. Before copying my script please read and understand its purpose and limitations.+I have heavily modified the original install.sh so that it is more useful and flexible. This script is not 100% complete but it is functional and will simplify the initial process of compiling from source. Because it is still in development, I would recommend that you first follow the steps here [[Compiling DD-WRT Sources]] to lay out the necessary directory structure and required files. You don't have to use install.sh, instead you can use this script to compile the distribution you want. Before copying my script please read and understand its purpose and limitations.
<<WARNING>> This is still under development. Some features do not work as expected. <<WARNING>> <<WARNING>> This is still under development. Some features do not work as expected. <<WARNING>>
Line 228: Line 228:
## the snapshot you want to download. ## the snapshot you want to download.
back_one_day() { back_one_day() {
- days=`expr $days 1`+ days=`expr $days + 1`
- monthday=`expr $(date %d) - $days`+ monthday=`expr $(date +%d) - $days`
- snapday="$(date %m)$monthday-$(date %Y)"+ snapday="$(date +%m)$monthday-$(date +%Y)"
snapshot="$snapday-snapshot.tar.bz2" snapshot="$snapday-snapshot.tar.bz2"
url=$site"/$snapshot" url=$site"/$snapshot"
Line 249: Line 249:
success="no" success="no"
days=0 days=0
- snapday=$(date %m%d-%Y)+ snapday=$(date +%m%d-%Y)
snapshot="$snapday-snapshot.tar.bz2" snapshot="$snapday-snapshot.tar.bz2"
url="$site/$snapshot" url="$site/$snapshot"
cd $snaproot cd $snaproot
- while [ "$success" = "no" ]</pre>+ while [ "$success" = "no" ] && [ $days -le $attempts ]
 + do
 + echo -e "\nAttempting to download $url"
 + if [ $debug -eq 0 ]; then
 + if [ ! -f $snapshot ]; then
 + wget $url
 + fi
 + else
 + echo -e "\nGrabbed $url"
 + fi
 + if [ -f $snapshot ]; then
 + echo -e "\nDownload successful."
 + success="yes"
 + else
 + echo -e "\nDownload failed."
 + back_one_day
 + fi
 + done
 + 
 + ## Can't find a snapshot within the last 7 days
 + ## so we need to specify it manually. There's no sanity
 + ## checks here so be careful what you enter.
 + if [ $days -gt $attempts ] && [ "$success" = "no" ]; then
 + echo -e "\nPlease enter snapshot date (eg. 0420):"
 + read snapdate
 + if [ "$snapdate" = "" ]; then
 + echo -e "Nothing entered. Exiting."
 + exit
 + else
 + snapshot="$snapdate$(date +-%Y-)snapshot.tar.bz2"
 + url="$site/$snapshot"
 + echo -e "\nAttempting to download $url"
 + if [ $debug -eq 0 ]; then
 + wget $url
 + else
 + echo -e "\nGrabbed $url"
 + fi
 + if [ $debug -eq 0 ]; then
 + if [ -f $snapshot ]; then
 + echo -e "\nDownload successful."
 + success="yes"
 + else
 + echo -e "\nDownload failed. Exiting."
 + exit
 + fi
 + fi
 + fi
 + fi
 +}
 + 
 +## Download and extract toolchains
 +download_toolchain() {
 +if [ $debug -eq 0 ]; then
 + wget $toolchain_url
 + if [ -f $chainfile ]; then
 + tar -xjvf $chainfile
 + if [ -d $chainroot ]; then
 + mv "$chainroot/$tc3_full" "$chainroot/$tc3_short"
 + mv "$chainroot/$tc4_full" "$chainroot/$tc4_short"
 + else
 + echo -e "\nProblems creating $chainroot. Exiting."
 + exit
 + fi
 + fi
 +else
 + echo -e "\nDebug Output:"
 + echo -e "Grabbed \n$toolchain_url"
 + echo "tar -xjvf $chainfile"
 + echo "mv $chainroot/$tc3_full $chainroot/$tc3_short"
 + echo "mv $chainroot/$tc4_full $chainroot/$tc4_short"
 +fi
 +}
 + 
 +## Setup our new build environment
 +setup_build_env() {
 + if [ $debug -eq 1 ]; then
 + mkdir -p $snaproot-debug
 + snapdir=$snaproot-debug
 + else
 + mkdir -p $snaproot
 + snapdir=$snaproot
 + fi
 + if [ -d $snapdir ] && [ "$dl" = "yes" ]; then
 + download_snapshot
 + if [ "$success" = "yes" ]; then
 + if [ ! -d $buildroot ]; then
 + extract_snapshot
 + fi
 + if [ -d $buildroot ]; then
 + env="yes"
 + cd $buildroot/opt
 + rm libgcc_s.so
 + ln -sf libgcc/libgcc_s.so.1 libgcc_s.so
 + else
 + echo -e "\nProblems creating $buildroot. Exiting."
 + exit
 + fi
 + fi
 + fi
 + cd $ddroot
 + imageroot=$ddroot/image
 + if [ $debug -eq 0 ]; then
 + if [ ! -f $chainfile ]; then
 + download_toolchain
 + fi
 + if [ ! -d $imageroot ]; then
 + mkdir $imageroot
 + ln -sf $imageroot /GruppenLW
 + fi
 + else
 + echo -e "\nDebug Output:"
 + echo "cd $ddroot"
 + download_toolchain
 + echo "mkdir $imageroot"
 + echo "ln -sf $imageroot /GruppenLW"
 + fi
 +}
 + 
 +## Download source using subversion
 +## to be completed
 +download_svn() {
 + if [ `which svn` ]; then
 + echo "Found svn"
 + fi
 +}
 + 
 +## Execute options specified
 +process_options() {
 + if [ "$new" = "yes" ] && [ "$env" = "no" ]; then
 + setup_build_env
 + fi
 +}
 + 
 +## Compile the kernel using the 3.4.6 toolchain
 +## Default version is v23
 +ver=23
 +compile_kernel() {
 + export MYPATH=$PATH
 + export PATH=/home/dd-wrt/toolchains/3.4.6/bin:$MYPATH
 + echo "#define BUILD_DATE \"$(date +%D)\"" > build.h
 + 
 + export SRCBASE=$(cd "../src" && pwd -P)
 + echo $SRCBASE
 + 
 + cd ../src
 + cd linux/linux.v$ver
 + make oldconfig
 + make clean
 + make dep
 + make
 + make modules
 +}
 + 
 +## Switch to 4.1.0 toolchain for compiling userspace
 +prep_userspace() {
 + cd ../../
 + make clean
 + cd ../opt
 + export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$MYPATH
 +}
 + 
 +## Perform clean-up before installing
 +prep_install() {
 + cd ../src/router
 + rm -dfr mipsel-uclibc/install
 + make httpd-clean
 + make rc-clean
 + make shared-clean
 + cd ../../opt
 +}
 + 
 +## Mark start of build, in seconds
 +mark_start() {
 + start=`date +%s`
 +}
 + 
 +## Mark end of build and compute total time taken
 +mark_stop() {
 + stop=`date +%s`
 + total=`expr $stop - $start`
 + 
 + ## If ruby is installed then compute fancy total
 + ## otherwise just echo total seconds
 + if [ `which ruby` ]; then
 + ruby <<CODE
 + total = ($total - 3*$delay)
 + puts "\n$build build completed in: #{(total/60).to_s.strip} minute(s), #{(total%60).to_s.strip} second(s)."
 +CODE
 + else
 + echo -e "\n$build build completed in: $total seconds."
 + fi
 +}
 + 
 +##########
 +## Main ##
 +##########
 + 
 +if [ "$opt" = "yes" ]; then
 + process_options
 +fi
 + 
 +check_env
 + 
 +if [ "$env" = "yes" ]; then
 + cd "$buildroot/opt"
 +else
 +cat <<NEW
 +
 +Serious error:
 +$buildroot does not exist!
 + 
 +Please use -nd options to create the proper directories.
 +You must be root (or have root privileges) for this step.
 + 
 +Example: `basename $0` -ndp2 mini
 + 
 +This will create $buildroot, download and extract
 +the latest snapshot, add a 2 seconds pause to the output,
 +and compile the mini image files.
 + 
 +See help: `basename $0` -h
 + 
 +NEW
 + exit
 +fi
 + 
 +## Okay to proceed?
 +if [ "$proceed" = "no" ]; then
 + echo -e "\nNothing to compile. Exiting."
 + exit
 +fi
 + 
 +if [ "$params" = "all" ]; then
 + distributions=$build_all
 +else
 + distributions=$params
 +fi
 + 
 +echo -e "\nThe following distribution(s) will be compiled: $distributions\n"
 + 
 +echo "Started at $(date +%D' - '%T)"
 + 
 +for build in $dist; do
 + mark_start
 + echo -e "\nWorking on $build distribution..."
 + echo -e "\nStarting stage1 (compile kernel)..."
 + sleep $delay
 + if [ $debug -eq 0 ]; then
 + compile_kernel
 + fi
 + echo -e "\nStarting stage2 (prep userspace)..."
 + sleep $delay
 + if [ $debug -eq 0 ]; then
 + prep_userspace
 + fi
 + echo -e "\nFinal stage, creating $build image files..."
 + sleep $delay
 + if [ $debug -eq 0 ]; then
 + prep_install
 + ./install_$build.sh
 + fi
 + mark_stop
 + sleep $delay
 +done
 + 
 +echo -e "\nCompleted at $(date +%D' - '%T)"
 + 
 +</pre>
 + 
 +[[Category:Developer resources]]

Current revision

I have heavily modified the original install.sh so that it is more useful and flexible. This script is not 100% complete but it is functional and will simplify the initial process of compiling from source. Because it is still in development, I would recommend that you first follow the steps here Compiling DD-WRT Sources to lay out the necessary directory structure and required files. You don't have to use install.sh, instead you can use this script to compile the distribution you want. Before copying my script please read and understand its purpose and limitations.

<<WARNING>> This is still under development. Some features do not work as expected. <<WARNING>>

What this script will allow you to do:

- Compile a single distribution, eg. builddwrt mini
- Compile a combination of distributions, eg. builddwrt micro mini
- Create your build environment from scratch, eg. builddwrt -nd
- Download and update the source using subversion, eg. builddwrt -s

When you use the -d option, the script will automatically generate the correct filename based on the current date, then it will use wget to grab the file. If this attempt fails, the script will automatically try to download the previous day's snapshot. It will attempt to grab only the first snapshot it finds from the last 7 days. If it cannot find a snapshot by this method then you are asked to supply the date of the snapshot you want to grab.

You can name this script whatever you like and the help menu will reflect this so it appears personalized. It can also be placed most anywhere in your local path, but it's best placed directly in your home directory (~). Don't forget to issue chmod x to make this script executable.

You can combine some of the options, for example, builddwrt -ndp2 mini normal voip. This will create the directory structure for your build environment, download the latest snapshot, pause the output for 2 seconds between stages (in case you're watching), then build the image files for mini, normal and voip distributions. If you specify "all", this will expand to "micro mini normal voip openvpn".

What this script does NOT do:

This script only changes the interface for compiling your source, that is, you can consider this as install.sh on steroids. I did not make any attempts to change the actual scripts which perform the compilation, for example, install_mini.sh. Assuming we have the correct directory structure (as per the wiki), if install.sh does not properly compile your source then neither will my script.

Unless I have made a terrible mistake, if the original install.sh works for you then this script will do the same. You just have better control over the initial process.

The usual disclaimer applies here. I wrote this for my own edification and enjoyment and make no guarantees of any kind. I'm sharing this in case someone in this forum has the same interest and curiosity as myself, and may find some uses for it. I'm sure this script is rather trivial to the more experienced and technical individuals visiting this forum, but it works for me and I like it.

Copy the script below and save as builddwrt or something else you prefer.

#!/bin/sh

#####################################################
# Custom install.sh script for DD-WRT v23 SP1
# version 0.1b, Apr 20 2006 --jayC
#
# Based on the original install.sh script and ideas
# from http://forum.bsr-clan.de/ftopic7326.html
#
# License:  GPL2
#####################################################

####################################
## Declaration and Initialization ##
####################################

hr="-----------------------------------------------------------------"
debug=0
## Use hidden option "-G" to enable debug mode for this script.
## No actions will be committed while in debug mode.  This is only
## useful if you intend to modify this script and run some tests.

## Display usage information
usage() {
cat <<MENU
$hr

Compile DD-WRT v23 SP1 with your choice of distribution(s).

Syntax: `basename $0` -[ndfshC] [-p<seconds>] distribution

Distributions:  micro, mini, normal, openvpn, voip, all

Options:
-n			Prepare a new build environment
-d			Download latest source from snapshot
-f			Force overwrite of previous files
-s			Use subversion to grab latest source
-p <seconds>		Add pause to screen output
-h			Display this information
-C			Check build environment

Examples of Proper Use:
			`basename $0` mini
			`basename $0` -p 5 micro
			`basename $0` normal voip
			`basename $0` -df all
			`basename $0` -ndp3 openvpn

To troubleshoot your build you can log all output by doing one of
the following examples:

`basename $0` voip | tee build.log    #View and log output at same time
`basename $0` voip > build.log        #No output, just create log file

You can find your log file in the same directory as your script.
$hr
MENU
exit
}

## This is our debug message
debug_script() {
cat <<DEBUG
$hr
Debug Mode (-G) Enabled
No actions will be committed.

Number of arguments passed to `basename $0` 	= $arg
Parameters passed				= $params
Distribution(s) selected			= $@
Number of seconds to pause screen output	= $delay
$hr
DEBUG
}

## Initialize variables
arg=$#				## number of arguments
params="$@"			## parameter list
dist=""
opt="no"
new="no"
dl="no"
force="no"
svn="no"
delay=0
proceed="no"
build_all="micro mini normal openvpn voip"
env="no"
startdir=`pwd`
ddroot="/home/dd-wrt"
snaproot="$ddroot/snapshot"
buildroot="$snaproot/DD-WRT"
site="http://www.dd-wrt.com/dd-wrtv2/downloads/sourcecode"
chainfile="toolchains.x86.debian.sp1.tar.bz2"
toolchain_url="$site/$chainfile"
chainroot="$ddroot/toolchains"
tc3_full="3.4.6-uclibc-0.9.28"
tc3_short="3.4.6"
tc4_full="4.1.0-uclibc-0.9.28"
tc4_short="4.1.0"

## Looks like we need some help
need_help() {
  echo "Please use \"`basename $0 `-h\" to get help."
  exit
}

## Check for proper build environment
check_env() {
  if [ -d $buildroot ]; then
    env="yes"
  fi
}

## Check if any arguments passed
if [ $arg -eq 0 ]; then
  echo -e "\nNo arguments passed.  See below for usage."
  usage
fi

## Parse the options first, exit if unknown
## Using getopts is more efficient than shift alone
while getopts ndfsp:hG option
do
  case $option in
    n) new="yes"
      opt="yes" ;;
    d) dl="yes"
      opt="yes" ;;
    f) force="yes"
      opt="yes" ;;
    s) svn="yes"
      opt="yes" ;;
    p) delay=$OPTARG
      case $delay in
        0|1|2|3|4|5) opt="yes" ;;
        *) echo -e "\nSyntax error.  -p value must be between 0 - 5."
          need_help ;;
      esac ;;
    h) usage ;;
    G) debug=1
      opt="yes" ;;
    C) ;; ## Check default build environment
    \?) echo -e "\nSyntax error.  Unknown option in \"$params\"."
    	need_help ;;
  esac
done

## Process the distributions next by dropping the options
if [ "$opt" = "yes" ]; then
  shift `expr $OPTIND - 1`
fi

## Optional debugging output
if [ $debug -eq 1 ]; then
  debug_script
fi

## Now validate the distributions
## Update these two variables with our new values
params="$@"
arg="$#"

## Exit immediately if distribution is unknown
if [ $arg -eq 1 ]; then
  if [ "$params" = "all" ]; then
    dist="$build_all"
    proceed="yes"
  else
    case $params in
      micro|mini|normal|voip|openvpn)
        dist="$params"
        proceed="yes" ;;
      *) echo -e "\nSyntax error.  Unknown distribution \"$params\"."
        need_help ;;
    esac
  fi
else  ## multiple distributions
  for each in $params; do
    if [ "$each" = "all" ]; then
      echo -e "\nSyntax error in \"$params\".  Cannot use \"all\" this way."
      need_help
    else
      case $each in
        micro|mini|normal|voip|openvpn)
          dist=$dist" $each"
          proceed="yes" ;;
      *) echo -e "\nSyntax error.  Unknown distribution in \"$params\"."
        need_help ;;       
      esac
    fi
  done 
fi

## Construct url for previous snapshot
## I haven't fully tested this routine, so it may
## not handle transitioning between months.  In that
## case you will have to enter the date manually for
## the snapshot you want to download.
back_one_day() {
  days=`expr $days + 1`
  monthday=`expr $(date +%d) - $days`
  snapday="$(date +%m)$monthday-$(date +%Y)"
  snapshot="$snapday-snapshot.tar.bz2"
  url=$site"/$snapshot" 
}

## Extract snapshot into current location
extract_snapshot() {
  echo -e "\nExtracting files..."
  tar -xjvf $snapshot
}

## Download latest snapshot based on current date,
## and work backwards until we find the most current
## file.  Check only within the last seven days.  You
## can change the number of attempts, if you want to.
download_snapshot() {
  attempts=6
  success="no"
  days=0
  snapday=$(date +%m%d-%Y)
  snapshot="$snapday-snapshot.tar.bz2"
  url="$site/$snapshot"
  cd $snaproot
  while [ "$success" = "no" ] && [ $days -le $attempts ]
  do
    echo -e "\nAttempting to download $url"
    if [ $debug -eq 0 ]; then
      if [ ! -f $snapshot ]; then
        wget $url
      fi
    else
      echo -e "\nGrabbed $url"
    fi
    if [ -f $snapshot ]; then
      echo -e "\nDownload successful."
      success="yes"
    else
      echo -e "\nDownload failed."
      back_one_day
    fi
  done

  ## Can't find a snapshot within the last 7 days
  ## so we need to specify it manually.  There's no sanity
  ## checks here so be careful what you enter.
  if [ $days -gt $attempts ] && [ "$success" = "no" ]; then
    echo -e "\nPlease enter snapshot date (eg. 0420):"
    read snapdate
    if [ "$snapdate" = "" ]; then
      echo -e "Nothing entered.  Exiting."
      exit
    else
      snapshot="$snapdate$(date +-%Y-)snapshot.tar.bz2"
      url="$site/$snapshot"
      echo -e "\nAttempting to download $url"
      if [ $debug -eq 0 ]; then
        wget $url
      else
        echo -e "\nGrabbed $url"
      fi
      if [ $debug -eq 0 ]; then
        if [ -f $snapshot ]; then
          echo -e "\nDownload successful."
          success="yes"
        else
          echo -e "\nDownload failed.  Exiting."
          exit
        fi
      fi
    fi
  fi
}

## Download and extract toolchains
download_toolchain() {
if [ $debug -eq 0 ]; then
  wget $toolchain_url
  if [ -f $chainfile ]; then
    tar -xjvf $chainfile
    if [ -d $chainroot ]; then
      mv "$chainroot/$tc3_full" "$chainroot/$tc3_short"
      mv "$chainroot/$tc4_full" "$chainroot/$tc4_short"
    else
      echo -e "\nProblems creating $chainroot.  Exiting."
      exit
    fi
  fi
else
  echo -e "\nDebug Output:"
  echo -e "Grabbed \n$toolchain_url"
  echo "tar -xjvf $chainfile"
  echo "mv $chainroot/$tc3_full $chainroot/$tc3_short"
  echo "mv $chainroot/$tc4_full $chainroot/$tc4_short"
fi
}

## Setup our new build environment
setup_build_env() {
    if [ $debug -eq 1 ]; then
      mkdir -p $snaproot-debug
      snapdir=$snaproot-debug
    else
      mkdir -p $snaproot
      snapdir=$snaproot
    fi
    if [ -d $snapdir ] && [ "$dl" = "yes" ]; then
      download_snapshot
      if [ "$success" = "yes" ]; then
        if [ ! -d $buildroot ]; then
          extract_snapshot
        fi
        if [ -d $buildroot ]; then
          env="yes"
          cd $buildroot/opt
	  rm libgcc_s.so
	  ln -sf libgcc/libgcc_s.so.1 libgcc_s.so
	else
	  echo -e "\nProblems creating $buildroot.  Exiting."
	  exit
        fi
      fi
    fi
    cd $ddroot
    imageroot=$ddroot/image
    if [ $debug -eq 0 ]; then
      if [ ! -f $chainfile ]; then
        download_toolchain
      fi
      if [ ! -d $imageroot ]; then
        mkdir $imageroot
        ln -sf $imageroot /GruppenLW
      fi
    else
      echo -e "\nDebug Output:"
      echo "cd $ddroot"
      download_toolchain
      echo "mkdir $imageroot"
      echo "ln -sf $imageroot /GruppenLW"
    fi
}

## Download source using subversion
## to be completed
download_svn() {
  if [ `which svn` ]; then
    echo "Found svn"
  fi
}

## Execute options specified
process_options() {
  if [ "$new" = "yes" ] && [ "$env" = "no" ]; then
    setup_build_env
  fi
}

## Compile the kernel using the 3.4.6 toolchain
## Default version is v23
ver=23
compile_kernel() {
  export MYPATH=$PATH
  export PATH=/home/dd-wrt/toolchains/3.4.6/bin:$MYPATH
  echo "#define BUILD_DATE \"$(date +%D)\"" > build.h

  export SRCBASE=$(cd "../src" && pwd -P)
  echo $SRCBASE

  cd ../src
  cd linux/linux.v$ver
  make oldconfig
  make clean
  make dep
  make
  make modules
}

## Switch to 4.1.0 toolchain for compiling userspace
prep_userspace() {
  cd ../../
  make clean
  cd ../opt
  export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$MYPATH
}

## Perform clean-up before installing
prep_install() {
  cd ../src/router
  rm -dfr mipsel-uclibc/install
  make httpd-clean
  make rc-clean
  make shared-clean
  cd ../../opt
}

## Mark start of build, in seconds
mark_start() {
  start=`date +%s`
}

## Mark end of build and compute total time taken
mark_stop() {
  stop=`date +%s`
  total=`expr $stop - $start`

  ## If ruby is installed then compute fancy total
  ## otherwise just echo total seconds
  if [ `which ruby` ]; then
    ruby <<CODE
      total = ($total - 3*$delay)
      puts "\n$build build completed in:  #{(total/60).to_s.strip} minute(s), #{(total%60).to_s.strip} second(s)."
CODE
  else
    echo -e "\n$build build completed in:  $total seconds."
  fi
}

##########
## Main ##
##########

if [ "$opt" = "yes" ]; then
  process_options
fi

check_env

if [ "$env" = "yes" ]; then
  cd "$buildroot/opt"
else
cat <<NEW
  
Serious error:
$buildroot does not exist!

Please use -nd options to create the proper directories.
You must be root (or have root privileges) for this step.

Example:  `basename $0` -ndp2 mini

This will create $buildroot, download and extract
the latest snapshot, add a 2 seconds pause to the output,
and compile the mini image files.

See help:  `basename $0` -h

NEW
  exit
fi

## Okay to proceed?
if [ "$proceed" = "no" ]; then
  echo -e "\nNothing to compile.  Exiting."
  exit
fi

if [ "$params" = "all" ]; then
  distributions=$build_all
else
  distributions=$params
fi

echo -e "\nThe following distribution(s) will be compiled:  $distributions\n"

echo "Started at $(date +%D' - '%T)"

for build in $dist; do
  mark_start
  echo -e "\nWorking on $build distribution..."
  echo -e "\nStarting stage1 (compile kernel)..."
  sleep $delay
  if [ $debug -eq 0 ]; then
    compile_kernel
  fi
  echo -e "\nStarting stage2 (prep userspace)..."
  sleep $delay
  if [ $debug -eq 0 ]; then
    prep_userspace
  fi
  echo -e "\nFinal stage, creating $build image files..."
  sleep $delay
  if [ $debug -eq 0 ]; then
    prep_install
    ./install_$build.sh
  fi
  mark_stop
  sleep $delay
done

echo -e "\nCompleted at $(date +%D' - '%T)"