#!/usr/bin/expect -f # install_firmware.tcl - Expect script to install firmware on IP04 # # this software is for the production of IP04. upgrade the common software voiptel here. #exp_internal 1 set send_slow {1 0.2} set timeout -1 # running on local machine set eth0 [lindex $argv 0] spawn minicom # get u-boot prompt expect "Hit any key to stop autoboot" send "\r" expect "ip04>" # flash new kernel send -s "set autostart\r" expect "ip04>" send -s "set serverip 192.168.1.234\r" expect "ip04>" send -s "save\r" expect "ip04>" send -s "tftp 0x1000000 uImage_r2_voiptel.ip08\r" expect "ip04>" send -s "nand erase clean\r" expect "ip04>" send -s "nand erase\r" expect "ip04>" send -s "nand write 0x1000000 0x0 0x300000\r" expect "ip04>" # set bootargs for /dev/mtdblock0 send -s "set bootargs ethaddr=$eth0 console=ttyBF0,115200 root=/dev/mtdblock0 rw\r" expect "ip04>" #boot from 0x1000000 send -s "save\r" expect "ip04>" send -s "bootm 0x1000000\r" # Set up yaffs, reboot back to u-book expect "root:~> " send -s "/bin/copy_rootfs.sh\r" expect "root:~> " send -s "mount /dev/mtdblock2 /mnt\r" expect "root:~> " send -s "echo \"src atcom http://192.168.1.234/IP04/\" > /mnt/etc/ipkg.conf\r" expect "root:~> " send -s "echo \"dest root /\" >> /mnt/etc/ipkg.conf\r" expect "root:~> " send -s "sync\r" expect "root:~> " send -s "umount /mnt\r" expect "root:~> " send -s "reboot\r" # set yaffs as root fs, reboot into uClinux expect "Hit any key to stop autoboot" send "\r" expect "ip04>" send -s "set bootargs ethaddr=$eth0 console=ttyBF0,115200 root=/dev/mtdblock2 rw\r" expect "ip04>" send -s "set autostart yes\r" expect "ip04>" send -s "set nandboot 'nboot 0x2000000 0x0'\r" expect "ip04>" send -s "set bootcmd run nandboot\r" expect "ip04>" send -s "save\r" expect "ip04>" send -s "reset\r" expect "root:~> " #set the IPKG server to voiptel and rowetel send -s "/etc/init.d/zaptel enable\r" expect "root:~> " send -s "/etc/init.d/asterisk enable\r" expect "root:~> " send -s "echo \"src snapshots http://rowetel.com/ucasterisk/ipkg\" > /etc/ipkg.conf\r" expect "root:~> " send -s "echo \"src voiptel http://update.voiptel.no\" >> /etc/ipkg.conf\r" expect "root:~> " send -s "echo \"dest root /\" >> /etc/ipkg.conf\r" expect "root:~> "