diff mbox series

[isar-cip-core,v4,3/3] doc/README.swupdate.md: Update steps to test Delta software Update

Message ID 20240425094444.404036-4-Adithya.Balakumar@toshiba-tsip.com (mailing list archive)
State Superseded
Headers show
Series Integrate Delta Update with rdiff_image and delta handler | expand

Commit Message

Adithya Balakumar April 25, 2024, 9:44 a.m. UTC
This change includes steps to verify Delta Software Update with
rdiff_image and delta handler

Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
---
 doc/README.swupdate.md | 59 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

Comments

Jan Kiszka April 29, 2024, 12:45 p.m. UTC | #1
On 25.04.24 11:44, Adithya Balakumar wrote:
> This change includes steps to verify Delta Software Update with
> rdiff_image and delta handler
> 
> Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
> ---
>  doc/README.swupdate.md | 59 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
> 
> diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md
> index b7e13f7..d955868 100644
> --- a/doc/README.swupdate.md
> +++ b/doc/README.swupdate.md
> @@ -360,6 +360,65 @@ user variables:
>  
>  ```
>  
> +# Building and testing the CIP Core image for Delta Software Update
> +
> +Set up `kas-container` as described in the [top-level README](../README.md), and then proceed with the following steps.
> +
> +First build an image using the following command:
> +```
> +host$ ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/rt.yml
> +```
> +The above image will be used as the base image to which the update is applied.
> +
> +## Delta Software Update using rdiff_image handler
> +
> +Creating an delta update file for rdiff_image handler requires a reference artifact (against which the delta is computed). In this case, the image built in the previous section can be used as the reference artifact(.squashfs/.verity file). Set the variable `DELTA_UPDATE_TYPE` as `rdiff` and set the variable `DELTA_RDIFF_REF_IMAGE` with the name of the reference artifact. The values of `DELTA_UPDATE_TYPE` and `DELTA_RDIFF_REF_IMAGE` can be changed in the `swupdate.yml` file.
> +

Can't we enable rdiff by default set DELTA_RDIFF_REF_IMAGE for our own
demo image? I don't want to hack on the code to try things out, at most
select an option in the kconfig menu.

> +The build system looks for the reference artifact in a directory named `previous-image` in the build directory used for the build process.
> +
> +Copy the reference artifact to the mentioned directory with the following commands:
> +```
> +mkdir -p build-v2/previous-image
> +cp build/tmp/deploy/images/qemu-amd64/cip-core-image-cip-core-bookworm-qemu-amd64.squashfs build-v2/previous-image
> +```
> +Build the second image with `build-v2` as the build directory with the following command:
> +```
> +KAS_BUILD_DIR=build-v2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml
> +```
> +Now start the first image. Run the following commands:
> +```
> +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64
> +```
> +Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system:
> +```
> +host$ cd build-v2/tmp/deploy/images/qemu-amd64/
> +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost:
> +```
> +
> +## Delta Software Update using delta handler

Shouldn't this contain "zchunk" in the title?

> +
> +Currently zchunk based delta updates are supported only in Sid images. Make sure to build the first image with Sid as the distribution (use `sid.yml` file as part of the build command).
> +For Delta update with zchunk, set the variable `DELTA_ZCK_URL` with the URL of the zck file that is hosted in a http server and set the `DELTA_UPDATE_TYPE` to `zchunk` in `swupdate.yml` file.
> +
> +Build the second image with the modification as shown above with the following command:
> +```
> +KAS_BUILD_DIR=build-v2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/sid.yml
> +```
> +Now start the first image. Run the following commands:
> +```
> +host$ DISTRO_RELEASE=sid SWUPDATE_BOOT=y ./start-qemu.sh amd64
> +```
> +Copy `cip-core-image-cip-core-sid-qemu-amd64-delta.swu` file from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system:
> +```
> +host$ cd build-v2/tmp/deploy/images/qemu-amd64/
> +host$ scp -P 22222 ./cip-core-image-cip-core-sid-qemu-amd64-delta.swu root@localhost:
> +```
> +The `cip-core-image-cip-core-sid-qemu-amd64.zck` file must be hosted in a http server.
> +
> +### Delta Software Update Verification

This should be "##", i.e. at the same subsection level as the previous ones.

> +
> +Follow the steps mentioned in the section [SWUpdate verification](#swupdate-verification) for verification.
> +
>  # Building and testing the CIP Core image for BBB
>  
>  Follow the steps mentioned in the section [Building and testing the CIP Core image](README.swupdate.md#building-and-testing-the-cip-core-image) for creating images and .swu files.

Jan
Adithya Balakumar April 29, 2024, 1:05 p.m. UTC | #2
-----Original Message-----
From: Jan Kiszka <jan.kiszka@siemens.com> 
Sent: Monday, April 29, 2024 6:15 PM
To: balakumar adithya(TSIP TEUR) <Adithya.Balakumar@toshiba-tsip.com>; cip-dev@lists.cip-project.org
Cc: quirin.gylstorff@siemens.com; felix.moessbauer@siemens.com; kunijadar shivanand(TSIP TMIEC ODG Porting) <Shivanand.Kunijadar@toshiba-tsip.com>; ashrith sai(TSIP) <Sai.Sathujoda@toshiba-tsip.com>; dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
Subject: Re: [isar-cip-core][PATCH v4 3/3] doc/README.swupdate.md: Update steps to test Delta software Update

On 25.04.24 11:44, Adithya Balakumar wrote:
> This change includes steps to verify Delta Software Update with 
> rdiff_image and delta handler
> 
> Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
> ---
>  doc/README.swupdate.md | 59 
> ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
> 
> diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md index 
> b7e13f7..d955868 100644
> --- a/doc/README.swupdate.md
> +++ b/doc/README.swupdate.md
> @@ -360,6 +360,65 @@ user variables:
>  
>  ```
>  
> +# Building and testing the CIP Core image for Delta Software Update
> +
> +Set up `kas-container` as described in the [top-level README](../README.md), and then proceed with the following steps.
> +
> +First build an image using the following command:
> +```
> +host$ ./kas-container build 
> +kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/rt.y
> +ml
> +```
> +The above image will be used as the base image to which the update is applied.
> +
> +## Delta Software Update using rdiff_image handler
> +
> +Creating an delta update file for rdiff_image handler requires a reference artifact (against which the delta is computed). In this case, the image built in the previous section can be used as the reference artifact(.squashfs/.verity file). Set the variable `DELTA_UPDATE_TYPE` as `rdiff` and set the variable `DELTA_RDIFF_REF_IMAGE` with the name of the reference artifact. The values of `DELTA_UPDATE_TYPE` and `DELTA_RDIFF_REF_IMAGE` can be changed in the `swupdate.yml` file.
> +

