Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions Dockerfile.rhel

This file was deleted.

49 changes: 12 additions & 37 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
set -euo pipefail

# Detect what platform we are on
if grep -q '^Fedora' /etc/redhat-release; then
ISFEDORA=1
ISEL=''
elif grep -q '^Red Hat' /etc/redhat-release; then
ISFEDORA=''
ISEL=1
else
echo 1>&2 "should be on either RHEL or Fedora"
if ! grep -q '^Fedora' /etc/redhat-release; then
echo 1>&2 "should be on either Fedora"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/either Fedora/Fedora

exit 1
fi

Expand All @@ -31,13 +25,11 @@ srcdir=$(pwd)
release="30"

configure_yum_repos() {
if [ -n "${ISFEDORA}" ]; then
# Add continuous tag for latest build tools and mark as required so we
# can depend on those latest tools being available in all container
# builds.
echo -e "[f$release-coreos-continuous]\nenabled=1\nmetadata_expire=1m\nbaseurl=https://kojipkgs.fedoraproject.org/repos-dist/f$release-coreos-continuous/latest/\$basearch/\ngpgcheck=0\nskip_if_unavailable=False\n" > /etc/yum.repos.d/coreos.repo
# Add continuous tag for latest build tools and mark as required so we
# can depend on those latest tools being available in all container
# builds.
echo -e "[f$release-coreos-continuous]\nenabled=1\nmetadata_expire=1m\nbaseurl=https://kojipkgs.fedoraproject.org/repos-dist/f$release-coreos-continuous/latest/\$basearch/\ngpgcheck=0\nskip_if_unavailable=False\n" > /etc/yum.repos.d/coreos.repo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could replace this with a heredoc to make the \n's a little easier to understand, but that can wait for a different PR if you want.


fi
}

install_rpms() {
Expand All @@ -49,29 +41,22 @@ install_rpms() {
# xargs is part of findutils, which may not be installed
yum -y install /usr/bin/xargs

# define the filter we want to use to filter out deps that don't
# apply to the platform we are on
[ -n "${ISFEDORA}" ] && filter='^#FEDORA '
[ -n "${ISEL}" ] && filter='^#EL7 '

# These are only used to build things in here. Today
# we ship these in the container too to make it easier
# to use the container as a development environment for itself.
# Down the line we may strip these out, or have a separate
# development version.
builddeps=$(sed "s/${filter}//" "${srcdir}"/build-deps.txt | grep -v '^#')
builddeps=$(grep -v '^#' "${srcdir}"/build-deps.txt)

# Process our base dependencies + build dependencies and install
deps=$(sed "s/${filter}//" "${srcdir}"/deps.txt | grep -v '^#')
archdeps=$(sed "s/${filter}//" "${srcdir}/deps-$(arch)".txt | grep -v '^#')
deps=$(grep -v '^#' "${srcdir}"/deps.txt)
archdeps=$(grep -v '^#' "${srcdir}/deps-$(arch)".txt)
echo "${builddeps}" "${deps}" "${archdeps}" | xargs yum -y install

# Commented out for now, see above
#dnf remove -y $builddeps}
#dnf remove -y ${builddeps}
# can't remove grubby on el7 because libguestfs-tools depends on it
if [ -n "${ISFEDORA}" ]; then
rpm -q grubby && yum remove -y grubby
fi
rpm -q grubby && yum remove -y grubby

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stale comment


# Allow Kerberos Auth to work from a keytab. The keyring is not
# available in a Container.
Expand Down Expand Up @@ -100,12 +85,6 @@ _prep_make_and_make_install() {
echo -e "\033[1merror: submodules not initialized. Run: git submodule update --init\033[0m" 1>&2
exit 1
fi

# Can only (easily) get gobject-introspection in Python2 on EL7
if [ -n "${ISEL}" ]; then
sed -i 's|^#!/usr/bin/python3|#!/usr/bin/python2|' src/commitmeta_to_json
sed -i 's|^#!/usr/bin/env python3|#!/usr/bin/python2|' src/cmd-oscontainer
fi
}

# For now keep using the f29 anaconda. There's no golden f30 image yet and it
Expand Down Expand Up @@ -165,11 +144,7 @@ install_anaconda() {
make_and_makeinstall() {
_prep_make_and_make_install
# And the main scripts
if [ -n "${ISEL}" ]; then
echo "make && make check && make install" | scl enable rh-python36 bash
else
make && make check && make install
fi
make && make check && make install
}

configure_user(){
Expand Down
2 changes: 1 addition & 1 deletion src/deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dnf-utils
genisoimage

# We expect people to use these explicitly in their repo configurations.
#FEDORA distribution-gpg-keys
distribution-gpg-keys
# We need these for rojig
selinux-policy-targeted rpm-build

Expand Down
2 changes: 1 addition & 1 deletion src/vmdeps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ dhcp-client bind-export-libs iproute
selinux-policy selinux-policy-targeted policycoreutils

# coreos-assembler
#FEDORA python3 python3-gobject-base buildah podman skopeo iptables iptables-libs
python3 python3-gobject-base buildah podman skopeo iptables iptables-libs

gdisk xfsprogs e2fsprogs grub2 dosfstools shim-x64 grub2-efi-x64