Fix: cobbler: setup.sh: Re-add extra RPM repos.
[armband.git] / patches / fuel-main / 0004-FIXME-cobbler-setup.sh-Keep-extra-RPM-repos.patch
1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Thu, 28 Apr 2016 01:41:45 +0200
3 Subject: [PATCH] FIXME: cobbler: setup.sh: Keep extra RPM repos.
4
5 cobbler-grub-aarch64 (arm64 specific loader) is currently
6 distributed and added to the cobbler docker container during
7 ISO build using EXTRA_RPM_REPOS envvar mechanism.
8
9 However, since this package installs files in a mounted location,
10 its contents are not persistent, requiring a test and eventual
11 forced reinstall during container start.
12
13 This, of course, requires the package to be available at that point,
14 which is not currently possible, as we remove the extra RPM repository
15 entry from yum config at the end of container build.
16
17 Hacky temporary workaround:
18 Re-add extra RPM yum config after container is set up, only for cobbler.
19
20 TODO: This patch should be dropped once cobbler-grub-aarch64 RPM
21 package gets upstreamed.
22 ---
23  docker/cobbler/setup.sh | 14 ++++++++++++++
24  1 file changed, 14 insertions(+)
25
26 diff --git a/docker/cobbler/setup.sh b/docker/cobbler/setup.sh
27 index 90627a8..508eaa4 100644
28 --- a/docker/cobbler/setup.sh
29 +++ b/docker/cobbler/setup.sh
30 @@ -80,6 +80,20 @@ baseurl=file:/var/www/nailgun/mos-centos/x86_64
31  gpgcheck=0
32  EOF
33  
34 +## FIXME(armband): Add extra RPM repository in Cobbler container
35 +# Normally, extra RPM repos are not re-added post-build, but we
36 +# need cobbler-grub-aarch64 during each container start.
37 +
38 +for repo in ${EXTRA_RPM_REPOS}; do
39 +  IFS=, read -a repo_args <<< "$repo"
40 +  cat << EOF >> /etc/yum.repos.d/nailgun.repo
41 +
42 +[extra-repo-${repo_args[0]}]
43 +name=MOS Extra Repo ${repo_args[0]}
44 +baseurl=file:/var/www/nailgun/extra-repos/${repo_args[0]}
45 +gpgcheck=0
46 +EOF
47 +done
48  yum clean all
49  
50