Updated armband
[armband.git] / patches / opnfv-fuel / 0036-repo-mirror-Allow-multi-arch-local-mirrors.patch
1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Sat, 18 Jun 2016 19:42:15 +0200
3 Subject: [PATCH] repo mirror: Allow multi-arch local mirrors
4
5 This patch allows specifying multiple architectures via UBUNTU_ARCH in
6 form of a list of space separated architectures. The first architecture
7 in the list is considered primary and will be used for building all the
8 deb packages by fuel-main. Additional architectures are added to allow
9 targets of other architectures to use the mirror.
10
11 NOTE: this imposes a requirement that all packages built are arch
12 independent (which is true so far).
13
14 [ Alexandru Avadanii ]
15 Reworked for applying on top of fuel@OPNFV.
16
17 Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
18 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
19 ---
20  build/Makefile                            |  1 +
21  build/repo-multi-arch-local-mirrors.patch | 45 +++++++++++++++++++++++++++++++
22  2 files changed, 46 insertions(+)
23  create mode 100644 build/repo-multi-arch-local-mirrors.patch
24
25 diff --git a/build/Makefile b/build/Makefile
26 index 2d33aa4..0490bab 100644
27 --- a/build/Makefile
28 +++ b/build/Makefile
29 @@ -139,6 +139,7 @@ $(ISOCACHE):
30         cd /tmp/fuel-main && git config user.email "fuel@opnfv.org"
31         cd /tmp/fuel-main && git am $(TOPDIR)/bootstrap_admin_node.sh.patch
32         cd /tmp/fuel-main && git am $(TOPDIR)/isolinux.cfg.patch
33 +       cd /tmp/fuel-main && git am $(TOPDIR)/repo-multi-arch-local-mirrors.patch
34         # Repeat build up to three times
35         sudo -E ./fuel_build_loop
36         cp /tmp/fuel-main/build/artifacts/fuel*.iso .
37 diff --git a/build/repo-multi-arch-local-mirrors.patch b/build/repo-multi-arch-local-mirrors.patch
38 new file mode 100644
39 index 0000000..c3ff26a
40 --- /dev/null
41 +++ b/build/repo-multi-arch-local-mirrors.patch
42 @@ -0,0 +1,45 @@
43 +From: Stanislaw Kardach <stanislaw.kardach@cavium.com>
44 +Date: Thu, 25 Feb 2016 13:31:19 +0100
45 +Subject: repo mirror: Allow multi-arch local mirrors
46 +
47 +This patch allows specifying multiple architectures via UBUNTU_ARCH in
48 +form of a list of space separated architectures. The first architecture
49 +in the list is considered primary and will be used for building all the
50 +deb packages by fuel-main. Additional architectures are added to allow
51 +targets of other architectures to use the mirror.
52 +NOTE: this imposes a requirement that all packages built are arch
53 +independent (which is true so far).
54 +
55 +Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
56 +Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
57 +---
58 + mirror/ubuntu/module.mk | 2 +-
59 + sandbox.mk              | 2 +-
60 + 2 files changed, 2 insertions(+), 2 deletions(-)
61 +
62 +diff --git a/mirror/ubuntu/module.mk b/mirror/ubuntu/module.mk
63 +index 7a9466e..fe1ada2 100644
64 +--- a/mirror/ubuntu/module.mk
65 ++++ b/mirror/ubuntu/module.mk
66 +@@ -81,7 +81,7 @@ $(BUILD_DIR)/mirror/ubuntu/mirror.done:
67 +       --root=$(MIRROR_MOS_UBUNTU_ROOT) \
68 +       --dist=$(MIRROR_MOS_UBUNTU_SUITE) \
69 +       --section=$(subst $(space),$(comma),$(MIRROR_MOS_UBUNTU_SECTION)) \
70 +-      --arch=$(UBUNTU_ARCH) \
71 ++      --arch=$(shell echo $(UBUNTU_ARCH) | tr ' ' ',') \
72 +       $(LOCAL_MIRROR_UBUNTU)/
73 +       rm -rf $(LOCAL_MIRROR_UBUNTU)/.temp $(LOCAL_MIRROR_UBUNTU)/project
74 +       $(ACTION.TOUCH)
75 +diff --git a/sandbox.mk b/sandbox.mk
76 +index 4bc3962..5ffddbd 100644
77 +--- a/sandbox.mk
78 ++++ b/sandbox.mk
79 +@@ -188,7 +188,7 @@ touch $(SANDBOX_UBUNTU)/etc/init.d/.legacy-bootordering
80 + mkdir -p $(SANDBOX_UBUNTU)/usr/sbin
81 + cp -a $(BUILD_DIR)/policy-rc.d $(SANDBOX_UBUNTU)/usr/sbin
82 + echo "Running debootstrap"
83 +-sudo debootstrap --no-check-gpg --include=ca-certificates --arch=$(UBUNTU_ARCH) $(MIRROR_UBUNTU_SUITE) $(SANDBOX_UBUNTU) $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT)
84 ++sudo debootstrap --no-check-gpg --include=ca-certificates --arch=$(word 1,$(UBUNTU_ARCH)) $(MIRROR_UBUNTU_SUITE) $(SANDBOX_UBUNTU) $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT)
85 + if [ -e $(SANDBOX_UBUNTU)/etc/resolv.conf ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf.orig; fi
86 + sudo cp /etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf
87 + if [ -e $(SANDBOX_UBUNTU)/etc/hosts ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/hosts $(SANDBOX_UBUNTU)/etc/hosts.orig; fi