aboutsummaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/000098-FIXME-build-fuel-main-Decouple-patches-Makefile.patch
blob: 53ceaa5bdf8c0cd6fc213cbb7eb0d35ef1b51186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Sat, 18 Jun 2016 01:09:27 +0200
Subject: [PATCH] WIP: build: fuel-main: Decouple patches, Makefile.

FIXME: Not tested, only a discussion starter.

Submitted upstream in Fuel@OPNFv, see change-id.

ARMBAND changes:
Upstream removed all mirrors but usa and cz, and changed
its default to mirror.fuel-infra.org in [1].

This allows us to drop patching of fuel-main/config.mk
with the Czech mirror.

If needed, USE_MIRROR=cz can be specified as an env var.

FIXME: Remove when Fuel@OPNFV pulls change and deals with it.

Use `git apply` and/or `git am` in favor of `patch`.
Change patches from old context format to unified diff.

This change allows us to decouple Makefile and patches.
This means we no longer have to manually stage touched files
before committing them to git.

Possible improvements:
- replace cz mirror patch with USE_MIRROR=cz makevar;
- move patches to separate dir and add ordering info (prefix);
- merge patches (currently we have one per touched file);

Remove obsolete (unused?) patch:
- fuel-main_docker_version.patch

[1] https://github.com/openstack/fuel-main/commit/
    751d502cfe15d9c9df0ee89530ac3b0b73aa1638

Change-Id: I5b621370993b259779c813b47105f632948e6da7
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 build/Makefile                       |  17 ++--
 build/bootstrap_admin_node.sh.patch  | 167 +++++++++++++++--------------------
 build/fuel-main_docker_version.patch |  20 -----
 build/isolinux.cfg.patch             |  43 +++++----
 5 files changed, 113 insertions(+), 166 deletions(-)
 delete mode 100644 build/fuel-main_docker_version.patch

diff --git a/build/Makefile b/build/Makefile
index 956183c..69e5690 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -109,7 +109,7 @@ $(ISOCACHE):
 		cd /tmp && git clone $(FUEL_MAIN_REPO); \
 	fi
 	cd /tmp/fuel-main && git checkout $(FUEL_MAIN_TAG)
-	@echo "fuel" `git -C /tmp/fuel-main show | grep commit | head -1 | cut -d " " -f2` >> $(VERSION_FILE)
+	@echo "fuel" `git -C /tmp/fuel-main rev-parse HEAD` >> $(VERSION_FILE)
 	# Remove Docker optimizations, otherwise multistrap will fail during
 	# Fuel build.
 	sudo rm -f /etc/apt/apt.conf.d/docker*
@@ -135,13 +135,10 @@ $(ISOCACHE):
 	# OPNFV patches at Fuel build time
 	# Need to be commited in order for them to be considered by the Fuel
 	# build system
-	cd /tmp/fuel-main/iso && git config user.name "Fuel OPNFV"
-	cd /tmp/fuel-main/iso && git config user.email "fuel@opnfv.org"
-	cd /tmp/fuel-main/iso && patch -p0 < $(TOPDIR)/bootstrap_admin_node.sh.patch
-	cd /tmp/fuel-main/iso && git add -u bootstrap_admin_node.sh
-	cd /tmp/fuel-main/iso/isolinux && patch -p0 <  $(TOPDIR)/isolinux.cfg.patch
-	cd /tmp/fuel-main/iso/isolinux && git add -u isolinux.cfg
-	cd /tmp/fuel-main/iso && git commit -m "Added OPNFV patches"
+	cd /tmp/fuel-main && git config user.name "Fuel OPNFV"
+	cd /tmp/fuel-main && git config user.email "fuel@opnfv.org"
+	cd /tmp/fuel-main && git am $(TOPDIR)/bootstrap_admin_node.sh.patch
+	cd /tmp/fuel-main && git am $(TOPDIR)/isolinux.cfg.patch
 	# Repeat build up to three times
 	sudo -E ./fuel_build_loop
 	cp /tmp/fuel-main/build/artifacts/fuel*.iso .
