Skip to content

Commit 73f73a6

Browse files
authored
hofix - install privileges (DexterInd#280)
* ref RobertLucian#9 : hotfix - removed sudoes and updated README * Revert "ref RobertLucian#9 : hotfix - removed sudoes and updated README" This reverts commit 8d5a90b. * ref RobertLucian#9 : hotfix - removed sudoes for python-related s * ref RobertLucian#9 : hotfix - removed sudo from bash * ref RobertLucian#9 : hotfix - removed sudo checker * ref RobertLucian#9 : hotfix - added smbus dependency * ref RobertLucian#9 : hotfix - added hightened privileges for some * ref RobertLucian#9 : hotfix - added README * ref RobertLucian#9 : hotfix - updated README * ref RobertLucian#9 : hotfix - updated README * ref RobertLucian#9 : hotfix - corrected README
1 parent 7a7b3af commit 73f73a6

File tree

5 files changed

+35
-25
lines changed

5 files changed

+35
-25
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ This repository contains source code, firmware and design materials for the GoPi
1212

1313
# Quick Install
1414

15-
In order to quick install the `GoPiGo` repository, open up a terminal and type the following command:
15+
For installing the python package(s) of the GoPiGo with root privileges (except for anything else that comes with it), use one of the following command:
1616
```
17-
sudo curl -kL dexterindustries.com/update_gopigo | bash
17+
sudo sh -c "curl -kL dexterindustries.com/update_gopigo | bash"
18+
```
19+
20+
In order to quick install the GoPiGo package(s) without root privileges (except for anything else that comes with it), use the following command:
21+
```
22+
curl -kL dexterindustries.com/update_gopigo | bash
1823
```
19-
The same command can be used for updating the `GoPiGo` to the latest version.
2024

2125
# See Also
2226

Setup/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@
22

33
This is the install script for the GoPiGo which installs all the packages and libraries need for running the GoPiGo.
44

5-
For installing the GoPiGo you should only enter the following command:
5+
For installing the GoPiGo you should only enter one of the 2 following command(s):
66
```
7-
sudo curl -kL dexterindustries.com/update_gopigo | bash
7+
# for installing the python packages with root permissions (except anything else which will ran as root) run this
8+
sudo sh -c "curl -kL dexterindustries.com/update_tools | bash"
9+
10+
# for installing the python packages with user permissions (except anything else which will ran as root) run this
11+
curl -kL dexterindustries.com/update_tools | bash
812
```
913

1014
Or if you want the classic way, you can clone the repository, change directory to this folder and then enter the following command:
1115
```
16+
# for root privileges
1217
sudo bash install.sh
18+
19+
# for user privileges
1320
```
1421

1522
Make sure that you are connected to the internet before starting.

Setup/install.sh

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ echo " "
3939

4040
check_root_user() {
4141
if [[ $EUID -ne 0 ]]; then
42-
feedback "FAIL! This script must be run as such: sudo ./install.sh"
43-
exit 1
42+
feedback "No root permissions: the update script will not install python libraries."
4443
fi
4544
echo " "
4645
}
@@ -77,16 +76,15 @@ install_dependencies() {
7776
echo " "
7877
feedback "Installing Dependencies"
7978
feedback "======================="
80-
sudo apt-get install python-pip git libi2c-dev python-serial python-rpi.gpio i2c-tools python-smbus arduino minicom libnss-mdns python-dev -y
81-
sudo pip install -U RPi.GPIO
82-
sudo pip install pyusb
83-
sudo pip install numpy
84-
sudo pip install python-periphery==1.1.0
85-
sudo pip3 install -U RPi.GPIO
86-
sudo pip3 install pyusb
87-
sudo pip3 install numpy
88-
sudo pip3 install python-periphery==1.1.0
89-
79+
sudo apt-get install python-pip git libi2c-dev python-serial python-rpi.gpio i2c-tools python-smbus arduino minicom libnss-mdns python-dev build-essential libffi-dev -y
80+
pip install -U RPi.GPIO
81+
pip install pyusb
82+
pip install numpy
83+
pip install python-periphery==1.1.0
84+
pip3 install -U RPi.GPIO
85+
pip3 install pyusb
86+
pip3 install numpy
87+
pip3 install python-periphery==1.1.0
9088

9189
feedback "Dependencies installed"
9290
}
@@ -95,8 +93,8 @@ install_DHT() {
9593
# Install the DHT library
9694
feedback "Installing DHT library"
9795
pushd $ROBOT_DIR/Software/Python/sensor_examples/dht/Adafruit_Python_DHT > /dev/null
98-
sudo python setup.py install
99-
sudo python3 setup.py install
96+
python setup.py install
97+
python3 setup.py install
10098
popd > /dev/null
10199
}
102100

@@ -161,8 +159,8 @@ install_spi_i2c() {
161159
feedback "Making I2C changes in /boot/config.txt . . ."
162160
feedback "================================================"
163161

164-
echo dtparam=i2c1=on >> /boot/config.txt
165-
echo dtparam=i2c_arm=on >> /boot/config.txt
162+
sudo sh -c "echo dtparam=i2c1=on >> /boot/config.txt"
163+
sudo sh -c "echo dtparam=i2c_arm=on >> /boot/config.txt"
166164

167165
sudo adduser pi i2c
168166
echo " "
@@ -270,10 +268,10 @@ install_dependencies
270268

271269

272270
#Copy Software Servo
273-
cp -R $ROBOT_DIR/Firmware/SoftwareServo/ /usr/share/arduino/libraries/
271+
sudo cp -R $ROBOT_DIR/Firmware/SoftwareServo/ /usr/share/arduino/libraries/
274272

275-
chmod +x gopigo
276-
cp gopigo /usr/bin
273+
sudo chmod +x gopigo
274+
sudo cp gopigo /usr/bin
277275

278276
cd $ROBOT_DIR/Software/Python
279277
python setup.py install

Setup/update_gopigo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ change_branch $BRANCH # change to a branch we're working on.
2525
pushd $DEXTER_PATH/GoPiGo/Setup > /dev/null
2626
feedback "--> UPDATING LIBRARIES"
2727
feedback "------------------"
28-
sudo bash ./install.sh
28+
bash ./install.sh
2929
popd > /dev/null

Software/Python/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
future
2+
smbus-cffi

0 commit comments

Comments
 (0)