Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "docker" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
18 changes: 18 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- name: Build the Docker image
run: sh run.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
build
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ TARGET_OPENJDK_VERSION="11" # 9, 10, 12, 13, 14 - retired, may not be working
# loom or tip - experimental, may be broken

# clone repository
git clone https://github.com/ev3dev-lang-java/openjdk-ev3.git
cd openjdk-ev3
# git clone https://github.com/ev3dev-lang-java/openjdk-ev3.git
# cd openjdk-ev3

# prepare working directory
mkdir -p "$TARGET_WORKSPACE"
Expand Down
Binary file modified docs/images/build_process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/build_system_layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/host_machine_archs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/packaging_process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/release_process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion packaging/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ RUN apt-get -qq update && \
zip unzip \
gnupg dctrl-tools dput \
liblcms2-2 \
pigz xz-utils
pigz xz-utils \
build-essential \
g++

# prepare a nonroot user
COPY compiler.sudoers /etc/sudoers.d/compiler
Expand Down
50 changes: 50 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh

rm -rf build

# define parameters
TARGET_WORKSPACE="$(pwd)/build" # 10 GB of free space should be sufficient, probably less
TARGET_DEBIAN_VERSION="stretch" # stretch or buster
TARGET_OPENJDK_VERSION="11" # 9, 10, 12, 13, 14 - retired, may not be working
# 11, 15 - most likely working
# loom or tip - experimental, may be broken

# clone repository
# git clone https://github.com/ev3dev-lang-java/openjdk-ev3.git
# cd openjdk-ev3

# prepare working directory
mkdir -p "$TARGET_WORKSPACE"
chmod -R 777 "$TARGET_WORKSPACE" # docker may not share UID with the current user

# build base system container
docker build --build-arg DEBIAN_RELEASE="$TARGET_DEBIAN_VERSION" \
--build-arg ARCH="armel" \
--tag "ev3dev-lang-java:jdk-cross-$TARGET_DEBIAN_VERSION" \
--file ./system/Dockerfile.cross \
./system

# on top of that, create a build scripts container
docker build --build-arg commit="$(git rev-parse HEAD)" \
--build-arg extra="Manual build by $(whoami)" \
--build-arg DEBIAN_RELEASE="$TARGET_DEBIAN_VERSION" \
--build-arg BUILD_TYPE="cross" \
--tag "ev3dev-lang-java:jdk-cross-build" \
./scripts

# now run the build
docker run --rm \
--interactive \
--tty \
--volume "$TARGET_WORKSPACE:/build" \
--env JDKVER="$TARGET_OPENJDK_VERSION" \
--env JDKVM="client" \
--env JDKPLATFORM="ev3" \
--env JDKDEBUG="release" \
--env AUTOBUILD="1" \
ev3dev-lang-java:jdk-cross-build

# finally, make workspace accessible for all users (i.e. current one too) and list files in its root
chmod -R 777 "$TARGET_WORKSPACE"
# and list the output directory (now it should contain three *-ev3.tar.gz files)
ls "$TARGET_WORKSPACE"
4 changes: 2 additions & 2 deletions scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TARBALL_MAX_DOWNLOADS=10
JRI_MODULES="java.se,jdk.jdwp.agent,jdk.unsupported,jdk.management.agent,jdk.jartool,jdk.crypto.ec"

JTREG="$BUILDDIR/jtreg"
JTREG_URL="https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact/jtreg-4.2.0-tip.tar.gz"
JTREG_URL="https://ftp2.osuosl.org/pub/blfs/conglomeration/jdk/jtreg-4.2.0-tip.tar.gz"
JTREG_FILE="$BUILDDIR/jtreg.tar.gz"

###############################################################################
Expand Down Expand Up @@ -183,7 +183,7 @@ elif [ "$JDKVER" == "10" ]; then

# OpenJDK 11
elif [ "$JDKVER" == "11" ]; then
VERSION_POLICY="latest_general_availability"
VERSION_POLICY="jdk-11.0.15+10"
JAVA_SCM="git"
JAVA_REPO="https://github.com/openjdk/jdk11u.git"
PATCHVER="jdk11"
Expand Down
118 changes: 59 additions & 59 deletions system/Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,75 @@ FROM debian:$DEBIAN_RELEASE
ARG DEBIAN_RELEASE
ARG ARCH

# this is a customized version of ev3dev-stretch-cross image
# This is a customized version of ev3dev-stretch-cross image

# setup repositories and install required packages
# Setup repositories and install required packages
COPY sources.list.$DEBIAN_RELEASE /etc/apt/sources.list
COPY ev3dev-archive-keyring.gpg /etc/apt/trusted.gpg.d/

# Install native packages first
RUN dpkg --add-architecture $ARCH && \
apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive apt-get -qq install --yes --no-install-recommends \
bash-completion \
ca-certificates \
cmake \
build-essential \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates wget curl less nano vim bash-completion tree sudo \
man-db cmake build-essential gdb-multiarch pkg-config qemu-user-static \
xz-utils zip pigz unzip cpio file make m4 gawk procps autoconf \
autoconf-archive automake autotools-dev mercurial git systemtap \
systemtap-sdt-dev zlib1g-dev gdb libarchive13 libbabeltrace-ctf1 \
libbabeltrace1 libcurl3 libcurl3-gnutls libdw1 libgnutls30 \
g++

# Install cross-compilation packages with ALL dependencies in one go
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
crossbuild-essential-$ARCH \
gdb-multiarch \
less \
man-db \
nano \
pkg-config \
qemu-user-static \
sudo \
tree \
vim \
wget \
xz-utils \
libcups2-dev:$ARCH \
libfreetype6-dev:$ARCH \
# X11 development libraries
libx11-dev:$ARCH \
libxext-dev:$ARCH \
libxrender-dev:$ARCH \
libxrandr-dev:$ARCH \
libxtst-dev:$ARCH \
libxt-dev:$ARCH \
# CUPS printing system
libcups2-dev:$ARCH \
libcups2:$ARCH \
libcupsimage2-dev:$ARCH \
# Font and graphics
libfreetype6-dev:$ARCH \
libfreetype6:$ARCH \
libfontconfig1-dev:$ARCH \
libasound2-dev:$ARCH \
libx11-dev:$ARCH \
libxext-dev:$ARCH \
libxrender-dev:$ARCH \
libxrandr-dev:$ARCH \
libxtst-dev:$ARCH \
libxt-dev:$ARCH \
libffi-dev:$ARCH \
libpng-dev:$ARCH \
libjpeg-dev:$ARCH \
libgif-dev:$ARCH \
liblcms2-dev:$ARCH \
zlib1g-dev:$ARCH \
systemtap \
systemtap-sdt-dev \
curl \
make \
m4 \
cpio \
gawk \
file \
zip \
pigz \
unzip \
procps \
autoconf \
autoconf-archive \
automake \
autotools-dev \
mercurial \
git \
zlib1g-dev && \
( if [ "$DEBIAN_RELEASE" = "stretch" ]; then \
wget http://ftp.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_3.1-2_$ARCH.deb -O /tmp/systemtap.deb; \
libfontconfig1:$ARCH \
libexpat1-dev:$ARCH \
# Multimedia
libasound2-dev:$ARCH \
# Compression and images
libffi-dev:$ARCH \
libpng-dev:$ARCH \
libpng16-16:$ARCH \
libjpeg-dev:$ARCH \
libgif-dev:$ARCH \
liblcms2-dev:$ARCH \
zlib1g-dev:$ARCH \
zlib1g:$ARCH \
# Essential C development for cross-compilation
libc6-dev:$ARCH \
linux-libc-dev:$ARCH \
build-essential \
g++

# Clean up
RUN rm -rf /var/lib/apt/lists/*

# Download and extract architecture-specific systemtap-sdt-dev
RUN ( if [ "$DEBIAN_RELEASE" = "stretch" ]; then \
wget http://archive.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_3.1-2_$ARCH.deb -O /tmp/systemtap.deb; \
elif [ "$DEBIAN_RELEASE" = "buster" ]; then \
wget http://ftp.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_4.0-1_$ARCH.deb -O /tmp/systemtap.deb; \
wget http://archive.debian.org/debian/pool/main/s/systemtap/systemtap-sdt-dev_4.0-1_$ARCH.deb -O /tmp/systemtap.deb; \
fi ) && \
dpkg-deb -x /tmp/systemtap.deb / && \
rm -rf /tmp/systemtap.deb /var/lib/apt/lists/*
rm -rf /tmp/systemtap.deb

# prepare a nonroot user
# Prepare a nonroot user
COPY compiler.sudoers /etc/sudoers.d/compiler
RUN chmod 0440 /etc/sudoers.d/compiler && \
adduser --disabled-password --gecos \"\" compiler && \
adduser --disabled-password --gecos "" compiler && \
usermod -a -G sudo compiler
Loading