During the installation of a new image, the squashfs image is mounted, various thing including the config is copied, but the image is not unmounted.
When upgrading and rebooting fast enough it is possible the data is not sync-ed to disk yet and is corrupted. During my testing I had various problems where different parts of files where corrupted.
Modifying the install-image-existing script with:
ln -s $NEWNAME $BOOT_DIR/%%default_image fi fi ### Added stuff echo "Unmount $INST_ROOT" umount $INST_ROOT echo "Unmount $READ_ROOT" umount $READ_ROOT ### Added stuff logger -p local3.warning -t "SystemImage" "System Image $NEWNAME has been added and made the default boot image" echo 'Done.' # done exit 0
Fixes the problem. I certainly do not mind creating a PR, but, is something like the above correct? Or is a proper try-umount() function with some error handling needed?