The three apps openjdk8-zulu-compact* provide base images for Java 8 compact profiles. Each of the 3 apps uses the https://github.com/wkozaczuk/openjdk8_compact_profiles_builder tool to build Java 8 compact profile JRE based on regular OpenJDK 8 JDK, in this case Zulu OpenJDK 8 builds (https://www.azul.com/products/zulu/).
The other 3 apps are simple Java Hello apps that demonstrate usages of each of the base compact profiles. Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com> --- java-compact1-example/Hello.java | 5 +++++ java-compact1-example/Makefile | 7 +++++++ java-compact1-example/module.py | 5 +++++ java-compact1-example/usr.manifest | 1 + java-compact2-example/Hello.java | 5 +++++ java-compact2-example/Makefile | 7 +++++++ java-compact2-example/module.py | 5 +++++ java-compact2-example/usr.manifest | 1 + java-compact3-example/Hello.java | 5 +++++ java-compact3-example/Makefile | 7 +++++++ java-compact3-example/module.py | 5 +++++ java-compact3-example/usr.manifest | 1 + openjdk8-zulu-compact-common/common.gmk | 37 +++++++++++++++++++++++++++++++++ openjdk8-zulu-compact-common/latest.sh | 3 +++ openjdk8-zulu-compact1/Makefile | 11 ++++++++++ openjdk8-zulu-compact1/latest.sh | 2 ++ openjdk8-zulu-compact1/module.py | 24 +++++++++++++++++++++ openjdk8-zulu-compact1/usr.manifest | 20 ++++++++++++++++++ openjdk8-zulu-compact2/Makefile | 11 ++++++++++ openjdk8-zulu-compact2/latest.sh | 2 ++ openjdk8-zulu-compact2/module.py | 24 +++++++++++++++++++++ openjdk8-zulu-compact2/usr.manifest | 20 ++++++++++++++++++ openjdk8-zulu-compact3/Makefile | 11 ++++++++++ openjdk8-zulu-compact3/latest.sh | 2 ++ openjdk8-zulu-compact3/module.py | 26 +++++++++++++++++++++++ openjdk8-zulu-compact3/usr.manifest | 20 ++++++++++++++++++ 26 files changed, 267 insertions(+) create mode 100644 java-compact1-example/Hello.java create mode 100644 java-compact1-example/Makefile create mode 100644 java-compact1-example/module.py create mode 100644 java-compact1-example/usr.manifest create mode 100644 java-compact2-example/Hello.java create mode 100644 java-compact2-example/Makefile create mode 100644 java-compact2-example/module.py create mode 100644 java-compact2-example/usr.manifest create mode 100644 java-compact3-example/Hello.java create mode 100644 java-compact3-example/Makefile create mode 100644 java-compact3-example/module.py create mode 100644 java-compact3-example/usr.manifest create mode 100644 openjdk8-zulu-compact-common/common.gmk create mode 100755 openjdk8-zulu-compact-common/latest.sh create mode 100644 openjdk8-zulu-compact1/Makefile create mode 100755 openjdk8-zulu-compact1/latest.sh create mode 100644 openjdk8-zulu-compact1/module.py create mode 100644 openjdk8-zulu-compact1/usr.manifest create mode 100644 openjdk8-zulu-compact2/Makefile create mode 100755 openjdk8-zulu-compact2/latest.sh create mode 100644 openjdk8-zulu-compact2/module.py create mode 100644 openjdk8-zulu-compact2/usr.manifest create mode 100644 openjdk8-zulu-compact3/Makefile create mode 100755 openjdk8-zulu-compact3/latest.sh create mode 100644 openjdk8-zulu-compact3/module.py create mode 100644 openjdk8-zulu-compact3/usr.manifest diff --git a/java-compact1-example/Hello.java b/java-compact1-example/Hello.java new file mode 100644 index 0000000..a605554 --- /dev/null +++ b/java-compact1-example/Hello.java @@ -0,0 +1,5 @@ +public class Hello { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} diff --git a/java-compact1-example/Makefile b/java-compact1-example/Makefile new file mode 100644 index 0000000..8a385c9 --- /dev/null +++ b/java-compact1-example/Makefile @@ -0,0 +1,7 @@ +module: Hello.class + +%.class: %.java + javac -target 7 -source 7 $^ + +clean: + rm -rf *.class diff --git a/java-compact1-example/module.py b/java-compact1-example/module.py new file mode 100644 index 0000000..216cf35 --- /dev/null +++ b/java-compact1-example/module.py @@ -0,0 +1,5 @@ +from osv.modules import api + +api.require('openjdk8-zulu-compact1') + +default = api.run('/java.so -cp /java-example Hello') diff --git a/java-compact1-example/usr.manifest b/java-compact1-example/usr.manifest new file mode 100644 index 0000000..f62abc7 --- /dev/null +++ b/java-compact1-example/usr.manifest @@ -0,0 +1 @@ +/java-example/Hello.class: ${MODULE_DIR}/Hello.class diff --git a/java-compact2-example/Hello.java b/java-compact2-example/Hello.java new file mode 100644 index 0000000..a605554 --- /dev/null +++ b/java-compact2-example/Hello.java @@ -0,0 +1,5 @@ +public class Hello { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} diff --git a/java-compact2-example/Makefile b/java-compact2-example/Makefile new file mode 100644 index 0000000..8a385c9 --- /dev/null +++ b/java-compact2-example/Makefile @@ -0,0 +1,7 @@ +module: Hello.class + +%.class: %.java + javac -target 7 -source 7 $^ + +clean: + rm -rf *.class diff --git a/java-compact2-example/module.py b/java-compact2-example/module.py new file mode 100644 index 0000000..f17ac37 --- /dev/null +++ b/java-compact2-example/module.py @@ -0,0 +1,5 @@ +from osv.modules import api + +api.require('openjdk8-zulu-compact2') + +default = api.run('/java.so -cp /java-example Hello') diff --git a/java-compact2-example/usr.manifest b/java-compact2-example/usr.manifest new file mode 100644 index 0000000..f62abc7 --- /dev/null +++ b/java-compact2-example/usr.manifest @@ -0,0 +1 @@ +/java-example/Hello.class: ${MODULE_DIR}/Hello.class diff --git a/java-compact3-example/Hello.java b/java-compact3-example/Hello.java new file mode 100644 index 0000000..a605554 --- /dev/null +++ b/java-compact3-example/Hello.java @@ -0,0 +1,5 @@ +public class Hello { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} diff --git a/java-compact3-example/Makefile b/java-compact3-example/Makefile new file mode 100644 index 0000000..8a385c9 --- /dev/null +++ b/java-compact3-example/Makefile @@ -0,0 +1,7 @@ +module: Hello.class + +%.class: %.java + javac -target 7 -source 7 $^ + +clean: + rm -rf *.class diff --git a/java-compact3-example/module.py b/java-compact3-example/module.py new file mode 100644 index 0000000..05cb1f4 --- /dev/null +++ b/java-compact3-example/module.py @@ -0,0 +1,5 @@ +from osv.modules import api + +api.require('openjdk8-zulu-compact3') + +default = api.run('/java.so -cp /java-example Hello') diff --git a/java-compact3-example/usr.manifest b/java-compact3-example/usr.manifest new file mode 100644 index 0000000..f62abc7 --- /dev/null +++ b/java-compact3-example/usr.manifest @@ -0,0 +1 @@ +/java-example/Hello.class: ${MODULE_DIR}/Hello.class diff --git a/openjdk8-zulu-compact-common/common.gmk b/openjdk8-zulu-compact-common/common.gmk new file mode 100644 index 0000000..314c6a1 --- /dev/null +++ b/openjdk8-zulu-compact-common/common.gmk @@ -0,0 +1,37 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +jvm_dir=install/usr/lib/jvm + +java8_compact_profile_builder_git_url=https://github.com/wkozaczuk/openjdk8_compact_profiles_builder.git + +java8_jdk_tarball_url = $(shell ./latest.sh) + +SRC = $(shell readlink -f ../..) + +COMPACT_PROFILE_IMAGE_DIR=j2re-compact$(PROFILE_NUMBER)-image + +module: + cd $(SRC)/java && mvn package -q -DskipTests=true + rm -rf upstream + mkdir -p upstream + cd upstream && git clone https://github.com/wkozaczuk/openjdk8_compact_profiles_builder.git + cd upstream/openjdk8_compact_profiles_builder && ./build_compact_profile.sh $(java8_jdk_tarball_url) $(PROFILE_NUMBER) + rm -rf install + mkdir -p install/usr/lib/jvm/$(COMPACT_PROFILE_IMAGE_DIR) + mv upstream/openjdk8_compact_profiles_builder/work/build/linux-x86_64-normal-server-release/images/$(COMPACT_PROFILE_IMAGE_DIR) $(jvm_dir)/$(COMPACT_PROFILE_IMAGE_DIR)/jre + ln -sf $(COMPACT_PROFILE_IMAGE_DIR) install/usr/lib/jvm/java + rm -rf $(jvm_dir)/java/jre/bin + rm -rf $(jvm_dir)/java/jre/lib/security/cacerts + rm -rf $(jvm_dir)/java/jre/lib/audio/* + cp $(SRC)/java/runjava/target/runjava.jar install/usr/lib/jvm/java/jre/lib/ext/ + ln -s /etc/pki/java/cacerts install/usr/lib/jvm/java/jre/lib/security/ + +clean: + rm -rf upstream install + cd $(SRC)/java && mvn clean -q + -rm -f dependency-reduced-pom.xml diff --git a/openjdk8-zulu-compact-common/latest.sh b/openjdk8-zulu-compact-common/latest.sh new file mode 100755 index 0000000..ad3726d --- /dev/null +++ b/openjdk8-zulu-compact-common/latest.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +wget -qO- http://www.azul.com/downloads/zulu/zulu-linux/ | grep "jdk8.*linux.*64.tar.gz" | grep -o "http:.*tar.gz" | head -1 diff --git a/openjdk8-zulu-compact1/Makefile b/openjdk8-zulu-compact1/Makefile new file mode 100644 index 0000000..686c904 --- /dev/null +++ b/openjdk8-zulu-compact1/Makefile @@ -0,0 +1,11 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +PROFILE_NUMBER=1 +include ../openjdk8-zulu-compact-common/common.gmk + +.PHONY: module clean diff --git a/openjdk8-zulu-compact1/latest.sh b/openjdk8-zulu-compact1/latest.sh new file mode 100755 index 0000000..d0195a5 --- /dev/null +++ b/openjdk8-zulu-compact1/latest.sh @@ -0,0 +1,2 @@ +#!/bin/bash +. ../openjdk8-zulu-compact-common/latest.sh diff --git a/openjdk8-zulu-compact1/module.py b/openjdk8-zulu-compact1/module.py new file mode 100644 index 0000000..ac7dbcc --- /dev/null +++ b/openjdk8-zulu-compact1/module.py @@ -0,0 +1,24 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +from osv.modules.filemap import FileMap +from osv.modules import api +import os, os.path + +provides = ['java'] + +api.require('fonts') +api.require('ca-certificates') +api.require('libz') +api.require('josvsym') + +usr_files = FileMap() +usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact1/install').to('/').allow_symlink() +usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact1/install/usr/lib/jvm/java') \ + .to('/usr/lib/jvm/java') \ + .allow_symlink() +usr_files.link('/usr/lib/jvm/jre').to('/usr/lib/jvm/java/jre') diff --git a/openjdk8-zulu-compact1/usr.manifest b/openjdk8-zulu-compact1/usr.manifest new file mode 100644 index 0000000..7c9851e --- /dev/null +++ b/openjdk8-zulu-compact1/usr.manifest @@ -0,0 +1,20 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +[manifest] +/usr/lib/libz.so.1: %(miscbase)s/usr/lib64/libz.so.1 +/usr/lib/&/libexpat.so.1: %(miscbase)s/usr/lib64/& +/usr/lib/&/libjpeg.so.62: %(miscbase)s/usr/lib64/& +/usr/lib/jni/balloon.so: java/jni/balloon.so +/usr/lib/jni/monitor.so: java/jni/monitor.so +/usr/lib/&/jni/elf-loader.so: java/& +/usr/lib/&/jni/networking.so: java/& +/usr/lib/&/jni/stty.so: java/& +/usr/lib/&/jni/tracepoint.so: java/& +/usr/lib/&/jni/power.so: java/& +/java.so: java/jvm/java_non_isolated.so +/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar diff --git a/openjdk8-zulu-compact2/Makefile b/openjdk8-zulu-compact2/Makefile new file mode 100644 index 0000000..b78d850 --- /dev/null +++ b/openjdk8-zulu-compact2/Makefile @@ -0,0 +1,11 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +PROFILE_NUMBER=2 +include ../openjdk8-zulu-compact-common/common.gmk + +.PHONY: module clean diff --git a/openjdk8-zulu-compact2/latest.sh b/openjdk8-zulu-compact2/latest.sh new file mode 100755 index 0000000..d0195a5 --- /dev/null +++ b/openjdk8-zulu-compact2/latest.sh @@ -0,0 +1,2 @@ +#!/bin/bash +. ../openjdk8-zulu-compact-common/latest.sh diff --git a/openjdk8-zulu-compact2/module.py b/openjdk8-zulu-compact2/module.py new file mode 100644 index 0000000..4385a78 --- /dev/null +++ b/openjdk8-zulu-compact2/module.py @@ -0,0 +1,24 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +from osv.modules.filemap import FileMap +from osv.modules import api +import os, os.path + +provides = ['java'] + +api.require('fonts') +api.require('ca-certificates') +api.require('libz') +api.require('josvsym') + +usr_files = FileMap() +usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact2/install').to('/').allow_symlink() +usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact2/install/usr/lib/jvm/java') \ + .to('/usr/lib/jvm/java') \ + .allow_symlink() +usr_files.link('/usr/lib/jvm/jre').to('/usr/lib/jvm/java/jre') diff --git a/openjdk8-zulu-compact2/usr.manifest b/openjdk8-zulu-compact2/usr.manifest new file mode 100644 index 0000000..7c9851e --- /dev/null +++ b/openjdk8-zulu-compact2/usr.manifest @@ -0,0 +1,20 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +[manifest] +/usr/lib/libz.so.1: %(miscbase)s/usr/lib64/libz.so.1 +/usr/lib/&/libexpat.so.1: %(miscbase)s/usr/lib64/& +/usr/lib/&/libjpeg.so.62: %(miscbase)s/usr/lib64/& +/usr/lib/jni/balloon.so: java/jni/balloon.so +/usr/lib/jni/monitor.so: java/jni/monitor.so +/usr/lib/&/jni/elf-loader.so: java/& +/usr/lib/&/jni/networking.so: java/& +/usr/lib/&/jni/stty.so: java/& +/usr/lib/&/jni/tracepoint.so: java/& +/usr/lib/&/jni/power.so: java/& +/java.so: java/jvm/java_non_isolated.so +/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar diff --git a/openjdk8-zulu-compact3/Makefile b/openjdk8-zulu-compact3/Makefile new file mode 100644 index 0000000..be4c93d --- /dev/null +++ b/openjdk8-zulu-compact3/Makefile @@ -0,0 +1,11 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +PROFILE_NUMBER=3 +include ../openjdk8-zulu-compact-common/common.gmk + +.PHONY: module clean diff --git a/openjdk8-zulu-compact3/latest.sh b/openjdk8-zulu-compact3/latest.sh new file mode 100755 index 0000000..d0195a5 --- /dev/null +++ b/openjdk8-zulu-compact3/latest.sh @@ -0,0 +1,2 @@ +#!/bin/bash +. ../openjdk8-zulu-compact-common/latest.sh diff --git a/openjdk8-zulu-compact3/module.py b/openjdk8-zulu-compact3/module.py new file mode 100644 index 0000000..12f4dc9 --- /dev/null +++ b/openjdk8-zulu-compact3/module.py @@ -0,0 +1,26 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +from osv.modules.filemap import FileMap +from osv.modules import api +import os, os.path + +provides = ['java'] + +api.require('fonts') +api.require('ca-certificates') +api.require('libz') +api.require('josvsym') +api.require('httpserver-jolokia-plugin') +api.require('httpserver-jvm-plugin') + +usr_files = FileMap() +usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact3/install').to('/').allow_symlink() +usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-compact3/install/usr/lib/jvm/java') \ + .to('/usr/lib/jvm/java') \ + .allow_symlink() +usr_files.link('/usr/lib/jvm/jre').to('/usr/lib/jvm/java/jre') diff --git a/openjdk8-zulu-compact3/usr.manifest b/openjdk8-zulu-compact3/usr.manifest new file mode 100644 index 0000000..7c9851e --- /dev/null +++ b/openjdk8-zulu-compact3/usr.manifest @@ -0,0 +1,20 @@ +# +# Copyright (C) 2016 Waldemar Kozaczuk +# +# This work is open source software, licensed under the terms of the +# BSD license as described in the LICENSE file in the top-level directory. +# + +[manifest] +/usr/lib/libz.so.1: %(miscbase)s/usr/lib64/libz.so.1 +/usr/lib/&/libexpat.so.1: %(miscbase)s/usr/lib64/& +/usr/lib/&/libjpeg.so.62: %(miscbase)s/usr/lib64/& +/usr/lib/jni/balloon.so: java/jni/balloon.so +/usr/lib/jni/monitor.so: java/jni/monitor.so +/usr/lib/&/jni/elf-loader.so: java/& +/usr/lib/&/jni/networking.so: java/& +/usr/lib/&/jni/stty.so: java/& +/usr/lib/&/jni/tracepoint.so: java/& +/usr/lib/&/jni/power.so: java/& +/java.so: java/jvm/java_non_isolated.so +/java/cloudius.jar: ${OSV_BASE}/java/cloudius/target/cloudius.jar -- 2.7.4 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.