# ELWIX project setup
#
# (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
# by Michael Pounov <misho@elwix.org>
#
# $Id: rc.elwix.mips_alfan2,v 1.4 2021/03/11 13:59:50 misho Exp $
#
ELWIX_IS_CONFIGURED="YES"
VERSION="2.3_alfa_n2"
PLATFORM="elwix"
TIMEZONE="Europe/Sofia"
BUILD_DATE=`date "+%Y-%m-%d"`
TARGET="mips"
TARGET_ARCH="mips"
TARGET_CPUTYPE="mips32"
TARGET_BUILD="${TARGET_ARCH}-${PLATFORM}-freebsd"
PARALLEL_BUILD="-j2"
CURDIR=$(pwd)
CFGDIR="${CURDIR}/config"
SRCCONF="${CFGDIR}/src_mips_alfa_n2.conf"
MAKECONF="${CFGDIR}/make_mips_alfa_n2.conf"
PREDIR=".."
# Dont change TOPDIR!!!
TOPDIR="${CURDIR}/build/${VERSION}"
#
BSDSRC="/home/fbsd_work.src/src"
ADDSRC="/home/misho/work/embedaddon"
REL="${TOPDIR}/release"
DEST="${TOPDIR}/destdir"
OBJS="${TOPDIR}/obj"
ADIR="${TOPDIR}/arch"
WORLD="${ADIR}/${TARGET_ARCH}/world"
KERN="${ADIR}/${TARGET_ARCH}/kernel"
KERN_ROOTFS="${ADIR}/${TARGET_ARCH}/kernel.rootfs"
KERN_NFS="${ADIR}/${TARGET_ARCH}/kernel.nfs"
PKG="${ADIR}/${TARGET_ARCH}/pkg"
AIT="${ADIR}/${TARGET_ARCH}"
BSDOBJ="${OBJS}/${TARGET_ARCH}"
BSDTOOLS="${BSDSRC}/tools/tools"
PKGDIR="${WORLD}/elwix/pkg"
CROSSTOOLDIR="${BSDOBJ}/${BSDSRC}/tmp"
### Kernel
BSDKERNCONF="${BSDSRC}/sys/${TARGET}/conf"
KERNDEVHINTS="${BSDKERNCONF}/PB92.hints"
KERNHINT="ELWIX_ALFA_N2.hints"
KERNEL="${KERN}/boot/kernel/kernel"
KERNCONF="ELWIX_ALFA_N2"
KERNEL_ROOTFS="${KERN_ROOTFS}/boot/kernel/kernel"
KERNCONF_ROOTFS="ELWIX_ALFA_N2_ROOTFS"
KERNEL_NFS="${KERN_NFS}/boot/kernel/kernel"
KERNCONF_NFS="ELWIX_ALFA_N2_NFS"
### Rootfs
ROOTFS_MKDIR="${ADIR}/${TARGET_ARCH}/elwix"
ROOTFS_CONF="elwix_firmware_alfa_n2.conf"
ROOTFS="${DEST}/rootfs"
ROOTFS_ETC="${CFGDIR}/etc/rootfs"
ELWIX_ROOTFS="${CFGDIR}/elwix_rootfs_alfa_n2.conf"
ROOTFS_KERN="kernel_rootfs.gz"
ROOTFS_IMG="rootfs.img"
ROOTFS_SIZE="9000k"
### tools Firmware
LOCALFS_IMG="elwix-pkg.frm"
### 3th party
ROMFS_USR2="${DEST}/romfs.pkg"
ROMFS_IMG2="elwix-firmware2.sys"
#ROMFS_SIZE2="40m"
### RomFS Firmware
ROMFS="${DEST}/romfs"
ELWIX_ROMFS="${CFGDIR}/elwix_romfs.conf"
ROMFS_USR="${ROMFS}/usr"
ROMFS_IMG="elwix-firmware.sys"
#ROMFS_SIZE="38m"
### Base Firmware
BASEFS="${DEST}/base"
ELWIX_BASEFS="${CFGDIR}/elwix_base.conf"
BASE_FS="${DEST}/base.fs"
BASE_ETC="${CFGDIR}/etc/default"
BASE_OS="ELWIX-${VERSION}_base_64mb_${TARGET_ARCH}_${BUILD_DATE}.tar.gz"
### U-boot base firmware
UBFS="${DEST}/ubfs"
ELWIX_UBFS="${CFGDIR}/elwix_uboot.conf"
UBOOT_FS="${DEST}/uboot.fs"
UBOOT_ETC="${CFGDIR}/etc/uboot"
UBOOT_OS="ELWIX-${VERSION}_uboot_6mb_${TARGET_ARCH}_${BUILD_DATE}.tar.gz"
### FS Image
FS="${DEST}/elwix.fs"
FS_ETC="${CFGDIR}/etc/default"
OS="ELWIX-${VERSION}_64mb_${TARGET_ARCH}_${BUILD_DATE}.tar.gz"
FS_EXT="${DEST}/elwix_ext.fs"
FS_EXT_ETC="${CFGDIR}/etc/default"
OS_EXT="ELWIX-${VERSION}_ext_128mb_${TARGET_ARCH}_${BUILD_DATE}.tar.gz"
### Make OS Image
IMG_SIZE=62592
IMG_SIZE128=125100
IMGNAME="${REL}/ELWIX-${VERSION}_${TARGET_ARCH}"
### Make U-boot image
UB_COMPRESS="lzma"
UB_COMPRESS_ROOTFS="ulzma"
# Must be same like into kernel config [ KERNLOADADDR=0x80050000 ]
# if address variables are commented install2ub.sh automatic detect addresses
UB_LOADADDR=0x80050000
UB_ENTRYADDR=0x80050100
UB_ORDER="be"
# u-boot rootfs image size
UB_ROOTFS_SIZE="24m"
# rootfs size on nand with 64kb blocks
UB_ROOTFS_NAND_SIZE="6291456"
UB_KERNEL_NAND_SIZE="1638400"
UB_CFG_NAND_SIZE="65536"
### Cross
CBUILD="${DEST}/cross_build.sh"
CGBUILD="${DEST}/cross_gbuild.sh"
CEXEC="${DEST}/cross_exec.sh"
CENV="${DEST}/cross_env.sh"
CROSS_FT_ATH="${BSDTOOLS}/ath"
CROSS_FT_IPW="${BSDTOOLS}/ipw"
CROSS_FT_IWI="${BSDTOOLS}/iwi"
CROSS_FT_MWL="${BSDTOOLS}/mwl"
CROSS_FT_NET80211="${BSDTOOLS}/net80211"
CROSS_FT_VIMAGE="${BSDTOOLS}/vimage"
CROSS_FT_WTAP="${BSDTOOLS}/wtap"
CROSS_FT_CXGB="${BSDTOOLS}/cxgbtool"
CROSS_FT_IFINFO="${BSDTOOLS}/ifinfo"
CROSS_FT_MCTEST="${BSDTOOLS}/mctest"
CROSS_FT_NETMAP="${BSDTOOLS}/netmap"
CROSS_FT_NETBLAST="${BSDTOOLS}/netrate/netblast"
CROSS_FT_NETRCV="${BSDTOOLS}/netrate/netreceive"
CROSS_FT_NETSND="${BSDTOOLS}/netrate/netsend"
#CROSS_AXL="../gpl/axl"
#AXL_CFG="./configure --disable-py-axl --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
##AXL_LIB="${CROSS_AXL}/src/.libs/libaxl.so.*"
##AXL_LIB_NS="${CROSS_AXL}/ns/.libs/libaxl-ns.so.*"
##AXL_LIB_BABEL="${CROSS_AXL}/babel/.libs/libaxl-babel.so.*"
CROSS_ELWIX="../libelwix"
ELWIX_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_ELWIX="${CROSS_ELWIX}/lib/libelwix.so"
CROSS_AITIO="../libaitio"
AITIO_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITIO="${CROSS_AITIO}/lib/libaitio.so"
CROSS_AITCFG="../libaitcfg"
AITCFG_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITCFG="${CROSS_AITCFG}/lib/libaitcfg.so"
CROSS_AITRPC="../libaitrpc"
AITRPC_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITRPC="${CROSS_AITRPC}/lib/libaitrpc.so"
CROSS_AITSCHED="../libaitsched"
AITSCHED_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITSCHED="${CROSS_AITSCHED}/lib/libaitsched.so"
CROSS_AITWWW="../libaitwww"
AITWWW_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITWWW="${CROSS_AITWWW}/lib/libaitwww.so"
CROSS_AITPELCO="../libaitpelco"
AITPELCO_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITPELCO="${CROSS_AITPELCO}/lib/libaitpelco.so"
CROSS_AITSYNC="../libaitsync"
AITSYNC_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITSYNC="${CROSS_AITSYNC}/lib/libaitsync.so"
CROSS_AITCLI="../libaitcli"
AITCLI_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITCLI="${CROSS_AITCLI}/lib/libaitcli.so"
CROSS_AITMQTT="../libaitmqtt"
AITMQTT_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#ELWIX_LIB_AITMQTT="${CROSS_AITMQTT}/lib/libaitmqtt.so"
CROSS_EMBEDTOOLS="../embedtools"
EMBEDTOOLS_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
CROSS_ANSH="../ansh"
ANSH_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
CROSS_MQTT="../mqtt"
MQTT_CFG="./configure --with-sqlite3dir=${WORLD}/usr/local --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
CROSS_WIFINATOR="../wifinator"
WIFINATOR_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
CROSS_TFTPD="../tftpd"
TFTPD_CFG="./configure --prefix=${WORLD}/usr/local --host=${TARGET_BUILD}"
#####
[ -r ${CFGDIR}/rc.subr ] && . ${CFGDIR}/rc.subr
#####
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>