#!/bin/sh # # ELWIX build script for kernel # # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # # $Id: build_kernel.sh,v 1.1 2011/07/05 23:43:00 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then echo echo "ELWIX project is not configured !?!" echo exit 1 fi if [ ! -d $BSDSRC -o ! -d ${BSDKERNCONF} ]; then echo echo "ELWIX project is not configured - missing BSD sources !?!" echo exit 1 fi if [ "${USER}" != "root" ]; then echo echo "ELWIX project is not configured - BSD kernel must compile under root !?!" echo exit 1 fi clean_kernel() { echo "+++ Clean ELWIX Kernel ..." rm -rf $KERN mkdir -p $KERN ln -sf $(pwd)/config/${KERNCONF} ${BSDKERNCONF} } build_kernel() { echo "+++ Build ELWIX Kernel ..." cd $BSDSRC env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ -j${PARALLEL_BUILD} buildkernel KERNCONF=${KERNCONF} DESTDIR=${KERN} cd - } install_kernel() { echo "+++ Install ELWIX Kernel ..." cd $BSDSRC env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ installkernel KERNCONF=${KERNCONF} DESTDIR=${KERN} cd - echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${KERN}/elwix.ver } ### main() if ! SnitVer ${KERN}/elwix.ver; then clean_kernel build_kernel install_kernel else echo "Skipped ELWIX Kernel build ..." fi echo "+++ Complete build ELWIX Kernel"