X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/a9929695c6ad0779eaa8cb3d68d37760981d55b7..11e663d8459a87510762609dd7e49bcf445feef2:/package/base-files/files/lib/firstboot/99_10_with_fo_cleanup diff --git a/package/base-files/files/lib/firstboot/99_10_with_fo_cleanup b/package/base-files/files/lib/firstboot/99_10_with_fo_cleanup index 8b0015972..0181b39d4 100644 --- a/package/base-files/files/lib/firstboot/99_10_with_fo_cleanup +++ b/package/base-files/files/lib/firstboot/99_10_with_fo_cleanup @@ -6,7 +6,19 @@ with_fo_cleanup() { # try to get rid of /tmp/root # this will almost always fail - mount /tmp/root 2>&- + umount /tmp/root 2>&- + grep -q overlay /proc/filesystems && { + cd / + ( + cd /overlay + find -type l + ) | while read FILE; do + [ -z "$FILE" ] && break + if ls -la "$FILE" 2>&- | grep -q '(overlay-whiteout)'; then + rm -f "$FILE" + fi + done + } exit 0 }