--- elwix/build_kernel.sh 2012/10/12 08:22:43 1.3 +++ elwix/build_kernel.sh 2017/02/13 16:52:46 1.7 @@ -5,7 +5,7 @@ # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # -# $Id: build_kernel.sh,v 1.3 2012/10/12 08:22:43 misho Exp $ +# $Id: build_kernel.sh,v 1.7 2017/02/13 16:52:46 misho Exp $ # [ -r ./config/rc.elwix ] && . ./config/rc.elwix @@ -32,19 +32,21 @@ fi clean_kernel() { - echo "+++ Clean ELWIX Kernel ..." - rm -rf $KERN - mkdir -p $KERN + echo "+++ Clean ELWIX Kernel $2 ... $1" + rm -rf $1 + mkdir -p $1 - ln -sf ${CFGDIR}/${KERNCONF} ${BSDKERNCONF} + ln -sf ${CFGDIR}/$2 ${BSDKERNCONF} + ln -sf ${CFGDIR}/${KERNHINT:=$KERNCONF.hints} ${BSDKERNCONF} } build_kernel() { - echo "+++ Build ELWIX Kernel ..." + echo "+++ Build ELWIX Kernel $2 ... $1" cd $BSDSRC env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - -j${PARALLEL_BUILD} buildkernel KERNCONF=${KERNCONF} DESTDIR=${KERN} + ${PARALLEL_BUILD} SRCCONF=${SRCCONF} __MAKE_CONF=${MAKECONF} DESTDIR=$1 \ + buildkernel KERNCONF=$2 if [ $? -eq 0 ]; then cd - else @@ -54,24 +56,34 @@ build_kernel() install_kernel() { - echo "+++ Install ELWIX Kernel ..." + echo "+++ Install ELWIX Kernel $2 ... $1" cd $BSDSRC env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - installkernel KERNCONF=${KERNCONF} DESTDIR=${KERN} + SRCCONF=${SRCCONF} __MAKE_CONF=${MAKECONF} DESTDIR=$1 installkernel KERNCONF=$2 cd - if [ $? -eq 0 ]; then - echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${KERN}/elwix.ver + echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >$1/elwix.ver fi + + echo "+++ Completed ELWIX Kernel $2 ... $1" } ### main() if ! SnitVer ${KERN}/elwix.ver; then - clean_kernel - build_kernel - install_kernel + clean_kernel ${KERN} ${KERNCONF} + build_kernel ${KERN} ${KERNCONF} + install_kernel ${KERN} ${KERNCONF} else echo "Skipped ELWIX Kernel build ..." fi -echo "+++ Complete build ELWIX Kernel" +if ! SnitVer ${KERN_ROOTFS}/elwix.ver; then + clean_kernel ${KERN_ROOTFS} ${KERNCONF_ROOTFS} + build_kernel ${KERN_ROOTFS} ${KERNCONF_ROOTFS} + install_kernel ${KERN_ROOTFS} ${KERNCONF_ROOTFS} +else + echo "Skipped ELWIX rootfs Kernel build ..." +fi + +echo "+++ Complete build ELWIX Kernels"