Annotation of elwix/build_init.sh, revision 1.4.4.1
1.1 misho 1: #!/bin/sh
2: #
3: # ELWIX build script for setup host cross compile process - *** START FIRST *** -
4: #
5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
6: # by Michael Pounov <misho@elwix.org>
7: #
1.4.4.1 ! misho 8: # $Id: build_init.sh,v 1.4 2014/09/15 19:06:42 misho Exp $
1.1 misho 9: #
10:
1.4.4.1 ! misho 11: # ./build_init.sh [custom build rc.elwix config]
1.4 misho 12: if [ -n "$1" ]; then
13: cd config
14: ln -sf $1 rc.elwix
15: cd -
16: fi
17:
1.1 misho 18: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
19: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
20: echo
21: echo "ELWIX project is not configured !?!"
22: echo
23: exit 1
24: fi
25:
26: if [ ! -d $BSDSRC ]; then
27: echo
28: echo "ELWIX project is not configured - missing BSD sources !?!"
29: echo
30: exit 1
31: fi
32:
33: if [ "${USER}" != "root" ]; then
34: echo
35: echo "ELWIX project is not configured - Init must build under root !?!"
36: echo
37: exit 1
38: fi
39:
1.3 misho 40: clean_pkgsrc()
41: {
42: echo "+++ Clean ELWIX pkgsrc ..."
43: # MNTEXISTS=$(mount | awk -vpkgsrc="${PKGSRC_DIR}" -vdstmnt="${WORLD}/usr/pkgsrc" \
44: # '($1 == pkgsrc && $3 == dstmnt) { printf("YES"); }')
45: # if [ "${MNTEXISTS}" != "YES" ]; then
46: # umount ${WORLD}/usr/pkgsrc
47: # fi
48:
49: rm -f /elwix ${WORLD}/usr/pkgsrc
50: echo "+++ Erased pkgsrc helper dirs!"
51: }
52:
1.1 misho 53: clean_init()
54: {
55: echo "+++ Clean ELWIX Projects ..."
56: echo -n "Erase *ALL* builded ELWIX projects [NO/yes]? "
57: read LINE
58: if [ X"$LINE" = X"yes" ]; then
1.3 misho 59: clean_pkgsrc
60:
1.4 misho 61: chflags -Rf noschg,nosunlink ${TOPDIR}
1.1 misho 62: rm -rf $TOPDIR
63: mkdir -p $TOPDIR
64: echo "+++ Erased *ALL* builded ELWIX projects!"
65: fi
66: }
67:
68: install_init()
69: {
70: echo "+++ Install ELWIX Project directories ..."
71:
72: install -d $REL
73: install -d $DEST
74: install -d $OBJS
75: install -d $ADIR
76:
77: install -d $BSDOBJ
78:
1.2 misho 79: # ln -sf $BSDSRC
80:
1.1 misho 81: echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${TOPDIR}/elwix.ver
82: }
83:
84: ### main()
85: install -d ${TOPDIR}
86:
87: V=$(CheckVer ${TOPDIR}/elwix.ver)
88: if [ $? -ne 0 -o X"$V" != X"${VERSION}" ]; then
89: echo " Not found valid version or different version from current - Start CLEAN *ALL*"
90: rm -rf $TOPDIR
91: mkdir -p $TOPDIR
92: echo "+++ CLEAN *ALL* complete"
93: else
94: clean_init
95: fi
96:
97: install_init
98:
99: echo "+++ Complete Init ELWIX"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>