Skip to content

Commit f7ef7d3

Browse files
committed
build.sh: move permissions changes to end
What I found is that doing this before kola (and friends) are built and installed means the `make install` from those set the /usr/bin permissions back. Let's just do this as a final step. Fixup for 17b3f52, d34ab4a
1 parent a20a5f4 commit f7ef7d3

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ RUN ./build.sh write_archive_info
2121
RUN ./build.sh make_and_makeinstall
2222
RUN ./build.sh configure_user
2323
RUN ./build.sh patch_osbuild
24+
RUN ./build.sh fixup_file_permissions
2425

2526
# clean up scripts (it will get cached in layers, but oh well)
2627
WORKDIR /srv/

build.sh

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ if [ $# -gt 1 ]; then
2323
echo " install_rpms"
2424
echo " make_and_makeinstall"
2525
echo " patch_osbuild"
26+
echo " fixup_file_permissions"
2627
exit 1
2728
fi
2829

@@ -112,16 +113,6 @@ install_rpms() {
112113
ln -s {/usr/share/distribution-gpg-keys/centos,/etc/pki/rpm-gpg}/RPM-GPG-KEY-CentOS-SIG-Virtualization
113114
fi
114115

115-
# Allow group write permissions on /usr/ because in upstream project's
116-
# CI we want to overwrite software for testing. The directories
117-
# are typically owned by root:root and CI runs in openshift as a user
118-
# that is a member of the `root` (GID: 0) group.
119-
# See https://github.com/coreos/coreos-installer/pull/1716
120-
chmod -R g+w /usr/
121-
# And also one exception for /etc/grub.d (on arches that support
122-
# grub) since ostree upstream tries to put a symlink in this directory.
123-
[ -d /etc/grub.d ] && chmod g+rwx /etc/grub.d
124-
125116
# Further cleanup
126117
yum clean all
127118
}
@@ -225,6 +216,19 @@ patch_osbuild() {
225216
##mkdir -p /usr/lib/osbuild/osbuild
226217
}
227218

219+
fixup_file_permissions() {
220+
# Allow group write permissions on /usr/ because in upstream project's
221+
# CI we want to overwrite software for testing. The directories
222+
# are typically owned by root:root and CI runs in openshift as a user
223+
# that is a member of the `root` (GID: 0) group.
224+
# See https://github.com/coreos/coreos-installer/pull/1716
225+
chmod -R g+w /usr/
226+
# And also one exception for /etc/grub.d (on arches that support
227+
# grub) since ostree upstream tries to put a symlink in this directory.
228+
[ -d /etc/grub.d ] && chmod g+rwx /etc/grub.d
229+
230+
}
231+
228232
if [ $# -ne 0 ]; then
229233
# Run the function specified by the calling script
230234
${1}
@@ -240,4 +244,5 @@ else
240244
trust_redhat_gpg_keys
241245
configure_user
242246
patch_osbuild
247+
fixup_file_permissions
243248
fi

0 commit comments

Comments
 (0)