#!/bin/sh # # Put the $BUILD script and the $SRC archive in a working directory # and run the script # # Define the SRC file and work directory for building the extension PKG="sc101-nbd" VERSION=0.03 SRC=${PKG}_${VERSION}.tar.gz SUBMIT=${PKG}.tar.gz BUILD=build-$PKG-$VERSION.sh export WORK=$PKG-work ; sudo rm -rf $WORK export DIR=`dirname $0` ; cd $DIR ; DIR=`pwd` export TMP=$DIR/$WORK/tmp ; mkdir -p $TMP export FILES=$DIR/files # Load the necessary tools - make sure you have downloaded them. for PROG in compiletc squashfs-tools-4.x zsync submitqc4 do [ -e /usr/local/tce.installed/$PROG ] || ( tce-load -i $PROG || ( tce-load -w $PROG && tce-load -i $PROG || exit )) done # Make work directory and copy custom files sudo rm -rf $WORK ; mkdir -p $TMP ( cd $FILES ; tar -cf - usr | tar -xf - -C $TMP ) cd $WORK # Extract the TARFILE and patch tar -xvzf ../$SRC # Build it ( cd $PKG-$VERSION cp Makefile Makefile.org for FILE in $FILES/patch/* do patch < $FILE done make strip ut make install # mkdir -p ../tmp/usr/local/share/doc/sc101-nbd/ # cp COPYING ../tmp/usr/local/share/doc/sc101-nbd/ ) # Create extension sudo mksquashfs $TMP $PKG.tcz # Create md5sum file md5sum $PKG.tcz > $PKG.tcz.md5.txt # Create zcync file zsyncmake $PKG.tcz # Create file list mkdir mnt sudo mount -o loop $PKG.tcz ./mnt ( cd mnt ; find `ls` -not -type d ) > $PKG.tcz.list sudo umount ./mnt # Create Info Files echo -ne "Title: sc101-nbd.tcz Description: Netgear SC101 'Toaster' driver translates psan to nbd. Version: Alpha Author: Iain Wade Original-site: http://code.google.com/p/sc101-nbd/downloads/list Copying-policy: GPL v2 Size: 12K Extension_by: gerald_clark Tags: NBD SC101 Comments: Install the man package to read the ut man page or see the website for instructions on 'ut' usage. Sample config file is /usr/local/etc/sc101-nbd.conf.sample. Make a custom sc101-nbd.conf file. Config file consists of lines with: LABEL Device-Name Optional-Mount-Point Add usr/local/ext/sc101-nbd.conf to /opt/filetool.lst. Use '/usr/local/etc/init.d/sc101-nbd start' to attach and mount the SC101 drives listed in /usr/local/etc/sc101-nbd.conf. Use '/usr/local/etc/init.d/sc101-nbd stop' to umount and detach the drives. HD install - use a pretce install of sc101-ndb.tcz per wiki. NETBOOT - use tftp or http to load sc101-ndb.tcz per wiki. Boot code: sc101=Drive[,Drive]... Where Drive is: Label or Label:Mount-Point or Label:- Mount point defaults to /mnt/nbdX where X is the number of this Label in the comma seperated list. Mount point of '-' means connect the drive to /dev/nbdX but don't mount it. If a mount point is specified, it is relative to /mnt unless it starts with a '/'. Use 'ut listall' to see the current labels.. You can specify tce=nbd0 opt=nbd0 home=nbd0 ( or any specified mount point in /mnt). For use with md RAID, use boot option like sc101=Label1:-,Label2:- so nbd0 and nbd1 will not be mounted. Do not include devices in the config file that are specified in the boot code. Change-log: 04/19/13 Original Current: 04/19/13 " > $PKG.tcz.info # Tar everything up tar -cvzf ../$SUBMIT ../$BUILD ../$SRC ../files\ $PKG.tcz $PKG.tcz.info $PKG.tcz.list $PKG.tcz.md5.txt $PKG.tcz.zsync cd $DIR # Encrypt it for transfer echo "bcrypt $SUBMIT" bcrypt -r $SUBMIT echo -e "\nSend $SUBMIT.bfe to tcesubmit@gmail.com."