Can't we enable rdiff by default set DELTA_RDIFF_REF_IMAGE for our own demo image? I don't want to hack on the code to try things out, at most select an option in the kconfig menu. 

[Adithya Balakumar] 
Hi Jan,

I was considering this approach as suggested by you here. But when rdiff is given as a default option and if the necessary artifact was **not** provided at the expected location, then we would have to fallback to create a complete update swu file. It could cause a confusion for the user. 

Or maybe handle the above situation by a warning msg that we are falling back to creating a complete swu file.

Regards,
Adithya  

> +The build system looks for the reference artifact in a directory named `previous-image` in the build directory used for the build process.
> +
> +Copy the reference artifact to the mentioned directory with the following commands:
> +```
> +mkdir -p build-v2/previous-image
> +cp 
> +build/tmp/deploy/images/qemu-amd64/cip-core-image-cip-core-bookworm-q
> +emu-amd64.squashfs build-v2/previous-image ``` Build the second image with `build-v2` as the build directory with the following command:
> +```
> +KAS_BUILD_DIR=build-v2 ./kas-container build 
> +kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml
> +```
> +Now start the first image. Run the following commands:
> +```
> +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64 
> +``` Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file 
> +from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system:
> +```
> +host$ cd build-v2/tmp/deploy/images/qemu-amd64/
> +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost:
> +```
> +
> +## Delta Software Update using delta handler

Shouldn't this contain "zchunk" in the title?

> +
> +Currently zchunk based delta updates are supported only in Sid images. Make sure to build the first image with Sid as the distribution (use `sid.yml` file as part of the build command).
> +For Delta update with zchunk, set the variable `DELTA_ZCK_URL` with the URL of the zck file that is hosted in a http server and set the `DELTA_UPDATE_TYPE` to `zchunk` in `swupdate.yml` file.
> +
> +Build the second image with the modification as shown above with the following command:
> +```
> +KAS_BUILD_DIR=build-v2 ./kas-container build 
> +kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/sid.
> +yml
> +```
> +Now start the first image. Run the following commands:
> +```
> +host$ DISTRO_RELEASE=sid SWUPDATE_BOOT=y ./start-qemu.sh amd64 ``` 
> +Copy `cip-core-image-cip-core-sid-qemu-amd64-delta.swu` file from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system:
> +```
> +host$ cd build-v2/tmp/deploy/images/qemu-amd64/
> +host$ scp -P 22222 ./cip-core-image-cip-core-sid-qemu-amd64-delta.swu root@localhost:
> +```
> +The `cip-core-image-cip-core-sid-qemu-amd64.zck` file must be hosted in a http server.
> +
> +### Delta Software Update Verification

