This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug 551315 - updating n810 imaging tools
- Loading branch information
John Ford
committed
May 17, 2010
1 parent
034f814
commit ac0c427
Showing
13 changed files
with
303 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
SDDEV=$1 | ||
IMGNAME=$2 | ||
RSYNC=rsync2 | ||
|
||
function info { | ||
echo "INFO($SDDEV): $1" | ||
} | ||
|
||
function warn { | ||
echo "WARN($SDDEV): $1" | ||
} | ||
|
||
function error { | ||
echo "ERROR!($SDDEV): $1" | ||
exit | ||
} | ||
|
||
function copy { | ||
info "Copying data from card" | ||
if [[ -d $IMGNAME ]] ; then | ||
error 'I will not overwrite another image' | ||
fi | ||
mkdir $IMGNAME $MOUNT || error "could not create $MOUNT directory" | ||
mount -t ext2 ${SDDEV}1 $MOUNT || error "could not mount $SDDEV on $MOUNT" | ||
$RSYNC -a $MOUNT/. $IMGNAME/. || error "could not copy files to $IMGNAME" | ||
} | ||
|
||
function clean_image { | ||
info "Cleaning up image" | ||
rm -f $IMGNAME/var/log/uptime.log | ||
rm -f $IMGNAME/sentinel | ||
|
||
} | ||
|
||
function eject { | ||
info "Unmounting" | ||
sync | ||
if [[ `mount | grep ${SDDEV}1` ]] ; then | ||
umount ${SDDEV}1 || warn "could not umount root-fs/${SDDEV}1" | ||
fi | ||
if [[ `mount | grep ${SDDEV}2` ]] ; then | ||
umount ${SDDEV}2 || warn "could not umount root-fs/${SDDEV}2" | ||
fi | ||
rm -rf $MOUNT | ||
} | ||
|
||
|
||
if [[ $EUID -ne 0 ]]; then | ||
error "This script must be run as root" | ||
fi | ||
if [[ "x$1" == "x" || "x$2" == "x" ]] ; then | ||
error "Usage: moz-get-image.sh <sd card dev> <image name>" | ||
else | ||
MOUNT="`basename $SDDEV `-$$" | ||
eject | ||
copy | ||
clean_image | ||
eject | ||
sleep 2 | ||
rm -rf $MOUNT | ||
echo "All done on $SDDEV" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
buildfarm/mobile/n810-imaging/rootfs/bin/maemo4-monitor.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python | ||
|
||
import os, sys, time, subprocess | ||
|
||
NTPCOMMAND = '/usr/local/bin/ntpdate' | ||
NTPSERVER = 'ntp1.build.mozilla.org' | ||
LOG_FILE = '/var/log/ntpdate.log' | ||
|
||
def main(): | ||
log = open(LOG_FILE, 'w+') #don't care for long logs | ||
print >>log, '%s - starting up' % time.asctime(time.localtime()) | ||
log.flush() | ||
while True: | ||
rv = subprocess.call([NTPCOMMAND, NTPSERVER], stdout=log, | ||
stderr=log) | ||
if rv is 0: | ||
sys.exit(0) | ||
time.sleep(5) | ||
|
||
if __name__=="__main__": | ||
try: | ||
pid = os.fork() | ||
if pid > 0: | ||
sys.exit(0) | ||
except OSError, e: | ||
print >>sys.stderr, 'first fork failed %d %s' %(e.errno, e.strerror) | ||
sys.exit(1) | ||
|
||
os.chdir("/") | ||
os.setsid() | ||
try: | ||
pid = os.fork() | ||
if pid > 0: | ||
sys.exit(0) | ||
else: | ||
main() | ||
except OSError, e: | ||
print >>sys.stderr, 'second fork failed %d %s' %(e.errno, e.strerror) | ||
sys.exit(1) |
Oops, something went wrong.