Archive for August, 2007

note on FreeBSD ports use for avr-gcc tool chain.

Thursday, August 23rd, 2007

Tack #1

Write script to download and patch FreeBSD sources.

#!/bin/bash
function getfiles ()
{
for fname in $FILES ; do
echo "GETTING ----- $fname -----"
case ${fname##*\.} in
  bz2)
     echo "GETTING ----- $fname ----- using bunzip "
     curl ftp://ftp2.freebsd.org/pub/FreeBSD/distfiles/$fname \
      |bunzip2 -dc|tar -xf -
     ;;
  gz|tgz)
     echo "GETTING ----- $fname ----- using gunzip "
     curl ftp://ftp2.freebsd.org/pub/FreeBSD/distfiles/$fname \
      |gzip -dc|tar -xf -
     ;;
esac
done

}

function patchfiles () {
PORTNAME=`cat $port/Makefile |grep ^PORTNAME|cut -f2`
PORTVERSION=`cat $port/Makefile |grep ^PORTVERSION|cut -f2`
ocd=`pwd`
cd $PORTNAME-$PORTVERSION*
echo "-------- PATCHING HERE `pwd`  ------"
for p in $ocd/$port/files/patch* ; do
   patch -p0 -u <$p
done
cd $ocd

}

function makeit () {
PREFIX=/usr/local
LOCALBASE=/usr/local
CONFIGURE_ARGS=`cat $port/Makefile |grep ^CONFIGURE_ARGS|sed 's/^CONFIGURE_ARGS\=\t//'`
MAKE_ARGS=`cat $port/Makefile |grep ^MAKE_ARGS|sed 's/^MAKE_ARGS\=\t//'`
PORTNAME=`cat $port/Makefile |grep ^PORTNAME|cut -f2`
PORTVERSION=`cat $port/Makefile |grep ^PORTVERSION|cut -f2`
ocd=`pwd`
cd $PORTNAME-$PORTVERSION*
echo "-------- CONFIGURING HERE `pwd`  ------"
echo "$CONFIGURE_ENV ./configure $CONFIGURE_ARGS "
export `cat $port/Makefile |grep ^CONFIGURE_ENV|sed 's/\t/ /g'|sed 's/^CONFIGURE_ENV\=//'`
./configure $CONFIGURE_ARGS >config.out
echo "$MAKE_ENV make $MAKE_FLAGS && $MAKE_ENV make $MAKE_FLAGS install"
export `cat $port/Makefile |grep ^MAKE_ENV|sed 's/\t/ /g'|sed 's/^MAKE_ENV\=//'`
make $MAKE_FLAGS && make $MAKE_FLAGS install
# make $MAKE_FLAGS distclean
cd $ocd
}

for port in avr-binutils avr-gcc avr-libc avr-gdb avarice simulavr ; do
curl  "http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/$port/$port.tar.gz?tarball=1"|gzip -dc|tar -xvf -
export FILES=`grep MD5 $port/distinfo|cut -d\( -f2|cut -d\) -f1`
getfiles "$FILES"
patchfiles "$port" "$FILES"
makeit "$port" "$FILES"
done

Tack #2

Work with the ports tree, bsdmake and the .mk files to try to get the download, build and packaging to work as they do in the ports.

One Step Beyond ! Taking your boards to the shop.

Wednesday, August 15th, 2007

Two months ago fellow PARTs person and DorkbotPDXer Mark Gross gave me a $100 gift certificate from Sunstone Circuits from last years PDXBot. Sunstone circuits is a local (oregon) board fabrication company who makes a windows based design to board solution called pcb123.  Since i am Mac based I had been putting off the board design until the last possible minute. I had several ideas which I have been laying out and fabbing by hand and a lot of other things on my plate. I had planned to select a design and work on the boards the week of after the arduno cult indoctrination but after spending the weekend frantically building 27 ftdi based boards and then finding that the design in process needed to be simplified if it was to be unleased on the general public. I instead focused on learning cocoa and leaving any new hardware design on the backburner.  I did spend a few hours redesigning my ftdi based boards and then used that work to make a single purpose board based on the benito 5 programmer that I built and have been developing with monty goodson of bittybot.   

July Release Process Notes

Friday, August 10th, 2007

I have been really busy. So of course I have to start all over from srcatch. If you build gdb for either avarice or simulavr along with avra then scripting this environment goes out the obscening window. As usual however I start with the distfiles and the ports. In general the process goes like

  1. grab the “files” for the port
  2. grab the ftp://ftpx.freebsd.org/ports/disfiles/zzzz referenced in the files/<zzzz>/distinfo file (this could be automated)
  3. unpack and apply all of the patches in <zzzz>/files/patch-*. (except for the goober that I have to chase down with Joerge in gdb this could be automated).
  4. Then pull out the config args and the other compilation arguments from the make file. (Except that every other port has this done slightly differently this might be automatable)
  5. configure && make && make install (at this point the process becomes adaptive and frustraiting because the software is disparate and of varying quality, some of it requires you to upgrade Xcode (Avarice), Some of it wont obcening compile at all (Simulavr), and some of it is not as broken as it used to be but still doesnt have any of the new devices (avra)).
    1. So deal with it and a few days later…
  6. reinstall into a staging directory
  7. find all of the bin directories and run strip on the executables
  8. copy and adapt the package maker files to the new versions.
  9. repackage them using PackageMaker (this is automatable)
  10. make a folder
  11. build a readwrite uncompressed dmg from the folder
  12. mount dmg ajust the background and layout of the folder.
  13. test mount and install.
  14. convert dmg to compressed dmg.
  15. repeat for intel.
  16. release and pray.

Some amazing kinetic sculpture at Visage, 1046 Nw Johnson St.

Monday, August 6th, 2007


SEE: http:http://www.chriscoledesigns.com/

While I did not get to first thursday due to band practice I did run across some amazing sculpture in the perl at an eye glasses shop calledvisage. I encouraged you to see it if possible.