commit 88cb0f51be0fe6a6c881419b73be18fcb437c0b2
Author: p4u <p4u@dabax.net>
Date:   Fri May 3 19:57:39 2013 +0200

    Adapt the pre_build/post_build scripts to the new variable scheme (TARGET/TBUILD)
    Add a new script to enable bmx6-quagga from bmx6 package (the current one is marked as BROKEN)
    Update the script's README

diff --git a/Makefile b/Makefile
index 32bb4fa..882bac9 100644
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,7 @@
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-#    Author: Pau Escrich <p4u@dabax.net>
-#    Contributors: Simó Albert i Beltran, Agustí Moll
+#    Contributors: Pau Escrich <p4u@dabax.net>, Simó Albert i Beltran, Agustí Moll
 
 
 #OWRT_SVN_REV = 29592
@@ -110,6 +109,10 @@ endef
 define update_feeds
 	@echo "Updating feed $(1)"
 	./$(BUILD_DIR)/$(1)/scripts/feeds update -a
+	
+	# Temporay patch while old bmx6 is still in OpenWRT
+	./$(BUILD_DIR)/$(1)/scripts/feeds install -a -p openwrt_routing
+	
 	./$(BUILD_DIR)/$(1)/scripts/feeds install -a
 endef
 
diff --git a/scripts/README b/scripts/README
index cee5144..cc025c5 100644
--- a/scripts/README
+++ b/scripts/README
@@ -4,5 +4,6 @@
 #
 # All files named *.script placed in this directory will be executed during compilation process.
 # First parameter will be PRE_BUILD or POST_BUILD, so script can detect which is the current step and it can be executed or not.
-# Second parameter will be the Target for the current compilation.
-#
+# Second parameter will be the build directory relative to build/ (ex. ar71xx)
+# Third parameter will be the target name (ex. nsm5)
+# See the existing scripts to better understand the idea of this recipes
diff --git a/scripts/copyregdb.script b/scripts/copyregdb.script
index 0246550..684ff7b 100755
--- a/scripts/copyregdb.script
+++ b/scripts/copyregdb.script
@@ -1,6 +1,7 @@
 #!/bin/sh
 [ "$1" != "PRE_BUILD" ] && exit 0
 shift
-TARGET="$1"
-[ -z "$TARGET" ] || [ ! -d "build/$TARGET" ] && exit 1
-cp -f scripts/files/regdb.txt build/$TARGET/package/mac80211/files
+TBUILD="$1"
+
+[ -z "$TBUILD" ] || [ ! -d "build/$TBUILD" ] && exit 1
+cp -f scripts/files/regdb.txt build/$TBUILD/package/mac80211/files
diff --git a/scripts/enable-bmx6-quagga.script b/scripts/enable-bmx6-quagga.script
new file mode 100755
index 0000000..7eb1fd9
--- /dev/null
+++ b/scripts/enable-bmx6-quagga.script
@@ -0,0 +1,6 @@
+#!/bin/sh
+[ "$1" != "PRE_BUILD" ] && exit 0
+shift
+TBUILD="$1"
+[ -z "$TBUILD" ] || [ ! -d "build/$TBUILD" ] && exit 1
+sed -i -e "s|@BROKEN||" build/$TBUILD/feeds/openwrt_routing/bmx6/Makefile
diff --git a/scripts/ubnt-fix-image.script b/scripts/ubnt-fix-image.script
index b74b4bd..1fb3142 100755
--- a/scripts/ubnt-fix-image.script
+++ b/scripts/ubnt-fix-image.script
@@ -7,11 +7,14 @@ UBNT_TARGETS="nsm5 rocket nsm2 bullet"
 
 [ "$1" != "PRE_BUILD" ] && exit 0
 
+shift
+TBUILD="$2"
+
 shift
 TARGET="$1"
 
-[ -z "$TARGET" ] || [ ! -d "build/nsm5" ] && exit 1
+[ -z "$TARGET" ] || [ -z "$TBUILD" ] || [ ! -d "build/$TBUILD" ] && exit 1
 [[ "$UBNT_TARGETS" =~ "$TARGET" ]] || exit 2
 
-FILE="build/nsm5/target/linux/ar71xx/image/Makefile"
+FILE="build/$TBUILD/target/linux/ar71xx/image/Makefile"
 sed -i -e s/"XM,ar7240)"/"XM,ar7240.v5.3.6)"/g $FILE
