Adding changes to support ppc64le amphora builds with CentOS
Updated diskimage create script to include an argument for disabling the temporary filesystem. Updated diskimage create to support ppc64le as an argument. Updated backports to support a properly configured PaaS repository for CentOS on power. Change-Id: I8897278b1ac8b76d564f45bd0c7cbc26b29a8e5d
This commit is contained in:
parent
66656bceb6
commit
4c9097c681
@ -91,11 +91,12 @@ Command syntax:
|
|||||||
.. line-block::
|
.. line-block::
|
||||||
|
|
||||||
$ diskimage-create.sh
|
$ diskimage-create.sh
|
||||||
[-a i386 | **amd64** | armhf ]
|
[-a i386 | **amd64** | armhf | ppc64le ]
|
||||||
[-b **haproxy** ]
|
[-b **haproxy** ]
|
||||||
[-c **~/.cache/image-create** | <cache directory> ]
|
[-c **~/.cache/image-create** | <cache directory> ]
|
||||||
[-d **xenial**/**7** | trusty | <other release id> ]
|
[-d **xenial**/**7** | trusty | <other release id> ]
|
||||||
[-e]
|
[-e]
|
||||||
|
[-f]
|
||||||
[-h]
|
[-h]
|
||||||
[-i **ubuntu** | fedora | centos | rhel ]
|
[-i **ubuntu** | fedora | centos | rhel ]
|
||||||
[-l <log file> ]
|
[-l <log file> ]
|
||||||
@ -114,6 +115,7 @@ Command syntax:
|
|||||||
'-c' is the path to the cache directory (default: ~/.cache/image-create)
|
'-c' is the path to the cache directory (default: ~/.cache/image-create)
|
||||||
'-d' distribution release id (default on ubuntu: xenial)
|
'-d' distribution release id (default on ubuntu: xenial)
|
||||||
'-e' enable complete mandatory access control systems when available (default: permissive)
|
'-e' enable complete mandatory access control systems when available (default: permissive)
|
||||||
|
'-f' disable tmpfs for build
|
||||||
'-h' display help message
|
'-h' display help message
|
||||||
'-i' is the base OS (default: ubuntu)
|
'-i' is the base OS (default: ubuntu)
|
||||||
'-l' is output logfile (default: none)
|
'-l' is output logfile (default: none)
|
||||||
|
@ -20,11 +20,12 @@ set -e
|
|||||||
usage() {
|
usage() {
|
||||||
echo
|
echo
|
||||||
echo "Usage: $(basename $0)"
|
echo "Usage: $(basename $0)"
|
||||||
echo " [-a i386 | **amd64** | armhf ]"
|
echo " [-a i386 | **amd64** | armhf | ppc64le]"
|
||||||
echo " [-b **haproxy** ]"
|
echo " [-b **haproxy** ]"
|
||||||
echo " [-c **~/.cache/image-create** | <cache directory> ]"
|
echo " [-c **~/.cache/image-create** | <cache directory> ]"
|
||||||
echo " [-d **xenial**/**7** | trusty | <other release id> ]"
|
echo " [-d **xenial**/**7** | trusty | <other release id> ]"
|
||||||
echo " [-e]"
|
echo " [-e]"
|
||||||
|
echo " [-f]"
|
||||||
echo " [-h]"
|
echo " [-h]"
|
||||||
echo " [-i **ubuntu-minimal** | fedora | centos | rhel ]"
|
echo " [-i **ubuntu-minimal** | fedora | centos | rhel ]"
|
||||||
echo " [-l <log file> ]"
|
echo " [-l <log file> ]"
|
||||||
@ -43,6 +44,7 @@ usage() {
|
|||||||
echo " '-c' is the path to the cache directory (default: ~/.cache/image-create)"
|
echo " '-c' is the path to the cache directory (default: ~/.cache/image-create)"
|
||||||
echo " '-d' distribution release id (default on ubuntu: xenial)"
|
echo " '-d' distribution release id (default on ubuntu: xenial)"
|
||||||
echo " '-e' enable complete mandatory access control systems when available (default: permissive)"
|
echo " '-e' enable complete mandatory access control systems when available (default: permissive)"
|
||||||
|
echo " '-f' disable tmpfs for build"
|
||||||
echo " '-h' display this help message"
|
echo " '-h' display this help message"
|
||||||
echo " '-i' is the base OS (default: ubuntu)"
|
echo " '-i' is the base OS (default: ubuntu)"
|
||||||
echo " '-l' is output logfile (default: none)"
|
echo " '-l' is output logfile (default: none)"
|
||||||
@ -85,12 +87,13 @@ dib_enable_tracing=
|
|||||||
|
|
||||||
AMP_LOGFILE=""
|
AMP_LOGFILE=""
|
||||||
|
|
||||||
while getopts "a:b:c:d:ehi:l:no:pt:r:s:vw:x" opt; do
|
while getopts "a:b:c:d:efhi:l:no:pt:r:s:vw:x" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
a)
|
a)
|
||||||
AMP_ARCH=$OPTARG
|
AMP_ARCH=$OPTARG
|
||||||
if [ $AMP_ARCH != "i386" ] && \
|
if [ $AMP_ARCH != "i386" ] && \
|
||||||
[ $AMP_ARCH != "amd64" ] && \
|
[ $AMP_ARCH != "amd64" ] && \
|
||||||
|
[ $AMP_ARCH != "ppc64le" ] && \
|
||||||
[ $AMP_ARCH != "armhf" ]; then
|
[ $AMP_ARCH != "armhf" ]; then
|
||||||
echo "Error: Unsupported architecture " $AMP_ARCH " specified"
|
echo "Error: Unsupported architecture " $AMP_ARCH " specified"
|
||||||
exit 3
|
exit 3
|
||||||
@ -113,6 +116,9 @@ while getopts "a:b:c:d:ehi:l:no:pt:r:s:vw:x" opt; do
|
|||||||
e)
|
e)
|
||||||
AMP_ENABLE_FULL_MAC_SECURITY=1
|
AMP_ENABLE_FULL_MAC_SECURITY=1
|
||||||
;;
|
;;
|
||||||
|
f)
|
||||||
|
AMP_DISABLE_TMP_FS='--no-tmpfs'
|
||||||
|
;;
|
||||||
h)
|
h)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
@ -138,7 +144,7 @@ while getopts "a:b:c:d:ehi:l:no:pt:r:s:vw:x" opt; do
|
|||||||
;;
|
;;
|
||||||
o)
|
o)
|
||||||
AMP_OUTPUTFILENAME=$(readlink -f $OPTARG)
|
AMP_OUTPUTFILENAME=$(readlink -f $OPTARG)
|
||||||
amp_dir=$(dirname $AMP_OUTPUTFILENAME)
|
amp_dir=$(dirname $AMP_OUTPUTFILENAME)
|
||||||
if [ ! -d $amp_dir ]; then
|
if [ ! -d $amp_dir ]; then
|
||||||
echo "Error: Directory $amp_dir does not exist"
|
echo "Error: Directory $amp_dir does not exist"
|
||||||
exit 3
|
exit 3
|
||||||
@ -215,6 +221,8 @@ AMP_PACKAGE_INSTALL=${AMP_PACKAGE_INSTALL:-0}
|
|||||||
|
|
||||||
AMP_ENABLE_FULL_MAC_SECURITY=${AMP_ENABLE_FULL_MAC_SECURITY:-0}
|
AMP_ENABLE_FULL_MAC_SECURITY=${AMP_ENABLE_FULL_MAC_SECURITY:-0}
|
||||||
|
|
||||||
|
AMP_DISABLE_TMP_FS=${AMP_DISABLE_TMP_FS:-""}
|
||||||
|
|
||||||
if [ "$AMP_BASEOS" = "rhel" -o "$AMP_BASEOS" = "centos" -o "$AMP_BASEOS" = "fedora" ] && [ "$AMP_IMAGESIZE" -lt 3 ]; then
|
if [ "$AMP_BASEOS" = "rhel" -o "$AMP_BASEOS" = "centos" -o "$AMP_BASEOS" = "fedora" ] && [ "$AMP_IMAGESIZE" -lt 3 ]; then
|
||||||
echo "RHEL/centos based amphora requires an image size of at least 3GB"
|
echo "RHEL/centos based amphora requires an image size of at least 3GB"
|
||||||
exit 1
|
exit 1
|
||||||
@ -288,7 +296,7 @@ if [ "$platform" = 'NAME="Ubuntu"' ]; then
|
|||||||
for pkg in $PKG_LIST; do
|
for pkg in $PKG_LIST; do
|
||||||
if ! dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
|
if ! dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
|
||||||
echo "Required package " $pkg " is not installed. Exiting."
|
echo "Required package " $pkg " is not installed. Exiting."
|
||||||
echo "Binary dependencies on this platform are: ${PKG_LIST}"
|
echo "Binary dependencies on this platform are: ${PKG_LIST}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -308,7 +316,7 @@ elif [[ $platform =~ "SUSE" ]]; then
|
|||||||
for pkg in $PKG_LIST; do
|
for pkg in $PKG_LIST; do
|
||||||
if ! rpm -q $pkg &> /dev/null; then
|
if ! rpm -q $pkg &> /dev/null; then
|
||||||
echo "Required package " ${pkg/\*} " is not installed. Exiting."
|
echo "Required package " ${pkg/\*} " is not installed. Exiting."
|
||||||
echo "Binary dependencies on this platform are: ${PKG_LIST}"
|
echo "Binary dependencies on this platform are: ${PKG_LIST}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -320,7 +328,7 @@ else
|
|||||||
for pkg in $PKG_LIST; do
|
for pkg in $PKG_LIST; do
|
||||||
if ! rpm -qa $pkg ; then
|
if ! rpm -qa $pkg ; then
|
||||||
echo "Required package " ${pkg/\*} " is not installed. Exiting."
|
echo "Required package " ${pkg/\*} " is not installed. Exiting."
|
||||||
echo "Binary dependencies on this platform are: ${PKG_LIST}"
|
echo "Binary dependencies on this platform are: ${PKG_LIST}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -405,7 +413,7 @@ if [ -n "$dib_enable_tracing" ]; then
|
|||||||
dib_trace_arg="-x"
|
dib_trace_arg="-x"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
disk-image-create $AMP_LOGFILE $dib_trace_arg -a $AMP_ARCH -o $AMP_OUTPUTFILENAME -t $AMP_IMAGETYPE --image-size $AMP_IMAGESIZE --image-cache $AMP_CACHEDIR $AMP_element_sequence
|
disk-image-create $AMP_LOGFILE $dib_trace_arg -a $AMP_ARCH -o $AMP_OUTPUTFILENAME -t $AMP_IMAGETYPE --image-size $AMP_IMAGESIZE --image-cache $AMP_CACHEDIR $AMP_DISABLE_TMP_FS $AMP_element_sequence
|
||||||
|
|
||||||
popd > /dev/null # out of $TEMP
|
popd > /dev/null # out of $TEMP
|
||||||
rm -rf $TEMP
|
rm -rf $TEMP
|
||||||
|
@ -7,11 +7,30 @@ set -o xtrace
|
|||||||
if [ "$DISTRO_NAME" == "ubuntu" ] && [ "$DIB_RELEASE" == "trusty" ]; then
|
if [ "$DISTRO_NAME" == "ubuntu" ] && [ "$DIB_RELEASE" == "trusty" ]; then
|
||||||
echo deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse > /etc/apt/sources.list.d/backports.list
|
echo deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse > /etc/apt/sources.list.d/backports.list
|
||||||
elif [ "$DISTRO_NAME" == "centos7" ]; then
|
elif [ "$DISTRO_NAME" == "centos7" ]; then
|
||||||
|
case $ARCH in ## Change this to an environment variable from DIB?!
|
||||||
|
x86_64|amd64)
|
||||||
|
BASEURL=http://mirror.centos.org/\$contentdir/\$releasever/paas/\$basearch/openshift-origin/
|
||||||
|
;;
|
||||||
|
ppc64le)
|
||||||
|
# For ppc64le, the CentOS PaaS sig does not currently publish a repo
|
||||||
|
# even though it does build everything for that architecture. Until
|
||||||
|
# there is an official repo, the publish buildroot can be used. One
|
||||||
|
# down-side to doing this is that the build root contains *all* of the
|
||||||
|
# CentOS-base, CentOS-extras, and CentOS-updates content. To ensure
|
||||||
|
# *only* `haproxy18` is retrieved from this repo, the explicit limit
|
||||||
|
# for that package can be used. This should be fine for now since
|
||||||
|
# haproxy18's dependencies are available outside this repo. If things
|
||||||
|
# change, the includepkgs line can be expanded as needed.
|
||||||
|
BASEURL=https://cbs.centos.org/kojifiles/repos/paas7-openshift-multiarch-el7-build/latest/\$basearch/
|
||||||
|
INCLUDEPKGS='includepkgs=haproxy*'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
cat > /etc/yum.repos.d/CentOS-PaaS.repo <<EOF
|
cat > /etc/yum.repos.d/CentOS-PaaS.repo <<EOF
|
||||||
[paas]
|
[paas]
|
||||||
name=CentOS-7 - PaaS
|
name=CentOS-7 - PaaS
|
||||||
baseurl=http://mirror.centos.org/centos/7/paas/\$basearch/openshift-origin/
|
baseurl=$BASEURL
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
enabled=1
|
enabled=1
|
||||||
|
$INCLUDEPKGS
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user