diff --git a/build/bootstrap_admin_node.sh.patch b/build/bootstrap_admin_node.sh.patch
index e137b74..8a2b69f 100644
--- a/build/bootstrap_admin_node.sh.patch
+++ b/build/bootstrap_admin_node.sh.patch
@@ -1,95 +1,72 @@
-*** bootstrap_admin_node.sh.orig	Mon May 30 06:31:38 2016
---- bootstrap_admin_node.sh	Mon May 30 06:35:11 2016
-***************
-*** 339,346 ****
-  set +x
-  echo "Done!"
-  
-  if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then
-!   fuelmenu || fail
-  else
-    # Give user 15 seconds to enter fuelmenu or else continue
-    echo
---- 339,360 ----
-  set +x
-  echo "Done!"
-  
-+ ### OPNFV addition BEGIN
-+ shopt -s nullglob
-+ for script in /opt/opnfv/bootstrap/pre.d/*.sh
-+ do
-+   echo "Pre script: $script" >> /root/pre.log 2>&1
-+   $script >> /root/pre.log 2>&1
-+ done
-+ shopt -u nullglob
-+ ### OPNFV addition END
-+ 
-+ # Enable sshd
-+ systemctl enable sshd
-+ systemctl start sshd
-+ 
-  if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then
-!   fuelmenu
-  else
-    # Give user 15 seconds to enter fuelmenu or else continue
-    echo
-***************
-*** 360,368 ****
-    fi
-  fi
+From: Fuel OPNFV <fuel@opnfv.org>
+Date: Mon, 13 Jun 2016 22:23:57 +0200
+Subject: OPNFV: Additions to bootstrap_admin_node.sh
 
-  # Enable online base MOS repos (security, updates) if we run an ISO installation
-! [ -f /etc/fuel_build_id ] && \
-!   yum-config-manager --enable mos${FUEL_RELEASE}-security mos${FUEL_RELEASE}-updates --save
-
-  if [ ! -f "${ASTUTE_YAML}" ]; then
-    echo ${fuelmenu_fail_message}
---- 360,369 ----
-    fi
-  fi
-
-+ # OPNFV: Disabled to speedup installation in offline env.
-  # Enable online base MOS repos (security, updates) if we run an ISO installation
-! #[ -f /etc/fuel_build_id ] && \
-! #  yum-config-manager --enable mos${FUEL_RELEASE}-security mos${FUEL_RELEASE}-updates --save
-
-  if [ ! -f "${ASTUTE_YAML}" ]; then
-    echo ${fuelmenu_fail_message}
-***************
-*** 374,382 ****
-  [ ! -f /etc/fuel_build_id ] && \
-    sed -i "s|127.0.0.1:8080/ubuntu/x86_64|mirror.fuel-infra.org/mos-repos/ubuntu/${FUEL_RELEASE}|g" "${ASTUTE_YAML}"
-  
-! # Enable sshd
-! systemctl enable sshd
-! systemctl start sshd
-  
-  # Enable iptables
-  systemctl enable iptables.service
---- 388,394 ----
-  [ ! -f /etc/fuel_build_id ] && \
-    sed -i "s|127.0.0.1:8080/ubuntu/x86_64|mirror.fuel-infra.org/mos-repos/ubuntu/${FUEL_RELEASE}|g" "${ASTUTE_YAML}"
-  
-! systemctl reload sshd
-  
-  # Enable iptables
-  systemctl enable iptables.service
-***************
-*** 529,534 ****
---- 541,556 ----
-  
-  bash /etc/rc.local
-  
-+ ### OPNFV addition BEGIN
-+ shopt -s nullglob
-+ for script in /opt/opnfv/bootstrap/post.d/*.sh
-+ do
-+   echo "Post script: $script" >> /root/post.log 2>&1
-+   $script >> /root/post.log 2>&1
-+ done
-+ shopt -u nullglob
-+ ### OPNFV addition END
-+ 
-  if [ "`get_bootstrap_skip`" = "False" ]; then
-    build_ubuntu_bootstrap bs_status || true
-  else
+---
+diff --git a/iso/bootstrap_admin_node.sh b/iso/bootstrap_admin_node.sh
+index 3197c91..e035145 100755
+--- a/iso/bootstrap_admin_node.sh
++++ b/iso/bootstrap_admin_node.sh
+@@ -339,8 +339,22 @@ fuelmenu --save-only --iface=$ADMIN_INTERFACE || fail
+ set +x
+ echo "Done!"
+ 
++### OPNFV addition BEGIN
++shopt -s nullglob
++for script in /opt/opnfv/bootstrap/pre.d/*.sh
++do
++  echo "Pre script: $script" >> /root/pre.log 2>&1
++  $script >> /root/pre.log 2>&1
++done
++shopt -u nullglob
++### OPNFV addition END
++
++# Enable sshd
++systemctl enable sshd
++systemctl start sshd
++
+ if [[ "$showmenu" == "yes" || "$showmenu" == "YES" ]]; then
+-  fuelmenu || fail
++  fuelmenu
+ else
+   # Give user 15 seconds to enter fuelmenu or else continue
+   echo
+@@ -360,9 +374,10 @@ else
+   fi
+ fi
+ 
++# OPNFV: Disabled to speedup installation in offline env.
+ # Enable online base MOS repos (security, updates) if we run an ISO installation
+-[ -f /etc/fuel_build_id ] && \
+-  yum-config-manager --enable mos${FUEL_RELEASE}-security mos${FUEL_RELEASE}-updates --save
++#[ -f /etc/fuel_build_id ] && \
++#  yum-config-manager --enable mos${FUEL_RELEASE}-security mos${FUEL_RELEASE}-updates --save
+ 
+ if [ ! -f "${ASTUTE_YAML}" ]; then
+   echo ${fuelmenu_fail_message}
+@@ -377,7 +392,5 @@ if [ ! -f /etc/fuel_build_id ]; then
+ 
+-# Enable sshd
+-systemctl enable sshd
+-systemctl start sshd
++systemctl reload sshd
+ 
+ # Enable iptables
+ systemctl enable iptables.service
+@@ -532,6 +545,16 @@ systemctl start ntpd
+ 
+ bash /etc/rc.local
+ 
++### OPNFV addition BEGIN
++shopt -s nullglob
++for script in /opt/opnfv/bootstrap/post.d/*.sh
++do
++  echo "Post script: $script" >> /root/post.log 2>&1
++  $script >> /root/post.log 2>&1
++done
++shopt -u nullglob
++### OPNFV addition END
++
+ if [ "`get_bootstrap_skip`" = "False" ]; then
+   build_ubuntu_bootstrap bs_status || true
+ else
diff --git a/build/fuel-main_docker_version.patch b/build/fuel-main_docker_version.patch
deleted file mode 100644
index 22b5824..0000000
--- a/build/fuel-main_docker_version.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-*** prepare-build-env.sh.orig	2016-01-11 14:55:50.615286910 +0100
---- prepare-build-env.sh	2016-01-11 14:59:44.775308422 +0100
-***************
-*** 102,108 ****
-    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
-    # Install docker
-    sudo apt-get update
-!   sudo apt-get -y install lxc-docker-1.5.0
-  fi
-  
-  # Install software
---- 102,109 ----
-    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
-    # Install docker
-    sudo apt-get update
-!   sudo sh -c 'echo DOCKER_OPTS=\"--bip 172.45.0.1/24\" > /etc/default/docker'
-!   sudo apt-get -y -o Dpkg::Options::="--force-confold" install lxc-docker-1.7.1
-  fi
-  
-  # Install software
diff --git a/build/isolinux.cfg.patch b/build/isolinux.cfg.patch
index ebd991b..7ca7a5c 100644
--- a/build/isolinux.cfg.patch
+++ b/build/isolinux.cfg.patch
@@ -1,24 +1,21 @@
-*** isolinux.cfg.orig	Tue May 10 10:13:21 2016
---- isolinux.cfg	Tue May 10 10:15:12 2016
-***************
-*** 19,27 ****
-    menu label ^1. Fuel Install (Static IP)
-    menu default
-    kernel vmlinuz
-!   append initrd=initrd.img net.ifnames=0 biosdevname=0 inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:eth0:off::: nameserver=10.20.0.1
-  
-  label nailgunifname
-    menu label ^2. Fuel Advanced Install (Static IP)
-    kernel vmlinuz
-!   append initrd=initrd.img inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:adminif:off::: nameserver=10.20.0.1 ifname=adminif:XX:XX:XX:XX:XX:XX
---- 19,27 ----
-    menu label ^1. Fuel Install (Static IP)
-    menu default
-    kernel vmlinuz
-!   append initrd=initrd.img net.ifnames=0 biosdevname=0 inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:eth0:off::: nameserver=10.20.0.1 showmenu=yes
-  
-  label nailgunifname
-    menu label ^2. Fuel Advanced Install (Static IP)
-    kernel vmlinuz
-!   append initrd=initrd.img inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:adminif:off::: nameserver=10.20.0.1 ifname=adminif:XX:XX:XX:XX:XX:XX showmenu=yes
+From: Fuel OPNFV <fuel@opnfv.org>
+Date: Mon, 13 Jun 2016 22:23:57 +0200
+Subject: OPNFV: showmenu=yes in isolinux.cfg
 
+---
+diff --git a/iso/isolinux/isolinux.cfg b/iso/isolinux/isolinux.cfg
+index c6b1ed9..77a4b18 100644
+--- a/iso/isolinux/isolinux.cfg
++++ b/iso/isolinux/isolinux.cfg
+@@ -19,9 +19,9 @@ label nailgun
+   menu label ^1. Fuel Install (Static IP)
+   menu default
+   kernel vmlinuz
+-  append initrd=initrd.img net.ifnames=0 biosdevname=0 inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:eth0:off::: nameserver=10.20.0.1
++  append initrd=initrd.img net.ifnames=0 biosdevname=0 inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:eth0:off::: nameserver=10.20.0.1 showmenu=yes
+ 
+ label nailgunifname
+   menu label ^2. Fuel Advanced Install (Static IP)
+   kernel vmlinuz
+-  append initrd=initrd.img inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:adminif:off::: nameserver=10.20.0.1 ifname=adminif:XX:XX:XX:XX:XX:XX
++  append initrd=initrd.img inst.repo=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ inst.ks=cdrom:LABEL=will_be_substituted_with_ISO_VOLUME_ID:/ks.cfg ip=10.20.0.2::10.20.0.1:255.255.255.0:fuel.domain.tld:adminif:off::: nameserver=10.20.0.1 ifname=adminif:XX:XX:XX:XX:XX:XX showmenu=yes