-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwheezy-stage4-lepidopter
executable file
·74 lines (65 loc) · 1.79 KB
/
wheezy-stage4-lepidopter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# Works with spindle http://asbradbury.org/projects/spindle
# See LICENSE.spindle file for copyright and license details
# See README for building details
set -ex
. ./common
CURIMG=stage4-lepidopter.$IMGFORMAT
install_packages() {
# we may want to break out DEBIAN_FRONTEND=noninteractive
ssh_in_to_qemu chroot /mnt sh -l -ex - <<EOF
apt-get update
apt-get install -y git-core rpi-update lsb-release debconf-utils
EOF
}
configure_hostname() {
onvm_chroot sh -l -e - <<EOF
hostname lepidopter
EOF
}
configure_ooniprobe() {
onvm_chroot sh -l -e <<EOF
cd /home/pi/
# Clone the ooni-probe Git repo
# "n/a" Bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=696332
sudo -u pi git clone -b setup-dependencies.sh_fix https://github.com/anadahz/ooni-probe.git
cd /home/pi/ooni-probe/
tee -a /etc/apt/sources.list <<EOF2
deb http://deb.torproject.org/torproject.org wheezy main
deb-src http://deb.torproject.org/torproject.org wheezy main
EOF2
# Install script
./setup-dependencies.sh -y
python setup.py install
pip install pydnet
# Building geoIP stuff
cd /usr/share/ooni/
make geoip 2>&1 > /dev/null
cd /usr/share/ooni/inputs
make lists 2>&1 > /dev/null
EOF
}
test_run_ooniprobe() {
onvm_chroot sh -l -e - <<EOF
sudo -u pi mkdir /home/pi/.ooni/
#cp /usr/share/ooni/ooniprobe.conf.sample /home/pi/.ooni/ooniprobe.conf
# Run ooniprobe
sudo -u pi ooniprobe --asciilulz
EOF
}
cd $WORKDIR
dotask branch_image ../$OUTDIR/stage3.$IMGFORMAT $CURIMG
dotask run_qemu $CURIMG
dotask mount_apt_cache
dotask disable_starting_services
dotask install_packages
dotask configure_hostname
dotask configure_ooniprobe
# Uncomment to test run ooniprobe
#dotask test_run_ooniprobe
dotask save_space_using_hardlink
dotask allow_starting_services
dotask update_issue
dotask fingerprint_debian
dotask shutdown_qemu
dotask finish_image