forked from openshift/os
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
/etc/motd
generation to packages-openshift.yaml
The MOTD message is strongly associated with OpenShift, so let's make it part of `packages-openshift.yaml`. Now, to do this in practice is actually quite cumbersome. To keep the MOTD wording similar to what we have and spell out the variant name, we need to have the postprocessing that edits `/etc/os-release` happen first. And to do that... we're forced to factor out the script that does that to a separate manifest so that we can include it *after* `packages-openshift.yaml`. This is all pretty messy, but is also temporary; once we execute the OCP split, we will remove those extra manifests. (See next commit which does this for the c9s variant.)
- Loading branch information
Showing
5 changed files
with
172 additions
and
155 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This manifest modifies `/etc/os-release` to contain RHCOS information. It | ||
# should no longer be necessary in the future when the base RHCOS image is pure | ||
# RHEL. For now, we split it out so that it can be executed before the bits in | ||
# `packages-openshift.yaml` which rely on some of the fields set here to update | ||
# `/etc/motd`. | ||
|
||
postprocess: | ||
- | | ||
#!/usr/bin/env bash | ||
set -xeo pipefail | ||
# Tweak /usr/lib/os-release | ||
grep -v "OSTREE_VERSION" /etc/os-release > /usr/lib/os-release.rhel | ||
OCP_RELEASE=4.16 | ||
( | ||
. /etc/os-release | ||
cat > /usr/lib/os-release <<EOF | ||
NAME="${NAME} CoreOS" | ||
ID="rhcos" | ||
ID_LIKE="rhel fedora" | ||
VERSION="${OSTREE_VERSION}" | ||
VERSION_ID="${OCP_RELEASE}" | ||
VARIANT="CoreOS" | ||
VARIANT_ID=coreos | ||
PLATFORM_ID="${PLATFORM_ID}" | ||
PRETTY_NAME="${NAME} CoreOS ${OSTREE_VERSION}" | ||
ANSI_COLOR="${ANSI_COLOR}" | ||
CPE_NAME="${CPE_NAME}::coreos" | ||
HOME_URL="${HOME_URL}" | ||
DOCUMENTATION_URL="https://docs.okd.io/latest/welcome/index.html" | ||
BUG_REPORT_URL="https://access.redhat.com/labs/rhir/" | ||
REDHAT_BUGZILLA_PRODUCT="OpenShift Container Platform" | ||
REDHAT_BUGZILLA_PRODUCT_VERSION="${OCP_RELEASE}" | ||
REDHAT_SUPPORT_PRODUCT="OpenShift Container Platform" | ||
REDHAT_SUPPORT_PRODUCT_VERSION="${OCP_RELEASE}" | ||
RHEL_VERSION=9.4 | ||
OSTREE_VERSION="${OSTREE_VERSION}" | ||
EOF | ||
) | ||
rm -f /etc/os-release | ||
ln -s ../usr/lib/os-release /etc/os-release | ||
# Tweak /etc/system-release, /etc/system-release-cpe & /etc/redhat-release | ||
( | ||
. /etc/os-release | ||
cat > /usr/lib/system-release-cpe <<EOF | ||
${CPE_NAME} | ||
EOF | ||
cat > /usr/lib/system-release <<EOF | ||
${NAME} release ${VERSION_ID} | ||
EOF | ||
rm -f /etc/system-release-cpe /etc/system-release /etc/redhat-release | ||
ln -s /usr/lib/system-release-cpe /etc/system-release-cpe | ||
ln -s /usr/lib/system-release /etc/system-release | ||
ln -s /usr/lib/system-release /etc/redhat-release | ||
) | ||
# Tweak /usr/lib/issue | ||
cat > /usr/lib/issue <<EOF | ||
\S \S{VERSION_ID} | ||
EOF | ||
rm -f /etc/issue /etc/issue.net | ||
ln -s /usr/lib/issue /etc/issue | ||
ln -s /usr/lib/issue /etc/issue.net |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# This manifest modifies `/etc/os-release` to contain SCOS information. It | ||
# should no longer be necessary in the future when the base SCOS image is pure | ||
# CentOS. For now, we split it out so that it can be executed before the bits in | ||
# `packages-openshift.yaml` which rely on some of the fields set here to update | ||
# `/etc/motd`. | ||
|
||
postprocess: | ||
- | | ||
#!/usr/bin/env bash | ||
set -xeo pipefail | ||
# Tweak /usr/lib/os-release | ||
grep -v "OSTREE_VERSION" /etc/os-release > /usr/lib/os-release.stream | ||
OCP_RELEASE="4.16" | ||
( | ||
. /etc/os-release | ||
cat > /usr/lib/os-release <<EOF | ||
NAME="${NAME} CoreOS" | ||
ID="scos" | ||
ID_LIKE="rhel fedora" | ||
VERSION="${OSTREE_VERSION}" | ||
VERSION_ID="${OCP_RELEASE}" | ||
VARIANT="CoreOS" | ||
VARIANT_ID=coreos | ||
PLATFORM_ID="${PLATFORM_ID}" | ||
PRETTY_NAME="${NAME} CoreOS ${OSTREE_VERSION}" | ||
ANSI_COLOR="${ANSI_COLOR}" | ||
CPE_NAME="${CPE_NAME}::coreos" | ||
HOME_URL="${HOME_URL}" | ||
DOCUMENTATION_URL="https://docs.okd.io/latest/welcome/index.html" | ||
BUG_REPORT_URL="https://access.redhat.com/labs/rhir/" | ||
REDHAT_BUGZILLA_PRODUCT="OpenShift Container Platform" | ||
REDHAT_BUGZILLA_PRODUCT_VERSION="${OCP_RELEASE}" | ||
REDHAT_SUPPORT_PRODUCT="OpenShift Container Platform" | ||
REDHAT_SUPPORT_PRODUCT_VERSION="${OCP_RELEASE}" | ||
OSTREE_VERSION="${OSTREE_VERSION}" | ||
EOF | ||
) | ||
rm -f /etc/os-release | ||
ln -s ../usr/lib/os-release /etc/os-release | ||
# Tweak /etc/system-release, /etc/system-release-cpe & /etc/redhat-release | ||
( | ||
. /etc/os-release | ||
cat > /usr/lib/system-release-cpe <<EOF | ||
${CPE_NAME} | ||
EOF | ||
cat > /usr/lib/system-release <<EOF | ||
${NAME} release ${VERSION_ID} | ||
EOF | ||
rm -f /etc/system-release-cpe /etc/system-release /etc/redhat-release | ||
ln -s /usr/lib/system-release-cpe /etc/system-release-cpe | ||
ln -s /usr/lib/system-release /etc/system-release | ||
ln -s /usr/lib/system-release /etc/redhat-release | ||
) | ||
# Tweak /usr/lib/issue | ||
cat > /usr/lib/issue <<EOF | ||
\S \S{VERSION_ID} | ||
EOF | ||
rm -f /etc/issue /etc/issue.net | ||
ln -s /usr/lib/issue /etc/issue | ||
ln -s /usr/lib/issue /etc/issue.net |