
As part of an effort to minimize the time to recover an AIO-SX system in case of a boot failure during an upgrade, this commit creates a service that executes during the boot sequence and: 1. Verifies if system is booted from the rollback deployment 2. Checks if current ostree commit-id matches from-release commit-id 3. If 1 and 2 are met, attempts to restore the LVM snapshots The delete_older_deployments function is changed as well, to find the active deployment (in this case not the first in the ostree admin status output) and only allow removing deployments with indexes greater than the active. Test Plan PASS: AIO-SX install/bootstrap/unlock PASS: AIO-SX upgrade stx-10 -> stx-11 using LVM snapshots feature, force boot failure by using the grub flag, verify the service executes and restore the snapshots Story: 2011357 Task: 52265 Change-Id: I38836f03301b4b2c3cb2c2e288e66c53f4c0b07e Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
15 lines
322 B
Desktop File
15 lines
322 B
Desktop File
[Unit]
|
|
Description=Restore LVM Snapshots
|
|
DefaultDependencies=no
|
|
After=systemd-udev-settle.service local-fs.target var-log.mount
|
|
Before=software.service controllerconfig.service
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
ExecStart=/etc/init.d/lvm-snapshot-restore
|
|
TimeoutStartSec=300
|
|
RemainAfterExit=yes
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|