Add ability to chose image upgrade mechanism at build time (SOTA, dnf , ...)

Description

Use cases:

  • simple image, without any upgrade mechanism

  • image upgradable though rpm only (copy package manually, install rpm package)

  • image upgradable through dnf (remote RPM repo)

  • SOTA image (no RPM db needed)

  • SOTA image (with RPM db for development)

So we can envision at least 4 upgrade modes. Modes 2 and 3 are envisioned as the main supported modes for AGL. 

 

 

Upgrade Mode

SOTA enabled *

Enable RPM db

Enable DNF db

mode0

Full image required

NO

No

No

mode1

through RPM only

NO

Yes

No

mode2

through DNF+RPM

NO

Yes

Yes

mode3

through SOTA

YES

No**

No***

mode4

SOTA "devel mode"

YES

Yes

No

 

* SOTA is enabled by adding agl-sota feature at aglsetup time
** after do_rootfs for image, /var/lib/rpm can be removed
*** after do_rootfs for image, /var/lib/dnf can be removed

Environment

None

Activity

Anton Gerasimov 
September 27, 2018 at 3:13 PM

It might be possible with rpm-ostree tool, no guarantees though, I've never tried.

Stephane Desneux 
September 27, 2018 at 3:05 PM
(edited)

Hi Anton,

Yes, we could add 2 variables to specify that we want to enable (or disable) RPM (resp. DNF). By default, RPM and DNF are there, so I'd say that we need variables to remove them partially (only the tool) or completely (tool + db).:

With XXXXXX = ( "RPM", "DNF" ):

  • DISABLE_XXXXXX_TOOL : don't install XXXXXX tool in image but leave initial XXXXXX database in /var

  • DISABLE_XXXXXX_DB : don't install XXXXXX tool in image and also clean XXXXXX database in /var at the end of image creation

NB:: there may be implied things: DISABLE_RPM_DB probably implies: DISABLE_RPM_TOOL and DISABLE_DNF_* ... But let's try to keep things simple.

So the 2 main modes would be:

  • By default, without anything specified, we should be in mode 2 (that's the case ATM with FF)

  • if we enable agl-sota feature, then we should be in mode 3: so in the config fragment associated to agl-sota, we should add something like DISABLE_RPM_TOOL, DISABLE_RPM_DB, DISABLE_DNF_TOOL, DISABLE_DNF_DB

And if we need to tweak/test other modes, it's easy to put things manually in local.conf.

 

For the second question: mode4 (which is the fifth - my bad ) is more a theoretical and educational mode. We regularly build rpms with bitbake or SDK (or something else) and copy the rpm manually to the target to install it and test: that's clearly a need for development, but I don't see that compatible with production mode. That said, depending on the SOTA mechanism, this can be valid or not. Typically, as ostree mounts things in readonly, I don't see how one could install an RPM on top of it on the target. But if you have another upgrade mechanism, this could be possible.

Anton Gerasimov 
September 27, 2018 at 2:46 PM
(edited)

Hi ,

what the user interface for it look like? Two envinronment variables `KEEP_RPM_DB` and `KEEP_DNF_DB`? (we already have agl-sota feature).
Also for the fourth mode, how do use use the RPM db in development?

Thanks,
Anton

Walt Miner 
September 27, 2018 at 1:49 PM

Reviewed and updated the description during the 27 Sep SAT call. 

Stephane Desneux 
September 25, 2018 at 6:39 AM
(edited)

Won't Fix

Details

Assignee

Reporter

Labels

Contract ID

Components

Priority

Created September 21, 2018 at 2:41 PM
Updated August 28, 2020 at 2:56 PM
Resolved August 27, 2020 at 1:22 PM