File:  [ELWIX - Embedded LightWeight unIX -] / elwix / build_init.sh
Revision 1.4.4.1: download - view: text, annotated - select for diffs - revision graph
Tue Jun 13 17:39:31 2017 UTC (7 years ago) by misho
Branches: elwix2_6
Diff to: branchpoint 1.4: preferred, unified
adds new script
update build
new sysctl

    1: #!/bin/sh
    2: #
    3: # ELWIX build script for setup host cross compile process - *** START FIRST *** -
    4: #
    5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
    6: #    by Michael Pounov <misho@elwix.org>
    7: #
    8: # $Id: build_init.sh,v 1.4.4.1 2017/06/13 17:39:31 misho Exp $
    9: #
   10: 
   11: # ./build_init.sh [custom build rc.elwix config]
   12: if [ -n "$1" ]; then
   13: 	cd config
   14: 	ln -sf $1 rc.elwix
   15: 	cd -
   16: fi
   17: 
   18: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
   19: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
   20: 	echo
   21: 	echo "ELWIX project is not configured !?!"
   22: 	echo
   23: 	exit 1
   24: fi
   25: 
   26: if [ ! -d $BSDSRC ]; then
   27: 	echo
   28: 	echo "ELWIX project is not configured - missing BSD sources !?!"
   29: 	echo
   30: 	exit 1
   31: fi
   32: 
   33: if [ "${USER}" != "root" ]; then
   34: 	echo
   35: 	echo "ELWIX project is not configured - Init must build under root !?!"
   36: 	echo
   37: 	exit 1
   38: fi
   39: 
   40: clean_pkgsrc()
   41: {
   42: 	echo "+++ Clean ELWIX pkgsrc ..."
   43: #	MNTEXISTS=$(mount | awk -vpkgsrc="${PKGSRC_DIR}" -vdstmnt="${WORLD}/usr/pkgsrc" \
   44: #		'($1 == pkgsrc && $3 == dstmnt) { printf("YES"); }')
   45: #	if [ "${MNTEXISTS}" != "YES" ]; then
   46: #		umount ${WORLD}/usr/pkgsrc
   47: #	fi
   48: 
   49: 	rm -f /elwix ${WORLD}/usr/pkgsrc
   50: 	echo "+++ Erased pkgsrc helper dirs!"
   51: }
   52: 
   53: clean_init()
   54: {
   55: 	echo "+++ Clean ELWIX Projects ..."
   56: 	echo -n "Erase *ALL* builded ELWIX projects [NO/yes]? "
   57: 	read LINE
   58: 	if [ X"$LINE" = X"yes" ]; then
   59: 		clean_pkgsrc
   60: 
   61: 		chflags -Rf noschg,nosunlink ${TOPDIR}
   62: 		rm -rf $TOPDIR
   63: 		mkdir -p $TOPDIR
   64: 		echo "+++ Erased *ALL* builded ELWIX projects!"
   65: 	fi
   66: }
   67: 
   68: install_init()
   69: {
   70: 	echo "+++ Install ELWIX Project directories ..."
   71: 
   72: 	install -d $REL
   73: 	install -d $DEST
   74: 	install -d $OBJS
   75: 	install -d $ADIR
   76: 
   77: 	install -d $BSDOBJ
   78: 
   79: #	ln -sf $BSDSRC
   80: 
   81: 	echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${TOPDIR}/elwix.ver
   82: }
   83: 
   84: ### main()
   85: install -d ${TOPDIR}
   86: 
   87: V=$(CheckVer ${TOPDIR}/elwix.ver)
   88: if [ $? -ne 0 -o X"$V" != X"${VERSION}" ]; then
   89: 	echo " Not found valid version or different version from current - Start CLEAN *ALL*"
   90: 	rm -rf $TOPDIR
   91: 	mkdir -p $TOPDIR
   92: 	echo "+++ CLEAN *ALL* complete"
   93: else
   94: 	clean_init
   95: fi
   96: 
   97: install_init
   98: 
   99: echo "+++ Complete Init ELWIX"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>