OTA update - A/B (seamless) system updates


#1

Hi,

I’m building Nougat from source for kvim2 and should use OTA updates.

Is it possible anyway to use A/B seamless OTA update for kvim2?

I.e.,

  • is the A/B is supported by the current uboot?
  • what changes should be applied inside AOSP to use A/B (dts, build variables etc)?

Kind regards.


#2

please tell me what is a/b ?


#3

ravelo, please refer to
https://source.android.com/devices/tech/ota/


#4

The SDK source code has support for A/B seamless OTA update.
But we don’t use it because we need more partitions and will waste a lot of storage.

      logo:logo{
            pname = "logo";
            size = <0x0 0x2000000>;
            mask = <1>;
        };
        boot:boot{
            pname = "boot";
            size = <0x0 0x2000000>;
            mask = <1>;
        };
        rsv:rsv{
            pname = "rsv";
            size = <0x0 0x800000>;
            mask = <1>;
        };
        tee:tee{
            pname = "tee";
            size = <0x0 0x800000>;
            mask = <1>;
        };
        crypt:crypt{
            pname = "crypt";
            size = <0x0 0x2000000>;
            mask = <1>;
        };
        misc:misc{
            pname = "misc";
            size = <0x0 0x2000000>;
            mask = <1>;
        };
        boot_a:boot_a
        {
            pname = "boot_a";
            size = <0x0 0x2000000>;
            mask = <1>;
        };
        boot_b:boot_b
        {
            pname = "boot_b";
            size = <0x0 0x2000000>;
            mask = <1>;
        };
        system_a:system_a
        {
            pname = "system_a";
            size = <0x0 0x80000000>;
            mask = <1>;
        };
        system_b:system_b
        {
            pname = "system_b";
            size = <0x0 0x80000000>;
            mask = <1>;
        };


#5

I’ve already found A/B partitioning inside amlogic dts:
e.g. partition_mbox_ab.dtsi

             logo:logo{
			pname = "logo";
			size = <0x0 0x2000000>;
			mask = <1>;
		};
		boot_a:boot_a{
			pname = "boot_a";
			size = <0x0 0x2000000>;
			mask = <1>;
		};
		rsv:rsv{
			pname = "rsv";
			size = <0x0 0x800000>;
			mask = <1>;
		};
		tee:tee{
			pname = "tee";
			size = <0x0 0x800000>;
			mask = <1>;
		};
		crypt:crypt{
			pname = "crypt";
			size = <0x0 0x2000000>;
			mask = <1>;
		};
		misc:misc{
			pname = "misc";
			size = <0x0 0x2000000>;
			mask = <1>;
		};
		boot_b:boot_b
		{
			pname = "boot_b";
			size = <0x0 0x2000000>;
			mask = <1>;
		};
		system_a:system_a
		{
			pname = "system_a";
			size = <0x0 0x80000000>;
			mask = <1>;
		};
		system_b:system_b
		{
			pname = "system_b";
			size = <0x0 0x80000000>;
			mask = <1>;
		};
		data:data
		{
			pname = "data";
			size = <0xffffffff 0xffffffff>;
			mask = <4>;
		};

By the way why does yours (above) have one more ‘boot’ partition (i.e. boot, boot_a, boot_b) ?

I’ve also found AB_OTA_UPDATER variable inside kvim2.mk (which is disabled)…

But I still have some questions:

  • Is A/B OTA supported inside kvim2 uboot?
    And how to get it via CONFIG flags, patches etc?
  • Do we need some kernel patches to get A/B OTA working?
  • How to activate A/B inside AOSP ?
    What build variables should be set except AB_OTA_UPDATER?
    Is there aml_upgrade_package config for A/B available?

Maybe you can also share some info (from the SDK source code) to get A/B working for us.

Thanks in advance.


#6

Hi, Do you can tell me why you need A/B OTA? What project are you developing with VIMs?


#7

Hi.

We are developing industrial automation projects based on VIMs.
And we need A/B OTA for the following reasons:

First of all, the devices should be mounted into the floor/walls, so there will be no physical access to the sdcard or usb ports possible. Update package should be loaded into data partition via network or just streaming A/B directly from the net.

Update should not stop the system for a long time, so should run in background. The consumers cannot interact with the devices (e.g. via uboot cli, recovery etc) or wait a long until update package is applied by recovery to complete update.

And the last important reason is that we need 100% safe update without any chance to get bricked or boot straight into recovery.

And I think, there is also enough space in VIM2 Pro flash for 2 x 2GB system partition in respect that there is no more need for cache (512 MB) and recovery.

So, please you give some info on how to get A/B working for VIMs?

Thanks in advance.