Skip to content

Instantly share code, notes, and snippets.

@s-zeid
Last active August 5, 2021 23:07
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 s-zeid/01e327e485cadee4c7c50ba191ae9e9f to your computer and use it in GitHub Desktop.
Save s-zeid/01e327e485cadee4c7c50ba191ae9e9f to your computer and use it in GitHub Desktop.
#!/bin/sh
# <https://gist.github.com/01e327e485cadee4c7c50ba191ae9e9f>
# Workaround for <https://bugs.chromium.org/p/chromium/issues/detail?id=1087937>
# Adapted from /u/ken_duda's comment:
# * <https://old.reddit.com/r/Crostini/comments/gsxx7o/userpid_namespaces_broken_in_crostini_83/fsqn1wj/>
# * <https://bugs.chromium.org/p/chromium/issues/detail?id=1087937#c6>
main() {
for name in cpuinfo diskstats meminfo stat uptime; do
if fgrep -q -e "/proc/$name" /proc/mounts; then
echo_run sudo umount "/proc/$name"
fi
done
return 0
}
echo_run() {
echo + "$@" >&2
command "$@"
}
main "$@"
#!/bin/sh
WORKAROUND="$HOME/bin/private/cros-procfs-workaround"
if [ -e /dev/.cros_milestone ]; then
if ! (pgrep -f "$WORKAROUND" >/dev/null 2>&1); then
for name in cpuinfo diskstats meminfo stat uptime; do
if fgrep -q -e "/proc/$name" /proc/mounts; then
echo + "$WORKAROUND" >&2
break
fi
done
command "$WORKAROUND"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment