Skip to content

Instantly share code, notes, and snippets.

@Duncaen
Created October 12, 2016 23:09
Show Gist options
  • Select an option

  • Save Duncaen/aa8937bdb50ea9ef347a5e14aeec0214 to your computer and use it in GitHub Desktop.

Select an option

Save Duncaen/aa8937bdb50ea9ef347a5e14aeec0214 to your computer and use it in GitHub Desktop.
plan9.sh
#!/bin/sh
binds="
mkdir -p usr/bin usr/lib;
mount -v --bind /usr/lib/ usr/lib;
mount -v --bind /usr/bin/ usr/bin;
ln -sf usr/lib lib;
ln -sf usr/bin bin;
touch dev/tty2
chmod 600 dev/tty2
mount -v --bind /dev/tty2 dev/tty2;
"
tmp=$(mktemp -d /tmp/plan9-XXXXXX)
contain -i "$binds" "$tmp" /usr/lib/plan9/bin/9 rc
rm -rf "$tmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment