X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/a9929695c6ad0779eaa8cb3d68d37760981d55b7..603d01fbba5d16467af24fa6c1d5902920d36dbb:/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 }