#!/bin/sh # # ELWIX install script for u-boot image # # (C) AITNET ltd - Sofia/Bulgaria # by Michael Pounov # # $Id: install2uboot.sh,v 1.1.2.10 2014/02/04 12:41:02 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 [ "${USER}" != "root" ]; then echo echo "ELWIX project is not configured - install must build under root !?!" echo exit 1 fi if [ -z "${UB_LOADADDR}" ]; then echo echo "ELWIX project is not configured for u-boot use !?!" echo exit 1 fi ### main() if [ -z "$1" ]; then echo echo "Error:: ELWIX u-boot option not found ..." echo exit 2 fi case $1 in kernel) oldlzma e ${KERNEL} ${REL}/kernel.${UB_COMPRESS} uboot_mkimage -A ${TARGET} -O linux -T kernel -C ${UB_COMPRESS} -n ELWIX \ -a ${UB_LOADADDR} -e ${UB_ENTRYADDR} -d ${REL}/kernel.${UB_COMPRESS} \ ${REL}/kernel.${UB_COMPRESS}.uImage ;; kernel_rootfs) oldlzma e ${KERNEL_ROOTFS} ${REL}/kernel_rootfs.${UB_COMPRESS} uboot_mkimage -A ${TARGET} -O linux -T kernel -C ${UB_COMPRESS} -n ELWIX_ROOTFS \ -a ${UB_LOADADDR} -e ${UB_ENTRYADDR} -d ${REL}/kernel_rootfs.${UB_COMPRESS} \ ${REL}/kernel_rootfs.${UB_COMPRESS}.uImage ;; rootfs) makefs -t ffs -B ${UB_ORDER} -f 1000 -s ${UB_ROOTFS_SIZE} \ -o "version=1,bsize=4096,fsize=512,minfree=0" \ ${REL}/rootfs.dsk ${UBOOT_FS} mkulzma -v -s 131072 -o ${REL}/rootfs.${UB_COMPRESS_ROOTFS} ${REL}/rootfs.dsk ;; bin) dd bs=65536 count=$((${UB_ROOTFS_NAND_SIZE} + ${UB_KERNEL_NAND_SIZE})) \ if=/dev/zero of=${REL}/elwix_firmware.bin dd bs=65536 count=${UB_ROOTFS_NAND_SIZE} conv=sync,notrunc \ if=${REL}/rootfs.${UB_COMPRESS_ROOTFS} \ of=${REL}/elwix_firmware.bin dd bs=65536 count=${UB_KERNEL_NAND_SIZE} conv=sync,notrunc seek=${UB_ROOTFS_NAND_SIZE} \ if=${REL}/kernel.${UB_COMPRESS}.uImage \ of=${REL}/elwix_firmware.bin ;; *) echo "Option $1 not supported at this moment" ;; esac echo "ELWIX u-boot image $1 complete."