Skip to content

Commit 9949c4e

Browse files
committed
[docker, scripts] Refactor Boot JDK out of container
1 parent 17ae343 commit 9949c4e

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,23 @@ sudo docker run --rm -it -v <path on host, where the sources should be stored>:/
3131
export JDKVER=9
3232
export JDKVER=10
3333
```
34-
5. Now we can download the OpenJDK sources:
34+
5. Before we can start the build process, Boot JDK must be downloaded:
35+
```
36+
./prepare.sh
37+
```
38+
6. Now we can download the OpenJDK sources:
3539
```
3640
./fetch.sh
3741
```
38-
6. The OpenJDK source tree should be ready. Now you can start the cross-build itself:
42+
7. The OpenJDK source tree should be ready. Now you can start the cross-build itself:
3943
```
4044
./build.sh
4145
```
42-
7. Create the zipped images:
46+
8. Create the zipped images:
4347
```
4448
./zip.sh
4549
```
46-
8. If the build was successful, JDK packages were created in `/build/jri-ev3.tar.gz`, `/build/jdk-ev3.tar.gz` and `/build/jmods.tar.gz`.
50+
9. If the build was successful, JDK packages were created in `/build/jri-ev3.tar.gz`, `/build/jdk-ev3.tar.gz` and `/build/jmods.tar.gz`.
4751
If you have mounted `/build`, you can access the files from the host.
4852

4953
## ~~JShell on the EV3~~

scripts/config.sh

+23-4
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@ BUILDDIR="/build"
88
JDKDIR="/build/jdk"
99
# output images directory
1010
IMAGEDIR="/build/jdk/build/linux-arm-normal-client-release/images"
11-
# boot jdk
12-
HOSTJDK="$SCRIPTDIR/jdk-10"
1311

14-
15-
# Version-specific configuration
12+
##
13+
## Version-specific configuration
14+
##
1615

1716
# mercurial repository
1817
#JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdkXu/"
18+
1919
# patch to apply
2020
#PATCHVER="jdkX"
21+
2122
# path to autogen.sh to regenerate the build system
2223
#AUTOGEN_PATH="./common/autoconf/autogen.sh"
24+
2325
# hotspot variant to use
2426
#HOTSPOT_VARIANT=client
2527
# A comment from OpenJDK build system sums it up pretty well:
@@ -32,20 +34,37 @@ HOSTJDK="$SCRIPTDIR/jdk-10"
3234
# 'client' JVM starts fast enough and provides the best performance.
3335
# 'zero' JVM provides us with a fallback when ARMv5 sflt JIT stops working completely.
3436

37+
## Boot JDK configs
38+
39+
# Destination Boot JDK directory
40+
#HOSTJDK="$BUILDDIR/jdk-9.0.4"
41+
42+
# Cached archive
43+
#HOSTJDK_FILE="$BUILDDIR/openjdk-9.0.4.tar.gz"
44+
45+
# Download URL
46+
#HOSTJDK_URL="https://download.java.net/java/GA/jdk9/9.0.4/binaries/openjdk-9.0.4_linux-x64_bin.tar.gz"
47+
3548

3649
# OpenJDK 9
3750
if [ "$JDKVER" -eq "9" ]; then
3851
JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdk9u/"
3952
PATCHVER="jdk9"
4053
AUTOGEN_PATH="./common/autoconf/autogen.sh"
4154
HOTSPOT_VARIANT=client
55+
HOSTJDK="$BUILDDIR/jdk-9.0.4"
56+
HOSTJDK_FILE="$BUILDDIR/openjdk-9.0.4.tar.gz"
57+
HOSTJDK_URL="https://download.java.net/java/GA/jdk9/9.0.4/binaries/openjdk-9.0.4_linux-x64_bin.tar.gz"
4258

4359
# OpenJDK 10
4460
elif [ "$JDKVER" -eq "10" ]; then
4561
JAVA_REPO="http://hg.openjdk.java.net/jdk-updates/jdk10u/"
4662
PATCHVER="jdk10"
4763
AUTOGEN_PATH="./make/autoconf/autogen.sh"
4864
HOTSPOT_VARIANT=client
65+
HOSTJDK="$BUILDDIR/jdk-10"
66+
HOSTJDK_FILE="$BUILDDIR/openjdk-10.tar.gz"
67+
HOSTJDK_URL="https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz"
4968

5069
# invalid or unset version
5170
else

scripts/prepare.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname ${BASH_SOURCE[0]})"
5+
source config.sh
6+
7+
if [ ! -d "HOSTJDK" ]; then
8+
if [ ! -e "$HOSTJDK_FILE" ]; then
9+
wget "$HOSTJDK_URL" -O "$HOSTJDK_FILE"
10+
fi
11+
tar -xf "$HOSTJDK_FILE" -C "$(dirname "$HOSTJDK")"
12+
fi

system/Dockerfile

-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ RUN dpkg --add-architecture armel && \
5050
mercurial \
5151
zlib1g-dev
5252

53-
# download JDK 10
54-
RUN mkdir /opt/jdkcross
55-
RUN curl -SL https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz | tar -xzC /opt/jdkcross
56-
5753
# prepare a nonroot user
5854
COPY compiler.sudoers /etc/sudoers.d/compiler
5955
RUN chmod 0440 /etc/sudoers.d/compiler && \

0 commit comments

Comments
 (0)