Skip to content

Commit 20a5342

Browse files
committed
[OPENJDK-3655] change script permissions to permit o+x
We currently move scripts into place by executing a configure.sh script, and changing ownership and permissions etc. However, in the majority of cases we could instead declare where scripts should be installed using artifacts:. The advantages are: smaller sources; more declarative; more uniform ownership (default root:root); no need to chown (set the permissions on the script in git directly). Also addresses OPENJDK-2814 (running user shouldn't own /opt/jboss/container) Signed-off-by: Jonathan Dowland <[email protected]>
1 parent 18ee5a6 commit 20a5342

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+52
-193
lines changed

modules/jdk/17/configure.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22
# Configure module
33
set -e
44

5-
SCRIPT_DIR=$(dirname $0)
6-
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
7-
8-
chown -R $USER:root $SCRIPT_DIR
9-
chmod -R ug+rwX $SCRIPT_DIR
10-
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*
11-
12-
pushd ${ARTIFACTS_DIR}
13-
cp -pr * /
14-
popd
15-
165
# Set this JDK as the alternative in use
176
_arch="$(uname -i)"
187
alternatives --set java java-17-openjdk.${_arch}

modules/jdk/17/module.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ modules:
3333

3434
execute:
3535
- script: configure.sh
36+
37+
artifacts:
38+
- path: artifacts/jvm-options
39+
dest: /opt/jboss/container/openjdk/jdk

modules/jdk/21/configure.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22
# Configure module
33
set -e
44

5-
SCRIPT_DIR=$(dirname $0)
6-
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
7-
8-
chown -R $USER:root $SCRIPT_DIR
9-
chmod -R ug+rwX $SCRIPT_DIR
10-
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*
11-
12-
pushd ${ARTIFACTS_DIR}
13-
cp -pr * /
14-
popd
15-
165
# Set this JDK as the alternative in use
176
_arch="$(uname -i)"
187
alternatives --set java java-21-openjdk.${_arch}

modules/jdk/21/module.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ modules:
3333

3434
execute:
3535
- script: configure.sh
36+
37+
artifacts:
38+
- path: artifacts/jvm-options
39+
dest: /opt/jboss/container/openjdk/jdk

modules/jre/17/configure.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
#!/bin/sh
2-
# Configure module
32
set -e
43

5-
SCRIPT_DIR=$(dirname $0)
6-
echo $SCRIPT_DIR
7-
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
8-
echo $ARTIFACTS_DIR
9-
10-
chown -R $USER:root $SCRIPT_DIR
11-
chmod -R ug+rwX $SCRIPT_DIR
12-
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jre/*
13-
14-
pushd ${ARTIFACTS_DIR}
15-
cp -pr * /
16-
popd
17-
184
# Set this JDK as the alternative in use
195
_arch="$(uname -i)"
206
alternatives --set java java-17-openjdk.${_arch}

modules/jre/17/module.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ modules:
3333

3434
execute:
3535
- script: configure.sh
36+
37+
artifacts:
38+
- path: artifacts/jvm-options
39+
dest: /opt/jboss/container/openjdk/jre

0 commit comments

Comments
 (0)