diff --git a/build_patches/openwrt/0031-ar71xx-remove-bs-partition-ro-flag-for-UniFi-AC.patch b/build_patches/openwrt/0031-ar71xx-remove-bs-partition-ro-flag-for-UniFi-AC.patch
new file mode 100644
index 0000000000000000000000000000000000000000..9814f668794da9908a08a0dc46770691f9466522
--- /dev/null
+++ b/build_patches/openwrt/0031-ar71xx-remove-bs-partition-ro-flag-for-UniFi-AC.patch
@@ -0,0 +1,36 @@
+From e873363e0541d8ded05635e8341efe564c5d9cff Mon Sep 17 00:00:00 2001
+From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
+Date: Tue, 10 Apr 2018 19:04:13 +0200
+Subject: [PATCH] ar71xx: remove bs-partition ro-flag for UniFi AC
+
+This removes the read-only flag from the bs (bootselect) partition
+on UniFi AC devices. This allows to correct the indicator from which
+partition the device is booting its kernel from.
+
+See also:
+ - freifunk-gluon/gluon#1301freifunk-gluon/gluon#1301, ar71xx:  UBNT UniFi AP-AC Mesh/Lite/Pro sysupgrade broken
+ - https://bugs.lede-project.org/index.php?do=details&task_id=662
+
+Signed-off-by: David Bauer <mail@david-bauer.net>
+[Backported to our lede-17.01 snapshot]
+Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
+---
+ target/linux/ar71xx/image/ubnt.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk
+index 68fe8ad..65ed708 100644
+--- a/target/linux/ar71xx/image/ubnt.mk
++++ b/target/linux/ar71xx/image/ubnt.mk
+@@ -82,7 +82,7 @@ define Device/ubnt-unifiac
+   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
+   DEVICE_PROFILE := UBNT
+   IMAGE_SIZE := 7744k
+-  MTDPARTS = spi0.0:384k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),7744k(ubnt-airos)ro,128k(bs)ro,256k(cfg)ro,64k(EEPROM)ro
++  MTDPARTS = spi0.0:384k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),7744k(ubnt-airos)ro,128k(bs),256k(cfg)ro,64k(EEPROM)ro
+   IMAGES := sysupgrade.bin
+   IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
+ endef
+-- 
+2.7.4
+