Skip to content

Commit fe3aecc

Browse files
authored
hotfix - add gui option & optimize install script (#195)
* hotfix - add option to bypass gui installation * hotfix - don't install recommended packages with apt-get * hotfix - add details in the README * hotfix - take out script_tools and add bypass for gui stuff * hotfix - add in the README & remove artifacts * hotfix - change the name of the platform to the adequate one * hotfix - change github references for testing purposes * hotfix - remove the dependency checker in the gopigo3 * hotfix - remove artifact from script_tools installation * hotfix - rename a function * hotfix - assign correct exit codes * hotfix - remove unnecessary option for minimal ist * Revert "hotfix - change github references for testing purposes" This reverts commit a92f877. * hotfix - change the wording in the README
1 parent a136a18 commit fe3aecc

File tree

3 files changed

+58
-43
lines changed

3 files changed

+58
-43
lines changed

Install/README.md

+24-5
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,42 @@ An example using options appended to the command can be:
3131
curl -kL dexterindustries.com/update_gopigo3 | bash -s --user-local --no-update-aptget --no-dependencies
3232
```
3333

34-
#### Command Options
34+
## Command Options
3535

3636
The options that can be appended to this command are:
3737

38+
* `--no-update-aptget` - to skip using `sudo apt-get update` before installing dependencies. For this to be useful, `--no-dependencies` has to be not used. Applies to RFR_Tools and the GoPiGo3.
39+
* `--bypass-rfrtools` - skips installing RFR_Tools completely.
40+
* `--bypass-python-rfrtools` - skips installing/updating the python package for [RFR_Tools](https://github.com/DexterInd/RFR_Tools).
41+
* `--bypass-gui-installation` - skips installing the GUI packages/dependencies from [RFR_Tools](https://github.com/DexterInd/RFR_Tools).
3842
* `--no-dependencies` - skip installing any dependencies for the GoPiGo3. It's supposed to be used on each consecutive update after the initial install has gone through.
39-
* `--no-update-aptget` - to skip using `sudo apt-get update` before installing dependencies. For this to be useful, `--no-dependencies` has to be not used.
40-
* `--bypass-rfrtools` - skip installing RFR_Tools altogether.
41-
* `--bypass-python-rfrtools` - skips installing/updating the python package for [RFR_Tools](https://github.com/DexterInd/RFR_Tools).
4243
* `--user-local` - install the python package for the GoPiGo3 in the home directory of the user. This doesn't require any special read/write permissions: the actual command used is (`python setup.py install --force --user`).
4344
* `--env-local` - install the python package for the GoPiGo3 within the given environment without elevated privileges: the actual command used is (`python setup.py install --force`).
4445
* `--system-wide` - install the python package for the GoPiGo3 within the sytem-wide environment with `sudo`: the actual command used is (`sudo python setup.py install --force`).
4546

4647
Important to remember is that `--user-local`, `--env-local` and `--system-wide` options are all mutually-exclusive - they cannot be used together.
4748
As a last thing, different versions of it can be pulled by appending a corresponding branch name or tag.
4849

50+
## Minimal Installation
51+
52+
Now, if you only want the absolute minimum in order to get going with the GoPiGo3, you can run this command:
53+
```bash
54+
curl -kL dexterindustries.com/update_gopigo3 | bash -s -- --bypass-gui-installation
55+
```
56+
57+
This will only install the GoPiGo3 dependencies and nothing else. You still can use options such as `--user-local` or `--env-local` if you are working with a different kind of environment. Keep in mind that `--system-wide` is selected by default.
58+
59+
## Subsequent Updates
60+
61+
If the GoPiGo3 has been installed either by using the full command or the one for the minimal installation, this means you have all the packages installed already and all dependencies put in. Therefore, on subsequent installation, you can skip installing any dependency and instead just reinstall the python package of the GoPiGo3. To do this, you can run this command:
62+
```bash
63+
curl -kL dexterindustries.com/update_gopigo3| bash -s -- --bypass-rfrtools --no-dependencies
64+
```
65+
66+
Or if this is too complex, you can always stick to the command meant for the full installation or the minimal one.
67+
4968
## Test and Troubleshooting
50-
You can see [the test and troubleshooting section on the GoPiGo3, including detailed information about updating the firmwaer, here.](https://www.dexterindustries.com/GoPiGo/get-started-with-the-gopigo3-raspberry-pi-robot/test-and-troubleshoot-the-gopigo3-raspberry-pi-robot/)
69+
You can see [the test and troubleshooting section on the GoPiGo3, including detailed information about updating the firmware, here.](https://www.dexterindustries.com/GoPiGo/get-started-with-the-gopigo3-raspberry-pi-robot/test-and-troubleshoot-the-gopigo3-raspberry-pi-robot/)
5170

5271
## License
5372

Install/install.sh

+3-9
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,11 @@ check_root_user() {
1717
}
1818

1919
install_dependencies() {
20-
21-
# the sudo apt-get update is already done by the
22-
# script_tools installer in update_gopigo3.sh
23-
2420
feedback "Installing Dependencies for the GoPiGo3"
2521

26-
# for python3
27-
sudo apt-get install python3-pip python3-numpy python3-curtsies -y
28-
29-
# for python2
30-
sudo apt-get install python-pip python-numpy python-curtsies -y
22+
sudo apt-get install --no-install-recommends -y \
23+
python3-pip python3-numpy python3-curtsies \
24+
python-pip python-numpy python-curtsies
3125

3226
feedback "Dependencies installed for the GoPiGo3"
3327
}

Install/update_gopigo3.sh

+31-29
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ check_if_run_with_pi() {
2323
## if not running with the pi user then exit
2424
if [ $(id -ur) -ne $(id -ur pi) ]; then
2525
echo "GoPiGo3 installer script must be run with \"pi\" user. Exiting."
26-
exit 7
26+
exit 6
2727
fi
2828
}
2929

@@ -35,6 +35,7 @@ parse_cmdline_arguments() {
3535
updaterepo=true
3636
install_rfrtools=true
3737
install_pkg_rfrtools=true
38+
install_rfrtools_gui=true
3839

3940
# the following 3 options are mutually exclusive
4041
systemwide=true
@@ -61,6 +62,9 @@ parse_cmdline_arguments() {
6162
--bypass-python-rfrtools)
6263
install_pkg_rfrtools=false
6364
;;
65+
--bypass-gui-installation)
66+
install_rfrtools_gui=false
67+
;;
6468
--user-local)
6569
userlocal=true
6670
systemwide=false
@@ -115,40 +119,45 @@ parse_cmdline_arguments() {
115119
([[ $updaterepo = "true" ]] && echo " --no-update-aptget=false") || echo " --no-update-aptget=true"
116120
([[ $install_rfrtools = "true" ]] && echo " --bypass-rfrtools=false") || echo " --bypass-rfrtools=true"
117121
([[ $install_pkg_rfrtools = "true" ]] && echo " --bypass-python-rfrtools=false") || echo " --bypass-python-rfrtools=true"
122+
([[ $install_rfrtools_gui = "true" ]] && echo " --bypass-gui-installation=false") || echo " --bypass-gui-installation=true"
118123
echo " --user-local=$userlocal"
119124
echo " --env-local=$envlocal"
120125
echo " --system-wide=$systemwide"
121126

122-
# in case the following packages are not installed and `--no-dependencies` option has been used
123-
if [[ $installdependencies = "false" || $install_rfrtools = "false" ]]; then
124-
command -v git >/dev/null 2>&1 || { echo "This script requires \"git\" but it's not installed. Don't use --no-dependencies option. Exiting." >&2; exit 1; }
125-
command -v python >/dev/null 2>&1 || { echo "Executable \"python\" couldn't be found. Don't use --no-dependencies option. Exiting." >&2; exit 2; }
126-
command -v python3 >/dev/null 2>&1 || { echo "Executable \"python3\" couldn't be found. Don't use --no-dependencies option. Exiting." >&2; exit 3; }
127-
command -v pip >/dev/null 2>&1 || { echo "Executable \"pip\" couldn't be found. Don't use --no-dependencies option. Exiting." >&2; exit 4; }
128-
command -v pip3 >/dev/null 2>&1 || { echo "Executable \"pip3\" couldn't be found. Don't use --no-dependencies option. Exiting." >&2; exit 5; }
129-
fi
130-
131127
# create rest of list of arguments for rfrtools call
132128
rfrtools_options+=("$selectedbranch")
133129
[[ $usepython3exec = "true" ]] && rfrtools_options+=("--use-python3-exe-too")
134130
[[ $updaterepo = "true" ]] && rfrtools_options+=("--update-aptget")
135131
[[ $installdependencies = "true" ]] && rfrtools_options+=("--install-deb-deps")
136132
[[ $install_pkg_rfrtools = "true" ]] && rfrtools_options+=("--install-python-package")
137-
138-
# create list of arguments for script_tools call
139-
declare -ga scriptools_options=("$selectedbranch")
133+
[[ $install_rfrtools_gui = "true" ]] && rfrtools_options+=("--install-gui")
140134

141135
echo "Using \"$selectedbranch\" branch"
142136
echo "Options used for RFR_Tools script: \"${rfrtools_options[@]}\""
143-
echo "Options used for script_tools script: \"${scriptools_options[@]}\""
144137
}
145138

146139
#################################################
147-
## Cloning GoPiGo3, Script_Tools & RFR_Tools ####
140+
########## Cloning GoPiGo3 & RFR_Tools ##########
148141
#################################################
149142

143+
# called in <<install_rfrtools_repo>>
144+
check_dependencies() {
145+
command -v git >/dev/null 2>&1 || { echo "This script requires \"git\" but it's not installed. Error occurred with RFR_Tools installation." >&2; exit 1; }
146+
command -v python >/dev/null 2>&1 || { echo "Executable \"python\" couldn't be found. Error occurred with RFR_Tools installation." >&2; exit 2; }
147+
command -v pip >/dev/null 2>&1 || { echo "Executable \"pip\" couldn't be found. Error occurred with RFR_Tools installation." >&2; exit 3; }
148+
if [[ $usepython3exec = "true" ]]; then
149+
command -v python3 >/dev/null 2>&1 || { echo "Executable \"python3\" couldn't be found. Error occurred with RFR_Tools installation." >&2; exit 4; }
150+
command -v pip3 >/dev/null 2>&1 || { echo "Executable \"pip3\" couldn't be found. Error occurred with RFR_Tools installation." >&2; exit 5; }
151+
fi
152+
153+
if [[ ! -f $DEXTERSCRIPT/functions_library.sh ]]; then
154+
echo "script_tools didn\'t get installed. Enable the installation of dependencies with RFR_Tools.'"
155+
exit 8
156+
fi
157+
}
158+
150159
# called way down below
151-
install_scriptools_and_rfrtools() {
160+
install_rfrtools_repo() {
152161

153162
# if rfrtools is not bypassed then install it
154163
if [[ $install_rfrtools = "true" ]]; then
@@ -164,19 +173,10 @@ install_scriptools_and_rfrtools() {
164173
echo "Done installing RFR_Tools"
165174
fi
166175

167-
# update script_tools
168-
curl --silent -kL https://raw.githubusercontent.com/DexterInd/script_tools/$selectedbranch/install_script_tools.sh > $PIHOME/.tmp_script_tools.sh
169-
echo "Installing script_tools. This might take a while.."
170-
bash $PIHOME/.tmp_script_tools.sh $selectedbranch > /dev/null
171-
ret_val=$?
172-
rm $PIHOME/.tmp_script_tools.sh
173-
if [[ $ret_val -ne 0 ]]; then
174-
echo "script_tools failed installing with exit code $ret_val. Exiting."
175-
exit 6
176-
fi
177-
# needs to be sourced from here when we call this as a standalone
176+
# check if all deb packages have been installed with RFR_Tools
177+
check_dependencies
178+
178179
source $DEXTERSCRIPT/functions_library.sh
179-
feedback "Done installing script_tools"
180180
}
181181

182182
# called way down bellow
@@ -285,8 +285,10 @@ install_gopigp3_power_service() {
285285
################################################
286286

287287
check_if_run_with_pi
288+
288289
parse_cmdline_arguments "$@"
289-
install_scriptools_and_rfrtools
290+
install_rfrtools_repo
291+
290292
clone_gopigo3
291293
install_python_pkgs_and_dependencies
292294
install_gopigp3_power_service

0 commit comments

Comments
 (0)