Last active
August 5, 2021 23:07
-
-
Save s-zeid/01e327e485cadee4c7c50ba191ae9e9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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