Message ID | 20240307074612.1996609-7-Adithya.Balakumar@toshiba-tsip.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | Integrate Delta Update with rdiff_image and delta handler | expand |
On 07.03.24 08:46, 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 | 95 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 95 insertions(+) > > diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md > index cf1bcfb..4003243 100644 > --- a/doc/README.swupdate.md > +++ b/doc/README.swupdate.md > @@ -324,6 +324,101 @@ 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 > +``` > +Currently, Delta Software Update is supported only for root file system. > +Now, to verify a delta update, build an image with some modifications to the root file system (ex: Add additional packages). > +For this example, add the packages vim and nano (since the packages are not already included in the base image) to the image. This can be done by modifying the `recipes-core/images/cip-core-image.bb` file as shown below. > +``` > +diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb > +index 0ec7220..f61ce23 100644 > +--- a/recipes-core/images/cip-core-image.bb > ++++ b/recipes-core/images/cip-core-image.bb > +@@ -14,6 +14,7 @@ inherit image > + ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always --match 'v[0-9].[0-9]*'" > + DESCRIPTION = "CIP Core image" > + > ++IMAGE_PREINSTALL += "vim nano" > + IMAGE_INSTALL += "customizations" > + > + CIP_IMAGE_OPTIONS ?= "" > +``` Do not duplicate the description how to generate v1 and v2 images, compared to the existing "Building and testing the CIP Core image", that is just confusing. Describe the delta-update specifics only, likely the bits below. > +## Delta Software Update using rdiff_image handler > + > +Creating a delta update file for rdiff_image handler requires a reference image (against which the delta is computed). In this case, the image built in the previous section can be used as the reference image. > +Copy the reference image to the project directory. And set the variable `DELTA_RDIFF_REF_IMAGE` with the path to the reference image and set the variable `DELTA_UPDATE_TYPE` to `rdiff`. > + > +``` > +header: > + version: 14 > + > +local_conf_header: > + delta-update: | > + IMAGE_CLASSES:append = " delta_update" > + DELTA_UPDATE_TYPE = "rdiff" > + DELTA_ZCK_URL = "" > + DELTA_RDIFF_REF_IMAGE = "path/to/image/from/project/root/directory.wic" > + > +``` I don't want to fiddle with such files for a first test unless I really have to. I would like to have a default case ideally without any editing, just by rebuilding an image differently, maybe providing v1 to that build under a specific path/filename, and let the second build generate the delta image automatically. Jan > +Run the below command to build the image with the modification as shown above and with the root file system modification as described in previous section. > +``` > +KAS_BUILD_DIR=image2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/delta-update.yml > +``` > +Run the below command to start first image > +``` > +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64 > +``` > +Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `image2/tmp/deploy/images/qemu-amd64/` folder into the running system: > +``` > +host$ cd image2/tmp/deploy/images/qemu-amd64/ > +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost: > +``` > + > +### Delta Software Update Verification > + > +Follow the steps mentioned in the section [SWUpdate verification](#swupdate-verification) for verification. > + > +Since our target was to update the root file system by adding a few packages (vim and nano in this example), Check if the packages are available after the update by running either the `vim` command or `nano` command. > + > +## Delta Software Update using delta handler > + > +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 variable `DELTA_UPDATE_TYPE` to `zchunk`. > +``` > +header: > + version: 14 > + > +local_conf_header: > + delta-update: | > + IMAGE_CLASSES:append = " delta_update" > + DELTA_UPDATE_TYPE = "zchunk" > + DELTA_ZCK_URL = "<zck file url>" > + DELTA_RDIFF_REF_IMAGE = "" > + > +``` > +Run the below command to build the image with the modification as shown above and with the root file system modification as described in previous section. > +``` > +KAS_BUILD_DIR=image2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/delta-update.yml > +``` > +Run the below command to start first image > +``` > +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64 > +``` > +Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `image2/tmp/deploy/images/qemu-amd64/` folder into the running system: > +``` > +host$ cd image2/tmp/deploy/images/qemu-amd64/ > +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost: > +``` > +The `cip-core-image-cip-core-bookworm-qemu-amd64.zck` file must be hosted in a server. > + > +### Delta Software Update Verification > + > +Follow the steps mentioned in the section [Delta Software Update Verification](#delta-software-update-verification) for verification. > > # Building and testing the CIP Core image for BBB >
On 3/7/24 8:45 AM, Adithya Balakumar via lists.cip-project.org 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 | 95 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 95 insertions(+) > > diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md > index cf1bcfb..4003243 100644 > --- a/doc/README.swupdate.md > +++ b/doc/README.swupdate.md > @@ -324,6 +324,101 @@ 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 > +``` > +Currently, Delta Software Update is supported only for root file system. > +Now, to verify a delta update, build an image with some modifications to the root file system (ex: Add additional packages). > +For this example, add the packages vim and nano (since the packages are not already included in the base image) to the image. This can be done by modifying the `recipes-core/images/cip-core-image.bb` file as shown below. > +``` > +diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb > +index 0ec7220..f61ce23 100644 > +--- a/recipes-core/images/cip-core-image.bb > ++++ b/recipes-core/images/cip-core-image.bb > +@@ -14,6 +14,7 @@ inherit image > + ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always --match 'v[0-9].[0-9]*'" > + DESCRIPTION = "CIP Core image" > + > ++IMAGE_PREINSTALL += "vim nano" > + IMAGE_INSTALL += "customizations" > + > + CIP_IMAGE_OPTIONS ?= "" > +``` > +## Delta Software Update using rdiff_image handler > + > +Creating a delta update file for rdiff_image handler requires a reference image (against which the delta is computed). In this case, the image built in the previous section can be used as the reference image. > +Copy the reference image to the project directory. And set the variable `DELTA_RDIFF_REF_IMAGE` with the path to the reference image and set the variable `DELTA_UPDATE_TYPE` to `rdiff`. > + > +``` > +header: > + version: 14 > + > +local_conf_header: > + delta-update: | > + IMAGE_CLASSES:append = " delta_update" > + DELTA_UPDATE_TYPE = "rdiff" > + DELTA_ZCK_URL = "" > + DELTA_RDIFF_REF_IMAGE = "path/to/image/from/project/root/directory.wic" In my opinion `DELTA_RDIFF_REF_IMAGE` should allow an url to an server. This would allow to setup automatic builds. Quirin > + > +``` > +Run the below command to build the image with the modification as shown above and with the root file system modification as described in previous section. > +``` > +KAS_BUILD_DIR=image2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/delta-update.yml > +``` > +Run the below command to start first image > +``` > +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64 > +``` > +Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `image2/tmp/deploy/images/qemu-amd64/` folder into the running system: > +``` > +host$ cd image2/tmp/deploy/images/qemu-amd64/ > +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost: > +``` > + > +### Delta Software Update Verification > + > +Follow the steps mentioned in the section [SWUpdate verification](#swupdate-verification) for verification. > + > +Since our target was to update the root file system by adding a few packages (vim and nano in this example), Check if the packages are available after the update by running either the `vim` command or `nano` command. > + > +## Delta Software Update using delta handler > + > +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 variable `DELTA_UPDATE_TYPE` to `zchunk`. > +``` > +header: > + version: 14 > + > +local_conf_header: > + delta-update: | > + IMAGE_CLASSES:append = " delta_update" > + DELTA_UPDATE_TYPE = "zchunk" > + DELTA_ZCK_URL = "<zck file url>" > + DELTA_RDIFF_REF_IMAGE = "" > + > +``` > +Run the below command to build the image with the modification as shown above and with the root file system modification as described in previous section. > +``` > +KAS_BUILD_DIR=image2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/delta-update.yml > +``` > +Run the below command to start first image > +``` > +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64 > +``` > +Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `image2/tmp/deploy/images/qemu-amd64/` folder into the running system: > +``` > +host$ cd image2/tmp/deploy/images/qemu-amd64/ > +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost: > +``` > +The `cip-core-image-cip-core-bookworm-qemu-amd64.zck` file must be hosted in a server. > + > +### Delta Software Update Verification > + > +Follow the steps mentioned in the section [Delta Software Update Verification](#delta-software-update-verification) for verification. > > # Building and testing the CIP Core image for BBB > > > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#15258): https://lists.cip-project.org/g/cip-dev/message/15258 > Mute This Topic: https://lists.cip-project.org/mt/104783343/1753640 > Group Owner: cip-dev+owner@lists.cip-project.org > Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129121/1753640/1405269326/xyzzy [quirin.gylstorff@siemens.com] > -=-=-=-=-=-=-=-=-=-=-=- >
diff --git a/doc/README.swupdate.md b/doc/README.swupdate.md index cf1bcfb..4003243 100644 --- a/doc/README.swupdate.md +++ b/doc/README.swupdate.md @@ -324,6 +324,101 @@ 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 +``` +Currently, Delta Software Update is supported only for root file system. +Now, to verify a delta update, build an image with some modifications to the root file system (ex: Add additional packages). +For this example, add the packages vim and nano (since the packages are not already included in the base image) to the image. This can be done by modifying the `recipes-core/images/cip-core-image.bb` file as shown below. +``` +diff --git a/recipes-core/images/cip-core-image.bb b/recipes-core/images/cip-core-image.bb +index 0ec7220..f61ce23 100644 +--- a/recipes-core/images/cip-core-image.bb ++++ b/recipes-core/images/cip-core-image.bb +@@ -14,6 +14,7 @@ inherit image + ISAR_RELEASE_CMD = "git -C ${LAYERDIR_cip-core} describe --tags --dirty --always --match 'v[0-9].[0-9]*'" + DESCRIPTION = "CIP Core image" + ++IMAGE_PREINSTALL += "vim nano" + IMAGE_INSTALL += "customizations" + + CIP_IMAGE_OPTIONS ?= "" +``` +## Delta Software Update using rdiff_image handler + +Creating a delta update file for rdiff_image handler requires a reference image (against which the delta is computed). In this case, the image built in the previous section can be used as the reference image. +Copy the reference image to the project directory. And set the variable `DELTA_RDIFF_REF_IMAGE` with the path to the reference image and set the variable `DELTA_UPDATE_TYPE` to `rdiff`. + +``` +header: + version: 14 + +local_conf_header: + delta-update: | + IMAGE_CLASSES:append = " delta_update" + DELTA_UPDATE_TYPE = "rdiff" + DELTA_ZCK_URL = "" + DELTA_RDIFF_REF_IMAGE = "path/to/image/from/project/root/directory.wic" + +``` +Run the below command to build the image with the modification as shown above and with the root file system modification as described in previous section. +``` +KAS_BUILD_DIR=image2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/delta-update.yml +``` +Run the below command to start first image +``` +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64 +``` +Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `image2/tmp/deploy/images/qemu-amd64/` folder into the running system: +``` +host$ cd image2/tmp/deploy/images/qemu-amd64/ +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost: +``` + +### Delta Software Update Verification + +Follow the steps mentioned in the section [SWUpdate verification](#swupdate-verification) for verification. + +Since our target was to update the root file system by adding a few packages (vim and nano in this example), Check if the packages are available after the update by running either the `vim` command or `nano` command. + +## Delta Software Update using delta handler + +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 variable `DELTA_UPDATE_TYPE` to `zchunk`. +``` +header: + version: 14 + +local_conf_header: + delta-update: | + IMAGE_CLASSES:append = " delta_update" + DELTA_UPDATE_TYPE = "zchunk" + DELTA_ZCK_URL = "<zck file url>" + DELTA_RDIFF_REF_IMAGE = "" + +``` +Run the below command to build the image with the modification as shown above and with the root file system modification as described in previous section. +``` +KAS_BUILD_DIR=image2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/delta-update.yml +``` +Run the below command to start first image +``` +host$ DISTRO_RELEASE=bookworm SWUPDATE_BOOT=y ./start-qemu.sh amd64 +``` +Copy `cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu` file from `image2/tmp/deploy/images/qemu-amd64/` folder into the running system: +``` +host$ cd image2/tmp/deploy/images/qemu-amd64/ +host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64-delta.swu root@localhost: +``` +The `cip-core-image-cip-core-bookworm-qemu-amd64.zck` file must be hosted in a server. + +### Delta Software Update Verification + +Follow the steps mentioned in the section [Delta Software Update Verification](#delta-software-update-verification) for verification. # Building and testing the CIP Core image for BBB
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 | 95 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+)