version 1.2.6.3, 2013/07/22 14:32:14
|
version 1.6.2.4, 2017/11/02 15:23:49
|
Line 9
|
Line 9
|
# |
# |
|
|
[ -r ./config/rc.elwix ] && . ./config/rc.elwix |
[ -r ./config/rc.elwix ] && . ./config/rc.elwix |
|
if [ ! -r ./config/rc.3thparty_helper ]; then |
|
echo |
|
echo "ELWIX project is not configured - Missing rc.3thparty_helper script" |
|
echo |
|
exit 1 |
|
fi |
|
|
if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then |
if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then |
echo |
echo |
echo "ELWIX project is not configured !?!" |
echo "ELWIX project is not configured !?!" |
Line 37 fi
|
Line 44 fi
|
|
|
clean_3th() |
clean_3th() |
{ |
{ |
echo "+++ Clean ELWIX 3th party ..." | echo "+++ Clean ELWIX 3th party ... ${PKG}, ${ROMFS_USR2}" |
|
|
rm -rf ${PKG} | rm -rf ${PKG} ${ROMFS_USR2} |
| |
install -d ${PKG} |
install -d ${PKG} |
install -d ${PKG}/bin |
install -d ${PKG}/bin |
install -d ${PKG}/etc |
install -d ${PKG}/etc |
Line 48 clean_3th()
|
Line 56 clean_3th()
|
install -d ${PKG}/lib |
install -d ${PKG}/lib |
install -d ${PKG}/libexec |
install -d ${PKG}/libexec |
install -d ${PKG}/sbin |
install -d ${PKG}/sbin |
|
|
|
install -d ${ROMFS_USR2} |
|
install -d ${ROMFS_USR2}/bin |
|
install -d ${ROMFS_USR2}/etc |
|
install -d ${ROMFS_USR2}/lib |
|
install -d ${ROMFS_USR2}/libexec |
|
install -d ${ROMFS_USR2}/sbin |
} |
} |
|
|
compile_3th() |
compile_3th() |
{ |
{ |
echo "+++ Compile ELWIX 3th party ..." |
echo "+++ Compile ELWIX 3th party ..." |
|
|
cd $CROSS_3TH | BUILD_SH="./config/rc.3thparty_helper" |
./build.sh expat ${CBUILD} ${PKG} ${TARGET_BUILD} | |
[ $? -ne 0 ] && exit 1 | # ${BUILD_SH} expat ${CBUILD} ${PKG} ${TARGET_BUILD} |
./build.sh libevent ${CBUILD} ${PKG} ${TARGET_BUILD} | # [ $? -ne 0 ] && exit 1 |
[ $? -ne 0 ] && exit 1 | # ${BUILD_SH} libevent ${CBUILD} ${PKG} ${TARGET_BUILD} |
./build.sh libiconv ${CGBUILD} ${PKG} ${TARGET_BUILD} | # [ $? -ne 0 ] && exit 1 |
[ $? -ne 0 ] && exit 1 | # ${BUILD_SH} libiconv ${CGBUILD} ${PKG} ${TARGET_BUILD} |
./build.sh pcre ${CBUILD} ${PKG} ${TARGET_BUILD} | # [ $? -ne 0 ] && exit 1 |
[ $? -ne 0 ] && exit 1 | # ${BUILD_SH} pcre ${CBUILD} ${PKG} ${TARGET_BUILD} |
./build.sh mini_sendmail ${CBUILD} ${PKG} ${TARGET_BUILD} | # [ $? -ne 0 ] && exit 1 |
[ $? -ne 0 ] && exit 1 | |
./build.sh choparp ${CBUILD} ${PKG} ${TARGET_BUILD} | for i in ${CROSS_3THPARTY}; do |
[ $? -ne 0 ] && exit 1 | if [ -d "${CROSS_3THPATH}$i" ]; then |
./build.sh scan_ffs ${CBUILD} ${PKG} ${TARGET_BUILD} | MK=$(eval echo "\$${i}_MAKE") |
[ $? -ne 0 ] && exit 1 | env CFLAGS="-I${PKG}/include" LDFLAGS="-L${PKG}/lib" ${BUILD_SH} \ |
./build.sh istgt ${CBUILD} ${PKG} ${TARGET_BUILD} | $i $MK ${PKG} ${TARGET_BUILD} || Die "ERROR:: with $i packet!" |
[ $? -ne 0 ] && exit 1 | else |
./build.sh rsync ${CBUILD} ${PKG} ${TARGET_BUILD} | Die "Error:: ${CROSS_PATH}$i not found!" |
[ $? -ne 0 ] && exit 1 | fi |
./build.sh ttcp ${CBUILD} ${PKG} ${TARGET_BUILD} | done |
[ $? -ne 0 ] && exit 1 | |
./build.sh mpd ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} iftop ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh mrouted ${CGBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} sudo ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh igmpproxy ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} smartmontools ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh sudo ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} trafshow ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh bmon ${CGBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} ipsec-tools ${CGBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh mtr ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} dhcp ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh ipguard ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} dhcping ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh smartmontools ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} miniupnpd ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh quagga ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} miniupnpc ${CGBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh iftop ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} ntp ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh arping ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} spawn-fcgi ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh hping2 ${CGBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} lighttpd ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh trafshow ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} libxml2 ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh ipsec-tools ${CBUILD} ${PKG} ${TARGET_BUILD} | # ${BUILD_SH} php ${CBUILD} ${PKG} ${TARGET_BUILD} |
[ $? -ne 0 ] && exit 1 | # [ $? -ne 0 ] && exit 1 |
./build.sh dhcp ${CBUILD} ${PKG} ${TARGET_BUILD} | echo |
[ $? -ne 0 ] && exit 1 | } |
./build.sh dhcping ${CBUILD} ${PKG} ${TARGET_BUILD} | |
[ $? -ne 0 ] && exit 1 | install_3th() |
./build.sh miniupnpd ${CBUILD} ${PKG} ${TARGET_BUILD} | { |
[ $? -ne 0 ] && exit 1 | LIBS="${ROMFS_USR2}/lib" |
./build.sh miniupnpc ${CGBUILD} ${PKG} ${TARGET_BUILD} | LIBEXEC="${ROMFS_USR2}/libexec" |
[ $? -ne 0 ] && exit 1 | BIN="${ROMFS_USR2}/bin" |
./build.sh ntp ${CBUILD} ${PKG} ${TARGET_BUILD} | SBIN="${ROMFS_USR2}/sbin" |
[ $? -ne 0 ] && exit 1 | ETC="${ROMFS_USR2}/etc" |
./build.sh libxml2 ${CBUILD} ${PKG} ${TARGET_BUILD} | |
[ $? -ne 0 ] && exit 1 | echo "+++ Install ELWIX RomFS secondary firmware ... ${ROMFS_USR2}" |
./build.sh php ${CBUILD} ${PKG} ${TARGET_BUILD} | |
[ $? -ne 0 ] && exit 1 | StripFiles \*.so\* ${PKG}/lib |
| InstallFiles \*.so\* ${PKG}/lib $LIBS |
| StripFiles \* ${PKG}/libexec |
| InstallFiles \* ${PKG}/libexec $LIBEXEC |
| StripFiles \* ${PKG}/bin |
| InstallFiles \* ${PKG}/bin $BIN |
| StripFiles \* ${PKG}/sbin |
| InstallFiles \* ${PKG}/sbin $SBIN |
| |
| InstallFiles \* ${PKG}/etc $ETC |
| |
| chown -R root:wheel $SBIN $BIN $LIBDATA $LIBEXEC $LIBS |
| } |
| |
| build_3th() |
| { |
| echo "+++ Build ELWIX Firmware secondary image ... ${ROMFS_USR2} --> ${REL}/${ROMFS_IMG2}" |
| |
| cd ${ROMFS_USR2} |
| pax -w -z -v -f${REL}/${ROMFS_IMG2} . |
cd - |
cd - |
|
|
|
# Stop using uzip fs |
|
# makefs -ominfree=0,bsize=8192,fsize=1024,optimization=space -s${ROMFS_SIZE2} \ |
|
# ${REL}/${ROMFS_IMG2} ${ROMFS_USR2} |
|
|
|
# MDDEV=$(mdconfig -a -t vnode -f ${REL}/${ROMFS_IMG2}); |
|
# tunefs -L elwixFirmware2 /dev/$MDDEV; |
|
# mdconfig -d -u $MDDEV; |
|
|
|
# mkuzip -s 8192 -o ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2}; |
|
# mv ${REL}/${ROMFS_IMG2}.uzip ${REL}/${ROMFS_IMG2} |
|
|
|
echo "+++ Complited ELWIX Firmware secondary image ... ${REL}/${ROMFS_IMG2}" |
} |
} |
|
|
### main() |
### main() |
|
if [ -n "${1}" ]; then |
|
rm ${PKG}/elwix.ver |
|
fi |
|
|
if ! SnitVer ${PKG}/elwix.ver; then |
if ! SnitVer ${PKG}/elwix.ver; then |
clean_3th | clean_3th || exit 1 |
compile_3th | compile_3th || exit 1 |
| |
| install_3th || exit 1 |
| build_3th || exit 1 |
|
|
echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix.ver |
echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${PKG}/elwix.ver |
else |
else |