Skip to content

Commit

Permalink
Prepare Java for inclusion in openHABian image
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed May 29, 2020
1 parent 11000b7 commit fb1c2ab
Show file tree
Hide file tree
Showing 23 changed files with 263 additions and 289 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ jobs:
script:
# AdoptOpenJDK Java on 32bit ARMv7 on 32bit OS on Travis Arm64 HW
- export HW=rpi2
- sed -i 's/^java_opt=.*/java_opt=AdoptOpenJDK/' build-image/openhabian.conf
- sed -i 's/^java_opt=.*/java_opt=Adopt11/' build-image/openhabian.conf
- docker build -t openhabian/${HW}-openhabian -f Dockerfile.openhabian-arm32hf-native .
- echo -e "\n\e[36mopenHABian test installation 64bit AdoptOpenJDK Java \e[31m on 32bit OS\e[36m on virtual $HW ...\n"
- echo -e "\n\e[36mopenHABian test installation 64bit AdoptOpenJDK 11 Java \e[31m on 32bit OS\e[36m on virtual $HW ...\n"
- docker run --memory="1g" --memory-reservation="1g" --name "openhabian-${HW}" -d openhabian/${HW}-openhabian;
- docker exec -i "openhabian-${HW}" bash -c './build.bash local-test && mv ~/.profile ~/.bash_profile && /etc/rc.local'
1 change: 0 additions & 1 deletion Dockerfile.openhabian-ARMv6hf-native
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ VOLUME ["/sys/fs/cgroup"]
STOPSIGNAL 37

CMD ["bash", "start.sh"]

2 changes: 1 addition & 1 deletion Dockerfile.openhabian-aarch64-64bit
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN cp docker-systemctl-replacement/files/docker/systemctl3.py /bin/systemctl
ENTRYPOINT ["/usr/bin/entry.sh"]

RUN adduser openhabian --gecos "Openhabian,,," --disabled-password
RUN echo "openhabian:openhabian" | chpasswd
RUN echo "openhabian:openhabian" | chpasswd
RUN /bin/echo -n "Running on " && /usr/bin/arch

COPY . /opt/openhabian/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.openhabian-aarch64-native
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN cp docker-systemctl-replacement/files/docker/systemctl3.py /bin/systemctl
ENTRYPOINT ["/usr/bin/entry.sh"]

RUN adduser openhabian --gecos "Openhabian,,," --disabled-password
RUN echo "openhabian:openhabian" | chpasswd
RUN echo "openhabian:openhabian" | chpasswd
RUN /bin/echo -n "Running on " && /usr/bin/arch

COPY . /opt/openhabian/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.openhabian-arm32hf-CM3
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN cp docker-systemctl-replacement/files/docker/systemctl3.py /bin/systemctl
ENTRYPOINT ["/usr/bin/entry.sh"]

RUN adduser openhabian --gecos "Openhabian,,," --disabled-password
RUN echo "openhabian:openhabian" | chpasswd
RUN echo "openhabian:openhabian" | chpasswd
RUN /bin/echo -n "Running on " && /usr/bin/arch

COPY . /opt/openhabian/
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.openhabian-arm32hf-emulated
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# assumes at least ARMv71 but not ARMv8 (aarch64) yet
FROM balenalib/raspberry-pi2-debian-node:latest-buster

RUN [ "cross-build-start" ]

ENV container docker
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN cp docker-systemctl-replacement/files/docker/systemctl3.py /bin/systemctl
ENTRYPOINT ["/usr/bin/entry.sh"]

RUN adduser openhabian --gecos "Openhabian,,," --disabled-password
RUN echo "openhabian:openhabian" | chpasswd
RUN echo "openhabian:openhabian" | chpasswd
RUN /bin/echo -n "Running on " && /usr/bin/arch

COPY . /opt/openhabian/
Expand All @@ -54,4 +54,3 @@ STOPSIGNAL 37
CMD ["bash", "start.sh"]

RUN [ "cross-build-end" ]