This should be "##", i.e. at the same subsection level as the previous ones.

> +
> +Follow the steps mentioned in the section [SWUpdate verification](#swupdate-verification) for verification.
> +
>  # Building and testing the CIP Core image for BBB
>  
>  Follow the steps mentioned in the section [Building and testing the CIP Core image](README.swupdate.md#building-and-testing-the-cip-core-image) for creating images and .swu files.

Jan

--
Siemens AG, Technology
Linux Expert Center
Jan Kiszka April 29, 2024, 2:18 p.m. UTC | #3
On 29.04.24 15:05, Adithya.Balakumar@toshiba-tsip.com wrote:
> 
> 
> -----Original Message-----
> From: Jan Kiszka <jan.kiszka@siemens.com> 
> Sent: Monday, April 29, 2024 6:15 PM
> To: balakumar adithya(TSIP TEUR) <Adithya.Balakumar@toshiba-tsip.com>; cip-dev@lists.cip-project.org
> Cc: quirin.gylstorff@siemens.com; felix.moessbauer@siemens.com; kunijadar shivanand(TSIP TMIEC ODG Porting) <Shivanand.Kunijadar@toshiba-tsip.com>; ashrith sai(TSIP) <Sai.Sathujoda@toshiba-tsip.com>; dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [isar-cip-core][PATCH v4 3/3] doc/README.swupdate.md: Update steps to test Delta software Update
> 
> On 25.04.24 11:44, Adithya Balakumar wrote:
>> This change includes steps to verify Delta Software Update with 
>> rdiff_image and delta handler
>>
>> Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
>> ---
>>  doc/README.swupdate.md | 59 
>> ++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 59 insertions(+)
>>
>> diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md index 
>> b7e13f7..d955868 100644
>> --- a/doc/README.swupdate.md
>> +++ b/doc/README.swupdate.md
>> @@ -360,6 +360,65 @@ user variables:
>>  
>>  ```
>>  
>> +# Building and testing the CIP Core image for Delta Software Update
>> +
>> +Set up `kas-container` as described in the [top-level README](../README.md), and then proceed with the following steps.
>> +
>> +First build an image using the following command:
>> +```
>> +host$ ./kas-container build 
>> +kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/rt.y
>> +ml
>> +```
>> +The above image will be used as the base image to which the update is applied.
>> +
>> +## Delta Software Update using rdiff_image handler
>> +
>> +Creating an delta update file for rdiff_image handler requires a reference artifact (against which the delta is computed). In this case, the image built in the previous section can be used as the reference artifact(.squashfs/.verity file). Set the variable `DELTA_UPDATE_TYPE` as `rdiff` and set the variable `DELTA_RDIFF_REF_IMAGE` with the name of the reference artifact. The values of `DELTA_UPDATE_TYPE` and `DELTA_RDIFF_REF_IMAGE` can be changed in the `swupdate.yml` file.
>> +
> 
> Can't we enable rdiff by default set DELTA_RDIFF_REF_IMAGE for our own demo image? I don't want to hack on the code to try things out, at most select an option in the kconfig menu. 
> 
> [Adithya Balakumar] 
> Hi Jan,
> 
> I was considering this approach as suggested by you here. But when rdiff is given as a default option and if the necessary artifact was **not** provided at the expected location, then we would have to fallback to create a complete update swu file. It could cause a confusion for the user. 
> 
> Or maybe handle the above situation by a warning msg that we are falling back to creating a complete swu file.
> 

If we want to enforce the expectations and deliverables, then we need to
provide at least a kas option file to enable this mode. IIRC, we came
from there, and I asked to avoid that :).

So, we are currently generating only one SWU, and that is either a full
or a delta image, depending on the configured mode? Why not generating
both? Not easily expressible in our current classes/recipes?

Jan
Adithya Balakumar April 29, 2024, 2:59 p.m. UTC | #4
-----Original Message-----
From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf Of Jan Kiszka via lists.cip-project.org
Sent: Monday, April 29, 2024 7:48 PM
To: balakumar adithya(TSIP TEUR) <Adithya.Balakumar@toshiba-tsip.com>; cip-dev@lists.cip-project.org
Cc: quirin.gylstorff@siemens.com; felix.moessbauer@siemens.com; kunijadar shivanand(TSIP TMIEC ODG Porting) <Shivanand.Kunijadar@toshiba-tsip.com>; ashrith sai(TSIP) <Sai.Sathujoda@toshiba-tsip.com>; dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
Subject: Re: [cip-dev] [isar-cip-core][PATCH v4 3/3] doc/README.swupdate.md: Update steps to test Delta software Update

On 29.04.24 15:05, Adithya.Balakumar@toshiba-tsip.com wrote:
> 
> 
> -----Original Message-----
> From: Jan Kiszka <jan.kiszka@siemens.com>
> Sent: Monday, April 29, 2024 6:15 PM
> To: balakumar adithya(TSIP TEUR) <Adithya.Balakumar@toshiba-tsip.com>; 
> cip-dev@lists.cip-project.org
> Cc: quirin.gylstorff@siemens.com; felix.moessbauer@siemens.com; 
> kunijadar shivanand(TSIP TMIEC ODG Porting) 
> <Shivanand.Kunijadar@toshiba-tsip.com>; ashrith sai(TSIP) 
> <Sai.Sathujoda@toshiba-tsip.com>; dinesh kumar(TSIP TMIEC ODG Porting) 
> <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME 
> ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [isar-cip-core][PATCH v4 3/3] doc/README.swupdate.md: 
> Update steps to test Delta software Update
> 
> On 25.04.24 11:44, Adithya Balakumar wrote:
>> This change includes steps to verify Delta Software Update with 
>> rdiff_image and delta handler
>>
>> Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
>> ---
>>  doc/README.swupdate.md | 59
>> ++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 59 insertions(+)
>>
>> diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md index
>> b7e13f7..d955868 100644
>> --- a/doc/README.swupdate.md
>> +++ b/doc/README.swupdate.md
>> @@ -360,6 +360,65 @@ user variables:
>>  
>>  ```
>>  
>> +# Building and testing the CIP Core image for Delta Software Update
>> +
>> +Set up `kas-container` as described in the [top-level README](../README.md), and then proceed with the following steps.
>> +
>> +First build an image using the following command:
>> +```
>> +host$ ./kas-container build
>> +kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/rt.
>> +y
>> +ml
>> +```
>> +The above image will be used as the base image to which the update is applied.
>> +
>> +## Delta Software Update using rdiff_image handler
>> +
>> +Creating an delta update file for rdiff_image handler requires a reference artifact (against which the delta is computed). In this case, the image built in the previous section can be used as the reference artifact(.squashfs/.verity file). Set the variable `DELTA_UPDATE_TYPE` as `rdiff` and set the variable `DELTA_RDIFF_REF_IMAGE` with the name of the reference artifact. The values of `DELTA_UPDATE_TYPE` and `DELTA_RDIFF_REF_IMAGE` can be changed in the `swupdate.yml` file.
>> +
> 
> Can't we enable rdiff by default set DELTA_RDIFF_REF_IMAGE for our own demo image? I don't want to hack on the code to try things out, at most select an option in the kconfig menu. 
> 
> [Adithya Balakumar]
> Hi Jan,
> 
> I was considering this approach as suggested by you here. But when rdiff is given as a default option and if the necessary artifact was **not** provided at the expected location, then we would have to fallback to create a complete update swu file. It could cause a confusion for the user. 
> 
> Or maybe handle the above situation by a warning msg that we are falling back to creating a complete swu file.
> 

If we want to enforce the expectations and deliverables, then we need to provide at least a kas option file to enable this mode. IIRC, we came from there, and I asked to avoid that :).

So, we are currently generating only one SWU, and that is either a full or a delta image, depending on the configured mode? Why not generating both? Not easily expressible in our current classes/recipes?

Jan

[Adithya Balakumar] 

Hi Jan,

Apologies for this back and forth.

Yes, currently we are generating only one SWU (delta or complete). And this approach was taken based on feedback from v3. Linking the discussion thread here: https://lists.cip-project.org/g/cip-dev/topic/105533170#msg15561
Up until v3, the implementation was for creating complete update swu and a delta update swu (if an artifact was provided in a said location and possibly based on other configs).

Regards,
Adithya  

--
Siemens AG, Technology
Linux Expert Center
Jan Kiszka May 1, 2024, 7:39 a.m. UTC | #5
On 29.04.24 16:59, Adithya.Balakumar@toshiba-tsip.com wrote:
> 
> 
> -----Original Message-----
> From: cip-dev@lists.cip-project.org <cip-dev@lists.cip-project.org> On Behalf Of Jan Kiszka via lists.cip-project.org
> Sent: Monday, April 29, 2024 7:48 PM
> To: balakumar adithya(TSIP TEUR) <Adithya.Balakumar@toshiba-tsip.com>; cip-dev@lists.cip-project.org
> Cc: quirin.gylstorff@siemens.com; felix.moessbauer@siemens.com; kunijadar shivanand(TSIP TMIEC ODG Porting) <Shivanand.Kunijadar@toshiba-tsip.com>; ashrith sai(TSIP) <Sai.Sathujoda@toshiba-tsip.com>; dinesh kumar(TSIP TMIEC ODG Porting) <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
> Subject: Re: [cip-dev] [isar-cip-core][PATCH v4 3/3] doc/README.swupdate.md: Update steps to test Delta software Update
> 
> On 29.04.24 15:05, Adithya.Balakumar@toshiba-tsip.com wrote:
>>
>>
>> -----Original Message-----
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>> Sent: Monday, April 29, 2024 6:15 PM
>> To: balakumar adithya(TSIP TEUR) <Adithya.Balakumar@toshiba-tsip.com>; 
>> cip-dev@lists.cip-project.org
>> Cc: quirin.gylstorff@siemens.com; felix.moessbauer@siemens.com; 
>> kunijadar shivanand(TSIP TMIEC ODG Porting) 
>> <Shivanand.Kunijadar@toshiba-tsip.com>; ashrith sai(TSIP) 
>> <Sai.Sathujoda@toshiba-tsip.com>; dinesh kumar(TSIP TMIEC ODG Porting) 
>> <dinesh.kumar@toshiba-tsip.com>; hayashi kazuhiro(林 和宏 DME 
>> ○DIG□MPS○MP4) <kazuhiro3.hayashi@toshiba.co.jp>
>> Subject: Re: [isar-cip-core][PATCH v4 3/3] doc/README.swupdate.md: 
>> Update steps to test Delta software Update
>>
>> On 25.04.24 11:44, Adithya Balakumar wrote:
>>> This change includes steps to verify Delta Software Update with 
>>> rdiff_image and delta handler
>>>
>>> Signed-off-by: Adithya Balakumar <Adithya.Balakumar@toshiba-tsip.com>
>>> ---
>>>  doc/README.swupdate.md | 59
>>> ++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 59 insertions(+)
>>>
>>> diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md index
>>> b7e13f7..d955868 100644
>>> --- a/doc/README.swupdate.md
>>> +++ b/doc/README.swupdate.md
>>> @@ -360,6 +360,65 @@ user variables:
>>>  
>>>  ```
>>>  
>>> +# Building and testing the CIP Core image for Delta Software Update
>>> +
>>> +Set up `kas-container` as described in the [top-level README](../README.md), and then proceed with the following steps.
>>> +
>>> +First build an image using the following command:
>>> +```
>>> +host$ ./kas-container build
>>> +kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/rt.
>>> +y
>>> +ml
>>> +```
>>> +The above image will be used as the base image to which the update is applied.
>>> +
>>> +## Delta Software Update using rdiff_image handler
>>> +
>>> +Creating an delta update file for rdiff_image handler requires a reference artifact (against which the delta is computed). In this case, the image built in the previous section can be used as the reference artifact(.squashfs/.verity file). Set the variable `DELTA_UPDATE_TYPE` as `rdiff` and set the variable `DELTA_RDIFF_REF_IMAGE` with the name of the reference artifact. The values of `DELTA_UPDATE_TYPE` and `DELTA_RDIFF_REF_IMAGE` can be changed in the `swupdate.yml` file.
>>> +
>>
>> Can't we enable rdiff by default set DELTA_RDIFF_REF_IMAGE for our own demo image? I don't want to hack on the code to try things out, at most select an option in the kconfig menu. 
>>
>> [Adithya Balakumar]
>> Hi Jan,
>>
>> I was considering this approach as suggested by you here. But when rdiff is given as a default option and if the necessary artifact was **not** provided at the expected location, then we would have to fallback to create a complete update swu file. It could cause a confusion for the user. 
>>
>> Or maybe handle the above situation by a warning msg that we are falling back to creating a complete swu file.
>>
> 
> If we want to enforce the expectations and deliverables, then we need to provide at least a kas option file to enable this mode. IIRC, we came from there, and I asked to avoid that :).
> 
> So, we are currently generating only one SWU, and that is either a full or a delta image, depending on the configured mode? Why not generating both? Not easily expressible in our current classes/recipes?
> 
> Jan
> 
> [Adithya Balakumar] 
> 
> Hi Jan,
> 
> Apologies for this back and forth.
> 
> Yes, currently we are generating only one SWU (delta or complete). And this approach was taken based on feedback from v3. Linking the discussion thread here: https://lists.cip-project.org/g/cip-dev/topic/105533170#msg15561
> Up until v3, the implementation was for creating complete update swu and a delta update swu (if an artifact was provided in a said location and possibly based on other configs).
> 

For now, please just add a kas option file and a Kconfig menu entry
again. We will later model delta updates as a separate image format so
that you can select both, and we can then decide whether to keep the
option or build the delta swu automatically when there is v1 artifact found.

Thanks,
Jan
diff mbox series

Patch

diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md
index b7e13f7..d955868 100644
--- a/doc/README.swupdate.md
+++ b/doc/README.swupdate.md
@@ -360,6 +360,65 @@  user variables:
 
 ```
 
+# Building and testing the CIP Core image for Delta Software Update
+
+Set up `kas-container` as described in the [top-level README](../README.md), and then proceed with the following steps.
+
+First build an image using the following command:
+```
+host$ ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/rt.yml
+```
+The above image will be used as the base image to which the update is applied.
+
+## Delta Software Update using rdiff_image handler
+
+Creating an delta update file for rdiff_image handler requires a reference artifact (against which the delta is computed). In this case, the image built in the previous section can be used as the reference artifact(.squashfs/.verity file). Set the variable `DELTA_UPDATE_TYPE` as `rdiff` and set the variable `DELTA_RDIFF_REF_IMAGE` with the name of the reference artifact. The values of `DELTA_UPDATE_TYPE` and `DELTA_RDIFF_REF_IMAGE` can be changed in the `swupdate.yml` file.
+
+The build system looks for the reference artifact in a directory named `previous-image` in the build directory used for the build process.
+
+Copy the reference artifact to the mentioned directory with the following commands:
+```
+mkdir -p build-v2/previous-image
+cp build/tmp/deploy/images/qemu-amd64/cip-core-image-cip-core-bookworm-qemu-amd64.squashfs build-v2/previous-image
+```
+Build the second image with `build-v2` as the build directory with the following command:
+```
+KAS_BUILD_DIR=build-v2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml
+```
+Now start the first image. Run the following commands:
+```
+host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64
+```
+Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system:
+```
+host$ cd build-v2/tmp/deploy/images/qemu-amd64/
+host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost:
+```
+
+## Delta Software Update using delta handler
+
+Currently zchunk based delta updates are supported only in Sid images. Make sure to build the first image with Sid as the distribution (use `sid.yml` file as part of the build command).
+For Delta update with zchunk, set the variable `DELTA_ZCK_URL` with the URL of the zck file that is hosted in a http server and set the `DELTA_UPDATE_TYPE` to `zchunk` in `swupdate.yml` file.
+
+Build the second image with the modification as shown above with the following command:
+```
+KAS_BUILD_DIR=build-v2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/sid.yml
+```
+Now start the first image. Run the following commands:
+```
+host$ DISTRO_RELEASE=sid SWUPDATE_BOOT=y ./start-qemu.sh amd64
+```
+Copy `cip-core-image-cip-core-sid-qemu-amd64-delta.swu` file from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system:
+```
+host$ cd build-v2/tmp/deploy/images/qemu-amd64/
+host$ scp -P 22222 ./cip-core-image-cip-core-sid-qemu-amd64-delta.swu root@localhost:
+```
+The `cip-core-image-cip-core-sid-qemu-amd64.zck` file must be hosted in a http server.
+
+### Delta Software Update Verification
+
+Follow the steps mentioned in the section [SWUpdate verification](#swupdate-verification) for verification.
+
 # Building and testing the CIP Core image for BBB
 
 Follow the steps mentioned in the section [Building and testing the CIP Core image](README.swupdate.md#building-and-testing-the-cip-core-image) for creating images and .swu files.