From 4fc75b215e16db0f4ac872a0fb6831156d88ea62 Mon Sep 17 00:00:00 2001 From: Artem Prilutskiy Date: Wed, 3 Aug 2016 10:55:44 +0300 Subject: [PATCH] OpenWRT files updated --- OpenWRT/{package => }/Makefile | 0 OpenWRT/build.sh | 35 +++++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) rename OpenWRT/{package => }/Makefile (100%) diff --git a/OpenWRT/package/Makefile b/OpenWRT/Makefile similarity index 100% rename from OpenWRT/package/Makefile rename to OpenWRT/Makefile diff --git a/OpenWRT/build.sh b/OpenWRT/build.sh index 86e428e..0e0191a 100755 --- a/OpenWRT/build.sh +++ b/OpenWRT/build.sh @@ -5,15 +5,40 @@ PACKAGE=cronosagent PROJECT=$(pwd)/.. OPENWRT=${HOME}/openwrt -rm -rf $OPENWRT/package/$PACKAGE +test -d $OPENWRT/package/$PACKAGE +STATE=$? + +if [ "$STATE" -eq "0" ] +then + # Remove existing package in buildroot + rm -rf $OPENWRT/package/$PACKAGE +fi + +# Create package directory and copy all stuff mkdir -p $OPENWRT/package/$PACKAGE/source cp -R $PROJECT $OPENWRT/package/$PACKAGE/source -rm $OPENWRT/package/$PACKAGE/source/OpenWRT/package/Makefile rm -rf $OPENWRT/package/$PACKAGE/source/.git -pushd . +pushd . > /dev/null cd $OPENWRT -make -popd \ No newline at end of file +if [ "$STATE" -eq "1" ] +then + # Build predefined packages for the first run + make +fi + +# Make Makefile visible to Buildroot +mv package/$PACKAGE/source/OpenWRT/Makefile package/$PACKAGE + +if [ "$STATE" -eq "1" ] +then + # Give user to choose package $PACKAGE + make menuconfig +fi + +# Build package +make package/$PACKAGE/compile V=99 2>&1 | tee $PROJECT/../build.log | grep -i error + +popd > /dev/null