Files
update/software/service-files/lvm-snapshot-restore.service
Heitor Matsui fd90264778 Create LVM snapshot-based boot recovery
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>
2025-06-16 14:31:11 -03:00

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