File:  [ELWIX - Embedded LightWeight unIX -] / elwix / install2uboot.sh
Revision 1.1.2.4: download - view: text, annotated - select for diffs - revision graph
Thu Jan 23 22:26:00 2014 UTC (10 years, 4 months ago) by misho
Branches: elwix2_2
upd images

    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: install2uboot.sh,v 1.1.2.4 2014/01/23 22:26:00 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: if [ -z "${UB_LOADADDR}" ]; then
   27: 	echo
   28: 	echo "ELWIX project is not configured for u-boot use !?!"
   29: 	echo
   30: 	exit 1
   31: fi
   32: 
   33: 
   34: ### main()
   35: 
   36: if [ -z "$1" ]; then
   37: 	echo
   38: 	echo "Error:: ELWIX u-boot option not found ..."
   39: 	echo
   40: 	exit 2
   41: fi
   42: 
   43: case $1 in
   44: 	kernel)
   45: 		oldlzma e ${KERNEL} ${REL}/kernel.${UB_COMPRESS}
   46: 		uboot_mkimage -A ${TARGET} -O linux -T kernel -C ${UB_COMPRESS} -n ELWIX \
   47: 			-a ${UB_LOADADDR} -e ${UB_ENTRYADDR} -d ${REL}/kernel.${UB_COMPRESS} \
   48: 			${REL}/kernel.${UB_COMPRESS}.uImage
   49: 		;;
   50: 	kernel_rootfs)
   51: 		oldlzma e ${KERNEL_ROOTFS} ${REL}/kernel_rootfs.${UB_COMPRESS}
   52: 		uboot_mkimage -A ${TARGET} -O linux -T kernel -C ${UB_COMPRESS} -n ELWIX_ROOTFS \
   53: 			-a ${UB_LOADADDR} -e ${UB_ENTRYADDR} -d ${REL}/kernel_rootfs.${UB_COMPRESS} \
   54: 			${REL}/kernel_rootfs.${UB_COMPRESS}.uImage
   55: 		;;
   56: 	rootfs)
   57: 		makefs -t ffs -B ${UB_ORDER} -f 1000 \
   58: 			-o "version=1,bsize=4096,fsize=512,minfree=0" \
   59: 			${REL}/rootfs.dsk ${UBOOT_FS}
   60: 		mkulzma -v -s 131072 -o ${REL}/rootfs.${UB_COMPRESS_ROOTFS} ${REL}/rootfs.dsk
   61: 		;;
   62: 	cfg)
   63: 		dd if=/dev/zero of=${REL}/cfg.dsk bs=${UBOOT_CFG_SIZE} count=1
   64: 		DEV=`mdconfig -a -tvnode -f ${REL}/cfg.dsk`
   65: 		newfs -n -m0 -O1 -b4096 -f 1024 -L cfg ${DEV}
   66: 		mdconfig -d -u $DEV
   67: 		;;
   68: 	*)
   69: 		echo "Option $1 not supported at this moment"
   70: 		;;
   71: esac
   72: 
   73: echo "ELWIX u-boot image $1 complete."

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