Forked from simonswine/install-openjdk8-musl.sh
Last active
October 10, 2024 22:01
-
-
Save stokito/7dd425da5a12abce8b39dda1bd1106d7 to your computer and use it in GitHub Desktop.
Install Java openjdk8 compiled for musl from Alpine onto OpenWRT (armv7). Tested on Turris Omnia (TurrisOS 6.4.1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# aarch64, armhf, armv7, ppc64le, s390x, x86, x86_64 | |
ARCH="armv7" # Turris Omnia | |
REVISION="8.275.01-r0" | |
DESTDIR="" # empty for root, you can set to /opt | |
# Alpine v3.13 switched to musl v1.2.0 while TurrisOS 6.4.1 uses older musl v1.1.24 | |
# Use ldd command to see a musl version. | |
# If it's newer then change the URL to https://dl-cdn.alpinelinux.org/alpine/edge/ | |
# You will also need to change the REVISION for the latest | |
URL="https://dl-cdn.alpinelinux.org/alpine/v3.12/community/$ARCH" | |
PACKAGES="openjdk8 openjdk8-jre openjdk8-jre-lib openjdk8-jre-base" | |
for package in $PACKAGES; do | |
# download and extract on the fly | |
# apk files are just tar.gz with additional .PKGINFO and .SIGN.RSA files | |
wget -q -O - "${URL}/${package}-${REVISION}.apk" | tar -xz -C "$DESTDIR" --exclude=.PKGINFO --exclude=.SIGN* | |
done | |
export PATH="$PATH:$DESTDIR/usr/lib/jvm/java-8-openjdk/bin" | |
echo "export PATH=\"$PATH:$DESTDIR/usr/lib/jvm/java-8-openjdk/bin\"" >> /etc/profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You may also need to install packages:
The liblcms is absent in OpenWrt repo and needs to be installed similarly from Alpine.
The Alpine openjdk also depends on java-cacerts package which is an updater of java certs from ca-bundle. We may need something similar or port it into OpenWrt. Currently the TLS CA certs in the default keystore are outdated and basically you can't make a HTTPS call to any external service. I didn't checked if you can serve TLS but it shouldn't be a problem as far I understood.
There may be other libraries needed https://git.alpinelinux.org/aports/tree/community/openjdk8/APKBUILD?h=3.12-stable#n17
Links: