r4145 - in developers/tick: . Test_env_script_GTA02A5

tick at sita.openmoko.org tick at sita.openmoko.org
Mon Mar 3 09:02:17 CET 2008


Author: tick
Date: 2008-03-03 09:02:11 +0100 (Mon, 03 Mar 2008)
New Revision: 4145

Added:
   developers/tick/Test_env_script_GTA02A5/
   developers/tick/Test_env_script_GTA02A5/README
   developers/tick/Test_env_script_GTA02A5/gta02.conf
   developers/tick/Test_env_script_GTA02A5/resolv.conf
   developers/tick/Test_env_script_GTA02A5/setneo
   developers/tick/Test_env_script_GTA02A5/setup_at_neo_assassin.script
   developers/tick/Test_env_script_GTA02A5/setupenv
Log:
Adding some script for personal testing


Added: developers/tick/Test_env_script_GTA02A5/README
===================================================================
--- developers/tick/Test_env_script_GTA02A5/README	2008-03-02 14:04:17 UTC (rev 4144)
+++ developers/tick/Test_env_script_GTA02A5/README	2008-03-03 08:02:11 UTC (rev 4145)
@@ -0,0 +1,9 @@
+License: GPL
+Composor: Tick
+
+Notice: Assassin is not availiable on public yet, coming soon. 
+
+Please Run the ./setupenv and choose your option. 
+If you get any problem from that, please e-mail to tick at openmoko.com
+
+Enjoy it. 

Added: developers/tick/Test_env_script_GTA02A5/gta02.conf
===================================================================
--- developers/tick/Test_env_script_GTA02A5/gta02.conf	2008-03-02 14:04:17 UTC (rev 4144)
+++ developers/tick/Test_env_script_GTA02A5/gta02.conf	2008-03-03 08:02:11 UTC (rev 4145)
@@ -0,0 +1,14 @@
+arch any 6
+arch noarch 11
+arch arm 16
+arch armv4t 21
+src oe-armv4t http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/ipk/armv4t/
+arch neo1973 26
+src neo1973 http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/ipk/neo1973/
+arch fic-gta02 31
+src fic-gta02 http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/ipk/fic-gta02/
+arch all 36
+src all http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/ipk/all/
+arch fic-gta01 41
+src fic-gta01 http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/ipk/fic-gta01/
+

Added: developers/tick/Test_env_script_GTA02A5/resolv.conf
===================================================================
--- developers/tick/Test_env_script_GTA02A5/resolv.conf	2008-03-02 14:04:17 UTC (rev 4144)
+++ developers/tick/Test_env_script_GTA02A5/resolv.conf	2008-03-03 08:02:11 UTC (rev 4145)
@@ -0,0 +1,6 @@
+search tw.openmoko.com
+nameserver 172.16.23.13
+nameserver 168.95.1.1
+
+
+nameserver 192.168.0.200

Added: developers/tick/Test_env_script_GTA02A5/setneo
===================================================================
--- developers/tick/Test_env_script_GTA02A5/setneo	2008-03-02 14:04:17 UTC (rev 4144)
+++ developers/tick/Test_env_script_GTA02A5/setneo	2008-03-03 08:02:11 UTC (rev 4145)
@@ -0,0 +1,10 @@
+#!/bin/bash 
+if (( $UID==0 ));then
+	ifconfig usb0 192.168.0.200
+	if (( `cat /proc/sys/net/ipv4/ip_forward` == 0 )); then
+		echo 1 >  /proc/sys/net/ipv4/ip_forward
+		iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
+	fi
+else
+	echo "Please run this script as a root!!"
+fi


Property changes on: developers/tick/Test_env_script_GTA02A5/setneo
___________________________________________________________________
Name: svn:executable
   + *

Added: developers/tick/Test_env_script_GTA02A5/setup_at_neo_assassin.script
===================================================================
--- developers/tick/Test_env_script_GTA02A5/setup_at_neo_assassin.script	2008-03-02 14:04:17 UTC (rev 4144)
+++ developers/tick/Test_env_script_GTA02A5/setup_at_neo_assassin.script	2008-03-03 08:02:11 UTC (rev 4145)
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# name server stuff
+cp resolv.conf /etc/
+
+cd /etc/ipkg
+rm -rf *
+cd ~
+cp gta02.conf /etc/ipkg
+cd /etc
+ln -sf ipkg opkg
+cd /var/lib/ipkg
+rm -rf 
+cd ~/
+ipkg update
+sleep 5
+ipkg -force-overwrite install opkg
+sleep 5
+ipkg install assassin
+sleep 5
+ipkg install e-wm
+sleep 5
+cd /usr/bin/
+ln -sf opkg-cl opkg
+opkg update
+
+

