From d83deb475faf8d0f89b574338275a845ba127005 Mon Sep 17 00:00:00 2001
From: Andreas Gnau <andreas.gnau@iopsys.eu>
Date: Tue, 16 Mar 2021 19:39:09 +0100
Subject: [PATCH] brcm63xx: Change overlay volume name to overlay1/2

To be consistent with the naming of bootfs1/2 and rootfs1/2, change the
name of the corresponding volume for the overlay to overlay1/2.

Only WE7202242SA and SMARTHUB3_R0A are in customer's hands.
SMARTHUB3_R0A is using eMMC flash, and we use the partition number for
eMMC devices at this point, so there is no issue. Existing WE7202242SA
or SMARTHUB3_R0A won't be migrated. New revisions of the boards have a
different board id with the new renamed overlay partition.

Existing boards currently under development, need to be updated manually.
After upgrading to the new system, the overlay will fail to mount due to
the rename, and the following needs to be executed from serial console:

0. Upgrade to the new version (does not matter if via sysupgrade or
   bootloader)

1. After the reboot into the new system, rename overlayA:

       ubirename /dev/ubi0 overlayA overlay1

2. Then, rename overlayB:

       ubirename /dev/ubi0 overlayB overlay2
3. Check that both overlay partitions exist with the new names. The
   command

       ubinfo --all | grep overlay
   should return:

       Name:        overlay1
       Name:        overlay2
4. Reboot:
    reboot

From this point on, running older images with the old overlay name will
no longer work and only newer images (i.e. after this change) will work.
---
 iopsys-brcm63xx-arm/base-files/etc/system_layout/nand.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iopsys-brcm63xx-arm/base-files/etc/system_layout/nand.json b/iopsys-brcm63xx-arm/base-files/etc/system_layout/nand.json
index 364046b2c..301fb5996 100644
--- a/iopsys-brcm63xx-arm/base-files/etc/system_layout/nand.json
+++ b/iopsys-brcm63xx-arm/base-files/etc/system_layout/nand.json
@@ -5,13 +5,13 @@
       "id": 0,
       "name": "A",
       "rootfs": "/dev/ubiblock0_4",
-      "overlay": "ubi0:overlayA"
+      "overlay": "ubi0:overlay1"
     },
     {
       "id": 1,
       "name": "B",
       "rootfs": "/dev/ubiblock0_6",
-      "overlay": "ubi0:overlayB"
+      "overlay": "ubi0:overlay2"
     }
   ],
   "overlay_scope": [
-- 
GitLab