ostroproject / ostro-os

Ostro OS
Other
93 stars 43 forks source link

Updating target using ipk packages #115

Closed js333031 closed 8 years ago

js333031 commented 8 years ago

I see that build/tmp-glibc/deploy/ipk/edison contains ipk files. ipk and opkg are not mentioned on https://ostroproject.org.

Does ostro-image-swupd support updating via opkg?

kad commented 8 years ago

No, swupd uses different approach to deal with software updates. You can read details on how it works here: https://clearlinux.org/documentation/index_sw_update.html IPK packages that you see in build directory are used internally by Yocto build tools to produce images and not usable for anything else.

js333031 commented 8 years ago

I'm not familiar with swup process from CL. When a SWUPD_BUNDLES and BUNDLE_CONTENTS[feature_one] are defined, are the dependencies automatically brought into the bundle?

For example, I want to create a sftp-server bundle. Will the bundle content include other packages needed by sftp-server? Would IMAGE_FEATURE be an alternative to including sftp-server in a development target image?

Also, what's the opkg.py in noswupd image?

gvancuts commented 8 years ago

Hi @js333031 , yes, all dependencies will be resolved at build time and the bundle will include all of them.

You can also add functionalities (like sftp and others) in your image (i.e. without defining them in a bundle), I would recommend you read this section of our documentation on how to do that: https://ostroproject.org/documentation/howtos/building-images.html#installing-additional-packages

js333031 commented 8 years ago

swupd sounds like it targets a production/deployment env. where required files are well known in advance. Given that in development phases, packages may be needed on the fly, rebuilding the image to include packages is inefficient. I'm used to having package repositories available via web-server and using rpm like tools to do updates on the target without having to reimage the target.

With Ostro, my choices for installing SW on target are:

  1. create bundles and use swupd to update the target.
  2. Use OSTRO_IMAGE_EXTRA_FEATURES
  3. Use OSTRO_IMAGE_EXTRA_INSTALL

Is that correct?

gvancuts commented 8 years ago

The three options you list above are the main ones indeed but there are more choices depending on how comfortable you feel with them. A good starting point in the doc is here: https://ostroproject.org/documentation/architecture/architecture-overview.html#ostro-os-development-workflows

In addition to the options mentionned above, you could:

Just to clarify one point when using swupd, regardless of whether you add more packages to an image using bitbake (either using bundles or OSTRO_IMAGE_EXTRA_INSTALL/FEATURES), you can point your device at the updated swupd repo that contains these additional packages and simply update/add new bundles. You don't need to reflash your device with a complete new image.

js333031 commented 8 years ago

Currently, I'm interested in updating target with sftp server, not adding my own layers or developing new packages. I could add the sftp server via local.conf variables. When using Moon Island, I used smart tool which made it easy to update the target using a web server. It took care of installing dependencies. I will check what bundle includes sftp server in Ostro.

Thanks!

js333031 commented 8 years ago

Adding packages via SWUPD_BUNDLES is very unproductive, probably because I'm not yet familiar with swupd workflow. After updating local.conf with new package in my bundle, I am doing bitbake -k ostro-image-swupd followed by swupd on Edison. After the update, I discover something else is needed so then repeat the process again. Hours wasted. Is there a better way?

pohly commented 8 years ago

Adding content to an image via swupd is not recommended while experimenting. swupd is meant to be used when producing and maintaining the final, production-quality image.

The recommended approach while experimenting is to add content to ostro-image-noswupd.bb and build that image. That can be done in your local.conf. If you want a bit more reproducibility, define your own non-swupd image with the desired content and keep that in a source code repository.

Another, unsupported option is to enable package management in your local build, for example with OSTRO_IMAGE_NOSWUPD_EXTRA_FEATURES_append = " package-management" in local.conf, and then making your own package feed available as described in http://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#package-feeds-dev-environment.

js333031 commented 8 years ago

I added OSTRO_IMAGE_NOSWUPD_EXTRA_FEATURES_append = " package-management" in local.conf and now am able to use opkg on target.

Thanks.