preinit-mounts: init: Enhance handling of overlay errors
There has been a couple instances of overlay errors: duplicated
overlay mounts, and corrupted files that live in a subdirectory.
Add the following enhancements for when an overlay error is detected:
- If the etc umount fails, do not attempt to re-mount the overlay.
This prevents duplicate mounts.
- Check each file after re-creating the overlay, and if it still has
errors, delete it from the overlay. This would help also in cases
like the point above where the umount fails and the overlay was not
recreated.
- Check all overlay files recursively instead of just the ones in the
top directory. One instance of this corruption was seen on a file
in a subdirectory.
Tested: Verified the script would check all files in the overlay.
Change-Id: Ifbf5f283c6b19a3d90eead2c9c9f3cb0f6350a4b
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
1 file changed