#!/bin/sh # Add the directory of this script to PATH. PATH=$PATH:$(dirname $0) TMP=/tmp/tcz SQUASHFS=$TMP/squashfs PACKAGE=$TMP/package while [ ! -z "$1" ] ; do EXTENSION=$1 ; shift # Ensure that $SQUASHFS and $PACKAGE are empty. rm -fR $SQUASHFS $PACKAGE mkdir -p $SQUASHFS $PACKAGE # Make $EXTENSION. ./make_$EXTENSION.sh echo ============================================================ echo echo The following files were installed in /usr/local: echo find /usr/local -depth -not -type d -newer $TMP/TIMESTAMP echo echo ============================================================ echo echo The following files were copied to $SQUASHFS: echo ( cd $SQUASHFS find usr/local -depth -not -type d -newer $TMP/TIMESTAMP ) echo echo ============================================================ # Strip files that are executable and and unstripped. find $SQUASHFS | xargs file | grep ELF | grep "not stripped" | egrep 'executable|shared object' | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null # Make a squashfs of the contents of $SQUASHFS. tce-load -wi squashfs-tools-4.x.tcz rm -f $PACKAGE/$EXTENSION.tcz mksquashfs $SQUASHFS $PACKAGE/$EXTENSION.tcz -info -noappend # Add the size to $EXTENSION.tcz.info ( cd $PACKAGE [ -w $EXTENSION.tcz.info ] && sed -i s/SiZeK/"$(du -sh $EXTENSION.tcz | cut -f1)"/ $EXTENSION.tcz.info ) # Use submitqc to verify $EXTENSION.tcz and to build auxiliary files. tce-load -wi submitqc4 ( cd $PACKAGE ; yes | sudo submitqc4 ) # Copy the files into $EXTENSION.tar.gz cp $0 $(dirname $0)/make_$EXTENSION.sh $PACKAGE rm -f $TMP/$EXTENSION.tar.gz ( cd $PACKAGE ; tar cz * >$TMP/$EXTENSION.tar.gz ) yes tinycore | bcrypt -r $TMP/$EXTENSION.tar.gz ls -l $TMP echo ============================================================ echo echo The following files were copied into $TMP/$EXTENSION.tar.gz: echo tar tvzf $TMP/$EXTENSION.tar.gz sleep 1 echo echo ============================================================ done