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.3 2014/01/21 23:37:03 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 -o "version=1,bsize=4096,fsize=512" \
58: ${REL}/rootfs.dsk ${UBOOT_FS}
59: mkulzma -v -s 131072 -o ${REL}/rootfs.${UB_COMPRESS_ROOTFS} ${REL}/rootfs.dsk
60: ;;
61: *)
62: echo "Option $1 not supported at this moment"
63: ;;
64: esac
65:
66: echo "ELWIX u-boot image $1 complete."
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>