Skip to content

Commit

Permalink
Fixes to allow use of RHEL downloads for s390x devkit, and support Ma…
Browse files Browse the repository at this point in the history
…rist podman UIDs
  • Loading branch information
sxa committed Apr 3, 2024
1 parent 7725dff commit 43db106
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
11 changes: 9 additions & 2 deletions pipelines/build/devkit/build_devkit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,15 @@ node(params.DEVKIT_BUILD_NODE) {

if (params.DOCKER_IMAGE != "") {
// Build within docker container
docker.image(params.DOCKER_IMAGE).pull()
docker.image(params.DOCKER_IMAGE).inside() {
if (!("${params.DOCKER_IMAGE}".contains('rhel'))) {
docker.image(params.DOCKER_IMAGE).pull()
}
String dockerRunArg=""
// Add extra mapping for Marist s390x machiens if running podman
if ( ! sh(script: "docker --version | grep podman", returnStatus:true) ) {
dockerRunArg += " --userns keep-id:uid=1002,gid=1003"
}
docker.image(params.DOCKER_IMAGE).inside(dockerRunArg) {
build()
}
} else {
Expand Down
23 changes: 20 additions & 3 deletions pipelines/build/devkit/make_devkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
################################################################################

set -e
set -ex

if [ $# -lt 4 ]; then
echo "Usage: $0 VERSION ARCH BASE_OS BASE_OS_VERSION"
Expand Down Expand Up @@ -43,9 +43,26 @@ patch -p1 < ../Tools.gmk.patch

devkit_target="${ARCH}-linux-gnu"

# Perform devkit build
cd make/devkit && make TARGETS=${devkit_target} BASE_OS=${BASE_OS} BASE_OS_VERSION=${BASE_OS_VERSION}
if [ "${BASE_OS}" = "rhel" ]; then
mkdir -p ../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}
# Downloding RPMS from RHEL (Requires machine to be attached to RHEL subscription)
# yum reinstall --downloadonly --downloaddir=../../build/devkit/download/rpms/s390x-linux-gnu-${BASE_OS}${BASE_OS_VERSION} glibc glibc-headers glibc-devel cups-libs cups-devel libX11 libX11-devel xorg-x11-proto-devel alsa-lib alsa-lib-devel libXext libXext-devel libXtst libXtst-devel libXrender libXrender-devel libXrandr libXrandr-devel freetype freetype-devel libXt libXt-devel libSM libSM-devel libICE libICE-devel libXi libXi-devel libXdmcp libXdmcp-devel libXau libXau-devel libgcc libxcrypt zlib zlib-devel libffi libffi-devel fontconfig fontconfig-devel kernel-headers
RPMDIR=/var/cache/yum/s390x/7Server/rhel-7-for-system-z-rpms/packages
pwd
for A in glibc glibc-headers glibc-devel cups-libs cups-devel libX11 libX11-devel xorg-x11-proto-devel alsa-lib alsa-lib-devel libXext libXext-devel libXtst libXtst-devel libXrender libXrender-devel libXrandr libXrandr-devel freetype freetype-devel libXt libXt-devel libSM libSM-devel libICE libICE-devel libXi libXi-devel libXdmcp libXdmcp-devel libXau libXau-devel libgcc libxcrypt zlib zlib-devel libffi libffi-devel fontconfig fontconfig-devel kernel-headers; do
if [ ! -z "$(ls $RPMDIR/${A}-[0-9]*${ARCH}*.rpm)" ]; then
cp -pv ${RPMDIR}/${A}-[0-9]*${ARCH}*.rpm "../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}"
elif [ ! -z "$(ls $RPMDIR/${A}-[0-9]*noarch.rpm)" ]; then
cp -pv ${RPMDIR}/${A}-[0-9]*noarch.rpm "../../../build/devkit/jdk21u/build/devkit/download/rpms/s390x-linux-gnu-Centos${BASE_OS_VERSION}"
fi
done
# Temporary fudge to use Centos logic until we adjust Tools.gmk
BASE_OS=Centos
fi

# Perform devkit build
cd make/devkit && pwd && make TARGETS=${devkit_target} BASE_OS=${BASE_OS} BASE_OS_VERSION=${BASE_OS_VERSION}
find ../../build/devkit -type f -print
# Back to original folder
cd ../../..

Expand Down

0 comments on commit 43db106

Please sign in to comment.