File:  [ELWIX - Embedded LightWeight unIX -] / elwix / Attic / install2ub.sh
Revision 1.1.2.2: download - view: text, annotated - select for diffs - revision graph
Tue May 14 09:32:42 2013 UTC (11 years, 1 month ago) by misho
Branches: elwix1_9_mips
added new confs and files

    1: #!/bin/sh
    2: #
    3: # ELWIX install script for u-boot image
    4: #
    5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
    6: #    by Michael Pounov <misho@elwix.org>
    7: #
    8: # $Id: install2ub.sh,v 1.1.2.2 2013/05/14 09:32:42 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 [ "${USER}" != "root" ]; then
   20: 	echo
   21: 	echo "ELWIX project is not configured - install must build under root !?!"
   22: 	echo
   23: 	exit 1
   24: fi
   25: 
   26: UB_K=""
   27: 
   28: cleanUB()
   29: {
   30: 	echo "+++ Clean ELWIX U-boot images ..."
   31: 
   32: 	rm -rf ${UB_OBJS}
   33: 	install -d ${UB_OBJS}
   34: }
   35: 
   36: prepareUB()
   37: {
   38: 	echo "+++ Prepare ELWIX U-boot kernel ..."
   39: 
   40: 	cp ${KERNEL} ${UB_OBJS}
   41: 	${DEST}/cross_exec.sh objcopy -O binary ${UB_KERNEL} ${UB_KERNEL}.bin
   42: }
   43: 
   44: compUB()
   45: {
   46: 	echo "+++ Compress ELWIX U-boot kernel ..."
   47: 
   48: 	case ${UB_COMPRESS} in
   49: 		gzip)
   50: 			gzip --force --best ${UB_KERNEL}.bin
   51: 			UB_K="${UB_KERNEL}.bin.gz"
   52: 			;;
   53: 		lzma)
   54: 			oldlzma ${UB_KERNEL}.bin
   55: 			UB_K="${UB_KERNEL}.bin.lzma"
   56: 			;;
   57: 		*)
   58: 			echo "Error:: not supported compress method ..."
   59: 			exit 1
   60: 			;;
   61: 	esac
   62: }
   63: 
   64: mkimgUB()
   65: {
   66: 	echo "+++ Make ELWIX U-boot kernel image ..."
   67: 
   68: 	mkimage -A ${TARGET} -O linux -T kernel -C ${UB_COMPRESS} \
   69: 		-a ${UB_LOADADDR} -e ${UB_ENTRYADDR} -n "ELWIX version ${VERSION} kernel" \
   70: 		-d ${UB_K} ${UB_K}.ub
   71: }
   72: 
   73: instUB()
   74: {
   75: 	echo "+++ Install ELWIX U-boot kernel image into release directory ..."
   76: 
   77: 	install ${UB_K}.ub ${REL}
   78: }
   79: 
   80: ### main()
   81: 
   82: if [ ! -x ${DEST}/cross_exec.sh ]; then
   83: 	echo
   84: 	echo "Error:: ELWIX cross-toolchain not ready ... First execute ./build_world.sh"
   85: 	echo
   86: 	exit 1
   87: fi
   88: 
   89: cleanUB
   90: prepareUB
   91: compUB
   92: mkimgUB
   93: instUB
   94: 
   95: echo "ELWIX U-boot images install complete."

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