<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-443223739594249029</id><updated>2012-01-25T12:49:59.295-08:00</updated><category term='Cisco ASA'/><category term='summer'/><category term='mp4nation doom homebrew'/><category term='water rockets'/><category term='arm toolchain'/><category term='water rocket launcher'/><category term='secure archive solution'/><category term='BBQ'/><category term='secure backup solution'/><category term='spmp8000'/><category term='Cisco FWSM'/><title type='text'>Dissasemble #5</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://paklids.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/443223739594249029/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://paklids.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Paklids</name><uri>http://www.blogger.com/profile/08394369209628528940</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-443223739594249029.post-4166468823646957904</id><published>2012-01-25T11:35:00.000-08:00</published><updated>2012-01-25T12:49:59.307-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='secure backup solution'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco FWSM'/><category scheme='http://www.blogger.com/atom/ns#' term='secure archive solution'/><category scheme='http://www.blogger.com/atom/ns#' term='Cisco ASA'/><title type='text'>Securely backup a Cisco Firewall (ASA &amp; FWSM)</title><content type='html'>I have a problem with Cisco. Let me put it simply in this list:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Cisco does not support SSH keys (at least not very well) across its fleet of firewalls and security devices. &lt;/div&gt;&lt;div&gt;2. Config backups: TFTP is convenient but NOT secure. FTP is convenient but NOT secure. HTTP can be convenient but still NOT secure. HTTPS can be secure but can be unwieldy to setup and support. SCP is pretty convenient on a *nix machine, and is definitely secure, but there is a catch. &lt;/div&gt;&lt;div&gt;3. SCP on Cisco security devices: While these security devices usually do support SCP, they cannot SCP their configs to a destination (from the security device itself). Also, you cannot pull the running-config directly via SCP.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Addressing point #1 - using a password in an expect script is not extremely secure, but it beats the alternatives in almost every case. There are ways to secure strings (like passwords) in expect but you can decide for yourself whether these are needed.&lt;/div&gt;&lt;div&gt;Addressing point #3 - SCP can be used in the following way: Using expect, SSH to the device and save the running-config to a predefined location (root of the disk) and logout. Open a second shell and SCP the saved config back (from predefined location on device to predefined location on expect host).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My script isn't the shining example of a secure backup, but I'm unimpressed with the alternatives to this.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is an example of my firewall_backup.exp:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;#!/usr/bin/expect&lt;/div&gt;&lt;div&gt;#######################################################&lt;/div&gt;&lt;div&gt;# Written by paklids 2012 01 12                       #&lt;/div&gt;&lt;div&gt;# Expect script to securely backup Cisco ASAs &amp;amp; FWSMs #&lt;/div&gt;&lt;div&gt;# using SSH and SCP.                                  #&lt;/div&gt;&lt;div&gt;#                                                     #&lt;/div&gt;&lt;div&gt;# This script can be run under a wrapper shell script #&lt;/div&gt;&lt;div&gt;# and then used (if desired) to checkin the firewall  #&lt;/div&gt;&lt;div&gt;# configurations to SVN or any other change managment #&lt;/div&gt;&lt;div&gt;# or archiving solution - I will post my wrapper once #&lt;/div&gt;&lt;div&gt;# properly sanitized.                                 #&lt;/div&gt;&lt;div&gt;#######################################################&lt;/div&gt;&lt;div&gt;#&lt;/div&gt;&lt;div&gt;##set an overall timeout if individual commands hang&lt;/div&gt;&lt;div&gt;set timeout 15&lt;/div&gt;&lt;div&gt;#&lt;/div&gt;&lt;div&gt;##set the directory you'd like the script to work out of&lt;/div&gt;&lt;div&gt;set -- /home/user/*&lt;/div&gt;&lt;div&gt;#&lt;/div&gt;&lt;div&gt;##open a pre-built list of IPs/FQDN hostnames delimited by line returns&lt;/div&gt;&lt;div&gt;##Note: it may be necessary to SSH to each host manually as serviceaccountname &lt;/div&gt;&lt;div&gt;##to save SSH host key&lt;/div&gt;&lt;div&gt;set f [open "/home/user/firewall_list"]&lt;/div&gt;&lt;div&gt;#&lt;/div&gt;&lt;div&gt;##for each entry in firewall_list, SSH to host and move to enable&lt;/div&gt;&lt;div&gt;##Note: enable may not be required if you customize the permissions &lt;/div&gt;&lt;div&gt;##on the serviceaccountname&lt;/div&gt;&lt;div&gt;while {[gets $f line] != -1} {&lt;/div&gt;&lt;div&gt;        set pw1 "password_1"&lt;/div&gt;&lt;div&gt;        set pw2 "password_2"&lt;/div&gt;&lt;div&gt;        spawn "/bin/bash"&lt;/div&gt;&lt;div&gt;        send "ssh serviceaccountname@$line\r"&lt;/div&gt;&lt;div&gt;        expect "\npassword:"&lt;/div&gt;&lt;div&gt;        send "$pw1\r"&lt;/div&gt;&lt;div&gt;        expect -re "(\[^\r]*)&amp;gt;" {&lt;/div&gt;&lt;div&gt;                set name $expect_out(1,string)&lt;/div&gt;&lt;div&gt;                }&lt;/div&gt;&lt;div&gt;        send "enable\r"&lt;/div&gt;&lt;div&gt;        expect "\nPassword:"&lt;/div&gt;&lt;div&gt;        send "$pw2\r"&lt;/div&gt;&lt;div&gt;        expect "#"&lt;/div&gt;&lt;div&gt;##determine whether this is an FWSM or an ASA and appropriately save &lt;/div&gt;&lt;div&gt;##running-config to disk&lt;/div&gt;&lt;div&gt;        send "sho version\r"&lt;/div&gt;&lt;div&gt;        expect {&lt;/div&gt;&lt;div&gt;        "FWSM"  {&lt;/div&gt;&lt;div&gt;                send \x20&lt;/div&gt;&lt;div&gt;                set devtype "FWSM"&lt;/div&gt;&lt;div&gt;                expect "#"&lt;/div&gt;&lt;div&gt;                send "copy /noconfirm running-config disk:/$name\r"&lt;/div&gt;&lt;div&gt;                }&lt;/div&gt;&lt;div&gt;        "Adaptive Security Appliance" {&lt;/div&gt;&lt;div&gt;                send \x20&lt;/div&gt;&lt;div&gt;                set devtype "ASA"&lt;/div&gt;&lt;div&gt;                expect "#"&lt;/div&gt;&lt;div&gt;                send "copy /noconfirm running-config disk0:/$name\r"&lt;/div&gt;&lt;div&gt;                }&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;        expect "#"&lt;/div&gt;&lt;div&gt;        sleep 2&lt;/div&gt;&lt;div&gt;        send "logout\r"&lt;/div&gt;&lt;div&gt;#&lt;/div&gt;&lt;div&gt;##open a new bash shell and SCP the config that had been saved to disk &lt;/div&gt;&lt;div&gt;##back to the host this script is running on&lt;/div&gt;&lt;div&gt;        spawn "/bin/bash"&lt;/div&gt;&lt;div&gt;        send "scp serviceaccountname@$line:$name /home/user/workdir/$name\r"&lt;/div&gt;&lt;div&gt;        expect -re ".*password:.*"&lt;/div&gt;&lt;div&gt;        send "$pw1\r"&lt;/div&gt;&lt;div&gt;        expect "100%"&lt;/div&gt;&lt;div&gt;        sleep 1&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;#&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/443223739594249029-4166468823646957904?l=paklids.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paklids.blogspot.com/feeds/4166468823646957904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paklids.blogspot.com/2012/01/securely-backup-cisco-firewall-asa-fwsm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/443223739594249029/posts/default/4166468823646957904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/443223739594249029/posts/default/4166468823646957904'/><link rel='alternate' type='text/html' href='http://paklids.blogspot.com/2012/01/securely-backup-cisco-firewall-asa-fwsm.html' title='Securely backup a Cisco Firewall (ASA &amp; FWSM)'/><author><name>Paklids</name><uri>http://www.blogger.com/profile/08394369209628528940</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-443223739594249029.post-8436387835042506039</id><published>2010-07-23T13:29:00.000-07:00</published><updated>2010-08-02T11:35:02.443-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='water rocket launcher'/><category scheme='http://www.blogger.com/atom/ns#' term='water rockets'/><category scheme='http://www.blogger.com/atom/ns#' term='BBQ'/><category scheme='http://www.blogger.com/atom/ns#' term='summer'/><title type='text'>Old BBQ = water rocket launcher!</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;P.S. I'll be adding more build pics as I upload them....&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_oi11rqPMg5Y/TEoZWFKTjGI/AAAAAAAAANU/gwWrWPDG6q4/s1600/PICT0028.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_oi11rqPMg5Y/TEoZWFKTjGI/AAAAAAAAANU/gwWrWPDG6q4/s400/PICT0028.JPG" alt="" id="BLOGGER_PHOTO_ID_5497234162292329570" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/se0-w23iLUE&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/se0-w23iLUE&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;So a friend was having a "water rocket party" and we, as dads, were going to build water rocket launchers. It wasn't a competition, per se, but rather a way to have enough launchers that even if one or two failed, every kid would have a chance to launch their rocket.&lt;br /&gt;&lt;br /&gt;His idea was to take a bunch of 2 litre bottles and spray paint them white, then allow the kids to use Sharpie markers, duct tape and other craft items to customize (decorate) their rockets. Great fun, because every kid has a chance to do their own thing and yet have fun with the other kids, and a good chance of getting really wet when we launched the rockets.&lt;br /&gt;&lt;br /&gt;During my design phase, I researched a bunch of launchers on the internet. Trust me when I tell you that there are alot of different designs to choose from. They all were practical and easy to build, but they lacked 2 things:&lt;br /&gt;&lt;br /&gt;1. They were not built very "heavy duty". They were built to be used a few times and then discarded or rebuilt.&lt;br /&gt;2. They were slow to load. Most of the designs required pouring the water into the bottle prior to being put on the launcher, then required connecting the compressed air and pressurizing.&lt;br /&gt;&lt;br /&gt;My problem was that kids wanted to enjoy this, so it had to handle a certain amount of abuse. It had to be quick to load, because kids aren't typically known for having a great deal of patience.&lt;br /&gt;&lt;br /&gt;When I was in high school shop class, we built this monstrosity of a water rocket launcher, with a welded steel frame and plumbed water and air feeds. It was great for a launching alot of rockets quickly and certainly was tough, but I didn't have the resources to build something like that in my garage.&lt;br /&gt;&lt;br /&gt;My solution?&lt;br /&gt;&lt;br /&gt;Retrofit my old BBQ to be used as a water rocket launcher! I'd use the BBQ as a frame and then use common hardware store items to create a "simple to use" water rocket launcher.&lt;br /&gt;&lt;br /&gt;First, I separated the BBQ from the rest of the BBQ parts. Then, I used a drill and bolts to connect one square pipe running end to end.&lt;br /&gt;&lt;br /&gt;Next, I confirmed that an outer square pipe fit around that first square pipe. This second  pipe (they call it C channel?) would be my sliding mechanism and eventually act as a release for the bottle.&lt;br /&gt;&lt;br /&gt;Next, I drilled a hole in the inner square pipe and installed a T fitting upside down. One input would be water, one would be air and the output (pointed up) would be the bottle. When building this T piece, I took a 2L bottle with me to the hardware store (in my case Lowes) to make sure what I was building actually fit. This would now act as my launch mount.&lt;br /&gt;&lt;br /&gt;I bolted the launch mount loosely in place. At the hardware store, I purchased 2 ball valves, for controlling the input of both the water and the air, as well as some air hose (which would handle the necessary pressure) and connect my inputs to my launch mount.&lt;br /&gt;&lt;br /&gt;Adding a bit more control, I installed a pressure gauge just beyond the input air valve so that I could measure the air pressure I'd be adding to the system.&lt;br /&gt;&lt;br /&gt;Placing the bottle on my launch mount, I took an old metal tool and trimmed it with a hacksaw to act as a fork that would be able to hold and lock the bottle onto the launch mount. Using a carefully crafted piece of 2X4 wood, I was able to attach the fork onto the sliding mechanism using wire ties (AKA zip ties). I now had a working lock and release and decent inputs.&lt;br /&gt;&lt;br /&gt;A few wire ties later (to attach the ball valve inputs to the frame) and I had a working mock up that I could actually demonstrate.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please note: If you attempt anything like this own, you do so at your own risk. For example, the pressures involved can be unsafe for the 2L bottle, not to mention if you accidentally pressurize your home's water system. Understand the risks before proceeding with anything.&lt;br /&gt;&lt;br /&gt;After I tested the mockup, I decided to change my launch mount so that it withstood slightly more pressure. After a trip to Lowes &amp;amp; a helpful employee named Vern, I used a few additional PVC fittings and a stack of rubber O rings and was able to get a pretty decent seal on the bottle. This required me using a taller 2X4 wood piece.&lt;br /&gt;&lt;br /&gt;In the end, I tore everything down and painted the frame with some good Rustoleum paint (hammerlite finish to hide the imperfections). Putting it back together, I used wire ties to secure the air hose to the frame and used the right size of hose clamps to hold the input valves to the frame, the fork to the sliding mechanism, and each air hose on its respective fitting. Two more hose clamps to connect a handle to the sliding mechanism and I was ready! And I didn't forget to leave an air compressor quick connect so that we could easily connect and disconnect the compressor.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_oi11rqPMg5Y/TEoZ1SkVG9I/AAAAAAAAANc/L4tHtCUZgaM/s1600/PICT0029.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_oi11rqPMg5Y/TEoZ1SkVG9I/AAAAAAAAANc/L4tHtCUZgaM/s400/PICT0029.JPG" alt="" id="BLOGGER_PHOTO_ID_5497234698467089362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_oi11rqPMg5Y/TEoatL4ItaI/AAAAAAAAANk/A5uEhXfb3gE/s1600/PICT0032.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_oi11rqPMg5Y/TEoatL4ItaI/AAAAAAAAANk/A5uEhXfb3gE/s400/PICT0032.JPG" alt="" id="BLOGGER_PHOTO_ID_5497235658743788962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_oi11rqPMg5Y/TEobLmec5UI/AAAAAAAAANs/3t-CUII0YIA/s1600/PICT0033.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_oi11rqPMg5Y/TEobLmec5UI/AAAAAAAAANs/3t-CUII0YIA/s400/PICT0033.JPG" alt="" id="BLOGGER_PHOTO_ID_5497236181279892802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Shameless plug: Tire repair system that I think rocks:&lt;br /&gt;&lt;h2&gt;&lt;a href="http://www.ventura-mca.com/gryypvideo.aspx"&gt;Gryyp Emergency Puncture Tire Repair Systems&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/443223739594249029-8436387835042506039?l=paklids.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paklids.blogspot.com/feeds/8436387835042506039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paklids.blogspot.com/2010/07/old-bbq-water-rocket-launcher.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/443223739594249029/posts/default/8436387835042506039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/443223739594249029/posts/default/8436387835042506039'/><link rel='alternate' type='text/html' href='http://paklids.blogspot.com/2010/07/old-bbq-water-rocket-launcher.html' title='Old BBQ = water rocket launcher!'/><author><name>Paklids</name><uri>http://www.blogger.com/profile/08394369209628528940</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_oi11rqPMg5Y/TEoZWFKTjGI/AAAAAAAAANU/gwWrWPDG6q4/s72-c/PICT0028.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-443223739594249029.post-8075230862840333772</id><published>2010-06-14T12:34:00.000-07:00</published><updated>2010-06-14T12:45:37.842-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='arm toolchain'/><category scheme='http://www.blogger.com/atom/ns#' term='mp4nation doom homebrew'/><category scheme='http://www.blogger.com/atom/ns#' term='spmp8000'/><title type='text'>ARM Toolchain for libspmp8000</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Here is a toolchain builder that I edited from &lt;/span&gt;http://www.gnuarm.com that will help people build an ARM toolchain to start building programs for the spmp8000 series devices like the JXD1000 JXD2000 and any of those types of devices made by Suncom. This is designed on and built for Ubuntu 10.04 LTS but should work on newer versions of Fedora (sorry...haven't tested that yet).&lt;br /&gt;&lt;br /&gt;All directions are found within the script.&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;&lt;br /&gt;## Script largely based on gnu-arm-installer but customized for building a toolchain for the smpm8000&lt;br /&gt;## script customized by Paklids June 14 2010&lt;br /&gt;## *** for future be aware of the versions of source archives used (like gcc and binutils) and try to match those as closely as possible to the versions running natively on your build machine ***&lt;br /&gt;&lt;br /&gt;## Prerequisites&lt;br /&gt;## download and install these to your distribution (based on Ubuntu for now)&lt;br /&gt;## 1. apt-get install build-essential&lt;br /&gt;## 2. apt-get install libpng3 libpng12-dev libncurses5-dev&lt;br /&gt;## 3. apt-get install subversion&lt;br /&gt;## (hope there isn't enything else I'm missing...)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;## Steps to build toolchain&lt;br /&gt;## 1. create a parent directory for your toolchain (using mkdir) and cd into it&lt;br /&gt;## 2. create 3 subdirectories 'src' 'build' &amp;amp; 'install'&lt;br /&gt;## 3. Download these source archives into the 'src' subdirectory but don't unpack&lt;br /&gt;##     ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-4.4.3.tar.bz2&lt;br /&gt;##     ftp://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.bz2&lt;br /&gt;##     ftp://sources.redhat.com/pub/newlib/newlib-1.18.0.tar.gz&lt;br /&gt;##     ftp://sourceware.org/pub/insight/releases/insight-6.8.tar.bz2&lt;br /&gt;## 4. move this script to the toolchain parent directory &amp;amp; make this script executable (using something like chmod u+x ./custom-arm-toolchain)&lt;br /&gt;## 5. Launch script &amp;amp; let it run for a long while&lt;br /&gt;## 6. Make sure the ?/parent-dir/install/bin is in your $PATH. do an 'echo $PATH', then try an 'export PATH=/fullpathto/parent-dir/install/bin:$PATH', then test again using 'echo $PATH'&lt;br /&gt;## 7. After this you should be able to issue the command 'arm-elf-gcc' and it should NOT complain about 'command not found'.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ROOT=`pwd`&lt;br /&gt;SRCDIR=$ROOT/src&lt;br /&gt;BUILDDIR=$ROOT/build&lt;br /&gt;PREFIX=$ROOT/install&lt;br /&gt;&lt;br /&gt;GCC_SRC=gcc-4.4.3.tar.bz2&lt;br /&gt;GCC_VERSION=4.4.3&lt;br /&gt;GCC_DIR=gcc-$GCC_VERSION&lt;br /&gt;&lt;br /&gt;BINUTILS_SRC=binutils-2.20.1.tar.bz2&lt;br /&gt;BINUTILS_VERSION=2.20.1&lt;br /&gt;BINUTILS_DIR=binutils-$BINUTILS_VERSION&lt;br /&gt;&lt;br /&gt;NEWLIB_SRC=newlib-1.18.0.tar.gz&lt;br /&gt;NEWLIB_VERSION=1.18.0&lt;br /&gt;NEWLIB_DIR=newlib-$NEWLIB_VERSION&lt;br /&gt;&lt;br /&gt;INSIGHT_SRC=insight-6.8.tar.bz2&lt;br /&gt;INSIGHT_VERSION=6.8&lt;br /&gt;INSIGHT_DIR=insight-$INSIGHT_VERSION&lt;br /&gt;&lt;br /&gt;echo "I will build an arm-elf cross-compiler:&lt;br /&gt;&lt;br /&gt;  Prefix: $PREFIX&lt;br /&gt;  Sources: $SRCDIR&lt;br /&gt;  Build files: $BUILDDIR&lt;br /&gt;&lt;br /&gt;Press ^C now if you do NOT want to do this."&lt;br /&gt;read IGNORE&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Helper functions.&lt;br /&gt;#&lt;br /&gt;unpack_source()&lt;br /&gt;{&lt;br /&gt;(&lt;br /&gt;    cd $SRCDIR&lt;br /&gt;    ARCHIVE_SUFFIX=${1##*.}&lt;br /&gt;    if [ "$ARCHIVE_SUFFIX" = "gz" ]; then&lt;br /&gt;      tar zxvf $1&lt;br /&gt;    elif [ "$ARCHIVE_SUFFIX" = "bz2" ]; then&lt;br /&gt;      tar jxvf $1&lt;br /&gt;    else&lt;br /&gt;      echo "Unknown archive format for $1"&lt;br /&gt;      exit 1&lt;br /&gt;    fi&lt;br /&gt;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Create all the directories we need.&lt;br /&gt;#mkdir -p $SRCDIR $BUILDDIR $PREFIX&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;cd $SRCDIR&lt;br /&gt;&lt;br /&gt;# Unpack the sources.&lt;br /&gt;unpack_source $(basename $GCC_SRC)&lt;br /&gt;unpack_source $(basename $BINUTILS_SRC)&lt;br /&gt;unpack_source $(basename $NEWLIB_SRC)&lt;br /&gt;unpack_source $(basename $INSIGHT_SRC)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;# Set the PATH to include the binaries we're going to build.&lt;br /&gt;OLD_PATH=$PATH&lt;br /&gt;export PATH=$PREFIX/bin:$PATH&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Stage 1: Build binutils&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;(&lt;br /&gt;# autoconf check.&lt;br /&gt;cd $SRCDIR/$BINUTILS_DIR&lt;br /&gt;&lt;br /&gt;) || exit 1&lt;br /&gt;&lt;br /&gt;# Now, build it.&lt;br /&gt;mkdir -p $BUILDDIR/$BINUTILS_DIR&lt;br /&gt;cd $BUILDDIR/$BINUTILS_DIR&lt;br /&gt;&lt;br /&gt;$SRCDIR/$BINUTILS_DIR/configure --target=arm-elf --prefix=$PREFIX --disable-werror &amp;amp;&amp;amp; make all install&lt;br /&gt;&lt;br /&gt;) || exit 1&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Stage 2: Patch the GCC multilib rules, then build the gcc compiler only&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;MULTILIB_CONFIG=$SRCDIR/$GCC_DIR/gcc/config/arm/t-arm-elf&lt;br /&gt;&lt;br /&gt;echo "&lt;br /&gt;&lt;br /&gt;MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork&lt;br /&gt;MULTILIB_DIRNAMES += normal interwork&lt;br /&gt;&lt;br /&gt;" &gt;&gt; $MULTILIB_CONFIG&lt;br /&gt;&lt;br /&gt;mkdir -p $BUILDDIR/$GCC_DIR&lt;br /&gt;cd $BUILDDIR/$GCC_DIR&lt;br /&gt;&lt;br /&gt;$SRCDIR/$GCC_DIR/configure --target=arm-elf --prefix=$PREFIX \&lt;br /&gt; --enable-languages="c" --with-gnu-as --with-gnu-ld --with-cpu=arm926ej-s \&lt;br /&gt; --disable-nls --disable-werror --disable-libssp  --disable-libgomp --disable-libmudflap --disable-werror &amp;amp;&amp;amp; make all-gcc install-gcc&lt;br /&gt;&lt;br /&gt;) || exit 1&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Stage 3: Build and install newlib&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;(&lt;br /&gt;# Same issue, we have to patch to support makeinfo &gt;= 4.11.&lt;br /&gt;cd $SRCDIR/$NEWLIB_DIR&lt;br /&gt;&lt;br /&gt;) || exit 1&lt;br /&gt;&lt;br /&gt;# And now we can build it.&lt;br /&gt;mkdir -p $BUILDDIR/$NEWLIB_DIR&lt;br /&gt;cd $BUILDDIR/$NEWLIB_DIR&lt;br /&gt;&lt;br /&gt;$SRCDIR/$NEWLIB_DIR/configure --target=arm-elf --prefix=$PREFIX --disable-newlib-supplied-syscalls --disable-werror &amp;amp;&amp;amp; make all install&lt;br /&gt;&lt;br /&gt;) || exit 1&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Stage 4: Build and install the rest of GCC.&lt;br /&gt;#&lt;br /&gt;(&lt;br /&gt;cd $BUILDDIR/$GCC_DIR&lt;br /&gt;echo "*** Re-CONFIGUREing GCC ***"&lt;br /&gt;$SRCDIR/$GCC_DIR/configure --target=arm-elf --prefix=$PREFIX \&lt;br /&gt; --enable-languages="c,c++" --with-gnu-as --with-gnu-ld --with-cpu=arm926ej-s \&lt;br /&gt; --disable-nls --disable-werror --disable-libssp  --disable-libgomp \&lt;br /&gt; --disable-libmudflap --with-newlib --with-headers=$SRCDIR/$NEWLIB_DIR/newlib/libc/include&lt;br /&gt;sleep 60&lt;br /&gt;echo "*** Re-MAKEing GCC ***"&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;sleep 60&lt;br /&gt;&lt;br /&gt;) || exit 1&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Stage 5: Build and install INSIGHT.&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;# Now, build it.&lt;br /&gt;mkdir -p $BUILDDIR/$INSIGHT_DIR&lt;br /&gt;cd $BUILDDIR/$INSIGHT_DIR&lt;br /&gt;&lt;br /&gt;$SRCDIR/$INSIGHT_DIR/configure --target=arm-elf --prefix=$PREFIX --disable-werror  &amp;amp;&amp;amp; make all install&lt;br /&gt;&lt;br /&gt;) || exit 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;export PATH=$OLD_PATH&lt;br /&gt;&lt;br /&gt;echo "&lt;br /&gt;Build complete! Add $PREFIX/bin to your PATH to make arm-elf-gcc and friends&lt;br /&gt;accessible directly.&lt;br /&gt;"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/443223739594249029-8075230862840333772?l=paklids.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://paklids.blogspot.com/feeds/8075230862840333772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://paklids.blogspot.com/2010/06/arm-toolchain-for-libspmp8000.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/443223739594249029/posts/default/8075230862840333772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/443223739594249029/posts/default/8075230862840333772'/><link rel='alternate' type='text/html' href='http://paklids.blogspot.com/2010/06/arm-toolchain-for-libspmp8000.html' title='ARM Toolchain for libspmp8000'/><author><name>Paklids</name><uri>http://www.blogger.com/profile/08394369209628528940</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