Added: developers/tick/Test_env_script_GTA02A5/setupenv
===================================================================
--- developers/tick/Test_env_script_GTA02A5/setupenv	2008-03-02 14:04:17 UTC (rev 4144)
+++ developers/tick/Test_env_script_GTA02A5/setupenv	2008-03-03 08:02:11 UTC (rev 4145)
@@ -0,0 +1,149 @@
+#!/bin/bash
+
+IMAGE_DIR="images.storage"
+NEEDDOWNLOAD=1;
+ASSASSINTESTENV=1;
+
+get_date() {
+	YEAR=`date +%Y`
+	MONTH=`date +%m`
+	DAY=`date +%d`
+	return
+}
+get_days_of_month() {
+	if (( $MONTH == 1 )) || (( $MONTH == 3 )) || (( $MONTH == 5 ))  ||(( $MONTH == 7 )) || (( $MONTH == 8 ))  || (( $MONTH == 10 )) || (( $MONTH == 0 )); then
+		 DAY=31
+	 elif (( $MONTH == 2 ));then
+		 DAY=28  # forget about 2/29 here :-P
+	 else
+		 DAY=30
+	 fi
+	 return
+}
+get_date_sub1 () {
+	let DAY=$DAY-1
+	if (( $DAY == 0 ));then 
+		let MONTH=$MONTH-1
+		get_days_of_month
+	fi
+	if (( $MONTH == 0 ));then
+		MONTH=12;
+		let YEAR=$YEAR-1
+	fi
+}
+
+setup_env() 
+{
+	echo "Want do you want to do?"
+	echo "  1. Reflash images cached only."
+	echo "  2. Reflash images cached and setup Assassin Testing enviornment."
+	echo "  3. Download Images from buildhost, and reflashing them only."
+	echo "  4. Download Images from buildhostm and setup Assassin Testing environment."
+	echo -n "choice >"
+	read ANS
+	echo ""
+	if (( ${ANS} == 1 )) ;then 
+		NEEDDOWNLOAD=0;
+		ASSASSINTESTENV=0;
+	elif ((  ${ANS} == 2 ));then
+		NEEDDOWNLOAD=0;
+		ASSASSINTESTENV=1;
+	elif ((  ${ANS} == 3 ));then
+		NEEDDOWNLOAD=1;
+		ASSASSINTESTENV=0;
+	elif ((  ${ANS} == 4 ));then
+		NEEDDOWNLOAD=1;
+		ASSASSINTESTENV=1;
+	else 
+		setup_env
+	fi
+return
+}
+
+if ! [ -e setupenv ];then
+	echo Please run the script at where it is!!
+	exit 0
+fi
+setup_env
+
+if ! [ -e ${IMAGE_DIR} ];then
+	mkdir ${IMAGE_DIR}
+	NEEDDOWNLOAD=1
+fi
+
+if ! [ -f "dfu-util" ] ;then
+	wget http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/dfu-util
+	chmod 755 dfu-util
+fi
+
+if  (( ${NEEDDOWNLOAD} > 0 ));then 
+	pushd ${IMAGE_DIR}
+		rm -rf *
+		UBOOT=http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/uboot-gta02v5-latest.bin
+		wget ${UBOOT}
+		KERNEL=http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/uImage-neo1973-latest.bin
+		wget ${KERNEL}
+		get_date	
+		ROOTFS=http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/OpenMoko-openmoko-devel-image-glibc-ipk-P1-Snapshot-${YEAR}${MONTH}${DAY}-fic-gta02.rootfs.jffs2
+		echo Try to get ${ROOTFS}
+		while ! ( wget ${ROOTFS} );do
+			get_date_sub1
+			ROOTFS=http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/OpenMoko-openmoko-devel-image-glibc-ipk-P1-Snapshot-${YEAR}${MONTH}${DAY}-fic-gta02.rootfs.jffs2
+			echo Try to get ${ROOTFS}
+		done
+	popd
+fi
+
+if ! [ -e /dev/ttyACM0 ];then
+	echo Try to get root!!
+	sudo ls > /dev/null
+	echo Please restart Neo with USB cable NOW
+fi
+LALA=0;
+while (( `./dfu-util -l | awk '/^Found Runtime:/ {ans=substr($3,2,length($3)-2);print ans}' | grep "0x5119" | wc -l` == 0 ));do 
+	echo Waiting~~~;
+	let LALA=$LALA+1
+	if (( $LALA == 5 ));then
+		echo Please restart Neo with USB cable NOW...
+	fi
+	if (( $LALA > 10 ));then
+		echo I am waiting for you... Come on~~
+		LALA=0;
+	fi
+	sleep 1;
+done
+
+ID=`./dfu-util -l | awk '/^Found Runtime:/ {ans=substr($3,2,length($3)-2);print ans}' | grep "0x5119"`
+
+echo Scan device OK!!
+
+pushd ${IMAGE_DIR}
+	sleep 1
+	sudo ../dfu-util -d ${ID} -a kernel -R -D ./uImage-neo1973-latest.bin
+	sleep 3
+	sudo ../dfu-util -d ${ID} -a rootfs -R -D ./OpenMoko-openmoko-devel-image-glibc-ipk-P1-Snapshot-*-fic-gta02.rootfs.jffs2
+	sleep 5
+	sudo ../dfu-util -d ${ID} -a u-boot -R -D ./uboot-gta02v5-latest.bin
+	sleep 15
+popd
+
+echo Now remove battery and then remove USB calbel from the Device
+while [ -e /dev/ttyACM0 ];do
+	sleep 1
+done
+echo Ok plug battery and USB cable back NOW...
+while ! [ -e /dev/ttyACM0 ];do
+	sleep 1
+done
+echo Neo detected~
+echo Ok please wait for system booting....
+sleep 60
+sudo ./setneo
+rm -rf ~/.ssh/known_hosts
+sleep 100
+
+if (( ${ASSASSINTESTENV}== 1));then
+	scp gta02.conf  resolv.conf setup_at_neo_assassin.script root at 192.168.0.202:~/
+	ssh root at 192.168.0.202 "chmod 755 ./setup_at_neo_assassin.script;./setup_at_neo_assassin.script"
+fi
+echo "Ok!! Now the Neo is all yours. Enjoy Hacking || Testing..."


Property changes on: developers/tick/Test_env_script_GTA02A5/setupenv
___________________________________________________________________
Name: svn:executable
   + *





More information about the commitlog mailing list