diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-03-21 12:21:39 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-03-21 12:21:39 -0400 |
commit | fd9b3ae236abf5b1a47dbe4f94b3ef1a8c9cb68d (patch) | |
tree | ffb761a6ee9afda8ba2dd76da4fb817c21667c82 /.config/wmii-hg/util.sh | |
parent | 4173e67b6ca195497a53c10fd11c49a38402fce3 (diff) |
wmii: move (u)mount.9p to util.sh, prefer 9pfuse
Diffstat (limited to '.config/wmii-hg/util.sh')
-rw-r--r-- | .config/wmii-hg/util.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.config/wmii-hg/util.sh b/.config/wmii-hg/util.sh index 55344b2..f80b871 100644 --- a/.config/wmii-hg/util.sh +++ b/.config/wmii-hg/util.sh @@ -116,3 +116,31 @@ scansection() { conffile() { echo "$HOME/.wmii-hg/$1" } + +################################################################################ +# 9P filesystem # +################################################################################ + +# Prefer 9pfuse since: +# 1. Linux 9p directory listings are broken on i686 +# 2. 9umount doesn't work with recent versions of Linux 9p +if (. /etc/profile.d/plan9.sh || true; type 9pfuse) &>/dev/null; then + . /etc/profile.d/plan9.sh || true + mount.9p() { + 9pfuse "$1" "$2" + while ! [[ -f "$2/event" ]]; do :; done + } + umount.9p() { + fusermount -u "$1" + } +elif type 9mount &>/dev/null; then + mount.9p() { + 9mount -i "$1" "$2" + } + umount.9p() { + 9umount "$1" + } +else + >&2 echo "ERROR: I don't know how to mount 9P filesystems" + exit 5 # EXIT_NOTINSTALLED (LSB) +fi |