Skip to content

Instantly share code, notes, and snippets.

@aszlig
Created December 8, 2018 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aszlig/29aba28bab2619d90f70f071ea704427 to your computer and use it in GitHub Desktop.
Save aszlig/29aba28bab2619d90f70f071ea704427 to your computer and use it in GitHub Desktop.
#!/bin/sh -e
tmp="$(mktemp -d)"
trap '
umount "$tmp/result"
find "$tmp" -depth -type d -exec rmdir {} +
' EXIT
mkdir "$tmp/upper" "$tmp/work" "$tmp/result"
bindir="$(dirname "$(readlink -e "$(command -v find)")")"
mount -t overlay overlay "$tmp/result" \
-o "lowerdir=$bindir,upperdir=$tmp/upper,workdir=$tmp/work"
"$tmp/result/find" / -maxdepth 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment