Permalink
Browse files

bug 538517 - moz-refimage-v3.10 p=me r=aki

  • Loading branch information...
jhford committed Mar 11, 2010
1 parent 1e40064 commit 4170d99ccec4044d4a507926996898b1e976f915
@@ -27,6 +27,7 @@ done
echo "putting scripts into filesystem"
rsync -av rootfs/. ${ROOT}/.
+echo "using $OUTPUT generated `date`" | tee ${ROOT}/image-ver
cat > ubi.cfg <<EOF
[rootfs]
@@ -1,7 +1,7 @@
=Creating a Maemo5 Ref Image=
==Requirements==
*32-bit Linux Computer (I used Fedora 12)
-*MicroUSB Cable
+*Micro USB Cable
*flasher-3.5 v2.5.2
**<code>SHA1(flasher-3.5)= 68a1c3d9d8e925e74b361a4ddf30f5ffbe9da4ba</code>
*Main Firmware Image
@@ -381,7 +381,7 @@ Imaging Computer
hg clone http://hg.mozilla.org/build/tools
ln -s tools/buildfarm/mobile/n900-imaging maemo5
cd maemo5
- <OBTAIN flasher-3.5, and proprietary firmware images>
+ <OBTAIN flasher-3.5 and proprietary firmware images>
ls
# OUTPUT:
# add_prop.sh notes
@@ -390,7 +390,7 @@ Imaging Computer
# grab-image.sh RX-51_2009SE_1.2009.41-1.VANILLA_PR_EMMC_MR0_ARM.bin
# maemo5-flash.sh RX-51_2009SE_2.2009.51-1_PR_COMBINED_MR0_ARM.bin
# mkfs.ubifs ubinize
- #There is a list of hases (use openssl sha1 <file> to verify)
+ #There is a list of hashes (use openssl sha1 <file> to verify)
<OBTAIN firmware image>
file moz-refimage-3.2.ubi
#OUTPUT:
@@ -414,7 +414,8 @@ Follow the onscreen instructions. Wait for the screen to say "Suitable USB Devi
*If the desktop of the device has lots of things (calidar, get started, google, OVI...) then you need to initialize the device
**Launch terminal, shortcut on desktop of device
**run <code>sudo i NNN</code> where NNN is the device number (e.g. 001,002...)
-*If you only see the desktop, clock and Terminal shortcut then you need to start this device over as it improperly flashed the emmc image.
+***If this fails, make sure you are in the RF room, launch sudo i NNN a second time. If that fails restart the device ('sudo reboot') and try again. If it still fails, reflash device
+*If you only see the desktop, clock and Terminal shortcut then you need to start this device over as it improperly flashed the emmc image
==Device Won't Flash==
*Symptom: Device won't boot into flashing mode and the notification light is green.
@@ -23,10 +23,9 @@ info "hostname set to $(cat /etc/hostname)"
#Prepare home partition
sync
sleep 5
-#umount /home/user/MyDocs 2>/dev/null
-umount $TEMP_MP 2>/dev/null
-umount $BUILDDEV 2>/dev/null || umount -f $BUILDDEV || \
- fatal "umount -f $BUILDDEV"
+umount /home/user/MyDocs 2>/dev/null
+umount $TEMP_MP 2>/dev/null || error "umount $TEMP_MP"
+umount $BUILDDEV 2>/dev/null || error "umount -f $BUILDDEV"
rm -rf $TEMP_MP
mkdir $TEMP_MP || fatal "mkdir $TEMP_MP"
info "making temporary filesystem"
@@ -37,8 +36,10 @@ wget $TARBALL_URL -O ${TEMP_MP}/home.tar.bz2 || fatal "downloading tarball"
info "tarball sha1: $(sha1sum < $TEMP_MP/home.tar.bz2)"
tar jxf ${TEMP_MP}/home.tar.bz2 -C $TEMP_MP 2> /dev/null || \
fatal "failed tarball extraction"
-info "extracted tarball, starting rsync"
+info "extracted tarball"
#Make sure it is in a clean state with --delete-after
+info "rsync starting"
+##rsync -a --delete-after ${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_DIR}/. /home/.
rsync -a --delete-after ${TEMP_MP}/home/. /home/.
info "rsync finished"
umount $BUILDDEV || umount $TEMP_MP
@@ -49,7 +50,6 @@ ln -s /home/user /tools
generate_fstab
generate_pmconfig
-
cat > /etc/event.d/buildbot <<EOF
start on started dropbear
stop on starting shutdown
@@ -71,12 +71,12 @@ cp /root/.ssh/authorized_keys /home/user/.ssh/authorized_keys
chown -R user:users /home/user/.ssh
rsync -a /root-skel/. /. || fatal "rsync skeleton files"
-chmod +x /bin/start-buildbot || fatal "permissions start-buildbot"
-chmod +x /bin/verify-network || fatal "permissions verify-network"
-chmod +x /bin/reboot-user || fatal "permissions reboot-user"
-chmod +x /bin/start-mozilla || fatal "permissions start-mozilla"
-cat > /etc/event.d/rcS-late <<EOF
+chmod +x /bin/start-buildbot || fatal "+x permissions start-buildbot"
+chmod +x /bin/verify-network || fatal "+x permissions verify-network"
+chmod +x /bin/reboot-user || fatal "+x permissions reboot-user"
+chmod +x /bin/start-mozilla || fatal "+x permissions start-mozilla"
+cat > /etc/event.d/rcS-late <<EOF
description "late rcS actions"
start on started xomap
@@ -122,7 +122,6 @@ end script
normal exit 0
EOF
-
cat > $NGINXPREFIX/conf/nginx.conf <<EOF
worker_processes 1;
@@ -2,6 +2,20 @@
import os, time
from optparse import OptionParser
+def correct_tmp_file():
+ try:
+ #Normal program flow below:
+ if os.path.exists("/tmp/shutdown"):
+ os.remove("/tmp/shutdown")
+ if not os.path.exists("/tmp/reboot"):
+ f = open("/tmp/reboot")
+ f.write("")
+ f.close()
+ except IOError, e:
+ pass #We don't want to jeopardize the reboot
+
+env = {'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'}
+
parser = OptionParser()
parser.add_option("-s", "--slavedir", action="store",
default="/builds/slave",
@@ -22,15 +36,13 @@ if not os.path.exists(options.rebootcmd):
if not os.path.exists(options.slavedir) or not os.path.exists(options.buildbotcmd):
print "slave directory not found"
#this is the simple case where buildbot isn't going to work
- os.execve(str(options.rebootcmd), [str(options.rebootcmd)],
- {'PATH':'/sbin:/bin:/usr/sbin:/usr/bin'})
+ os.execve(str(options.rebootcmd), [str(options.rebootcmd)], env)
#Application either ends here because of exec, or has failed to call
#reboot
print "os.execv(%s) has failed!?!?!?!" % options.rebootcmd
import subprocess
subprocess.call([options.rebootcmd])
-#Normal program flow below:
pid = os.fork()
if pid == 0:
pid = os.fork()
@@ -40,22 +52,36 @@ if pid == 0:
bbpid = os.fork()
if bbpid == 0:
print "stoping buildbot"
- os.execv(str(options.buildbotcmd), [str(options.buildbotcmd),
- "stop", str(options.slavedir)])
+ os.execve(str(options.buildbotcmd), [str(options.buildbotcmd),
+ "stop", str(options.slavedir)], env)
#Application either ends here because of exec,
#or has failed to call reboot
print "os.execv(%s) has failed!?!?!?!" % options.rebootcmd
+
else:
print "rebooting"
+ time.sleep(30)
+ correct_tmp_file()
os.execve(str(options.rebootcmd), [str(options.rebootcmd)],
- {'PATH':'/sbin/:/bin:/usr/sbin:/usr/bin'})
+ env)
#Application either ends here because of exec
#or has failed to call reboot
print "os.execv(%s) has failed!?!?!?!" % options.rebootcmd
import subprocess
+ correct_tmp_file()
+ print "trying subprocess.call instead of os.execve"
subprocess.call([options.rebootcmd])
else:
exit(0)
else:
- time.sleep(1000) #to make sure slave doesn't take new job
- exit(0)
+ for i in range(0,2000):
+ correct_tmp_file()
+ time.sleep(0.5) #0.5 is arbitrary but is to ensure we don't
+ #steal *all* the cpu away from other tasks
+ print "TinderboxPrint: reboot failed"
+ for i in ["/sentinel", "/hwlog"]:
+ f=open(i, "a+")
+ f.write("%s PST ERROR: I failed to reboot" % \
+ time.asctime(time.localtime()))
+ f.close()
+ exit(1)
@@ -4,21 +4,25 @@
${NGINXPREFIX}/sbin/nginx -c ${NGINXPREFIX}/conf/nginx.conf
-i=0
-while true ; do
- i=$(($i + 1))
- ping -c 1 $BBHOST
- if [[ $? -eq 0 ]] ; then
- break
- elif [[ i -gt $PINGMAX ]] ; then
- reboot
- fi
-done
+# i=0
+# while true ; do
+# i=$(($i + 1))
+# ping -c 1 $BBHOST
+# if [[ $? -eq 0 ]] ; then
+# break
+# elif [[ $i -gt $PINGMAX ]] ; then
+# error "Cannot reach buildbot master"
+# reboot
+# fi
+# sleep $PINGDELAY
+# done
-setsid /bin/verify-network $BBHOST $BBPORT $PINGMAX $PINGDELAY \
- $PINGMAXREBT $HWLOG
-buildbot create-slave --maxdelay=20 $BBDIR ${BBHOST}:${BBPORT} \
- $BBUSER $BBPASS
+# setsid /bin/verify-network $BBHOST $BBPORT $PINGMAX $PINGDELAY \
+# $PINGMAXREBT $HWLOG
+
+rm /tmp/shutdown #this is not the power state you are looking for
+touch /tmp/reboot #I wonder if the jedi mind trick works on n900s?
+su - user -c "buildbot create-slave --maxdelay=20 $BBDIR ${BBHOST}:${BBPORT} \
+ $BBUSER $BBPASS"
cp $HWLOG $BBDIR/info/admin ; cp $CONFIGED ${BBDIR}/info/host
-buildbot start $BBDIR
-EOF
+su - user -c "buildbot start $BBDIR"
@@ -3,12 +3,16 @@
booterror() {
error "$1"
- while true ; do text2screen -x 1 -y 1 -s 4 -t "$1" ; done
+ text2screen -c
+ text2screen -x 1 -y 1 -s 1 -t "E: $1"
+ text2screen -x 1 -y 2 -s 1 -t "reboot 300s"
+ sleep 300
+ reboot
}
printinfo() {
text2screen -c
- text2screen -x 1 -y 1 -s 4 -t "$1"
+ text2screen -x 1 -y 1 -s 1 -t "$1"
}
printinfo "Running Mozilla Boot"
@@ -23,6 +23,8 @@ else:
ip = socket.gethostbyaddr(hostname)
except socket.gaierror:
failcount += 1
+ except socket.herror:
+
if ip:
host = ip[2][0]
break

0 comments on commit 4170d99

Please sign in to comment.