* See [doc/LegalStuff](doc/LegalStuff) for a full text
These scripts perform almost all of the steps involved in creating a chroot in OpenBSD for tor. It now includes all the configuration files you will need.
When a new version of tor is released, I run this script and copy my old '''/home/chrooted/tor/etc/tor/systrace''' directory over.
When a new version of tor is released, I run this script and copy my old **/home/chrooted/tor/etc/tor/systrace** directory over.
The systrace policies and updated rc.local are included here.
...
...
@@ -27,13 +27,12 @@ Also, it would be nice if I could upload my chroot to some website so people can
=== Stage 1: Run as root ===
I hard coded the paths to '''/home/chrooted/tor''' on purpose. If this is ever converted into perl, then with the '''use strict;''' mode I would add the path as a parameter. Since the shell won't warn you if you have a typo, I try to use hard coded paths as much as possible.
I hard coded the paths to **/home/chrooted/tor** on purpose. If this is ever converted into perl, then with the **use strict;** mode I would add the path as a parameter. Since the shell won't warn you if you have a typo, I try to use hard coded paths as much as possible.
Be sure to change the '''TOR_BUILD_USER''' and '''TOR_BUILD_GROUP''' to your own user. This is who is building the source. The files themselves will later be owned by '''_tor''' or '''root''' depending on the file.
Be sure to change the **TOR_BUILD_USER** and **TOR_BUILD_GROUP** to your own user. This is who is building the source. The files themselves will later be owned by **_tor** or **root** depending on the file.
'''tor_stage1_root.sh'''
{{{
#!/bin/sh
**tor_stage1_root.sh**
```
# Fail on the first error (non-zero return value)
set -e -x
...
...
@@ -116,7 +115,7 @@ cd /home/chrooted/tor/dev
echo "Stage 1: Done, please run Stage 2-3 next"
}}}
```
=== Stage 2: Run as the user ===
...
...
@@ -126,9 +125,8 @@ Run this as the user you specified at the top of stage1.
There's really no reason to set this to use static linking.