misc: Specific mkosi fixes for centos-7

Seems we need golang from epel, to mask out the old git version, and to
workaround mkosi bugs.
This commit is contained in:
James Shubin
2019-10-04 23:58:17 -04:00
parent d64f9f5401
commit d57f7aa03f
3 changed files with 23 additions and 7 deletions

View File

@@ -76,7 +76,7 @@ fi
if [ $travis -eq 0 ]; then
if [ ! -z "$YUM" ]; then
if [ -z "$GO" ]; then
$sudo_command $YUM install -y golang golang-googlecode-tools-stringer
$sudo_command $YUM install -y golang golang-googlecode-tools-stringer || $sudo_command $YUM install -y golang-bin # centos-7 epel
fi
# some go dependencies are stored in mercurial
$sudo_command $YUM install -y hg

View File

@@ -15,6 +15,20 @@ if [ ! -d "$dir" ]; then
echo "changelog dir ($dir) does not exist"
exit 1
fi
if [ "$DISTRO" = "centos-7" ]; then
# FIXME: This will fail *inside* a build running on CentOS-7, until we
# improve the below script to work when we have an old version of git!
# Build a "fake" (temporary) changelog so that fpm doesn't fail.
echo "" > "$CHANGELOG"
echo "* $(date '+%a %b %d %Y') James Shubin <james@shubin.ca> ${VERSION}" >> "$CHANGELOG"
echo "" >> "$CHANGELOG"
echo " - James Shubin (1):" >> "$CHANGELOG"
echo " Latest release of mgmt" >> "$CHANGELOG"
echo "" >> "$CHANGELOG"
exit 0 # `git tag` isn't new enough on centos-7, skip this here
fi
# input to format flag for git tag
TAG_FORMAT="* %(creatordate:format:%a %b %d %Y) %(creator) %(refname:lstrip=2)"
# a list of tags to be parsed in the loop

View File

@@ -1,11 +1,13 @@
[Distribution]
Distribution=centos
Distribution=centos_epel
Release=7
[Output]
Format=raw_btrfs
#Format=gpt_btrfs
Bootable=yes
# Bootable must be no or else systemd-udev package will be installed (some bug)
# TODO: https://github.com/systemd/mkosi/issues/356
Bootable=no
# This can be a ramdisk to improve performance.
OutputDirectory=mkosi.output
@@ -20,17 +22,17 @@ WithNetwork=true
# The packages to appear in both the build and the final image.
Packages=
dnf
yum
rpm-build
make
git
golang
tree
# The packages to appear in the build image, but absent from the final image.
#BuildPackages=
# dnf
# yum
# rpm-build
# make
# git
# golang
# tree
# Store our build artifacts here. This makes them accessible to the outside.