Skip to content

Commit 9326802

Browse files
authored
Merge develop back into master (PR #29)
2 parents 6c79e6c + 25a21fd commit 9326802

File tree

12 files changed

+235
-252
lines changed

12 files changed

+235
-252
lines changed

README.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ This project tries to save time in this process.
1111

1212
The installer will install the following libraries by default:
1313

14-
+ Java JDK 8 (Only for BrickPi/PiStorms)
14+
+ Java OpenJDK 11 (Java Runtime Image) for all bricks
1515

16-
If you like, you can install a utility to monitor the battery. (Recommended)
17-
18-
+ [BatteryMonitor](https://github.com/ev3dev-lang-java/batteryMonitor) (A Java utility to monitor the Battery)
19-
20-
But it is possible to install the following libraries if your project requires them.
16+
It is possible to install the following libraries if your project requires them.
2117

2218
+ [OpenCV](http://docs.opencv.org/2.4/doc/tutorials/introduction/desktop_java/java_dev_intro.html)
2319
+ [RXTX](https://github.com/rxtx/rxtx) (Serial port library used on [RPLIDAR4J](https://github.com/ev3dev-lang-java/RPLidar4J))
@@ -38,21 +34,6 @@ sudo apt-get dist-upgrade
3834
sudo reboot
3935
```
4036

41-
### EV3 Brick and Java
42-
43-
If you are using a EV3Brick, you will have to install Java JRE8 Manually.
44-
Download the file: `ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz` from:
45-
http://www.oracle.com/technetwork/java/embedded/downloads/javase/javaseemeddedev3-1982511.html
46-
and copy the file to the following route: `/home/robot/`
47-
48-
**Example:**
49-
50-
```
51-
scp "/home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" "[email protected]:/home/robot"
52-
```
53-
54-
Later, the Installer will manage the file in Java module.
55-
5637
### Running the installer
5738

5839
```
@@ -64,8 +45,3 @@ chmod +x installer.sh
6445
sudo ./installer.sh help
6546
sudo ./installer.sh
6647
```
67-
68-
## Advanced
69-
70-
It is nice to configure one brick but maybe you could discover that the installer could move the JDK one manual process to another brick and hte installer it is possible to replicate to another remote brick. Play with the help to discover the way.
71-

installer.sh

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,69 @@
11
#!/bin/bash
22
# A Bash script to install Linux Libraries used on EV3Dev-lang-java.
33
# Author: Juan Antonio Breña Moral, [email protected]
4+
# Author: Jakub Vaněk, [email protected]
45

5-
echo
6-
echo "##############################"
7-
echo "# EV3Dev-lang-java Installer #"
8-
echo "##############################"
9-
echo "# Last update: 2017/06/18 #"
10-
echo "##############################"
11-
echo
6+
MODULE="unknown"
7+
MODULE_FOLDER="/home/robot/installer/module"
8+
ROOT_URL="https://raw.githubusercontent.com/ev3dev-lang-java/installer/develop/modules"
9+
10+
# $1 => module name
11+
function download_module() {
12+
pushd "$MODULE_FOLDER" >/dev/null
13+
wget -qN "$ROOT_URL/$1.sh"
14+
popd >/dev/null
15+
}
16+
17+
# $1 => module name
18+
function run_module() {
19+
MODULE="$1"
20+
createHeader "$1"
21+
download_module "$1"
22+
source "$MODULE_FOLDER/$1.sh"
23+
}
1224

13-
OFF=0
14-
MODULE="EMPTY"
15-
MODULE_FOLDER="module2"
16-
function runModule(){
17-
if ! [ "$2" == "$OFF" ]; then
18-
createHeader $1
19-
fi
20-
local domain="https://raw.githubusercontent.com/ev3dev-lang-java/installer/develop/modules"
21-
wget -N "$domain/$1.sh"
22-
MODULE=$1
23-
mv ./$1.sh ./$MODULE_FOLDER/$1.sh
25+
# $1 => module name
26+
function inc_module() {
27+
download_module "$1"
2428
source "$MODULE_FOLDER/$1.sh"
2529
}
2630

27-
function initInstaller(){
31+
function init_installer() {
2832
echo "Init installer"
29-
mkdir -p $MODULE_FOLDER
30-
rm ./$MODULE_FOLDER/*
33+
#rm -rf "$MODULE_FOLDER"
34+
mkdir -p "$MODULE_FOLDER"
3135
}
3236

33-
MODE_HELP="help"
34-
MODE_JDK="jdk"
35-
MODE_BATTERY_MONITOR="batteryMonitor"
36-
MODE_COPY_INSTALLER="copy-installer"
37-
MODE_EXTENDED="extended"
37+
echo
38+
echo "##############################"
39+
echo "# EV3Dev-lang-java Installer #"
40+
echo "##############################"
41+
echo "# Last update: 2018/11/10 #"
42+
echo "##############################"
43+
echo
44+
3845

3946
#Init
40-
initInstaller
41-
runModule utilities 0
47+
init_installer
48+
inc_module vars
49+
inc_module utilities
4250

43-
if [ "$1" == "$MODE_HELP" ]; then
44-
runModule help
45-
fi
51+
run_module platform
4652

47-
#TODO Disable this option if platform is not EV3BRICK
48-
CREDENTIAL=""
49-
if [ "$1" == "$MODE_JDK" ]; then
50-
CREDENTIAL=$2
51-
runModule copy-jdk
52-
fi
5353

54-
if [ "$1" == "$MODE_COPY_INSTALLER" ]; then
55-
CREDENTIAL=$2
56-
runModule copy-installer
57-
fi
54+
if [ "$1" == "help" ]; then
55+
run_module help
5856

59-
runModule platform
60-
runModule java
57+
elif [ "$1" == "copy-installer" ]; then
58+
CREDENTIAL="$2"
59+
run_module copy-installer
6160

62-
if [ "$1" == "$MODE_BATTERY_MONITOR" ]; then
63-
runModule battery-monitor
64-
fi
61+
elif [ "$1" == "extended" ]; then
62+
run_module java
63+
run_module native-libraries
6564

66-
if [ "$1" == "$MODE_EXTENDED" ]; then
67-
runModule native-libraries
65+
elif [ "$1" == "java" ]; then
66+
run_module java
6867
fi
6968

70-
exit 0
69+
exit 0

modules/battery-monitor.sh

Lines changed: 0 additions & 51 deletions
This file was deleted.

modules/copy-installer.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/bash
22

3-
if [ -e "/home/robot/installer/installer.sh" ]; then
4-
echo $CREDENTIAL
5-
ssh $CREDENTIAL 'uptime'
6-
ssh $CREDENTIAL 'sudo mkdir /home/robot/installer/'
7-
scp "/home/robot/installer/installer.sh" "$CREDENTIAL:/home/robot/installer"
8-
ssh $CREDENTIAL 'sudo chmod +x /home/robot/installer.sh'
3+
if [ -e "$INSTALLER_EXE" ]; then
4+
chmod +x "$INSTALLER_EXE"
5+
6+
echo "SSHing to: $CREDENTIAL"
7+
ssh "$CREDENTIAL" "uptime; sudo mkdir -p $INSTALLER_DIR"
8+
scp "$INSTALLER_EXE" "$CREDENTIAL:$INSTALLER_DIR"
99
exit
1010
else
1111
echo "Sorry, the installer didn´t detect the installer"
1212
echo "on /home/robot/installer"
1313
echo "try to review your installation on your EV3 Brick."
1414
echo
1515
exit 1
16-
fi
16+
fi

modules/copy-jdk.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

modules/experimental/bluetooth.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ echo "##############################"
77
echo ""
88

99
#2. Install Bluetooth
10-
if [ "$PLATFORM" == "$EV3" ];
10+
if [ "$PLATFORM" == "ev3" ];
1111
then
12-
echo $EV3
12+
echo "EV3"
1313
#isInstalled libbluetooth-dev
1414
#wget http://ftp.us.debian.org/debian/pool/main/b/bluez/libbluetooth-dev_5.23-2+b1_armel.deb
1515
#dpkg --force-depends-version -i libbluetooth-dev_5.23-2+b1_armel.deb
1616
else
17-
echo $BRICKPI
18-
isInstalled libbluetooth-dev
17+
echo "BrickPi"
18+
isInstalled "$BT_BRICKPI_PKG"
1919
#apt-get install libbluetooth-dev
20-
fi
20+
fi

modules/help.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/bin/bash
22

33
echo "Installer options:"
4-
echo "sudo ./installer.sh [Execute modules: platform, java & batteryMonitor]"
5-
echo "sudo ./installer.sh batteryMonitor [Install batteryMonitor]"
6-
echo "sudo ./installer.sh extended [Execute modules: platform, java, batteryMonitor & native-libraries]"
7-
echo "sudo ./installer.sh jdk [email protected] [Copy your local JRE to a remote brick]"
4+
echo "sudo ./installer.sh java [Execute modules: platform, java]"
5+
echo "sudo ./installer.sh extended [Execute modules: platform, java & native-libraries]"
86
echo "sudo ./installer.sh copy-installer [email protected] [Copy the installer to a remote brick]"
97
echo
10-
exit
8+
exit

0 commit comments

Comments
 (0)