File:  [ELWIX - Embedded LightWeight unIX -] / elwix / build_kernel.sh
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Wed Nov 2 09:51:32 2011 UTC (12 years, 6 months ago) by misho
Branches: MAIN
CVS tags: elwix1_6, HEAD, ELWIX1_5
ver 1.5-stable

    1: #!/bin/sh
    2: #
    3: # ELWIX build script for kernel
    4: #
    5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
    6: #    by Michael Pounov <misho@elwix.org>
    7: #
    8: # $Id: build_kernel.sh,v 1.2 2011/11/02 09:51:32 misho Exp $
    9: #
   10: 
   11: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
   12: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
   13: 	echo
   14: 	echo "ELWIX project is not configured !?!"
   15: 	echo
   16: 	exit 1
   17: fi
   18: 
   19: if [ ! -d $BSDSRC -o ! -d ${BSDKERNCONF} ]; then
   20: 	echo
   21: 	echo "ELWIX project is not configured - missing BSD sources !?!"
   22: 	echo
   23: 	exit 1
   24: fi
   25: 
   26: if [ "${USER}" != "root" ]; then
   27: 	echo
   28: 	echo "ELWIX project is not configured - BSD kernel must compile under root !?!"
   29: 	echo
   30: 	exit 1
   31: fi
   32: 
   33: clean_kernel()
   34: {
   35: 	echo "+++ Clean ELWIX Kernel ..."
   36: 	rm -rf $KERN
   37: 	mkdir -p $KERN
   38: 
   39: 	ln -sf $(pwd)/config/${KERNCONF} ${BSDKERNCONF}
   40: }
   41: 
   42: build_kernel()
   43: {
   44: 	echo "+++ Build ELWIX Kernel ..."
   45: 	cd $BSDSRC
   46: 	env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
   47: 		-j${PARALLEL_BUILD} buildkernel KERNCONF=${KERNCONF} DESTDIR=${KERN}
   48: 	if [ $? -ne 0 ]; then
   49: 		exit 1
   50: 	else
   51: 		cd -
   52: 	fi
   53: }
   54: 
   55: install_kernel()
   56: {
   57: 	echo "+++ Install ELWIX Kernel ..."
   58: 	cd $BSDSRC
   59: 	env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
   60: 		installkernel KERNCONF=${KERNCONF} DESTDIR=${KERN}
   61: 	cd -
   62: 
   63: 	echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${KERN}/elwix.ver
   64: }
   65: 
   66: ### main()
   67: if ! SnitVer ${KERN}/elwix.ver; then
   68: 	clean_kernel
   69: 	build_kernel && install_kernel
   70: else
   71: 	echo "Skipped ELWIX Kernel build ..."
   72: fi
   73: 
   74: echo "+++ Complete build ELWIX Kernel"

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