apertis-update-manager-automount manual
medium
- Image Types:
- minimal-armhf
- Image Deployment:
- OSTree
- Type:
- functional
Description
Test the apertis-update-manager automatic update via mass storage device.
Resources
- A static update bundle file of the same architecture, variant and version as the testing image
- A Fat32 USB flash drive, preloaded with the update bundle at the root of the disk
- The latest static update file can be downloaded at the same location than the target image. It has the same basename, and a '.delta' extension
- The static update file should be copied to the flash drive using the name 'static-update.bundle'.
- A PC must be connected to DUT serial port
Execution Steps
- Check the initial deployment
- Prepare the copy of commit and deploy to allow the upgrade to the same version
- Command below shows you an initial commit ID, for instance
- Get the Collection ID and ref
- Create the list of files to skip and enshure there are some files in these directories
- Create the commit with changed timestamp and skipped list from above to allow upgrade with recent update file
- Deploy the prepared commit
- Wait until the system is booted again and check the deployment
- The booted commit (started with '*') must have ID which we prepare and the initial commit ID should be marked as '(rollback)'
- Check booted deployment have no file objects which we skip
- Remove the initial deployment
- Reboot the system
- Plug the USB flash drive in the device
- The update starts automatically
- After the update, the device will reboot automatically
- Remove the USB flash drive immediatly after reboot
- Check the current deployment has been updated and that the rollback entry points to the prepared deployment
$ sudo ostree admin status
$ export BOOTID=$(sudo ostree admin status | sed -n -e 's/^\* apertis \([0-9a-f]*\)\.[0-9]$/\1/p'); echo $BOOTID
$ export CID=$(sudo ostree refs -c | head -n 1 | tr -d '(),' | cut -f 1 -d ' '); echo COLLECTION_ID=$CID
$ export REF=$(sudo ostree refs -c | head -n 1 | tr -d '(),' | cut -f 2 -d ' '); echo REF=$REF
$ ls -1d /usr/share/locale /usr/share/man /usr/share/zoneinfo > /tmp/skip
$ du -sh /usr/share/locale /usr/share/man /usr/share/zoneinfo
$ export NEWID=$(sudo ostree commit --orphan --tree=ref=$BOOTID --add-metadata-string=ostree.collection-binding=$CID --bind-ref=$REF --timestamp="1 year ago" --skip-list=/tmp/skip); echo "New commit: $NEWID"
$ sudo ostree admin upgrade --allow-downgrade --deploy-only --override-commit=$NEWID --reboot
$ sudo ostree admin status
$ du -sh /usr/share/locale /usr/share/man /usr/share/zoneinfo
$ sudo ostree admin undeploy 1
$ sudo ostree admin status
Expected
The update was properly applied