Unifi AC: remove bs-partition ro-flag

Submitted by Adrian Schmutzler on April 11, 2018, 10:47 a.m.

Details

Message ID 1523443663-2086-1-git-send-email-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler April 11, 2018, 10:47 a.m.
This patch allows to modify the bs-partition on the AC Mesh.

Without the patch, the bs partition on the AC Mesh is locked
forever. This can be a problem if
a) the bs partition has not been updated correctly during initial flash
b) the sysupgrade mechanism is altered by OpenWRT in order to account for
the flip flop layout

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
 ...-remove-bs-partition-ro-flag-for-UniFi-AC.patch | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 build_patches/openwrt/0031-ar71xx-remove-bs-partition-ro-flag-for-UniFi-AC.patch

Patch hide | download patch | download mbox

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 0000000..9814f66
--- /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
+

Comments

Adrian Schmutzler June 10, 2018, 11:14 a.m.
Nur zur Erinnerung: Dieser Patch sollte unbedingt noch mit das nächste
Release.

https://mantis.freifunk-franken.de/view.php?id=99

Grüße

Adrian

> -----Original Message-----
> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf
> Of Adrian Schmutzler
> Sent: Mittwoch, 11. April 2018 12:48
> To: franken-dev@freifunk.net
> Subject: [PATCH] Unifi AC: remove bs-partition ro-flag
> 
> This patch allows to modify the bs-partition on the AC Mesh.
> 
> Without the patch, the bs partition on the AC Mesh is locked forever. This
> can be a problem if
> a) the bs partition has not been updated correctly during initial flash
> b) the sysupgrade mechanism is altered by OpenWRT in order to account for
> the flip flop layout
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> ---
>  ...-remove-bs-partition-ro-flag-for-UniFi-AC.patch | 36
> ++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>  create mode 100644 build_patches/openwrt/0031-ar71xx-remove-bs-
> partition-ro-flag-for-UniFi-AC.patch
> 
> 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 0000000..9814f66
> --- /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-airo
> +s)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-ai
> ++ ros)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
> +
> --
> 2.7.4
> 
> --
> franken-dev mailing list
> franken-dev@freifunk.net
> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net
Fabian Blaese June 13, 2018, 7:49 a.m.
Sollten wir wohl aufnehmen, bis wir auf eine OpenWRT Version updaten, die das schon drin hat.
Ist sonst etwas umständlich, die Partition zu reparieren, weil man das ohne TFTP nichta mehr geflasht bekommt.

Sieht soweit gut aus, habs aber selbst nicht ausprobiert.
Reviewed-by: Fabian Bläse <fabian@blaese.de>

Fabian

P.S. Dein Mailclient macht die Quote Levels irgendwie kaputt… (siehe unten)

> On 10. Jun 2018, at 13:14, <mail@adrianschmutzler.de> <mail@adrianschmutzler.de> wrote:
> 
> Nur zur Erinnerung: Dieser Patch sollte unbedingt noch mit das nächste
> Release.
> 
> https://mantis.freifunk-franken.de/view.php?id=99
> 
> Grüße
> 
> Adrian
> 
>> -----Original Message-----
>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf
>> Of Adrian Schmutzler
>> Sent: Mittwoch, 11. April 2018 12:48
>> To: franken-dev@freifunk.net
>> Subject: [PATCH] Unifi AC: remove bs-partition ro-flag
>> 
>> This patch allows to modify the bs-partition on the AC Mesh.
>> 
>> Without the patch, the bs partition on the AC Mesh is locked forever. This
>> can be a problem if
>> a) the bs partition has not been updated correctly during initial flash
>> b) the sysupgrade mechanism is altered by OpenWRT in order to account for
>> the flip flop layout
>> 
>> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
>> ---
>> ...-remove-bs-partition-ro-flag-for-UniFi-AC.patch | 36
>> ++++++++++++++++++++++
>> 1 file changed, 36 insertions(+)
>> create mode 100644 build_patches/openwrt/0031-ar71xx-remove-bs-
>> partition-ro-flag-for-UniFi-AC.patch
>> 
>> 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 0000000..9814f66
>> --- /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-airo
>> +s)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-ai
>> ++ ros)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
>> +
>> --
>> 2.7.4
>> 
>> --
>> franken-dev mailing list
>> franken-dev@freifunk.net
>> http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.net
>
Tim Niemeyer June 17, 2018, 8:39 a.m.
Hi

und applied.

Tim

Am Mittwoch, den 13.06.2018, 09:49 +0200 schrieb Fabian Bläse:
> Sollten wir wohl aufnehmen, bis wir auf eine OpenWRT Version updaten,
> die das schon drin hat.
> Ist sonst etwas umständlich, die Partition zu reparieren, weil man
> das ohne TFTP nichta mehr geflasht bekommt.
> 
> Sieht soweit gut aus, habs aber selbst nicht ausprobiert.
> Reviewed-by: Fabian Bläse <fabian@blaese.de>
> 
> Fabian
> 
> P.S. Dein Mailclient macht die Quote Levels irgendwie kaputt… (siehe
> unten)
> 
> > On 10. Jun 2018, at 13:14, <mail@adrianschmutzler.de> <mail@adrians
> > chmutzler.de> wrote:
> > 
> > Nur zur Erinnerung: Dieser Patch sollte unbedingt noch mit das
> > nächste
> > Release.
> > 
> > https://mantis.freifunk-franken.de/view.php?id=99
> > 
> > Grüße
> > 
> > Adrian
> > 
> > > -----Original Message-----
> > > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On
> > > Behalf
> > > Of Adrian Schmutzler
> > > Sent: Mittwoch, 11. April 2018 12:48
> > > To: franken-dev@freifunk.net
> > > Subject: [PATCH] Unifi AC: remove bs-partition ro-flag
> > > 
> > > This patch allows to modify the bs-partition on the AC Mesh.
> > > 
> > > Without the patch, the bs partition on the AC Mesh is locked
> > > forever. This
> > > can be a problem if
> > > a) the bs partition has not been updated correctly during initial
> > > flash
> > > b) the sysupgrade mechanism is altered by OpenWRT in order to
> > > account for
> > > the flip flop layout
> > > 
> > > Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> > > ---
> > > ...-remove-bs-partition-ro-flag-for-UniFi-AC.patch | 36
> > > ++++++++++++++++++++++
> > > 1 file changed, 36 insertions(+)
> > > create mode 100644 build_patches/openwrt/0031-ar71xx-remove-bs-
> > > partition-ro-flag-for-UniFi-AC.patch
> > > 
> > > 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 0000000..9814f66
> > > --- /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=66
> > > 2
> > > +
> > > +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-airo
> > > +s)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-ai
> > > ++ ros)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
> > > +
> > > --
> > > 2.7.4
> > > 
> > > --
> > > franken-dev mailing list
> > > franken-dev@freifunk.net
> > > http://lists.freifunk.net/mailman/listinfo/franken-dev-freifunk.n
> > > et
> 
>