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.1 2013/05/14 08:22:23 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: *)
54: echo "Error:: not supported compress method ..."
55: exit 1
56: ;;
57: esac
58: }
59:
60: mkimgUB()
61: {
62: echo "+++ Make ELWIX U-boot kernel image ..."
63:
64: mkimage -A ${TARGET} -O linux -T kernel -C ${UB_COMPRESS} \
65: -a ${UB_LOADADDR} -e ${UB_ENTRYADDR} -n "ELWIX version ${VERSION} kernel" \
66: -d ${UB_K} ${UB_K}.ub
67: }
68:
69: instUB()
70: {
71: echo "+++ Install ELWIX U-boot kernel image into release directory ..."
72:
73: install ${UB_K}.ub ${REL}
74: }
75:
76: ### main()
77:
78: if [ ! -x ${DEST}/cross_exec.sh ]; then
79: echo
80: echo "Error:: ELWIX cross-toolchain not ready ... First execute ./build_world.sh"
81: echo
82: exit 1
83: fi
84:
85: cleanUB
86: prepareUB
87: compUB
88: mkimgUB
89: instUB
90:
91: echo "ELWIX U-boot images install complete."
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>