Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorSimon Poirier <simpoir@Eridani.(none)>2009-09-04 14:49:28 (GMT)
committer Simon Poirier <simpoir@Eridani.(none)>2009-09-04 14:49:28 (GMT)
commit70c4e9b8a3c444c9c411a514ede416c50dce5c6f (patch)
treeff2ab61ae61fb1bd6562d16baaba5352ff3d99ab /contrib
parentf4091840319062be842fb9d178cd425846989660 (diff)
add SoaS iso repacker
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/packager.sh117
1 files changed, 117 insertions, 0 deletions
diff --git a/contrib/packager.sh b/contrib/packager.sh
new file mode 100755
index 0000000..c1bf752
--- /dev/null
+++ b/contrib/packager.sh
@@ -0,0 +1,117 @@
+#!/bin/bash
+
+ROOT=$PWD
+ISO_PATH=$ROOT/iso
+ISO=soas-strawberry.iso
+WORKDIR=$ROOT/work
+# needs to match python on the packaged SoaS
+PYTHON='python2.6'
+
+DO_TESTS=false
+
+
+if [ -d $ISO_PATH ]; then true; else
+ echo
+ echo ISO_PATH not found. Are you in the right path?
+ exit -1;
+fi
+
+if [ $UID = 0 ]; then
+ echo
+ echo good! we can mount devs!
+else
+ echo
+ echo not root? sudoing self...
+ sudo $0 $*
+ exit 0
+fi
+
+echo
+echo cleaning work dir...
+if [ -e $WORKDIR/soas ];then
+ umount $WORKDIR/soas
+fi
+if [ -e $WORKDIR/iso ];then
+ umount $WORKDIR/iso
+ rm -rf $WORKDIR/*
+fi
+
+mkdir $WORKDIR/iso
+mount -o loop $ISO $WORKDIR/iso
+if ls $ISO_PATH/* >/dev/null;then
+ rm -r $ISO_PATH/*
+fi
+cp -r $WORKDIR/iso/* $ISO_PATH
+umount $WORKDIR/iso
+
+echo
+echo extracting squashfs...
+mkdir $WORKDIR/squashfs
+pushd $WORKDIR/squashfs
+unsquashfs $ISO_PATH/LiveOS/squashfs.img || exit -1
+popd
+
+echo
+echo mounting SoaS...
+mkdir $WORKDIR/soas
+mount -o loop -t ext3 $WORKDIR/squashfs/squashfs-root/LiveOS/ext3fs.img \
+ $WORKDIR/soas || exit -1
+
+echo
+echo exporting current tutorius...
+if [ -d tutorius ];then
+ pushd tutorius
+ git pull origin master
+ popd
+else
+ git clone git://git.sugarlabs.org/tutorius/mainline.git tutorius
+fi
+
+echo
+echo installing tutorius to work path...
+pushd tutorius
+quoted_path=`echo "$WORKDIR/soas/usr" | sed -e "s/\\//\\\\\\\\\\//g"`
+sed -i -e "s/prefix=.*/prefix=$quoted_path/" setup.cfg || exit -1
+$PYTHON setup.py install || exit -1
+# fix icon cache for livecd
+LD_LIBRARY_PATH=$WORKDIR/soas/usr/lib $WORKDIR/soas/usr/bin/gtk-update-icon-cache $WORKDIR/soas/usr/share/icons/sugar/
+if $DO_TESTS; then
+ echo
+ echo running unit tests...
+ $PYTHON setup.py test
+else
+ echo
+ echo skipping unit testing
+fi
+popd
+
+
+echo
+echo unmounting SoaS
+if [ -e $WORKDIR/soas ];then
+ umount $WORKDIR/soas
+ rmdir $WORKDIR/soas
+fi
+
+echo
+echo repacking squashfs...
+mksquashfs $WORKDIR/squashfs/squashfs-root $ISO_PATH/LiveOS/squashfs.img -noappend || exit -1
+
+rm -rf $WORKDIR/*
+
+echo
+echo repacking iso...
+if [ -e tutorius.iso ];then
+ rm tutorius.iso
+fi
+lbl=`egrep -o "CDLABEL=\S*" $ISO_PATH/isolinux/isolinux.cfg | head -n 1 | cut -d = -f 2`
+mkisofs -b isolinux/isolinux.bin -c isolinux/boot.cat -o tutorius.iso -no-emul-boot -boot-load-size 4 -boot-info-table -V $lbl -J -r -hide-rr-moved iso/
+mv tutorius.iso /var/www/isos/tutorius-`date +%Y%m%d`.iso
+ln -sf /var/www/isos/tutorius-`date +%Y%m%d`.iso /var/www/isos/current.iso
+chown a+r /var/www/isos/tutorius-`date +%Y%m%d`.iso
+md5sum /var/www/isos/tutorius-`date +%Y%m%d`.iso > /var/www/isos/tutorius-`date +%Y%m%d`.md5
+shasum /var/www/isos/tutorius-`date +%Y%m%d`.iso > /var/www/isos/tutorius-`date +%Y%m%d`.sha
+
+
+echo
+echo All done!