Add support for the "Online Update" accepted/tizen/unified/20240430.020633 accepted/tizen/unified/toolchain/20240508.012353 accepted/tizen/unified/x/20240430.094814 accepted/tizen/unified/x/20240507.051009
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 17 Apr 2024 10:09:32 +0000 (12:09 +0200)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 26 Apr 2024 05:52:08 +0000 (14:52 +0900)
commitd73e8bad732c7e2a3154ef2dc0f272e1df93ff62
tree8094dfc259ad59c2a2ce6a0540c698493d1f6842
parent19d5bfcd5a347cdb62e898ed71b8acd4e109f774
Add support for the "Online Update"

"Online Update" is a new type of OS Update.
After "reboot fota" the normal boot will be performed, and in addition
the following targets will be run:

* online-update-pre.target - this target startup is reached very realy -
  after mouting the file system and before starting services. Within
  this target, changes to permission and directory structure, for
  example, should take place.

* online-update.target - this target is started after the basic services
  (like dlog, dbus) are started. Data migration of services should take
  place within this target.

If a service requires data migration after an upgrade, it should provide
a service that will perform the migration at the appropriate time of
system startup. For example:

  [Unit]
  Description=Bluetooth upgrade service
  ConditionKernelCommandLine=bootmode=fota
  Before=online-update.target bluetooth-share.service
  After=opt.mount
  DefaultDependencies=no

  [Service]
  Type=oneshot
  ExecStart=/usr/share/upgrade/scripts/bluetooth-share/bluetooth-share_upgrade.sh
  SmackProcessLabel=System

  [Install]
  RequiredBy=online-update.target

The lines:

  Before=online-update.target bluetooth-share.service
  After=opt.mount

are responsible for starting the service at the right time.

The old upgrade type is still supported. If the system is booted like
this:

    /usr/lib/systemd/systemd --unit=system-update.target

the old upgrade (Offline) will be performed. And if it runs like this:

   /usr/lib/systemd/system --unit=online-update.target

then the new upgrade (Online) will be performed.

Change-Id: I691af6c500da66fb537fd744e40fec2e7a607242
17 files changed:
packaging/upgrade.spec
scripts/rw-upgrade/CMakeLists.txt
scripts/rw-upgrade/online-update-failure.service [new file with mode: 0644]
scripts/rw-upgrade/online-update-failure.target [new file with mode: 0644]
scripts/rw-upgrade/online-update-pre.service.in [new file with mode: 0644]
scripts/rw-upgrade/online-update-pre.sh.in [new file with mode: 0644]
scripts/rw-upgrade/online-update-pre.target [new file with mode: 0644]
scripts/rw-upgrade/online-update-success.service [new file with mode: 0644]
scripts/rw-upgrade/online-update-success.sh.in [new file with mode: 0644]
scripts/rw-upgrade/online-update-verify.service.in [new file with mode: 0644]
scripts/rw-upgrade/online-update-verify.sh.in [new file with mode: 0644]
scripts/rw-upgrade/online-update.service.in [new file with mode: 0644]
scripts/rw-upgrade/online-update.sh.in [new file with mode: 0644]
scripts/rw-upgrade/online-update.target [new file with mode: 0644]
scripts/rw-upgrade/rw-update-macro.inc
scripts/rw-upgrade/update-finalize.service [deleted file]
scripts/rw-upgrade/update.sh.in