Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # Sets up the chrome-bot swarming user and installs python adb to /opt/adb | |
| 2 | 3 |
| 3 set -ex | 4 set -ex |
| 4 # Sets up the chrome-bot swarming user and installs python adb to /opt/adb | 5 |
| 5 sudo chroot /opt/raspberrypi/root/ | 6 sudo chroot /opt/raspberrypi/root/ |
| 7 | |
| 6 rm /etc/localtime | 8 rm /etc/localtime |
| 7 ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime | 9 ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime |
| 8 | 10 |
| 9 # Give the chrome-bot user access to various groups the pi user had access to. | 11 # Give the chrome-bot user access to various groups the pi user had access to. |
| 10 #If chrome-bot is already a member, this won't hurt | 12 #If chrome-bot is already a member, this won't hurt |
| 11 for i in $(groups pi | cut -d " " -f 4-); do echo $i; adduser chrome-bot $i; don e | 13 for i in $(groups pi | cut -d " " -f 4-); do echo $i; adduser chrome-bot $i; don e |
| 12 gpasswd -a chrome-bot plugdev | 14 gpasswd -a chrome-bot plugdev |
| 13 gpasswd -a chrome-bot adb | 15 gpasswd -a chrome-bot adb |
| 14 | 16 |
| 15 # Swarming requires a .boto file | 17 # Swarming requires a .boto file |
| 16 touch /home/chrome-bot/.boto | 18 touch /home/chrome-bot/.boto |
| 17 chown chrome-bot:chrome-bot /home/chrome-bot/.boto | 19 chown chrome-bot:chrome-bot /home/chrome-bot/.boto |
| 18 | 20 |
| 19 # This took a very long time for me. Maybe just a fluke | 21 # This took a very long time for me. Maybe just a fluke |
| 20 apt-get update | 22 apt-get update |
| 21 apt-get install libusb-1.0-0-dev libssl-dev openssl time build-essential swig py thon-m2crypto ntpdate python-pip git android-tools-adb | 23 apt-get install libusb-1.0-0-dev libssl-dev openssl time build-essential swig py thon-m2crypto ntpdate python-pip git android-tools-adb |
| 22 | 24 |
| 23 # Now to setup python-adb in /opt/adb | 25 # Now to setup python-adb in /opt/adb |
| 24 cd /opt | 26 cd /opt |
| 25 if [ ! -e /usr/include/openssl/opensslconf.h ] | 27 if [ ! -e /usr/include/openssl/opensslconf.h ] |
| 26 then | 28 then |
| 27 sudo ln -s /usr/include/arm-linux-gnueabihf/openssl/opensslconf.h /usr/i nclude/openssl/opensslconf.h | 29 sudo ln -s /usr/include/arm-linux-gnueabihf/openssl/opensslconf.h /usr/i nclude/openssl/opensslconf.h |
| 28 fi | 30 fi |
| 29 sudo pip install rsa | 31 pip install rsa |
|
stephana
2016/04/29 13:18:41
How does this work without sudo ?
It might be via
kjlubick
2016/04/29 13:53:05
So, after the chroot (line 6) all subsequent comma
stephana
2016/04/29 17:30:58
Virtual env would just isolate the Python installa
| |
| 30 sudo pip install libusb1 | 32 pip install libusb1 |
| 31 | 33 |
| 32 if [ ! -f /opt/adb ] | 34 if [ ! -f /opt/adb ] |
| 33 then | 35 then |
| 34 git clone https://github.com/google/python-adb | 36 git clone https://github.com/google/python-adb |
| 35 ./python-adb/make_tools.py | 37 ./python-adb/make_tools.py |
| 36 ln python-adb/adb.zip adb | 38 ln python-adb/adb.zip adb |
| 37 fi | 39 fi |
| 40 | |
| 41 # Make swarming run on boot | |
| 42 update-rc.d swarming defaults 90 | |
| 38 # Adb can now be used by python /opt/adb | 43 # Adb can now be used by python /opt/adb |
| 39 exit | 44 exit |
| OLD | NEW |