From 1117cc39de9d146397dc6014aeba35bf4bdf8f91 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 28 Dec 2013 15:11:59 +0100 Subject: [PATCH] Add patch and unpatch targets --- Makefile | 6 ++++ .../0001-Make-Unifi-images-flashable.patch | 28 +++++++++++++++++++ scripts/patch.sh | 14 ++++++++++ scripts/unpatch.sh | 10 +++++++ scripts/update.sh | 2 +- 5 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 patches/openwrt/0001-Make-Unifi-images-flashable.patch create mode 100755 scripts/patch.sh create mode 100755 scripts/unpatch.sh diff --git a/Makefile b/Makefile index be952221..73eb12ef 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,12 @@ export TOPDIR update: FORCE $(GLUONDIR)/scripts/update.sh $(GLUONDIR) +patch: FORCE + $(GLUONDIR)/scripts/patch.sh $(GLUONDIR) + +unpatch: FORCE + $(GLUONDIR)/scripts/unpatch.sh $(GLUONDIR) + -include $(TOPDIR)/include/host.mk _SINGLE=export MAKEFLAGS=$(space); diff --git a/patches/openwrt/0001-Make-Unifi-images-flashable.patch b/patches/openwrt/0001-Make-Unifi-images-flashable.patch new file mode 100644 index 00000000..d6e79711 --- /dev/null +++ b/patches/openwrt/0001-Make-Unifi-images-flashable.patch @@ -0,0 +1,28 @@ +From 9331b9e86ff3cd1a368ba61721c1555807fa772e Mon Sep 17 00:00:00 2001 +Message-Id: <9331b9e86ff3cd1a368ba61721c1555807fa772e.1388167228.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Fri, 27 Dec 2013 18:48:19 +0100 +Subject: [PATCH] Make Unifi images flashable + +--- + target/linux/ar71xx/image/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile +index 9ebe486..8e82f7f 100644 +--- a/target/linux/ar71xx/image/Makefile ++++ b/target/linux/ar71xx/image/Makefile +@@ -896,8 +896,8 @@ $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTAIRROUTER,ubnt-airrouter,UBNT-A + $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTBULLETM,ubnt-bullet-m,UBNT-BM,ttyS0,115200,XM,XM,ar7240)) + $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTROCKETM,ubnt-rocket-m,UBNT-RM,ttyS0,115200,XM,XM,ar7240)) + $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTNANOM,ubnt-nano-m,UBNT-NM,ttyS0,115200,XM,XM,ar7240)) +-$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,XM,ar7240)) +-$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,XM,ar7240)) ++$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,BZ,ar7240)) ++$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,BZ,ar7240)) + + $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N)) + $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N)) +-- +1.8.5.2 + diff --git a/scripts/patch.sh b/scripts/patch.sh new file mode 100755 index 00000000..5dbcb46a --- /dev/null +++ b/scripts/patch.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e +shopt -s nullglob + +. $1/modules + +for module in $GLUON_MODULES; do + dir=$1/$module + git -C $dir checkout -B patched base + + if [ -z $1/patches/$module/*.patch ]; then continue; fi + git -C $dir am $1/patches/$module/*.patch +done diff --git a/scripts/unpatch.sh b/scripts/unpatch.sh new file mode 100755 index 00000000..e94d236b --- /dev/null +++ b/scripts/unpatch.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +. $1/modules + +for module in $GLUON_MODULES; do + dir=$1/$module + git -C $dir checkout base +done diff --git a/scripts/update.sh b/scripts/update.sh index 0142815e..64ffc9c4 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e