2 changes: 1 addition & 1 deletion Dockerfile.openhabian-x86
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN cp docker-systemctl-replacement/files/docker/systemctl3.py /bin/systemctl
ENTRYPOINT ["/usr/bin/entry.sh"]

RUN adduser openhabian --gecos "Openhabian,,," --disabled-password
RUN echo "openhabian:openhabian" | chpasswd
RUN echo "openhabian:openhabian" | chpasswd
RUN /bin/echo -n "Running on " && /usr/bin/arch

COPY . /opt/openhabian/
Expand Down
2 changes: 1 addition & 1 deletion build-image/openhabian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mode=unattended
#release=buster

# Java architecture mode
# Valid arguments: "AdoptOpenJDK", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
# Valid arguments: "Adopt11", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
java_opt=Zulu8-32

# vim: filetype=sh
2 changes: 1 addition & 1 deletion build-image/openhabian.pi-raspbian.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mode=unattended
#release=buster

# Java architecture mode
# Valid arguments: "AdoptOpenJDK", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
# Valid arguments: "Adopt11", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
java_opt=Zulu8-32

# vim: filetype=sh
2 changes: 1 addition & 1 deletion build-image/openhabian.pine64-xenial.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ wifi_country=""
# vim: filetype=sh

# Java architecture mode
# Valid arguments: "AdoptOpenJDK", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
# Valid arguments: "Adopt11", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
java_opt=Zulu8-32
2 changes: 1 addition & 1 deletion docs/openhabian.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ In `openhabian.conf`, uncomment and complete the lines reading `hw=`, `hwarch=`

{: #debug-mode}
### Debug mode
See [Troubleshooting] section if you run into trouble installing. If you want to turn on debug mode,
See [Troubleshooting] section if you run into trouble installing. If you want to turn on debug mode,
edit `openhabian.conf` and set the `debug=` parameter to either `none`, `on` or `maximum`.

{: #ipv6-notes}
Expand Down
2 changes: 1 addition & 1 deletion functions/config.bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ clean_config_userpw() {
}

## Update java architecture in config file
## Valid arguments: "AdoptOpenJDK", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
## Valid arguments: "Adopt11", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64"
update_config_java() {
if [ "$1" == "Zulu8-64" ] || [ "$1" == "Zulu11-64" ]; then
if (! is_x86_64 && ! [ "$(getconf LONG_BIT)" == "64" ]) || (! is_aarch64 && ! [ "$(getconf LONG_BIT)" == "64" ]); then
Expand Down
7 changes: 4 additions & 3 deletions functions/influxdb+grafana.bash
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ influxdb_grafana_setup() {
influxdb_install() {
local influxdb_address
local influxdb_admin_username
local dist codename
local dist
local codename

cond_echo ""
echo "Installing InfluxDB..."
Expand All @@ -242,7 +243,7 @@ influxdb_install() {
influxdb_admin_username="admin"
# if [ ! -f /etc/influxdb/influxdb.conf ]; then
cond_redirect wget -O - https://repos.influxdata.com/influxdb.key | apt-key add - || FAILED=1
echo "deb https://repos.influxdata.com/$dist $codename stable" > /etc/apt/sources.list.d/influxdb.list || FAILED=1
echo "deb https://repos.influxdata.com/${dist} ${codename} stable" > /etc/apt/sources.list.d/influxdb.list || FAILED=1
cond_redirect apt-get update || FAILED=1
cond_redirect apt-get -y install influxdb || FAILED=1

Expand Down Expand Up @@ -301,7 +302,7 @@ grafana_install(){
echo -n "Wait for Grafana to start... "
curl --retry 5 --retry-connrefused -s http://localhost:3000 >/dev/null || FAILED=2
if [ $FAILED -eq 2 ]; then echo -n "FAILED "; return 2; else echo -n "OK "; fi
sleep 10
sleep 10
cond_echo ""

# password reset required if Grafana password was already set before (no first-time install)
Expand Down
Loading

0 comments on commit fb1c2ab

Please sign in to comment.