summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules32
-rw-r--r--Makefile65
-rw-r--r--README.md25
-rw-r--r--TODO.md28
-rw-r--r--patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch160
-rw-r--r--patches/fuel-agent/0002-Add-FLASH_KERNEL_SKIP-true.patch24
-rw-r--r--patches/fuel-agent/0003-Fix-qemu-user-static-replacement.patch58
-rw-r--r--patches/fuel-agent/0004-Prevent-common-cross-debootstrap-newaliases-issue.patch105
-rw-r--r--patches/fuel-agent/0005-FIXME-s-grub-pc-grub-efi-arm64.patch31
-rw-r--r--patches/fuel-agent/0006-Add-esp-partition-flag.patch51
-rw-r--r--patches/fuel-agent/0007-Add-fs-for-efi-partition.patch52
-rw-r--r--patches/fuel-library/0001-Add-arm64-templates-to-cobbler-and-nailgun.patch273
-rw-r--r--patches/fuel-library/0002-Add-arm64-for-auxiliary-repos.patch39
-rw-r--r--patches/fuel-library/0003-Make-qemu-kvm-architecture-aware.patch33
-rw-r--r--patches/fuel-library/0004-Make-TestVM-creation-architecture-aware.patch122
-rw-r--r--patches/fuel-main/0001-Use-qemu-debootstrap-to-support-multi-arch.patch53
-rw-r--r--patches/fuel-main/0002-Allow-multi-arch-debian-mirrors.patch45
-rw-r--r--patches/fuel-main/0003-Follow-redirects.patch24
-rw-r--r--patches/fuel-main/0004-Add-apt-https-support-package-to-sandbox.patch24
-rw-r--r--patches/fuel-main/0005-Make-cpio-accept-symlinks.patch30
-rw-r--r--patches/fuel-main/0006-Add-cobbler-grub-aarch64-RPM-reinstall-to-start.sh.patch42
-rw-r--r--patches/fuel-mirror/0001-Set-mos-ubuntu-base-URL-to-linux.enea.com.patch24
-rw-r--r--patches/fuel-mirror/0002-Add-fuel-agent-dependencies-to-Ubuntu-mirror.patch39
-rw-r--r--patches/fuel-plugin-ovsnfv/0001-fuel-plugin-Pick-updated-numa.-packages.patch36
-rw-r--r--patches/fuel-plugin-qemu/0001-Fix-apt-cache-and-qemu-version-handling.patch31
-rw-r--r--patches/fuel-web/0001-Add-arm64-fixture.patch118
-rw-r--r--patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch219
-rw-r--r--patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch24
-rw-r--r--patches/opnfv-fuel/0001-Allow-customizing-Fuel-commit.patch24
-rw-r--r--patches/opnfv-fuel/0002-Allow-customizing-java-and-fuel-mirror-URLs.patch46
-rw-r--r--patches/opnfv-fuel/0003-Add-arm64-deb-repositories-setup.patch161
-rw-r--r--patches/opnfv-fuel/0004-Follow-redirects.patch28
-rw-r--r--patches/opnfv-fuel/0005-Build-bootstrap-image-for-arm64.patch27
-rw-r--r--patches/opnfv-fuel/0006-bootstrap-Use-public-Ubuntu-ports-mirrors.patch51
-rw-r--r--patches/opnfv-fuel/0007-Allow-customizing-fuel-plugin-qemu.patch24
-rw-r--r--patches/opnfv-fuel/0008-Allow-customizing-fuel-plugin-ovsnfv.patch25
37 files changed, 2194 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..751b1d07
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build.log
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..1dd05a66
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,32 @@
+[submodule "opnfv-fuel"]
+ path = upstream/fuel
+ url = https://gerrit.opnfv.org/gerrit/fuel
+ branch = stable/brahmaputra
+[submodule "fuel-main"]
+ path = upstream/fuel-main
+ url = git@github.com:openstack/fuel-main.git
+ branch = stable/8.0
+[submodule "fuel-library"]
+ path = upstream/fuel-library
+ url = git@github.com:openstack/fuel-library.git
+ branch = stable/8.0
+[submodule "fuel-web"]
+ path = upstream/fuel-web
+ url = git@github.com:openstack/fuel-web.git
+ branch = stable/8.0
+[submodule "fuel-agent"]
+ path = upstream/fuel-agent
+ url = git@github.com:openstack/fuel-agent.git
+ branch = stable/8.0
+[submodule "fuel-mirror"]
+ path = upstream/fuel-mirror
+ url = git@github.com:openstack/fuel-mirror.git
+ branch = stable/8.0
+[submodule "fuel-plugin-qemu"]
+ path = upstream/fuel-plugin-qemu
+ url = https://github.com/openstack/fuel-plugin-qemu
+ branch = master
+[submodule "fuel-plugin-ovsnfv"]
+ path = upstream/fuel-plugin-ovsnfv
+ url = https://gerrit.opnfv.org/gerrit/p/ovsnfv.git
+ branch = stable/brahmaputra
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..34bfde7a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,65 @@
+root:=$(shell pwd)
+
+all: build
+
+.PHONY: submodules-init submodules-clean
+submodules-init:
+ @git submodule -q init
+ @git submodule -q sync
+ @git submodule update
+
+# Cleans any changes made to submodules
+submodules-clean:
+ @git submodule -q foreach \
+ 'git checkout -q armband-workbench-root; \
+ git branch -q -D armband-workbench; \
+ git tag -d armband-workbench-root; \
+ git reset -q --hard HEAD; git clean -xdff'
+
+.PHONY: patches-export patches-import
+# Generate patches from submodules
+patches-export:
+ @git submodule -q foreach 'mkdir -p ${root}/patches/$$name'
+ @git submodule -q foreach 'git format-patch \
+ -o ${root}/patches/$$name -N armband-workbench-root'
+ @find ${root}/patches -name '*.patch' -exec sed -i -e '1d' {} \;
+
+# apply patches from patches/* to respective submodules
+patches-import:
+ @git submodule -q foreach 'mkdir -p ${root}/patches/$$name'
+ @git submodule -q foreach 'git tag armband-workbench-root'
+ @git submodule -q foreach 'git checkout -q -b armband-workbench'
+ @git submodule -q foreach \
+ 'for p in $$(ls ${root}/patches/$$name/); do \
+ git am ${root}/patches/$$name/$$p; \
+ done'
+
+build:
+ cd ${root}/upstream/fuel/build && \
+ time make \
+ BUILD_FUEL_PLUGINS=f_odlpluginbuild \
+ FUEL_MAIN_REPO=${root}/upstream/fuel-main \
+ FUEL_MAIN_TAG= \
+ UBUNTU_ARCH="amd64 arm64" \
+ SEPARATE_IMAGES="/boot,ext2 /,ext4 /boot/efi,vfat" \
+ FUELLIB_REPO=${root}/upstream/fuel-library \
+ NAILGUN_REPO=${root}/upstream/fuel-web \
+ FUEL_AGENT_REPO=${root}/upstream/fuel-agent \
+ FUEL_MIRROR_REPO=${root}/upstream/fuel-mirror \
+ QEMU_REPO=${root}/upstream/fuel-plugin-qemu \
+ OVSNFV_DPDK_REPO=${root}/upstream/fuel-plugin-ovsnfv \
+ FUELLIB_COMMIT=HEAD \
+ NAILGUN_COMMIT=HEAD \
+ FUEL_AGENT_COMMIT=HEAD \
+ FUEL_MIRROR_COMMIT=HEAD \
+ QEMU_BRANCH=HEAD \
+ OVSNFV_DPDK_BRANCH=armband-workbench \
+ PRODUCT_VERSION=8.0 \
+ PRODUCT_NAME=mos \
+ CENTOS_MAJOR=7 \
+ MIRROR_FUEL=http://linux.enea.com/mos-repos/centos/mos8.0-centos7-fuel/os/x86_64/ \
+ MIRROR_UBUNTU_URL=http://archive.ubuntu.com/ubuntu/ \
+ LATEST_MIRROR_ID_URL=http://linux.enea.com/ \
+ JAVA8_URL=https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa/+files/openjdk-8-jre-headless_8u72-b15-1~trusty1_arm64.deb \
+ iso 2>&1 | tee ${root}/build.log
+
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..ea94089c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,25 @@
+Armband Fuel test
+=================
+
+This is a test repository to hold build scripts for Fuel 8 based OPNFV
+installer for aarch64 machines. Construction of this repository will change.
+
+Workflow
+--------
+The standard workflow should look as follows:
+
+1. Clone the repository.
+2. All the sub-projects are registered as submodules. Call `make submodules-init` to initialize them.
+2. Apply patches from `patches/sub-project/*` to respective submodules via `make patches-import`. This will result in creation of a tag `armband-workbench-root` at the `HEAD` of the submodule and creation of a new branch `armband-workbench` which will hold all the armband related work. Then each patch is applied on this new branch with `git-am`.
+3. Modify sub-projects for whatever you need. Commit your changes when you want them taken into account in the build.
+4. Build with `make build`
+5. Re-create patches via `make patches-export`. Each commit on `armband-workbench` branch of each subproject will be exported to the `patches/subproject/` via `git format-patch`. Remember to commit only patches! Commiting changed submodules (`git diff` will list something like: `Subproject commit: {hash}`) will result in breaking them as the new commit hash is non-existant in the upstream repo. Hence anybody cloning the repository will fail on `make submodules-init`. Similarily commiting changes to patches which only report a new hash (`git diff` reports something like: `From {hash} {date}`) is not needed (although won't break anything) because `git am` will discard them anyway.
+6. Clean workbench branches and tags with `make submodules-clean`.
+
+
+Sub-projects
+------------
+If you need to add another subproject, you can do it with `git submodule`. Make sure that you specify branch (with `-b`), short name (with `--name`) and point it to `upstream/*` directory, i.e.:
+```
+git submodule -b stable/8.0 add --name fuel-web git@github.com:openstack/fuel-web.git upstream/fuel-web
+```
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 00000000..8f3a3302
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,28 @@
+List of missing features and things to do
+=========================================
+
+* Extend arch list for auxiliary repo on fuel master (e.g. "amd64 arm64", or "arm64" if people want to support arm64 only).
+* Add Armband CentOS repository either as URL override.
+* [arm64-master] Add arm64 support for CentOS based actions.
+* [arm64-master] change docker repo in `upstream/fuel/build/config.mk`, perhaps by figuring out current architecture with `uname -m`
+* [arm64-master] Find `puppetlabs-products` repo for arm64.
+* [arm64-master] Fix license in ubuntu_1404_arm64.pp
+* [arm64-master] Remove/replace mini.iso with own kernel/initrd
+* [arm64-master] Look into default ubuntu_debootstrap change in cobbler.pp
+* [arm64-master] Add Cobbler aarch64 loader
+* [arm64-master] [fuel-agent] Custom package selection for arm64 in [1] or from above
+* [arm64-master] [fuel-agent] --kernel-flavor override in fuel_bootstrap based on arch [2]
+* [arm64-master] [fuel-agent] Package and repo update for arm64 in [3] (?)
+* [arm64-master] [fuel-agent] (?) Update image build tests for arm64 in [4] (+efi?)
+* [arm64-master] Factor out 10.0.2.6 local mirrors and switch to HTTPS for MOS mirror
+* [armband-deb-repo] Re-compile mixed-binaries (all+arch) debs for amd64 (e.g. ceph)
+* [ohai] ThunderX network card speed reported as N/A
+* [fuel?] Disabling rx-vlan-filter from Fuel WebUI is not applied during netcheck
+* [fuel?] Gray out vCenter & co for archs other than x86
+* [fuel] Figure a way for not hardcoding the bootstrap image architecture
+* [fuel] Add QEMU_VERSION for fuel-plugin-qemu
+
+[1] https://github.com/openstack/fuel-agent/blob/master/fuel_agent/drivers/nailgun.py#L687-L693
+[2] https://github.com/openstack/fuel-agent/blob/master/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/commands/build.py#L107
+[3] https://github.com/openstack/fuel-agent/blob/master/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/settings.yaml.sample#L19
+[4] https://github.com/openstack/fuel-agent/blob/master/fuel_agent/tests/test_nailgun_build_image.py#L26
diff --git a/patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch b/patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch
new file mode 100644
index 00000000..28ef2cff
--- /dev/null
+++ b/patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch
@@ -0,0 +1,160 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Thu, 25 Feb 2016 13:38:14 +0100
+Subject: [PATCH] Use qemu-debootstrap for image creation
+
+This commit adds qemu-debootstrap support and a command line argument
+`target_arch` which can be used for choosing the architecture to build
+the image for. The architecture detection from environment settings is
+not yet implemented.
+---
+ .../fuel_bootstrap_cli/fuel_bootstrap/commands/build.py | 8 ++++++++
+ .../fuel_bootstrap/utils/bootstrap_image.py | 3 ++-
+ debian/control | 2 ++
+ fuel_agent/manager.py | 13 ++++++++++++-
+ fuel_agent/tests/test_build_utils.py | 4 ++--
+ fuel_agent/utils/build.py | 2 +-
+ specs/fuel-agent.spec | 2 ++
+ 7 files changed, 29 insertions(+), 5 deletions(-)
+
+diff --git a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/commands/build.py b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/commands/build.py
+index ca2d3e1..b0d410d 100644
+--- a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/commands/build.py
++++ b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/commands/build.py
+@@ -166,6 +166,14 @@ class BuildCommand(command.Command):
+ " files",
+ action='append'
+ )
++ parser.add_argument(
++ '--target_arch',
++ type=str,
++ choices=['arm64', 'amd64'],
++ help="Choose the target architecture for which image is built",
++ default="amd64"
++ )
++
+ return parser
+
+ def take_action(self, parsed_args):
+diff --git a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py
+index 0219961..1387cf9 100644
+--- a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py
++++ b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py
+@@ -172,7 +172,8 @@ def make_bootstrap(data):
+
+ LOG.info("Try to build image with data:\n%s", yaml.safe_dump(bootdata))
+
+- opts = ['--data_driver', 'bootstrap_build_image']
++ opts = ['--data_driver', 'bootstrap_build_image',
++ '--target_arch', data['target_arch']]
+ if data.get('image_build_dir'):
+ opts.extend(['--image_build_dir', data['image_build_dir']])
+
+diff --git a/debian/control b/debian/control
+index 0a6f947..189dc00 100644
+--- a/debian/control
++++ b/debian/control
+@@ -36,6 +36,8 @@ Pre-Depends: dpkg (>= 1.15.6~)
+ Depends: bzip2,
+ cloud-utils,
+ debootstrap,
++ qemu-user-static,
++ binfmt-support,
+ dmidecode,
+ ethtool,
+ gdisk,
+diff --git a/fuel_agent/manager.py b/fuel_agent/manager.py
+index 15cc5d8..f613aef 100644
+--- a/fuel_agent/manager.py
++++ b/fuel_agent/manager.py
+@@ -18,6 +18,7 @@ import shutil
+ import signal
+
+ from oslo_config import cfg
++from oslo_config import types
+ import six
+ import yaml
+
+@@ -33,6 +34,8 @@ from fuel_agent.utils import md as mu
+ from fuel_agent.utils import partition as pu
+ from fuel_agent.utils import utils
+
++ArchType = types.String(choices=['amd64', 'arm64'])
++
+ opts = [
+ cfg.StrOpt(
+ 'nc_template_path',
+@@ -153,6 +156,13 @@ cli_opts = [
+ default='/tmp',
+ help='Directory where the image is supposed to be built',
+ ),
++ cfg.Opt(
++ 'target_arch',
++ default='amd64',
++ type=ArchType,
++ help='Architecture for which image will be built using '
++ 'debootstrap',
++ ),
+ ]
+
+ CONF = cfg.CONF
+@@ -551,7 +561,8 @@ class Manager(object):
+ LOG.debug('Preventing services from being get started')
+ bu.suppress_services_start(chroot)
+ LOG.debug('Installing base operating system using debootstrap')
+- bu.run_debootstrap(uri=uri, suite=suite, chroot=chroot,
++ bu.run_debootstrap(uri=uri, suite=suite, arch=CONF.target_arch,
++ chroot=chroot,
+ attempts=CONF.fetch_packages_attempts,
+ proxies=proxies.proxies,
+ direct_repo_addr=proxies.direct_repo_addr_list)
+diff --git a/fuel_agent/tests/test_build_utils.py b/fuel_agent/tests/test_build_utils.py
+index 82c3462..ac5ae82 100644
+--- a/fuel_agent/tests/test_build_utils.py
++++ b/fuel_agent/tests/test_build_utils.py
+@@ -42,7 +42,7 @@ class BuildUtilsTestCase(unittest2.TestCase):
+ def test_run_debootstrap(self, mock_exec, mock_environ):
+ bu.run_debootstrap('uri', 'suite', 'chroot', 'arch', attempts=2)
+ mock_exec.assert_called_once_with(
+- 'debootstrap', '--include={0}'
++ 'qemu-debootstrap', '--include={0}'
+ .format(','.join(bu.ADDITIONAL_DEBOOTSTRAP_PACKAGES)),
+ '--verbose', '--no-check-gpg', '--arch=arch',
+ 'suite', 'chroot', 'uri', attempts=2, env_variables={})
+@@ -53,7 +53,7 @@ class BuildUtilsTestCase(unittest2.TestCase):
+ bu.run_debootstrap('uri', 'suite', 'chroot', 'arch', eatmydata=True,
+ attempts=2)
+ mock_exec.assert_called_once_with(
+- 'debootstrap', '--include={0}'
++ 'qemu-debootstrap', '--include={0}'
+ .format(','.join(bu.ADDITIONAL_DEBOOTSTRAP_PACKAGES)),
+ '--verbose', '--no-check-gpg', '--arch=arch',
+ '--include=eatmydata', 'suite',
+diff --git a/fuel_agent/utils/build.py b/fuel_agent/utils/build.py
+index 7247965..af41b2b 100644
+--- a/fuel_agent/utils/build.py
++++ b/fuel_agent/utils/build.py
+@@ -80,7 +80,7 @@ def run_debootstrap(uri, suite, chroot, arch='amd64', eatmydata=False,
+ env_vars['no_proxy'] = ','.join(direct_repo_addr)
+ LOG.debug('Setting no_proxy for: {0}'.format(env_vars['no_proxy']))
+
+- cmds = ['debootstrap',
++ cmds = ['qemu-debootstrap',
+ '--include={0}'.format(",".join(ADDITIONAL_DEBOOTSTRAP_PACKAGES)),
+ '--verbose', '--no-check-gpg',
+ '--arch={0}'.format(arch)]
+diff --git a/specs/fuel-agent.spec b/specs/fuel-agent.spec
+index 5c37600..a43f693 100644
+--- a/specs/fuel-agent.spec
++++ b/specs/fuel-agent.spec
+@@ -50,6 +50,8 @@ Requires: xfsprogs
+ Requires: pciutils
+ Requires: ethtool
+ Requires: debootstrap
++Requires: dpkg
++Requires: qemu-user-static
+ Requires: xz
+ Requires: coreutils
+ Requires: psmisc
+--
+1.9.1
+
diff --git a/patches/fuel-agent/0002-Add-FLASH_KERNEL_SKIP-true.patch b/patches/fuel-agent/0002-Add-FLASH_KERNEL_SKIP-true.patch
new file mode 100644
index 00000000..260651c5
--- /dev/null
+++ b/patches/fuel-agent/0002-Add-FLASH_KERNEL_SKIP-true.patch
@@ -0,0 +1,24 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Thu, 25 Feb 2016 16:01:18 +0100
+Subject: [PATCH] Add FLASH_KERNEL_SKIP=true.
+
+FIXME: Add nice description of the issue at hand.
+---
+ fuel_agent/utils/build.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fuel_agent/utils/build.py b/fuel_agent/utils/build.py
+index af41b2b..6f31732 100644
+--- a/fuel_agent/utils/build.py
++++ b/fuel_agent/utils/build.py
+@@ -97,6 +97,7 @@ def set_apt_get_env():
+ # NOTE(agordeev): disable any confirmations/questions from apt-get side
+ os.environ['DEBIAN_FRONTEND'] = 'noninteractive'
+ os.environ['DEBCONF_NONINTERACTIVE_SEEN'] = 'true'
++ os.environ['FLASH_KERNEL_SKIP'] = 'true'
+ os.environ['LC_ALL'] = os.environ['LANG'] = os.environ['LANGUAGE'] = 'C'
+
+
+--
+1.9.1
+
diff --git a/patches/fuel-agent/0003-Fix-qemu-user-static-replacement.patch b/patches/fuel-agent/0003-Fix-qemu-user-static-replacement.patch
new file mode 100644
index 00000000..1ea93ba3
--- /dev/null
+++ b/patches/fuel-agent/0003-Fix-qemu-user-static-replacement.patch
@@ -0,0 +1,58 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Sun, 6 Mar 2016 16:09:39 +0100
+Subject: [PATCH] Fix qemu-user-static replacement
+
+---
+ fuel_agent/manager.py | 6 ++++++
+ fuel_agent/utils/build.py | 18 ++++++++++++++++++
+ 2 files changed, 24 insertions(+)
+
+diff --git a/fuel_agent/manager.py b/fuel_agent/manager.py
+index f613aef..6322a10 100644
+--- a/fuel_agent/manager.py
++++ b/fuel_agent/manager.py
+@@ -587,6 +587,12 @@ class Manager(object):
+ fu.mount_bind(chroot, '/proc')
+ bu.populate_basic_dev(chroot)
+
++ # we need to make sure that qemu-{target_arch}-static binary is
++ # not replaced inside chroot because we're possibly using it
++ # through qemu-debootstrap
++ LOG.debug('Preventing qemu-user-static replacement inside chroot')
++ bu.prevent_qemu_replacement(chroot, CONF.target_arch)
++
+ def destroy_chroot(self, chroot):
+ # Umount chroot tree and remove images tmp files
+ if not bu.stop_chrooted_processes(chroot, signal=signal.SIGTERM):
+diff --git a/fuel_agent/utils/build.py b/fuel_agent/utils/build.py
+index 6f31732..abd762e 100644
+--- a/fuel_agent/utils/build.py
++++ b/fuel_agent/utils/build.py
+@@ -312,6 +312,24 @@ def populate_basic_dev(chroot):
+ utils.execute('chroot', chroot,
+ 'ln', '-s', '/proc/self/fd', '/dev/fd')
+
++def prevent_qemu_replacement(chroot, arch):
++ """Prevents qemu-user-static replacement inside chroot.
++
++ Use dpkg-divert to prevent replacing qemu-user-static binary inside
++ chroot which is necessary for host-side qemu-debootstrap to work
++ properly."""
++ if arch == 'arm64':
++ qemu = 'qemu-aarch64-static'
++ elif arch == 'amd64':
++ qemu = 'qemu-x86_64-static'
++ utils.execute('chroot', chroot,
++ 'dpkg-divert', '--divert', '/usr/bin/%s.orig' % qemu,
++ '/usr/bin/%s' % qemu)
++ utils.execute('chroot', chroot,
++ 'dpkg-divert', '--divert', '/usr/sbin/update-binfmts.orig',
++ '--rename', '/usr/sbin/update-binfmts')
++ utils.execute('chroot', chroot, 'ln', '-sf', '/bin/true',
++ '/usr/sbin/update-binfmts')
+
+ def create_sparse_tmp_file(dir, suffix, size=8192):
+ """Creates sparse file.
+--
+1.9.1
+
diff --git a/patches/fuel-agent/0004-Prevent-common-cross-debootstrap-newaliases-issue.patch b/patches/fuel-agent/0004-Prevent-common-cross-debootstrap-newaliases-issue.patch
new file mode 100644
index 00000000..1d044585
--- /dev/null
+++ b/patches/fuel-agent/0004-Prevent-common-cross-debootstrap-newaliases-issue.patch
@@ -0,0 +1,105 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Tue, 8 Mar 2016 00:44:05 +0100
+Subject: [PATCH] Prevent common cross-debootstrap newaliases issue.
+
+While building target images for a different arch (using qemu-user-static),
+the following issue prevents the succesful image build:
+newaliases: fatal: inet_addr_local[getifaddrs]:
+getifaddrs: Address family not supported by protocol
+
+For more information, see [1].
+
+[1] https://bugs.launchpad.net/ubuntu/+source/postfix/+bug/1531299
+---
+ fuel_agent/manager.py | 14 ++++++++++++++
+ fuel_agent/utils/build.py | 24 ++++++++++++++++++++++++
+ 2 files changed, 38 insertions(+)
+
+diff --git a/fuel_agent/manager.py b/fuel_agent/manager.py
+index 6322a10..843c40b 100644
+--- a/fuel_agent/manager.py
++++ b/fuel_agent/manager.py
+@@ -836,10 +836,15 @@ class Manager(object):
+ direct_repo_addrs=driver_os.proxies.direct_repo_addr_list)
+ self._update_metadata_with_repos(
+ metadata, driver_os.repos)
++ # Prevent common cross-debootstraping problem w/ newaliases & qemu
++ # inet_addr_local[getifaddrs]: getifaddrs: Address family not supp
++ LOG.debug('Preventing newaliases from running inside chroot')
++ bu.prevent_qemu_newaliases(chroot)
+ LOG.debug('Installing packages using apt-get: %s',
+ ' '.join(packages))
+ # disable hosts/resolv files
+ bu.propagate_host_resolv_conf(chroot)
++
+ if hasattr(bs_scheme, 'certs') and bs_scheme.certs:
+ bu.copy_update_certs(bs_scheme.certs, chroot)
+ bu.run_apt_get(chroot, packages=packages,
+@@ -873,6 +878,7 @@ class Manager(object):
+ force_ipv4_file=CONF.force_ipv4_file)
+ # restore disabled hosts/resolv files
+ bu.restore_resolv_conf(chroot)
++ bu.restore_newaliases(chroot)
+ metadata['all_packages'] = bu.get_installed_packages(chroot)
+ # We need to recompress initramfs with new compression:
+ bu.recompress_initramfs(
+@@ -964,6 +970,11 @@ class Manager(object):
+ self._update_metadata_with_repos(
+ metadata, driver_os.repos)
+
++ # Prevent common cross-debootstraping problem w/ newaliases & qemu
++ # inet_addr_local[getifaddrs]: getifaddrs: Address family not supp
++ LOG.debug('Preventing newaliases from running inside chroot')
++ bu.prevent_qemu_newaliases(chroot)
++
+ LOG.debug('Installing packages using apt-get: %s',
+ ' '.join(packages))
+ bu.run_apt_get(chroot, packages=packages,
+@@ -974,6 +985,9 @@ class Manager(object):
+ allow_unsigned_file=CONF.allow_unsigned_file,
+ force_ipv4_file=CONF.force_ipv4_file)
+
++ LOG.debug('Restoring newaliases command inside chroot')
++ bu.restore_newaliases(chroot)
++
+ LOG.debug('Making sure there are no running processes '
+ 'inside chroot before trying to umount chroot')
+ if not bu.stop_chrooted_processes(chroot, signal=signal.SIGTERM):
+diff --git a/fuel_agent/utils/build.py b/fuel_agent/utils/build.py
+index abd762e..e11ceba 100644
+--- a/fuel_agent/utils/build.py
++++ b/fuel_agent/utils/build.py
+@@ -331,6 +331,30 @@ def prevent_qemu_replacement(chroot, arch):
+ utils.execute('chroot', chroot, 'ln', '-sf', '/bin/true',
+ '/usr/sbin/update-binfmts')
+
++def prevent_qemu_newaliases(chroot):
++ """Prevents running newaliases under qemu-user-static inside chroot.
++
++ Use dpkg-divert to prevent running newaliases binary through qemu inside
++ chroot which is necessary to avoid a dpkg --configure error:
++ inet_addr_local[getifaddrs]: getifaddrs: Address family not supported ...
++ """
++ utils.execute('chroot', chroot,
++ 'dpkg-divert', '--local', '--rename', '--add',
++ '/usr/bin/newaliases')
++ utils.execute('chroot', chroot, 'ln', '-sf', '/bin/true',
++ '/usr/bin/newaliases')
++
++def restore_newaliases(chroot):
++ """Restores newaliases inside chroot after previous dpkg-divert.
++
++ opposite to prevent_qemu_newaliases
++ """
++ utils.execute('chroot', chroot,
++ 'rm', '-f', '/usr/bin/newaliases')
++ utils.execute('chroot', chroot,
++ 'dpkg-divert', '--local', '--rename', '--remove',
++ '/usr/bin/newaliases')
++
+ def create_sparse_tmp_file(dir, suffix, size=8192):
+ """Creates sparse file.
+
+--
+1.9.1
+
diff --git a/patches/fuel-agent/0005-FIXME-s-grub-pc-grub-efi-arm64.patch b/patches/fuel-agent/0005-FIXME-s-grub-pc-grub-efi-arm64.patch
new file mode 100644
index 00000000..59fe0180
--- /dev/null
+++ b/patches/fuel-agent/0005-FIXME-s-grub-pc-grub-efi-arm64.patch
@@ -0,0 +1,31 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Tue, 8 Mar 2016 01:06:56 +0100
+Subject: [PATCH] FIXME: s/grub-pc/grub-efi-arm64/
+
+This hard replaced the previously hardcoded grub-pc req.
+
+Fuel 9.0 moved default package list to openstack.yaml fixture, see [1].
+TODO: At least make this arch-dependant for mos8 ...
+
+[1] https://github.com/openstack/fuel-web/commit/
+ 4ee42effe27694bd231663e3d0f10c0c42877177
+---
+ fuel_agent/drivers/nailgun.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fuel_agent/drivers/nailgun.py b/fuel_agent/drivers/nailgun.py
+index c2fef69..3807ca7 100644
+--- a/fuel_agent/drivers/nailgun.py
++++ b/fuel_agent/drivers/nailgun.py
+@@ -684,7 +684,7 @@ class NailgunBuildImage(BaseDataDriver):
+ "daemonize",
+ "debconf-utils",
+ "gdisk",
+- "grub-pc",
++ "grub-efi-arm64",
+ "hpsa-dkms",
+ "i40e-dkms",
+ "linux-firmware",
+--
+1.9.1
+
diff --git a/patches/fuel-agent/0006-Add-esp-partition-flag.patch b/patches/fuel-agent/0006-Add-esp-partition-flag.patch
new file mode 100644
index 00000000..e180468f
--- /dev/null
+++ b/patches/fuel-agent/0006-Add-esp-partition-flag.patch
@@ -0,0 +1,51 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Tue, 8 Mar 2016 16:29:39 +0100
+Subject: [PATCH] Add <esp> partition flag.
+
+Parted flag <esp> (see [1]) will mark EFI system partition, allowing us
+to properly format and mount it during do_partitioning deployment phase.
+
+[1] https://www.gnu.org/software/parted/manual/html_node/set.html
+---
+ fuel_agent/drivers/nailgun.py | 2 +-
+ fuel_agent/utils/partition.py | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/fuel_agent/drivers/nailgun.py b/fuel_agent/drivers/nailgun.py
+index 3807ca7..bc532b4 100644
+--- a/fuel_agent/drivers/nailgun.py
++++ b/fuel_agent/drivers/nailgun.py
+@@ -324,7 +324,7 @@ class Nailgun(BaseDataDriver):
+ # uefi partition (for future use)
+ LOG.debug('Adding UEFI partition on disk %s: size=200' %
+ disk['name'])
+- parted.add_partition(size=200)
++ parted.add_partition(size=200, flags=['esp'])
+
+ LOG.debug('Looping over all volumes on disk %s' % disk['name'])
+ for volume in disk['volumes']:
+diff --git a/fuel_agent/utils/partition.py b/fuel_agent/utils/partition.py
+index acdd0b3..86349d2 100644
+--- a/fuel_agent/utils/partition.py
++++ b/fuel_agent/utils/partition.py
+@@ -93,7 +93,7 @@ def set_partition_flag(dev, num, flag, state='on'):
+ :param dev: A device file, e.g. /dev/sda.
+ :param num: Partition number
+ :param flag: Flag name. Must be one of 'bios_grub', 'legacy_boot',
+- 'boot', 'raid', 'lvm'
++ 'boot', 'raid', 'lvm', 'esp'
+ :param state: Desiable flag state. 'on' or 'off'. Default is 'on'.
+
+ :returns: None
+@@ -103,7 +103,7 @@ def set_partition_flag(dev, num, flag, state='on'):
+ # parted supports more flags but we are interested in
+ # setting only this subset of them.
+ # not all of these flags are compatible with one another.
+- if flag not in ('bios_grub', 'legacy_boot', 'boot', 'raid', 'lvm'):
++ if flag not in ('bios_grub', 'legacy_boot', 'boot', 'raid', 'lvm', 'esp'):
+ raise errors.WrongPartitionSchemeError(
+ 'Unsupported partition flag: %s' % flag)
+ if state not in ('on', 'off'):
+--
+1.9.1
+
diff --git a/patches/fuel-agent/0007-Add-fs-for-efi-partition.patch b/patches/fuel-agent/0007-Add-fs-for-efi-partition.patch
new file mode 100644
index 00000000..573ec133
--- /dev/null
+++ b/patches/fuel-agent/0007-Add-fs-for-efi-partition.patch
@@ -0,0 +1,52 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Tue, 8 Mar 2016 21:08:55 +0100
+Subject: [PATCH] Add fs for efi partition
+
+---
+ debian/control | 1 +
+ fuel_agent/drivers/nailgun.py | 4 +++-
+ specs/fuel-agent.spec | 1 +
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/debian/control b/debian/control
+index 189dc00..acfda35 100644
+--- a/debian/control
++++ b/debian/control
+@@ -39,6 +39,7 @@ Depends: bzip2,
+ qemu-user-static,
+ binfmt-support,
+ dmidecode,
++ dosfstools,
+ ethtool,
+ gdisk,
+ genisoimage,
+diff --git a/fuel_agent/drivers/nailgun.py b/fuel_agent/drivers/nailgun.py
+index bc532b4..24d0d64 100644
+--- a/fuel_agent/drivers/nailgun.py
++++ b/fuel_agent/drivers/nailgun.py
+@@ -324,7 +324,9 @@ class Nailgun(BaseDataDriver):
+ # uefi partition (for future use)
+ LOG.debug('Adding UEFI partition on disk %s: size=200' %
+ disk['name'])
+- parted.add_partition(size=200, flags=['esp'])
++ prt = parted.add_partition(size=200, flags=['esp'])
++ partition_scheme.add_fs(device=prt.name, mount='/boot/efi',
++ fs_type='vfat')
+
+ LOG.debug('Looping over all volumes on disk %s' % disk['name'])
+ for volume in disk['volumes']:
+diff --git a/specs/fuel-agent.spec b/specs/fuel-agent.spec
+index a43f693..c2b9b51 100644
+--- a/specs/fuel-agent.spec
++++ b/specs/fuel-agent.spec
+@@ -50,6 +50,7 @@ Requires: xfsprogs
+ Requires: pciutils
+ Requires: ethtool
+ Requires: debootstrap
++Requires: dosfstools
+ Requires: dpkg
+ Requires: qemu-user-static
+ Requires: xz
+--
+1.9.1
+
diff --git a/patches/fuel-library/0001-Add-arm64-templates-to-cobbler-and-nailgun.patch b/patches/fuel-library/0001-Add-arm64-templates-to-cobbler-and-nailgun.patch
new file mode 100644
index 00000000..56796d48
--- /dev/null
+++ b/patches/fuel-library/0001-Add-arm64-templates-to-cobbler-and-nailgun.patch
@@ -0,0 +1,273 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Sun, 21 Feb 2016 16:29:52 +0100
+Subject: [PATCH] Add arm64 templates to cobbler and nailgun
+
+Add grub template import to cobbler server manifest
+
+Add arm64 templates to cobbler and nailgun
+---
+ deployment/puppet/cobbler/manifests/server.pp | 27 +++++++++++++++
+ .../puppet/cobbler/templates/dnsmasq.template.erb | 2 ++
+ .../cobbler/templates/efidefault.template.erb | 5 +++
+ .../cobbler/templates/grubprofile.template.erb | 16 +++++++++
+ .../cobbler/templates/grubsystem.template.erb | 16 +++++++++
+ .../templates/preseed/ubuntu-1404.preseed.erb | 2 ++
+ .../puppet/nailgun/manifests/auxiliaryrepos.pp | 12 ++++---
+ deployment/puppet/nailgun/manifests/cobbler.pp | 38 +++++++++++++++++-----
+ .../puppet/nailgun/manifests/cobbler/preseed.pp | 13 ++++++++
+ 9 files changed, 119 insertions(+), 12 deletions(-)
+ create mode 100644 deployment/puppet/cobbler/templates/efidefault.template.erb
+ create mode 100644 deployment/puppet/cobbler/templates/grubprofile.template.erb
+ create mode 100644 deployment/puppet/cobbler/templates/grubsystem.template.erb
+ create mode 100644 deployment/puppet/nailgun/manifests/cobbler/preseed.pp
+
+diff --git a/deployment/puppet/cobbler/manifests/server.pp b/deployment/puppet/cobbler/manifests/server.pp
+index bdb1ae7..0523404 100644
+--- a/deployment/puppet/cobbler/manifests/server.pp
++++ b/deployment/puppet/cobbler/manifests/server.pp
+@@ -288,6 +288,33 @@ class cobbler::server (
+ notify => [Service[$cobbler_service], Exec['cobbler_sync']],
+ }
+
++ file { '/etc/cobbler/pxe/efidefault.template':
++ content => template('cobbler/efidefault.template.erb'),
++ owner => 'root',
++ group => 'root',
++ mode => '0644',
++ require => Package[$cobbler::packages::cobbler_package],
++ notify => [Service[$cobbler_service], Exec['cobbler_sync']],
++ }
++
++ file { '/etc/cobbler/pxe/grubprofile.template':
++ content => template('cobbler/grubprofile.template.erb'),
++ owner => 'root',
++ group => 'root',
++ mode => '0644',
++ require => Package[$cobbler::packages::cobbler_package],
++ notify => [Service[$cobbler_service], Exec['cobbler_sync']],
++ }
++
++ file { '/etc/cobbler/pxe/grubsystem.template':
++ content => template('cobbler/grubsystem.template.erb'),
++ owner => 'root',
++ group => 'root',
++ mode => '0644',
++ require => Package[$cobbler::packages::cobbler_package],
++ notify => [Service[$cobbler_service], Exec['cobbler_sync']],
++ }
++
+ exec { '/var/lib/tftpboot/chain.c32':
+ command => 'cp /usr/share/syslinux/chain.c32 /var/lib/tftpboot/chain.c32',
+ unless => 'test -e /var/lib/tftpboot/chain.c32',
+diff --git a/deployment/puppet/cobbler/templates/dnsmasq.template.erb b/deployment/puppet/cobbler/templates/dnsmasq.template.erb
+index 3a96ac1..8d3e753 100644
+--- a/deployment/puppet/cobbler/templates/dnsmasq.template.erb
++++ b/deployment/puppet/cobbler/templates/dnsmasq.template.erb
+@@ -33,5 +33,7 @@ dhcp-no-override
+ # by assigning IPs one by one instead of using hash algorithm.
+ dhcp-sequential-ip
+
++dhcp-match=set:arm64,93,11
++dhcp-boot=net:arm64,grub/grub-aarch64.efi,boothost,<%= @next_server %>
+ dhcp-option=6,<%= @name_server %>
+ $insert_cobbler_system_definitions
+diff --git a/deployment/puppet/cobbler/templates/efidefault.template.erb b/deployment/puppet/cobbler/templates/efidefault.template.erb
+new file mode 100644
+index 0000000..af09eb8
+--- /dev/null
++++ b/deployment/puppet/cobbler/templates/efidefault.template.erb
+@@ -0,0 +1,5 @@
++set default=1
++set timeout=5
++tr -s ipxe_mac ':' '-' $net_default_mac
++
++$grub_menu_items
+diff --git a/deployment/puppet/cobbler/templates/grubprofile.template.erb b/deployment/puppet/cobbler/templates/grubprofile.template.erb
+new file mode 100644
+index 0000000..9a191bc
+--- /dev/null
++++ b/deployment/puppet/cobbler/templates/grubprofile.template.erb
+@@ -0,0 +1,16 @@
++set default=1
++set timeout=5
++tr -s ipxe_mac ':' '-' $net_default_mac
++
++menuentry '$profile_name' {
++ echo 'Network status:'
++ net_ls_cards
++ net_ls_addr
++ net_ls_routes
++
++ echo 'Loading Linux ...'
++ linux (tftp)$kernel_path $kernel_options BOOTIF=01-$ipxe_mac
++ echo 'Loading initial ramdisk ...'
++ initrd (tftp)$initrd_path
++ echo 'Booting bootstrap image ...'
++}
+diff --git a/deployment/puppet/cobbler/templates/grubsystem.template.erb b/deployment/puppet/cobbler/templates/grubsystem.template.erb
+new file mode 100644
+index 0000000..9a191bc
+--- /dev/null
++++ b/deployment/puppet/cobbler/templates/grubsystem.template.erb
+@@ -0,0 +1,16 @@
++set default=1
++set timeout=5
++tr -s ipxe_mac ':' '-' $net_default_mac
++
++menuentry '$profile_name' {
++ echo 'Network status:'
++ net_ls_cards
++ net_ls_addr
++ net_ls_routes
++
++ echo 'Loading Linux ...'
++ linux (tftp)$kernel_path $kernel_options BOOTIF=01-$ipxe_mac
++ echo 'Loading initial ramdisk ...'
++ initrd (tftp)$initrd_path
++ echo 'Booting bootstrap image ...'
++}
+diff --git a/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb b/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb
+index fd6dda3..65c6c69 100644
+--- a/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb
++++ b/deployment/puppet/cobbler/templates/preseed/ubuntu-1404.preseed.erb
+@@ -66,9 +66,11 @@ d-i apt-setup/mirror/error select Retry
+ # Use network mirror
+ d-i apt-setup/use_mirror boolean true
+
++<% if @arch == 'amd64' %>
+ # Select architecture to amd64. That's very important to dpkg, since
+ # by default we have both amd64 and i386.
+ d-i apt-setup/multiarch string amd64
++<% end %>
+
+ # You can choose to install restricted and universe software, or to install
+ # software from the backports repository.
+diff --git a/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp b/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp
+index 41a2570..720943d 100644
+--- a/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp
++++ b/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp
+@@ -48,17 +48,21 @@ class nailgun::auxiliaryrepos(
+
+ exec { 'create_ubuntu_repo_dirs':
+ path => '/bin:/sbin:/usr/bin:/usr/sbin',
+- command => "bash -c \"mkdir -p ${ubuntu_dir}/pool/{main,restricted} ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-amd64/\"",
++ command => "bash -c \"mkdir -p ${ubuntu_dir}/pool/{main,restricted} ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-{amd64,arm64}/\"",
+ unless => "test -d ${ubuntu_dir}/pool && \
+ test -d ${ubuntu_dir}/dists/auxiliary/main/binary-amd64 && \
+- test -d ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64",
++ test -d ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64 && \
++ test -d ${ubuntu_dir}/dists/auxiliary/main/binary-arm64 && \
++ test -d ${ubuntu_dir}/dists/auxiliary/restricted/binary-arm64",
+ }
+
+ exec { 'create_ubuntu_repo_Packages':
+ path => '/bin:/sbin:/usr/bin:/usr/sbin',
+- command => "bash -c \"touch ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-amd64/Packages\"",
++ command => "bash -c \"touch ${ubuntu_dir}/dists/auxiliary/{main,restricted}/binary-{amd64,arm64}/Packages\"",
+ unless => "test -f ${ubuntu_dir}/dists/auxiliary/main/binary-amd64/Packages && \
+- test -f ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64/Packages",
++ test -f ${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64/Packages && \
++ test -f ${ubuntu_dir}/dists/auxiliary/main/binary-arm64/Packages && \
++ test -f ${ubuntu_dir}/dists/auxiliary/restricted/binary-arm64/Packages",
+ }
+
+ file { $release_files:
+diff --git a/deployment/puppet/nailgun/manifests/cobbler.pp b/deployment/puppet/nailgun/manifests/cobbler.pp
+index a11498c..95a9497 100644
+--- a/deployment/puppet/nailgun/manifests/cobbler.pp
++++ b/deployment/puppet/nailgun/manifests/cobbler.pp
+@@ -43,7 +43,7 @@ class nailgun::cobbler(
+ $bootstrap_profile = $bootstrap_flavor ? {
+ /(?i)centos/ => 'bootstrap',
+ /(?i)ubuntu/ => 'ubuntu_bootstrap',
+- default => 'bootstrap',
++ default => 'ubuntu_bootstrap',
+ }
+
+ if $::osfamily == 'RedHat' {
+@@ -133,12 +133,9 @@ class nailgun::cobbler(
+ require => Class['::cobbler::server'],
+ }
+
+- file { '/var/lib/cobbler/kickstarts/ubuntu-amd64.preseed':
+- content => template('cobbler/preseed/ubuntu-1404.preseed.erb'),
+- owner => 'root',
+- group => 'root',
+- mode => '0644',
+- require => Class['::cobbler::server'],
++ nailgun::cobbler::preseed { 'ubuntu_1404_x86_64.preseed':
++ path =>'/var/lib/cobbler/kickstarts/ubuntu-amd64.preseed',
++ arch => "amd64",
+ } ->
+
+ cobbler_distro { 'ubuntu_1404_x86_64':
+@@ -151,6 +148,21 @@ class nailgun::cobbler(
+ require => Class['::cobbler::server'],
+ }
+
++ nailgun::cobbler::preseed { 'ubuntu_1404_arm64.preseed':
++ path => '/var/lib/cobbler/kickstarts/ubuntu-arm64.preseed',
++ arch => "arm64",
++ } ->
++
++ cobbler_distro { 'ubuntu_1404_arm64':
++ kernel => "${repo_root}/ubuntu/x86_64/images/linux",
++ initrd => "${repo_root}/ubuntu/x86_64/images/initrd.gz",
++ arch => 'x86_64', # Makes Cobbler choose PXE
++ breed => 'ubuntu',
++ osversion => 'trusty',
++ ksmeta => '',
++ require => Class['::cobbler::server'],
++ }
++
+ cobbler_profile { 'centos-x86_64':
+ kickstart => '/var/lib/cobbler/kickstarts/centos-x86_64.ks',
+ kopts => 'biosdevname=0 sshd=1 dhcptimeout=120',
+@@ -171,6 +183,16 @@ class nailgun::cobbler(
+ require => Cobbler_distro['ubuntu_1404_x86_64'],
+ }
+
++ cobbler_profile { 'ubuntu_1404_arm64':
++ kickstart => '/var/lib/cobbler/kickstarts/ubuntu-arm64.preseed',
++ kopts => 'console=ttyAMA0,115200 console=ttyS0,115200 net.ifnames=0 biosdevname=0 netcfg/choose_interface=eth0 netcfg/dhcp_timeout=120 netcfg/link_detection_timeout=20',
++ distro => 'ubuntu_1404_arm64',
++ ksmeta => '',
++ menu => false,
++ server => $real_server,
++ require => Cobbler_distro['ubuntu_1404_arm64'],
++ }
++
+ cobbler_distro { 'bootstrap':
+ kernel => "${repo_root}/bootstrap/linux",
+ initrd => "${repo_root}/bootstrap/initramfs.img",
+@@ -205,7 +227,7 @@ class nailgun::cobbler(
+ distro => 'ubuntu_bootstrap',
+ menu => true,
+ kickstart => '',
+- kopts => extend_kopts($bootstrap_meta['extend_kopts'], "console=ttyS0,9600 console=tty0 panic=60 ethdevice-timeout=${bootstrap_ethdevice_timeout} boot=live toram components fetch=http://${server}:8080/bootstraps/active_bootstrap/root.squashfs biosdevname=0 url=${nailgun_api_url} mco_user=${mco_user} mco_pass=${mco_pass}"),
++ kopts => extend_kopts($bootstrap_meta['extend_kopts'], "console=ttyAMA0,115200 console=ttyS0,115200 panic=60 ethdevice-timeout=${bootstrap_ethdevice_timeout} boot=live toram components fetch=http://${server}:8080/bootstraps/active_bootstrap/root.squashfs biosdevname=0 url=${nailgun_api_url} mco_user=${mco_user} mco_pass=${mco_pass}"),
+ ksmeta => '',
+ server => $real_server,
+ require => Cobbler_distro['ubuntu_bootstrap'],
+diff --git a/deployment/puppet/nailgun/manifests/cobbler/preseed.pp b/deployment/puppet/nailgun/manifests/cobbler/preseed.pp
+new file mode 100644
+index 0000000..93c71ba
+--- /dev/null
++++ b/deployment/puppet/nailgun/manifests/cobbler/preseed.pp
+@@ -0,0 +1,13 @@
++define nailgun::cobbler::preseed(
++ $path,
++ $arch = "amd64",
++) {
++
++ file { $path:
++ content => template('cobbler/preseed/ubuntu-1404.preseed.erb'),
++ owner => 'root',
++ group => 'root',
++ mode => '0644',
++ require => Class['::cobbler::server'],
++ }
++}
+--
+1.9.1
+
diff --git a/patches/fuel-library/0002-Add-arm64-for-auxiliary-repos.patch b/patches/fuel-library/0002-Add-arm64-for-auxiliary-repos.patch
new file mode 100644
index 00000000..0bf54a2c
--- /dev/null
+++ b/patches/fuel-library/0002-Add-arm64-for-auxiliary-repos.patch
@@ -0,0 +1,39 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 24 Feb 2016 20:05:25 +0100
+Subject: [PATCH] Add arm64 for auxiliary repos
+
+---
+ deployment/puppet/nailgun/files/Release-auxiliary | 2 +-
+ deployment/puppet/nailgun/manifests/auxiliaryrepos.pp | 4 +++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/deployment/puppet/nailgun/files/Release-auxiliary b/deployment/puppet/nailgun/files/Release-auxiliary
+index 2d5ce58..03f84b8 100644
+--- a/deployment/puppet/nailgun/files/Release-auxiliary
++++ b/deployment/puppet/nailgun/files/Release-auxiliary
+@@ -3,6 +3,6 @@ Label: auxiliary
+ Suite: auxiliary
+ Codename: auxiliary
+ Date: Mon, 15 Apr 2015 00:00:01 UTC
+-Architectures: amd64
++Architectures: amd64 arm64
+ Components: main restricted
+ Description: Auxiliary
+diff --git a/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp b/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp
+index 720943d..91adb3e 100644
+--- a/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp
++++ b/deployment/puppet/nailgun/manifests/auxiliaryrepos.pp
+@@ -40,7 +40,9 @@ class nailgun::auxiliaryrepos(
+ $release_files = [
+ "${ubuntu_dir}/dists/auxiliary/Release",
+ "${ubuntu_dir}/dists/auxiliary/main/binary-amd64/Release",
+- "${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64/Release"]
++ "${ubuntu_dir}/dists/auxiliary/restricted/binary-amd64/Release",
++ "${ubuntu_dir}/dists/auxiliary/main/binary-arm64/Release",
++ "${ubuntu_dir}/dists/auxiliary/restricted/binary-arm64/Release"]
+
+ Exec['create_ubuntu_repo_dirs'] ->
+ Exec['create_ubuntu_repo_Packages'] ->
+--
+1.9.1
+
diff --git a/patches/fuel-library/0003-Make-qemu-kvm-architecture-aware.patch b/patches/fuel-library/0003-Make-qemu-kvm-architecture-aware.patch
new file mode 100644
index 00000000..00cd3c7a
--- /dev/null
+++ b/patches/fuel-library/0003-Make-qemu-kvm-architecture-aware.patch
@@ -0,0 +1,33 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 24 Feb 2016 20:07:06 +0100
+Subject: [PATCH] Make qemu-kvm architecture aware
+
+---
+ deployment/puppet/openstack/manifests/compute.pp | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/deployment/puppet/openstack/manifests/compute.pp b/deployment/puppet/openstack/manifests/compute.pp
+index b2339bc..4f380b8 100644
+--- a/deployment/puppet/openstack/manifests/compute.pp
++++ b/deployment/puppet/openstack/manifests/compute.pp
+@@ -169,10 +169,15 @@ class openstack::compute (
+ before => Augeas['libvirt-conf'],
+ }
+
++ # Guard against some exotic distros with their `uname -m`
++ $arch = $::architecture ? {
++ 'arm64', 'aarch64' => 'aarch64',
++ default => 'x86_64',
++ }
+ # From legacy libvirt.pp
+ exec { 'symlink-qemu-kvm':
+- command => '/bin/ln -sf /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64',
+- creates => '/usr/bin/qemu-system-x86_64',
++ command => "/bin/ln -sf /usr/libexec/qemu-kvm /usr/bin/qemu-system-${arch}",
++ creates => "/usr/bin/qemu-system-${arch}",
+ }
+
+ package { 'avahi':
+--
+1.9.1
+
diff --git a/patches/fuel-library/0004-Make-TestVM-creation-architecture-aware.patch b/patches/fuel-library/0004-Make-TestVM-creation-architecture-aware.patch
new file mode 100644
index 00000000..0ea66f66
--- /dev/null
+++ b/patches/fuel-library/0004-Make-TestVM-creation-architecture-aware.patch
@@ -0,0 +1,122 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 24 Feb 2016 20:08:24 +0100
+Subject: [PATCH] Make TestVM creation architecture aware
+
+This depends on cirros-testvm package to contain both amd64 and arm64
+images.
+---
+ deployment/puppet/openstack/manifests/img/cirros.pp | 8 ++++++--
+ .../puppet/osnailyfacter/modular/generate_vms/generate_vms.pp | 11 +++++++++++
+ deployment/puppet/osnailyfacter/templates/vm_libvirt.erb | 5 ++++-
+ files/fuel-migrate/fuel-migrate | 5 ++++-
+ 4 files changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/deployment/puppet/openstack/manifests/img/cirros.pp b/deployment/puppet/openstack/manifests/img/cirros.pp
+index 84e202e..57ae256 100644
+--- a/deployment/puppet/openstack/manifests/img/cirros.pp
++++ b/deployment/puppet/openstack/manifests/img/cirros.pp
+@@ -9,6 +9,10 @@ class openstack::img::cirros (
+ $img_name = 'cirros',
+ $os_name = 'cirros',
+ ) {
++ $arch = $::architecture ? {
++ 'arm64', 'aarch64' => 'aarch64',
++ default => 'x86_64',
++ }
+
+ package { 'cirros-testvm':
+ ensure => "present"
+@@ -17,14 +21,14 @@ class openstack::img::cirros (
+ case $::osfamily {
+ 'RedHat': {
+ exec { 'upload-img':
+- command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /opt/vm/cirros-x86_64-disk.img",
++ command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /opt/vm/cirros-${arch}-disk.img",
+ unless => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index && (/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index | grep ${img_name})",
+
+ }
+ }
+ 'Debian': {
+ exec { 'upload-img':
+- command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /usr/share/cirros-testvm/cirros-x86_64-disk.img",
++ command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /usr/share/cirros-testvm/cirros-${arch}-disk.img",
+ unless => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index && (/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index | grep ${img_name})",
+
+ }
+diff --git a/deployment/puppet/osnailyfacter/modular/generate_vms/generate_vms.pp b/deployment/puppet/osnailyfacter/modular/generate_vms/generate_vms.pp
+index 6d5426a..da5954e 100644
+--- a/deployment/puppet/osnailyfacter/modular/generate_vms/generate_vms.pp
++++ b/deployment/puppet/osnailyfacter/modular/generate_vms/generate_vms.pp
+@@ -11,6 +11,17 @@ define vm_config {
+ $details = $name
+ $id = $details['id']
+
++ case $::architecture {
++ 'arm64', 'aarch64': {
++ $machine_arch = 'aarch64'
++ $machine_type = 'virt'
++ }
++ default: {
++ $machine_arch = 'x86_64'
++ $machine_type = 'pc-i440fx-trusty'
++ }
++ }
++
+ file { "${template_dir}/template_${id}_vm.xml":
+ owner => 'root',
+ group => 'root',
+diff --git a/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb b/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb
+index ae2ba5b..decf3ab 100644
+--- a/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb
++++ b/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb
+@@ -3,7 +3,7 @@
+ <memory unit='GiB'><%= @details['mem'] %></memory>
+ <vcpu placement='static'><%= @details['cpu'] %></vcpu>
+ <os>
+- <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
++ <type arch='<%= @machine_arch %>' machine='<%= @machine_type %>'>hvm</type>
+ <boot dev='network'/>
+ <boot dev='hd'/>
+ </os>
+@@ -11,6 +11,9 @@
+ <acpi/>
+ <apic/>
+ <pae/>
++ <% if $machine_arch == 'arm64' { %>
++ <gic version='3' />
++ <% } %>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+diff --git a/files/fuel-migrate/fuel-migrate b/files/fuel-migrate/fuel-migrate
+index fad9436..667d4a7 100755
+--- a/files/fuel-migrate/fuel-migrate
++++ b/files/fuel-migrate/fuel-migrate
+@@ -175,6 +175,8 @@ create_vm(){
+ exit 1
+ fi
+ fi
++ # figure out atchitecture of the destination
++ arch="$(virsh -c "${dkvm_uri}" nodeinfo | awk '/CPU model:/ { print $3}')"
+ # create disk
+ ssh "${dkvm_ip}" qemu-img create -f raw "${dkvm_folder}/${fvm_name}.img" "${fvm_disk_size}"
+ # make template for virsh
+@@ -184,13 +186,14 @@ create_vm(){
+ <memory unit='MiB'>${fvm_ram}</memory>
+ <vcpu >${fvm_cpu}</vcpu>
+ <os>
+- <type arch='x86_64' >hvm</type>
++ <type arch='${arch}' >hvm</type>
+ <boot dev='hd'/>
+ <boot dev='network'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
++ ${arch/aarch64/<gic version='3'\/>}
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+--
+1.9.1
+
diff --git a/patches/fuel-main/0001-Use-qemu-debootstrap-to-support-multi-arch.patch b/patches/fuel-main/0001-Use-qemu-debootstrap-to-support-multi-arch.patch
new file mode 100644
index 00000000..8b5e38d7
--- /dev/null
+++ b/patches/fuel-main/0001-Use-qemu-debootstrap-to-support-multi-arch.patch
@@ -0,0 +1,53 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Thu, 25 Feb 2016 13:31:19 +0100
+Subject: [PATCH] Use qemu-debootstrap to support multi-arch
+
+---
+ prepare-build-env.sh | 2 +-
+ requirements-rpm.txt | 1 +
+ sandbox.mk | 4 ++--
+ 3 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/prepare-build-env.sh b/prepare-build-env.sh
+index 194e528..fa186ed 100755
+--- a/prepare-build-env.sh
++++ b/prepare-build-env.sh
+@@ -112,7 +112,7 @@ sudo apt-get -y install build-essential make git $GEMPKG debootstrap createrepo
+ python-nose libvirt-bin python-ipaddr python-paramiko python-yaml \
+ python-pip kpartx extlinux unzip genisoimage syslinux debmirror \
+ lrzip python-daemon python-dev libparse-debcontrol-perl reprepro devscripts \
+- xorriso
++ xorriso qemu-user-static
+ sudo gem install bundler -v 1.2.1
+ sudo gem install builder
+ sudo pip install xmlbuilder jinja2 pbr
+diff --git a/requirements-rpm.txt b/requirements-rpm.txt
+index e0aa9ba..9a2d141 100644
+--- a/requirements-rpm.txt
++++ b/requirements-rpm.txt
+@@ -202,6 +202,7 @@ python-yaql
+ pytz
+ PyYAML
+ qemu-img
++qemu-user-static
+ rabbitmq-server
+ rpm
+ rpm-build
+diff --git a/sandbox.mk b/sandbox.mk
+index 3c65cc6..cf3704b 100644
+--- a/sandbox.mk
++++ b/sandbox.mk
+@@ -182,8 +182,8 @@ mkdir -p $(SANDBOX_UBUNTU)/etc/init.d
+ touch $(SANDBOX_UBUNTU)/etc/init.d/.legacy-bootordering
+ mkdir -p $(SANDBOX_UBUNTU)/usr/sbin
+ cp -a $(BUILD_DIR)/policy-rc.d $(SANDBOX_UBUNTU)/usr/sbin
+-echo "Running debootstrap"
+-sudo debootstrap --no-check-gpg --include=ca-certificates --arch=$(UBUNTU_ARCH) $(MIRROR_UBUNTU_SUITE) $(SANDBOX_UBUNTU) $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT)
++echo "Running qemu-debootstrap"
++sudo qemu-debootstrap --no-check-gpg --include=ca-certificates --arch=$(UBUNTU_ARCH) $(MIRROR_UBUNTU_SUITE) $(SANDBOX_UBUNTU) $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT)
+ if [ -e $(SANDBOX_UBUNTU)/etc/resolv.conf ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf.orig; fi
+ sudo cp /etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf
+ if [ -e $(SANDBOX_UBUNTU)/etc/hosts ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/hosts $(SANDBOX_UBUNTU)/etc/hosts.orig; fi
+--
+1.9.1
+
diff --git a/patches/fuel-main/0002-Allow-multi-arch-debian-mirrors.patch b/patches/fuel-main/0002-Allow-multi-arch-debian-mirrors.patch
new file mode 100644
index 00000000..d95abcac
--- /dev/null
+++ b/patches/fuel-main/0002-Allow-multi-arch-debian-mirrors.patch
@@ -0,0 +1,45 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Thu, 25 Feb 2016 23:58:58 +0100
+Subject: [PATCH] Allow multi-arch debian mirrors
+
+This patch allows specifying multiple architectures via UBUNTU_ARCH in
+form of a list of space separated architectures. The first architecture
+in the list is considered primary and will be used for building all the
+deb packages by fuel-main. Additional architectures are added to allow
+targets of other architectures to use the mirror.
+NOTE: this imposes a requirement that all packages built are arch
+independent (which is true so far).
+---
+ mirror/ubuntu/module.mk | 2 +-
+ sandbox.mk | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mirror/ubuntu/module.mk b/mirror/ubuntu/module.mk
+index 7a9466e..fe1ada2 100644
+--- a/mirror/ubuntu/module.mk
++++ b/mirror/ubuntu/module.mk
+@@ -81,7 +81,7 @@ $(BUILD_DIR)/mirror/ubuntu/mirror.done:
+ --root=$(MIRROR_MOS_UBUNTU_ROOT) \
+ --dist=$(MIRROR_MOS_UBUNTU_SUITE) \
+ --section=$(subst $(space),$(comma),$(MIRROR_MOS_UBUNTU_SECTION)) \
+- --arch=$(UBUNTU_ARCH) \
++ --arch=$(shell echo $(UBUNTU_ARCH) | tr ' ' ',') \
+ $(LOCAL_MIRROR_UBUNTU)/
+ rm -rf $(LOCAL_MIRROR_UBUNTU)/.temp $(LOCAL_MIRROR_UBUNTU)/project
+ $(ACTION.TOUCH)
+diff --git a/sandbox.mk b/sandbox.mk
+index cf3704b..18757a1 100644
+--- a/sandbox.mk
++++ b/sandbox.mk
+@@ -183,7 +183,7 @@ touch $(SANDBOX_UBUNTU)/etc/init.d/.legacy-bootordering
+ mkdir -p $(SANDBOX_UBUNTU)/usr/sbin
+ cp -a $(BUILD_DIR)/policy-rc.d $(SANDBOX_UBUNTU)/usr/sbin
+ echo "Running qemu-debootstrap"
+-sudo qemu-debootstrap --no-check-gpg --include=ca-certificates --arch=$(UBUNTU_ARCH) $(MIRROR_UBUNTU_SUITE) $(SANDBOX_UBUNTU) $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT)
++sudo qemu-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)
+ if [ -e $(SANDBOX_UBUNTU)/etc/resolv.conf ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf.orig; fi
+ sudo cp /etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf
+ if [ -e $(SANDBOX_UBUNTU)/etc/hosts ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/hosts $(SANDBOX_UBUNTU)/etc/hosts.orig; fi
+--
+1.9.1
+
diff --git a/patches/fuel-main/0003-Follow-redirects.patch b/patches/fuel-main/0003-Follow-redirects.patch
new file mode 100644
index 00000000..3d1d1b8b
--- /dev/null
+++ b/patches/fuel-main/0003-Follow-redirects.patch
@@ -0,0 +1,24 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Tue, 1 Mar 2016 09:35:24 +0100
+Subject: [PATCH] Follow redirects
+
+---
+ config.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config.mk b/config.mk
+index ae4766b..2a99278 100644
+--- a/config.mk
++++ b/config.mk
+@@ -271,7 +271,7 @@ USE_PREDEFINED_FUEL_LIB_PUPPET_MODULES?=
+
+ # If the URL given ended with target.txt then is't a pointer to a snapshot that
+ # should be unlinked. If it is not - return it as is.
+-expand_repo_url=$(shell url=$1; echo $${url} | grep -q -e '.*\.target\.txt$$' && echo "$${url%/*}/$$(curl -sSf $$url | head -1)/x86_64/" || echo $${url})
++expand_repo_url=$(shell url=$1; echo $${url} | grep -q -e '.*\.target\.txt$$' && echo "$${url%/*}/$$(curl -sSfL $$url | head -1)/x86_64/" || echo $${url})
+
+ # Expand repo URLs now
+ #MIRROR_CENTOS:=$(call expand_repo_url,$(MIRROR_CENTOS))
+--
+1.9.1
+
diff --git a/patches/fuel-main/0004-Add-apt-https-support-package-to-sandbox.patch b/patches/fuel-main/0004-Add-apt-https-support-package-to-sandbox.patch
new file mode 100644
index 00000000..da08ff80
--- /dev/null
+++ b/patches/fuel-main/0004-Add-apt-https-support-package-to-sandbox.patch
@@ -0,0 +1,24 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Tue, 1 Mar 2016 11:06:32 +0100
+Subject: [PATCH] Add apt https support package to sandbox
+
+---
+ sandbox.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sandbox.mk b/sandbox.mk
+index 18757a1..c450d19 100644
+--- a/sandbox.mk
++++ b/sandbox.mk
+@@ -183,7 +183,7 @@ touch $(SANDBOX_UBUNTU)/etc/init.d/.legacy-bootordering
+ mkdir -p $(SANDBOX_UBUNTU)/usr/sbin
+ cp -a $(BUILD_DIR)/policy-rc.d $(SANDBOX_UBUNTU)/usr/sbin
+ echo "Running qemu-debootstrap"
+-sudo qemu-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)
++sudo qemu-debootstrap --no-check-gpg --include=ca-certificates,apt-transport-https --arch=$(word 1,$(UBUNTU_ARCH)) $(MIRROR_UBUNTU_SUITE) $(SANDBOX_UBUNTU) $(MIRROR_UBUNTU_METHOD)://$(MIRROR_UBUNTU)$(MIRROR_UBUNTU_ROOT)
+ if [ -e $(SANDBOX_UBUNTU)/etc/resolv.conf ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf.orig; fi
+ sudo cp /etc/resolv.conf $(SANDBOX_UBUNTU)/etc/resolv.conf
+ if [ -e $(SANDBOX_UBUNTU)/etc/hosts ]; then sudo cp -a $(SANDBOX_UBUNTU)/etc/hosts $(SANDBOX_UBUNTU)/etc/hosts.orig; fi
+--
+1.9.1
+
diff --git a/patches/fuel-main/0005-Make-cpio-accept-symlinks.patch b/patches/fuel-main/0005-Make-cpio-accept-symlinks.patch
new file mode 100644
index 00000000..269eb907
--- /dev/null
+++ b/patches/fuel-main/0005-Make-cpio-accept-symlinks.patch
@@ -0,0 +1,30 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 2 Mar 2016 10:04:32 +0100
+Subject: [PATCH] Make cpio accept symlinks
+
+---
+ bootstrap/module.mk | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/bootstrap/module.mk b/bootstrap/module.mk
+index cb09691..3f28172 100644
+--- a/bootstrap/module.mk
++++ b/bootstrap/module.mk
+@@ -230,11 +230,11 @@ $(BUILD_DIR)/bootstrap/prepare-initram-root.done: \
+
+ # Installing kernel modules
+ find $(LOCAL_MIRROR_CENTOS_OS_BASEURL) -name '$(KERNEL_PATTERN)' | xargs rpm2cpio | \
+- ( cd $(INITRAMROOT); sudo cpio -idm './lib/modules/*' './boot/vmlinuz*' )
++ ( cd $(INITRAMROOT); sudo cpio --extract-over-symlinks -idm './lib/modules/*' './boot/vmlinuz*' )
+ find $(LOCAL_MIRROR_CENTOS_OS_BASEURL) -name '$(KERNEL_FIRMWARE_PATTERN)' | xargs rpm2cpio | \
+- ( cd $(INITRAMROOT); sudo cpio -idm './lib/firmware/*' )
++ ( cd $(INITRAMROOT); sudo cpio --extract-over-symlinks -idm './lib/firmware/*' )
+ find $(LOCAL_MIRROR_CENTOS_OS_BASEURL) -name 'libmlx4*' | xargs rpm2cpio | \
+- ( cd $(INITRAMROOT); sudo cpio -idm './etc/*' './usr/lib64/*' )
++ ( cd $(INITRAMROOT); sudo cpio --extract-over-symlinks -idm './etc/*' './usr/lib64/*' )
+ for version in `ls -1 $(INITRAMROOT)/lib/modules`; do \
+ sudo depmod -b $(INITRAMROOT) $$version; \
+ done
+--
+1.9.1
+
diff --git a/patches/fuel-main/0006-Add-cobbler-grub-aarch64-RPM-reinstall-to-start.sh.patch b/patches/fuel-main/0006-Add-cobbler-grub-aarch64-RPM-reinstall-to-start.sh.patch
new file mode 100644
index 00000000..0fafba2f
--- /dev/null
+++ b/patches/fuel-main/0006-Add-cobbler-grub-aarch64-RPM-reinstall-to-start.sh.patch
@@ -0,0 +1,42 @@
+From: Florin Dumitrascu <florin.dumitrascu@enea.com>
+Date: Fri, 4 Mar 2016 17:19:41 +0100
+Subject: [PATCH] Add cobbler-grub-aarch64 RPM reinstall to start.sh
+
+Because /var/lib/cobbler is mounted as a volume, new cobbler aarch64
+grub loader packaged as an RPM (cobbler-grub-aarch64) should be
+reinstalled if its files are missing on Docker container start.
+---
+ docker/cobbler/setup.sh | 2 +-
+ docker/cobbler/start.sh | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/docker/cobbler/setup.sh b/docker/cobbler/setup.sh
+index a7fce0c..90627a8 100644
+--- a/docker/cobbler/setup.sh
++++ b/docker/cobbler/setup.sh
+@@ -31,7 +31,7 @@ yum update -y
+
+ ln -s /etc/dnsmasq.conf /etc/cobbler.dnsmasq.conf
+
+-packages="httpd cobbler dnsmasq xinetd tftp-server"
++packages="httpd cobbler cobbler-grub-aarch64 dnsmasq xinetd tftp-server"
+ echo $packages | xargs -n1 yum install -y
+
+
+diff --git a/docker/cobbler/start.sh b/docker/cobbler/start.sh
+index 3c5d411..c1a359b 100644
+--- a/docker/cobbler/start.sh
++++ b/docker/cobbler/start.sh
+@@ -18,6 +18,9 @@ fi
+ if rpm -V cobbler-web | grep -q missing; then
+ yum reinstall -q -y cobbler-web
+ fi
++if rpm -V cobbler-grub-aarch64 | grep -q missing; then
++ yum reinstall -q -y cobbler-grub-aarch64
++fi
+
+
+ # Run puppet to apply custom config
+--
+1.9.1
+
diff --git a/patches/fuel-mirror/0001-Set-mos-ubuntu-base-URL-to-linux.enea.com.patch b/patches/fuel-mirror/0001-Set-mos-ubuntu-base-URL-to-linux.enea.com.patch
new file mode 100644
index 00000000..544172f7
--- /dev/null
+++ b/patches/fuel-mirror/0001-Set-mos-ubuntu-base-URL-to-linux.enea.com.patch
@@ -0,0 +1,24 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Fri, 4 Mar 2016 00:51:40 +0100
+Subject: [PATCH] Set mos-ubuntu base URL to linux.enea.com.
+
+Contents of amd64 mos-ubuntu repos should be in sync with arm64.
+---
+ contrib/fuel_mirror/data/ubuntu.yaml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/contrib/fuel_mirror/data/ubuntu.yaml b/contrib/fuel_mirror/data/ubuntu.yaml
+index 5ce288e..9a22ef4 100644
+--- a/contrib/fuel_mirror/data/ubuntu.yaml
++++ b/contrib/fuel_mirror/data/ubuntu.yaml
+@@ -1,6 +1,6 @@
+ # GLOBAL variables
+ ubuntu_baseurl: &ubuntu_baseurl http://archive.ubuntu.com/ubuntu
+-mos_baseurl: &mos_baseurl http://mirror.fuel-infra.org/mos-repos/ubuntu/$mos_version
++mos_baseurl: &mos_baseurl https://linux.enea.com/mos-repos/ubuntu/$mos_version
+
+ fuel_release_match:
+ version: $openstack_version
+--
+1.9.1
+
diff --git a/patches/fuel-mirror/0002-Add-fuel-agent-dependencies-to-Ubuntu-mirror.patch b/patches/fuel-mirror/0002-Add-fuel-agent-dependencies-to-Ubuntu-mirror.patch
new file mode 100644
index 00000000..acdbe9a2
--- /dev/null
+++ b/patches/fuel-mirror/0002-Add-fuel-agent-dependencies-to-Ubuntu-mirror.patch
@@ -0,0 +1,39 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Fri, 4 Mar 2016 00:59:54 +0100
+Subject: [PATCH] Add fuel-agent dependencies to Ubuntu mirror.
+
+Add qemu-user-static and binfmt-support to the list of packages
+the local mirror of amd64 Ubuntu should contain.
+
+NOTE: This is needed because fuel-agent from upstream mirror does not
+list them as dependencies (not patched for cross-debootstrap).
+
+FIXME: Will building/patching fuel-agent using OPNFV mechanism solve
+missing deps from local mirror too?
+---
+ contrib/fuel_mirror/data/ubuntu.yaml | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/contrib/fuel_mirror/data/ubuntu.yaml b/contrib/fuel_mirror/data/ubuntu.yaml
+index 9a22ef4..1e12508 100644
+--- a/contrib/fuel_mirror/data/ubuntu.yaml
++++ b/contrib/fuel_mirror/data/ubuntu.yaml
+@@ -77,6 +77,7 @@ packages: &packages
+ - "acct"
+ - "bash-completion"
+ - "bc"
++ - "binfmt-support"
+ - "build-essential"
+ - "cloud-init"
+ - "conntrackd"
+@@ -113,6 +114,7 @@ packages: &packages
+ - "puppet"
+ - "python-lesscpy"
+ - "python-pip"
++ - "qemu-user-static"
+ - "rsyslog-gnutls"
+ - "rsyslog-relp"
+ - "screen"
+--
+1.9.1
+
diff --git a/patches/fuel-plugin-ovsnfv/0001-fuel-plugin-Pick-updated-numa.-packages.patch b/patches/fuel-plugin-ovsnfv/0001-fuel-plugin-Pick-updated-numa.-packages.patch
new file mode 100644
index 00000000..bbd90cb8
--- /dev/null
+++ b/patches/fuel-plugin-ovsnfv/0001-fuel-plugin-Pick-updated-numa.-packages.patch
@@ -0,0 +1,36 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Sat, 5 Mar 2016 15:14:41 +0100
+Subject: [PATCH] fuel plugin: Pick updated numa... packages.
+
+Package version 1ubuntu3.14.04.1 of numactl_2.0.9~rc5,
+libnuma1_2.0.9~rc5 and libnuma-dev_2.0.9~rc5 is removed from
+archive.ubuntu.com and replaced with 1ubuntu3.14.04.2.
+
+TODO: This can be modified by using docker/chroot combined with apt-get
+download.
+---
+ fuel-plugin-ovsnfv/ovs_package/ubuntu/dependencies.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/fuel-plugin-ovsnfv/ovs_package/ubuntu/dependencies.txt b/fuel-plugin-ovsnfv/ovs_package/ubuntu/dependencies.txt
+index 7d62008..1766086 100644
+--- a/fuel-plugin-ovsnfv/ovs_package/ubuntu/dependencies.txt
++++ b/fuel-plugin-ovsnfv/ovs_package/ubuntu/dependencies.txt
+@@ -71,11 +71,11 @@ http://archive.ubuntu.com/ubuntu/pool/main/b/bc/bc_1.06.95-8ubuntu1_amd64.deb
+ http://archive.ubuntu.com/ubuntu/pool/main/p/pkg-config/pkg-config_0.26-1ubuntu4_amd64.deb
+ http://archive.ubuntu.com/ubuntu/pool/main/d/dbus/libdbus-1-dev_1.6.18-0ubuntu4.3_amd64.deb
+ http://archive.ubuntu.com/ubuntu/pool/main/p/python-defaults/libpython-dev_2.7.5-5ubuntu3_amd64.deb
+-http://archive.ubuntu.com/ubuntu/pool/universe/n/numactl/numactl_2.0.9~rc5-1ubuntu3.14.04.1_amd64.deb
++http://archive.ubuntu.com/ubuntu/pool/universe/n/numactl/numactl_2.0.9~rc5-1ubuntu3.14.04.2_amd64.deb
+ http://archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7-dev_2.7.6-8ubuntu0.2_amd64.deb
+ http://archive.ubuntu.com/ubuntu/pool/main/p/python-defaults/python-dev_2.7.5-5ubuntu3_amd64.deb
+-http://archive.ubuntu.com/ubuntu/pool/main/n/numactl/libnuma1_2.0.9~rc5-1ubuntu3.14.04.1_amd64.deb
+-http://archive.ubuntu.com/ubuntu/pool/main/n/numactl/libnuma-dev_2.0.9~rc5-1ubuntu3.14.04.1_amd64.deb
++http://archive.ubuntu.com/ubuntu/pool/main/n/numactl/libnuma1_2.0.9~rc5-1ubuntu3.14.04.2_amd64.deb
++http://archive.ubuntu.com/ubuntu/pool/main/n/numactl/libnuma-dev_2.0.9~rc5-1ubuntu3.14.04.2_amd64.deb
+ https://pypi.python.org/packages/source/l/libvirt-python/libvirt-python-1.2.12.tar.gz
+ http://archive.ubuntu.com/ubuntu/pool/main/libg/libgpg-error/libgpg-error-dev_1.12-0.2ubuntu1_amd64.deb
+ http://archive.ubuntu.com/ubuntu/pool/main/libg/libgcrypt11/libgcrypt11-dev_1.5.3-2ubuntu4.3_amd64.deb
+--
+1.9.1
+
diff --git a/patches/fuel-plugin-qemu/0001-Fix-apt-cache-and-qemu-version-handling.patch b/patches/fuel-plugin-qemu/0001-Fix-apt-cache-and-qemu-version-handling.patch
new file mode 100644
index 00000000..208cb93f
--- /dev/null
+++ b/patches/fuel-plugin-qemu/0001-Fix-apt-cache-and-qemu-version-handling.patch
@@ -0,0 +1,31 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Fri, 4 Mar 2016 14:26:43 +0100
+Subject: [PATCH] Fix apt cache and qemu version handling
+
+---
+ qemu/build-qemu.sh | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/qemu/build-qemu.sh b/qemu/build-qemu.sh
+index 652939e..f54f486 100755
+--- a/qemu/build-qemu.sh
++++ b/qemu/build-qemu.sh
+@@ -1,11 +1,12 @@
+ #!/bin/bash
+ wget http://wiki.qemu-project.org/download/qemu-2.2.1.tar.bz2
++sudo apt-get update -y
+ sudo apt-get build-dep qemu -y
+ sudo apt-get install devscripts -y
+ sudo apt-get install dpkg-dev -y
+-apt-get source qemu -y
+-dpkg-source -x qemu_2.0.0+dfsg-2ubuntu1.21.dsc
+-cd qemu-2.0.0+dfsg; uupdate -v 2.2.1 ../qemu-2.2.1.tar.bz2
++apt-get source qemu=2.0.0 -y
++dpkg-source -x qemu_2.0.0*.dsc
++cd qemu-2.0.0*; uupdate -v 2.2.1 ../qemu-2.2.1.tar.bz2
+ cd ../qemu-2.2.1;echo "">> debian/patches/series
+ sed -i 's/seccomp="yes"/seccomp="no"/' configure
+ debian/rules build
+--
+1.9.1
+
diff --git a/patches/fuel-web/0001-Add-arm64-fixture.patch b/patches/fuel-web/0001-Add-arm64-fixture.patch
new file mode 100644
index 00000000..58a64e49
--- /dev/null
+++ b/patches/fuel-web/0001-Add-arm64-fixture.patch
@@ -0,0 +1,118 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Sun, 21 Feb 2016 16:30:43 +0100
+Subject: [PATCH] Add arm64 fixture
+
+---
+ nailgun/nailgun/fixtures/openstack.yaml | 99 +++++++++++++++++++++++++++++++++
+ 1 file changed, 99 insertions(+)
+
+diff --git a/nailgun/nailgun/fixtures/openstack.yaml b/nailgun/nailgun/fixtures/openstack.yaml
+index f9c8ab6..4daa2a2 100644
+--- a/nailgun/nailgun/fixtures/openstack.yaml
++++ b/nailgun/nailgun/fixtures/openstack.yaml
+@@ -2079,3 +2079,102 @@
+ uri: "http://{settings.MASTER_IP}:8080/targetimages/env_{cluster.id}_ubuntu_1404_amd64-boot.img.gz"
+ format: "ext2"
+ container: "gzip"
++- pk: 3
++ extend: *base_release
++ fields:
++ name: "Liberty on Ubuntu 14.04 (aarch64)"
++ version: "liberty-8.0"
++ can_update_from_versions: []
++ operating_system: "Ubuntu"
++ description: "This option will install the OpenStack Liberty packages using Ubuntu as a base operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
++ attributes_metadata:
++ editable:
++ kernel_params:
++ kernel:
++ value: "console=ttyAMA0,115200 console=ttyS0,115200 net.ifnames=0 biosdevname=0 rootdelay=90 nomodeset"
++ repo_setup:
++ metadata:
++ label: "Repositories"
++ weight: 50
++ group: "general"
++ always_editable: true
++ repos:
++ type: "custom_repo_configuration"
++ extra_priority: null
++ description: |
++ Please note: the first repository will be considered the operating system mirror that will be used during node provisioning.
++ To create a local repository mirror on the Fuel master node, please follow the instructions provided by running "fuel-createmirror --help" on the Fuel master node.
++ Please make sure your Fuel master node has Internet access to the repository before attempting to create a mirror.
++ For more details, please refer to the documentation (https://docs.mirantis.com/openstack/fuel/fuel-8.0/operations.html#external-ubuntu-ops).
++ value:
++ # first repository on the list is used for downloading the kernel and initrd
++ - type: "deb"
++ name: "ubuntu"
++ uri: "http://ports.ubuntu.com/"
++ suite: "trusty"
++ section: "main universe multiverse"
++ priority: null
++ - type: "deb"
++ name: "ubuntu-updates"
++ uri: "http://ports.ubuntu.com/"
++ suite: "trusty-updates"
++ section: "main universe multiverse"
++ priority: null
++ - type: "deb"
++ name: "ubuntu-security"
++ uri: "http://ports.ubuntu.com/"
++ suite: "trusty-security"
++ section: "main universe multiverse"
++ priority: null
++ - type: "deb"
++ name: "mos"
++ uri: "http://{settings.MASTER_IP}:8080/{cluster.release.version}/ubuntu/x86_64"
++ suite: "mos8.0"
++ section: "main restricted"
++ priority: 1050
++ - type: "deb"
++ name: "mos-updates"
++ uri: "https://linux.enea.com/mos-repos/ubuntu/{cluster.release.environment_version}/"
++ suite: "mos8.0-updates"
++ section: "main restricted"
++ priority: 1050
++ - type: "deb"
++ name: "mos-security"
++ uri: "https://linux.enea.com/mos-repos/ubuntu/{cluster.release.environment_version}/"
++ suite: "mos8.0-security"
++ section: "main restricted"
++ priority: 1050
++ - type: "deb"
++ name: "mos-holdback"
++ uri: "https://linux.enea.com/mos-repos/ubuntu/{cluster.release.environment_version}/"
++ suite: "mos8.0-holdback"
++ section: "main restricted"
++ priority: 1100
++ - type: "deb"
++ name: "Auxiliary"
++ uri: "http://{settings.MASTER_IP}:8080/{cluster.release.version}/ubuntu/auxiliary"
++ suite: "auxiliary"
++ section: "main restricted"
++ priority: 1150
++ generated:
++ repo_setup:
++ installer_kernel:
++ remote_relative: "dists/trusty/main/installer-arm64/current/images/generic/netboot/vmlinuz"
++ local: "/var/www/nailgun/ubuntu/arm64/images/linux"
++ installer_initrd:
++ remote_relative: "dists/trusty/main/installer-arm64/current/images/generic/netboot/initrd.gz"
++ local: "/var/www/nailgun/ubuntu/arm64/images/initrd.gz"
++ cobbler:
++ profile:
++ generator_arg: "ubuntu_1404_arm64"
++ provision:
++ codename: "trusty"
++ image_data:
++ /:
++ uri: "http://{settings.MASTER_IP}:8080/targetimages/env_{cluster.id}_ubuntu_1404_arm64.img.gz"
++ format: "ext4"
++ container: "gzip"
++ /boot:
++ uri: "http://{settings.MASTER_IP}:8080/targetimages/env_{cluster.id}_ubuntu_1404_arm64-boot.img.gz"
++ format: "ext2"
++ container: "gzip"
+--
+1.9.1
+
diff --git a/patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch b/patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch
new file mode 100644
index 00000000..c5742f01
--- /dev/null
+++ b/patches/fuel-web/0002-Add-arch-to-nailgun-release-and-target-image.patch
@@ -0,0 +1,219 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 24 Feb 2016 20:11:54 +0100
+Subject: [PATCH] Add arch to nailgun release and target image
+
+Thsi is required so that the TestVM image is created using a cirros
+image that is compatible with the architecture of the deployment setup.
+As a bonus, it is also used when building the target image.
+---
+ nailgun/nailgun/consts.py | 5 +++
+ .../alembic_migrations/versions/armband.py | 47 ++++++++++++++++++++++
+ nailgun/nailgun/db/sqlalchemy/models/release.py | 8 ++++
+ nailgun/nailgun/fixtures/openstack.yaml | 3 ++
+ .../nailgun/orchestrator/deployment_serializers.py | 9 ++++-
+ .../orchestrator/provisioning_serializers.py | 3 +-
+ nailgun/nailgun/orchestrator/tasks_templates.py | 5 ++-
+ nailgun/nailgun/test/unit/test_tasks_templates.py | 6 ++-
+ 8 files changed, 80 insertions(+), 6 deletions(-)
+ create mode 100644 nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py
+
+diff --git a/nailgun/nailgun/consts.py b/nailgun/nailgun/consts.py
+index bb69168..2c19ec9 100644
+--- a/nailgun/nailgun/consts.py
++++ b/nailgun/nailgun/consts.py
+@@ -38,6 +38,11 @@ RELEASE_OS = Enum(
+ )
+ )
+
++RELEASE_ARCHS = Enum(
++ 'amd64',
++ 'arm64'
++)
++
+ CLUSTER_MODES = Enum(
+ 'multinode',
+ 'ha_full',
+diff --git a/nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py b/nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py
+new file mode 100644
+index 0000000..8b832df
+--- /dev/null
++++ b/nailgun/nailgun/db/migration/alembic_migrations/versions/armband.py
+@@ -0,0 +1,47 @@
++# Copyright 2016 Mirantis, Inc.
++#
++# Licensed under the Apache License, Version 2.0 (the "License"); you may
++# not use this file except in compliance with the License. You may obtain
++# a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
++# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
++# License for the specific language governing permissions and limitations
++# under the License.
++
++"""Armband patches
++
++Revision ID: f9b7fd91ac19
++Revises: 43b2cb64dae6
++Create Date: 2016-03-01 23:18:58.712617
++
++"""
++
++# revision identifiers, used by Alembic.
++revision = 'f9b7fd91ac19'
++down_revision = '43b2cb64dae6'
++
++from alembic import op
++import sqlalchemy as sa
++from sqlalchemy.dialects import postgresql
++
++ENUMS = (
++ 'release_arch')
++
++def upgrade():
++ add_release_arch()
++
++def downgrade():
++ remove_release_arch()
++ map(drop_enum, ENUMS)
++
++def add_release_arch():
++ arch_enum = sa.Enum('amd64', 'arm64', name='release_arch')
++ arch_enum.create(op.get_bind(), checkfirst=False)
++ op.add_column('releases', sa.Column('arch', arch_enum, nullable=False))
++
++def remove_release_arch():
++ op.drop_column('releases', 'arch')
+diff --git a/nailgun/nailgun/db/sqlalchemy/models/release.py b/nailgun/nailgun/db/sqlalchemy/models/release.py
+index 96cf2ed..62ac2c1 100644
+--- a/nailgun/nailgun/db/sqlalchemy/models/release.py
++++ b/nailgun/nailgun/db/sqlalchemy/models/release.py
+@@ -38,6 +38,14 @@ class Release(Base):
+ id = Column(Integer, primary_key=True)
+ name = Column(Unicode(100), nullable=False)
+ version = Column(String(30), nullable=False)
++ arch = Column(
++ Enum(
++ *consts.RELEASE_ARCHS,
++ name='release_arch'
++ ),
++ nullable=False,
++ default=consts.RELEASE_ARCHS.amd64
++ )
+ can_update_from_versions = Column(JSON, default=[],
+ nullable=False, server_default='[]')
+ description = Column(Unicode)
+diff --git a/nailgun/nailgun/fixtures/openstack.yaml b/nailgun/nailgun/fixtures/openstack.yaml
+index 4daa2a2..733fa0c 100644
+--- a/nailgun/nailgun/fixtures/openstack.yaml
++++ b/nailgun/nailgun/fixtures/openstack.yaml
+@@ -1913,6 +1913,7 @@
+ name: "Liberty on CentOS 6.5"
+ state: "unavailable"
+ version: "liberty-8.0"
++ arch: "amd64"
+ can_update_from_versions: []
+ operating_system: "CentOS"
+ description: "This option will install the OpenStack Liberty packages using a CentOS based operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
+@@ -1986,6 +1987,7 @@
+ fields:
+ name: "Liberty on Ubuntu 14.04"
+ version: "liberty-8.0"
++ arch: "amd64"
+ can_update_from_versions: []
+ operating_system: "Ubuntu"
+ description: "This option will install the OpenStack Liberty packages using Ubuntu as a base operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
+@@ -2084,6 +2086,7 @@
+ fields:
+ name: "Liberty on Ubuntu 14.04 (aarch64)"
+ version: "liberty-8.0"
++ arch: "arm64"
+ can_update_from_versions: []
+ operating_system: "Ubuntu"
+ description: "This option will install the OpenStack Liberty packages using Ubuntu as a base operating system. With high availability features built in, you are getting a robust, enterprise-grade OpenStack deployment."
+diff --git a/nailgun/nailgun/orchestrator/deployment_serializers.py b/nailgun/nailgun/orchestrator/deployment_serializers.py
+index 375a1ce..b8b38e2 100644
+--- a/nailgun/nailgun/orchestrator/deployment_serializers.py
++++ b/nailgun/nailgun/orchestrator/deployment_serializers.py
+@@ -291,7 +291,14 @@ class DeploymentMultinodeSerializer(object):
+ img_dir = '/usr/share/cirros-testvm/'
+ else:
+ img_dir = '/opt/vm/'
+- image_data['img_path'] = '{0}cirros-x86_64-disk.img'.format(img_dir)
++ release = self.current_release(node.cluster)
++ arch = release.arch
++ if arch == "amd64":
++ arch = "x86_64"
++ elif arch == "arm64":
++ arch = "aarch64"
++ image_data['img_path'] = '{0}cirros-{1}-disk.img'.format(img_dir,
++ arch)
+
+ glance_properties = []
+
+diff --git a/nailgun/nailgun/orchestrator/provisioning_serializers.py b/nailgun/nailgun/orchestrator/provisioning_serializers.py
+index 04ae0b0..c927f03 100644
+--- a/nailgun/nailgun/orchestrator/provisioning_serializers.py
++++ b/nailgun/nailgun/orchestrator/provisioning_serializers.py
+@@ -313,7 +313,8 @@ class ProvisioningSerializer61(ProvisioningSerializer):
+ [consts.MASTER_NODE_UID],
+ attrs['repo_setup']['repos'],
+ attrs['provision'],
+- cluster.id))
++ cluster.id,
++ cluster.release.arch))
+
+ # NOTE(kozhukalov): This pre-provision task is going to be
+ # removed by 7.0 because we need this only for classic way of
+diff --git a/nailgun/nailgun/orchestrator/tasks_templates.py b/nailgun/nailgun/orchestrator/tasks_templates.py
+index 39f2067..cd2278c 100644
+--- a/nailgun/nailgun/orchestrator/tasks_templates.py
++++ b/nailgun/nailgun/orchestrator/tasks_templates.py
+@@ -207,7 +207,7 @@ def make_reboot_task(uids, task):
+ 'timeout': task['parameters']['timeout']}}
+
+
+-def make_provisioning_images_task(uids, repos, provision_data, cid):
++def make_provisioning_images_task(uids, repos, provision_data, cid, arch):
+ conf = {
+ 'repos': repos,
+ 'image_data': provision_data['image_data'],
+@@ -224,7 +224,8 @@ def make_provisioning_images_task(uids, repos, provision_data, cid):
+ "--image_build_dir /var/lib/fuel/ibp "
+ "--log-file /var/log/fuel-agent-env-{0}.log "
+ "--data_driver nailgun_build_image "
+- "--input_data '{1}'").format(cid, conf),
++ "--target_arch {1} "
++ "--input_data '{2}'").format(cid, arch, conf),
+ 'timeout': settings.PROVISIONING_IMAGES_BUILD_TIMEOUT,
+ 'retries': 1}})
+
+diff --git a/nailgun/nailgun/test/unit/test_tasks_templates.py b/nailgun/nailgun/test/unit/test_tasks_templates.py
+index a38e975..9cb9171 100644
+--- a/nailgun/nailgun/test/unit/test_tasks_templates.py
++++ b/nailgun/nailgun/test/unit/test_tasks_templates.py
+@@ -133,7 +133,8 @@ class TestMakeTask(base.BaseTestCase):
+ 'uri': 'http://uri'
+ }
+ }},
+- cid=123)
++ cid=123,
++ arch='amd64')
+
+ fuel_image_conf = {
+ "image_data": {
+@@ -168,7 +169,8 @@ class TestMakeTask(base.BaseTestCase):
+ cmd = result["parameters"]["cmd"].lstrip(
+ "fa_build_image --image_build_dir /var/lib/fuel/ibp "
+ "--log-file /var/log/fuel-agent-env-123.log "
+- "--data_driver nailgun_build_image --input_data '").rstrip("'")
++ "--data_driver nailgun_build_image --target_arch amd64"
++ " --input_data '").rstrip("'")
+ self.assertEqual(jsonutils.loads(cmd), fuel_image_conf)
+
+ def test_generate_ironic_bootstrap_keys_task(self):
+--
+1.9.1
+
diff --git a/patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch b/patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch
new file mode 100644
index 00000000..b6ab7fe7
--- /dev/null
+++ b/patches/fuel-web/0003-Update-docs-for-qemu-debootstrap.patch
@@ -0,0 +1,24 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Thu, 25 Feb 2016 13:35:39 +0100
+Subject: [PATCH] Update docs for qemu-debootstrap
+
+---
+ docs/develop/env.rst | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/docs/develop/env.rst b/docs/develop/env.rst
+index 227549c..47b9823 100644
+--- a/docs/develop/env.rst
++++ b/docs/develop/env.rst
+@@ -114,7 +114,7 @@ your Fuel ISO build environment on Ubuntu 14.04:
+ python-setuptools yum yum-utils libmysqlclient-dev isomd5sum \
+ python-nose libvirt-bin python-ipaddr python-paramiko python-yaml \
+ python-pip kpartx extlinux unzip genisoimage nodejs multistrap \
+- lrzip python-daemon
++ lrzip python-daemon qemu-user-static
+ sudo gem install bundler -v 1.2.1
+ sudo gem install builder
+ sudo pip install xmlbuilder jinja2
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0001-Allow-customizing-Fuel-commit.patch b/patches/opnfv-fuel/0001-Allow-customizing-Fuel-commit.patch
new file mode 100644
index 00000000..eac38f74
--- /dev/null
+++ b/patches/opnfv-fuel/0001-Allow-customizing-Fuel-commit.patch
@@ -0,0 +1,24 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Sun, 21 Feb 2016 16:28:02 +0100
+Subject: [PATCH] Allow customizing Fuel commit
+
+---
+ build/config.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/config.mk b/build/config.mk
+index e11d033..2a81027 100644
+--- a/build/config.mk
++++ b/build/config.mk
+@@ -9,7 +9,7 @@
+ ##############################################################################
+
+ FUEL_MAIN_REPO := https://github.com/openstack/fuel-main
+-FUEL_MAIN_TAG = a365f05b903368225da3fea9aa42afc1d50dc9b4
++FUEL_MAIN_TAG :=
+ MOS_VERSION = 8.0
+ OPENSTACK_VERSION = liberty-8.0
+
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0002-Allow-customizing-java-and-fuel-mirror-URLs.patch b/patches/opnfv-fuel/0002-Allow-customizing-java-and-fuel-mirror-URLs.patch
new file mode 100644
index 00000000..4f6e8966
--- /dev/null
+++ b/patches/opnfv-fuel/0002-Allow-customizing-java-and-fuel-mirror-URLs.patch
@@ -0,0 +1,46 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 24 Feb 2016 20:02:25 +0100
+Subject: [PATCH] Allow customizing java and fuel-mirror URLs
+
+---
+ build/f_isoroot/f_odlpluginbuild/Makefile | 2 +-
+ build/f_isoroot/f_repobuild/Makefile | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/build/f_isoroot/f_odlpluginbuild/Makefile b/build/f_isoroot/f_odlpluginbuild/Makefile
+index f2a47b7..b0bc9c7 100644
+--- a/build/f_isoroot/f_odlpluginbuild/Makefile
++++ b/build/f_isoroot/f_odlpluginbuild/Makefile
+@@ -12,7 +12,7 @@ ODL_BRANCH=brahmaputra-release
+ ODL_REPO="https://github.com/openstack/fuel-plugin-opendaylight.git"
+
+ export USE_JAVA8=true
+-export JAVA8_URL=https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa/+files/openjdk-8-jre-headless_8u72-b15-1~trusty1_amd64.deb
++export JAVA8_URL:=https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa/+files/openjdk-8-jre-headless_8u72-b15-1~trusty1_amd64.deb
+
+ .PHONY: all
+ all: .odlbuild
+diff --git a/build/f_isoroot/f_repobuild/Makefile b/build/f_isoroot/f_repobuild/Makefile
+index e95dbf2..709ca6b 100644
+--- a/build/f_isoroot/f_repobuild/Makefile
++++ b/build/f_isoroot/f_repobuild/Makefile
+@@ -12,6 +12,7 @@ SHELL := /bin/bash
+ TOP := $(shell pwd)
+ TMP_ROOT_DIR := $(shell echo "$(MIRROR_UBUNTU_ROOT)" | cut -d "/" -f2)
+ # Enable use of exact repo commit if defined, else use Fuel main branch
++FUEL_MIRROR_REPO:=https://github.com/openstack/fuel-mirror
+ FUEL_MIRROR_COMMIT?=$(FUEL_MAIN_TAG)
+
+ include ../../config.mk
+@@ -26,7 +27,7 @@ nailgun:
+ sudo apt-get install -y git libxml2-dev libxslt-dev python-dev python-pip libz-dev libyaml-dev createrepo python-yaml
+ rm -Rf nailgun
+ sudo mkdir -p /var/www/nailgun
+- git clone https://github.com/openstack/fuel-mirror
++ git clone $(FUEL_MIRROR_REPO)
+ cd fuel-mirror && git checkout -q $(FUEL_MIRROR_COMMIT)
+ sudo pip install -U -r ./fuel-mirror/requirements.txt
+ sudo pip install ./fuel-mirror
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0003-Add-arm64-deb-repositories-setup.patch b/patches/opnfv-fuel/0003-Add-arm64-deb-repositories-setup.patch
new file mode 100644
index 00000000..9edcd2bb
--- /dev/null
+++ b/patches/opnfv-fuel/0003-Add-arm64-deb-repositories-setup.patch
@@ -0,0 +1,161 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Wed, 24 Feb 2016 20:04:03 +0100
+Subject: [PATCH] Add arm64 deb repositories setup
+
+---
+ build/f_isoroot/f_kscfg/ks.cfg | 1 +
+ build/install/apt-ftparchive-deb.conf | 8 +++++++-
+ build/install/apt-ftparchive-release.conf | 2 +-
+ build/install/apt-ftparchive-udeb.conf | 7 ++++++-
+ build/install/install.sh | 22 ++++++++++++++++++----
+ build/install/uninstall.sh | 20 +++++++++++---------
+ 6 files changed, 44 insertions(+), 16 deletions(-)
+
+diff --git a/build/f_isoroot/f_kscfg/ks.cfg b/build/f_isoroot/f_kscfg/ks.cfg
+index c93babe..30bad1d 100644
+--- a/build/f_isoroot/f_kscfg/ks.cfg
++++ b/build/f_isoroot/f_kscfg/ks.cfg
+@@ -448,6 +448,7 @@ cp -r ${SOURCE}/extra-repos ${repodir}/
+ cp ${SOURCE}/.treeinfo ${repodir}/centos/x86_64
+
+ # Copying Ubuntu files
++# FIXME: This is missleading as dist/pool may contain multiple arch!
+ mkdir -p ${repodir}/ubuntu/x86_64/images
+ cp -r ${SOURCE}/ubuntu/dists ${repodir}/ubuntu/x86_64
+ cp -r ${SOURCE}/ubuntu/pool ${repodir}/ubuntu/x86_64
+diff --git a/build/install/apt-ftparchive-deb.conf b/build/install/apt-ftparchive-deb.conf
+index 0d15aec..e6392f8 100644
+--- a/build/install/apt-ftparchive-deb.conf
++++ b/build/install/apt-ftparchive-deb.conf
+@@ -16,12 +16,18 @@ TreeDefault {
+ Directory "pool";
+ };
+
+-BinDirectory "pool/main" {
++BinDirectory "pool/main/binary-amd64" {
+ Packages "dists/trusty/main/binary-amd64/Packages";
+ BinOverride "./indices/override.trusty.main";
+ ExtraOverride "./indices/override.trusty.extra.main";
+ };
+
++BinDirectory "pool/main/binary-arm64" {
++ Packages "dists/trusty/main/binary-arm64/Packages";
++ BinOverride "./indices/override.trusty.main";
++ ExtraOverride "./indices/override.trusty.extra.main";
++};
++
+ Default {
+ Packages {
+ Extensions ".deb";
+diff --git a/build/install/apt-ftparchive-release.conf b/build/install/apt-ftparchive-release.conf
+index 02706bd..2838714 100644
+--- a/build/install/apt-ftparchive-release.conf
++++ b/build/install/apt-ftparchive-release.conf
+@@ -13,6 +13,6 @@ APT::FTPArchive::Release::Label "Ubuntu";
+ APT::FTPArchive::Release::Suite "trusty";
+ APT::FTPArchive::Release::Version "1.04";
+ APT::FTPArchive::Release::Codename "trusty";
+-APT::FTPArchive::Release::Architectures "amd64";
++APT::FTPArchive::Release::Architectures "amd64 arm64";
+ APT::FTPArchive::Release::Components "main";
+ APT::FTPArchive::Release::Description "Ubuntu Trusty Tahr 14.04 LTS";
+diff --git a/build/install/apt-ftparchive-udeb.conf b/build/install/apt-ftparchive-udeb.conf
+index 3b5b239..c6ab4fb 100644
+--- a/build/install/apt-ftparchive-udeb.conf
++++ b/build/install/apt-ftparchive-udeb.conf
+@@ -16,11 +16,16 @@ TreeDefault {
+ Directory "pool";
+ };
+
+-BinDirectory "pool/debian-installer" {
++BinDirectory "pool/debian-installer/binary-amd64" {
+ Packages "dists/trusty/main/debian-installer/binary-amd64/Packages";
+ BinOverride "./indices/override.trusty.main.debian-installer";
+ };
+
++BinDirectory "pool/debian-installer/binary-arm64" {
++ Packages "dists/trusty/main/debian-installer/binary-arm64/Packages";
++ BinOverride "./indices/override.trusty.main.debian-installer";
++};
++
+ Default {
+ Packages {
+ Extensions ".udeb";
+diff --git a/build/install/install.sh b/build/install/install.sh
+index 4e0389e..8c29e08 100755
+--- a/build/install/install.sh
++++ b/build/install/install.sh
+@@ -122,12 +122,24 @@ prep_make_live() {
+ ssh-copy-id root@$FUELHOST
+ sshfs root@1${FUELHOST}:/ $TMP_HOSTMOUNT
+
+- if [ -f $REPO/dists/trusty/main/binary-amd64/Packages.backup ]; then
++ for arch in arm64 amd64; do
++ if [ -f $REPO/dists/trusty/main/binary-${arch}/Packages.backup ]; then
++ echo "Error - found backup file for Packages for ${arch}!"
++ exit 1
++ fi
++
++ if [ -f $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup ]; then
++ echo "Error - found backup file for Packages.gz for ${arch}!"
++ exit 1
++ fi
++ done
++
++ if [ -f $REPO/dists/trusty/main/binary-arm64/Packages.backup ]; then
+ echo "Error - found backup file for Packages!"
+ exit 1
+ fi
+
+- if [ -f $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup ]; then
++ if [ -f $REPO/dists/trusty/main/binary-arm64/Packages.gz.backup ]; then
+ echo "Error - found backup file for Packages.gz!"
+ exit 1
+ fi
+@@ -142,8 +154,10 @@ prep_make_live() {
+ exit 1
+ fi
+
+- cp $REPO/dists/trusty/main/binary-amd64/Packages $REPO/dists/trusty/main/binary-amd64/Packages.backup
+- cp $REPO/dists/trusty/main/binary-amd64/Packages.gz $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup
++ for arch in arm64 amd64; do
++ cp $REPO/dists/trusty/main/binary-${arch}/Packages $REPO/dists/trusty/main/binary-${arch}/Packages.backup
++ cp $REPO/dists/trusty/main/binary-${arch}/Packages.gz $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup
++ done
+ cp $REPO/dists/trusty/Release $REPO/dists/trusty/Release.backup
+ cp -Rvp $DEST/etc/puppet $DEST/etc/puppet.backup
+ }
+diff --git a/build/install/uninstall.sh b/build/install/uninstall.sh
+index a9e74bc..0266e17 100755
+--- a/build/install/uninstall.sh
++++ b/build/install/uninstall.sh
+@@ -31,15 +31,17 @@ DEST=$MOUNT
+ REPO=$DEST/var/www/nailgun/ubuntu/fuelweb/x86_64
+
+ cd $REPO
+-if [ ! -f $REPO/dists/trusty/main/binary-amd64/Packages.backup ]; then
+- echo "Error - didn't find backup file for Packages!"
+- exit 1
+-fi
+-
+-if [ ! -f $REPO/dists/trusty/main/binary-amd64/Packages.gz.backup ]; then
+- echo "Error - didn't find backup file for Packages.gz!"
+- exit 1
+-fi
++for arch in arm64 amd64; do
++ if [ ! -f $REPO/dists/trusty/main/binary-${arch}/Packages.backup ]; then
++ echo "Error - didn't find backup file for Packages for ${arch}!"
++ exit 1
++ fi
++
++ if [ ! -f $REPO/dists/trusty/main/binary-${arch}/Packages.gz.backup ]; then
++ echo "Error - didn't find backup file for Packages.gz for ${arch}!"
++ exit 1
++ fi
++done
+
+ if [ ! -f $REPO/dists/trusty/Release.backup ]; then
+ echo "Error - didn't find backup file for Release!"
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0004-Follow-redirects.patch b/patches/opnfv-fuel/0004-Follow-redirects.patch
new file mode 100644
index 00000000..d056a9e0
--- /dev/null
+++ b/patches/opnfv-fuel/0004-Follow-redirects.patch
@@ -0,0 +1,28 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Tue, 1 Mar 2016 09:34:57 +0100
+Subject: [PATCH] Follow redirects
+
+---
+ build/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/build/Makefile b/build/Makefile
+index 01f6e41..61d41ab 100644
+--- a/build/Makefile
++++ b/build/Makefile
+@@ -52,10 +52,10 @@ export MIRROR_UBUNTU_ROOT := $(shell echo -n '/' ; echo "$(MIRROR_UBUNTU_URL)" |
+ export LATEST_MIRROR_ID_URL := http://$(shell ./select_closest_fuel_mirror.py)
+
+ export MIRROR_MOS_UBUNTU := $(shell echo "$(LATEST_MIRROR_ID_URL)" | cut -d'/' -f3)
+-export LATEST_TARGET_UBUNTU := $(shell curl -sSf "$(MIRROR_MOS_UBUNTU)/mos-repos/ubuntu/8.0.target.txt" | head -1)
++export LATEST_TARGET_UBUNTU := $(shell curl -sSfL "$(MIRROR_MOS_UBUNTU)/mos-repos/ubuntu/8.0.target.txt" | head -1)
+ export MIRROR_MOS_UBUNTU_ROOT := /mos-repos/ubuntu/$(LATEST_TARGET_UBUNTU)
+
+-export LATEST_TARGET_CENTOS := $(shell curl -sSf "$(LATEST_MIRROR_ID_URL)/mos-repos/centos/mos8.0-centos7-fuel/os.target.txt" | head -1)
++export LATEST_TARGET_CENTOS := $(shell curl -sSfL "$(LATEST_MIRROR_ID_URL)/mos-repos/centos/mos8.0-centos7-fuel/os.target.txt" | head -1)
+ export MIRROR_FUEL := "$(LATEST_MIRROR_ID_URL)/mos-repos/centos/mos8.0-centos7-fuel/$(LATEST_TARGET_CENTOS)/x86_64"
+
+ # uncomment and use: make print-VARIABLE
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0005-Build-bootstrap-image-for-arm64.patch b/patches/opnfv-fuel/0005-Build-bootstrap-image-for-arm64.patch
new file mode 100644
index 00000000..c6820393
--- /dev/null
+++ b/patches/opnfv-fuel/0005-Build-bootstrap-image-for-arm64.patch
@@ -0,0 +1,27 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Thu, 3 Mar 2016 19:04:07 +0100
+Subject: [PATCH] Build bootstrap image for arm64
+
+For now the arch is hardcoded for simplicity. We should detect this
+but how? If we're multi-arch then one bootstrap image should be built
+per supported arch. This requires Fuel refactoring.
+---
+ build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh b/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh
+index b096a78..744f352 100755
+--- a/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh
++++ b/build/f_isoroot/f_bootstrap/bootstrap_admin_node.sh
+@@ -325,7 +325,7 @@ build_ubuntu_bootstrap () {
+ local ret=1
+ echo ${bs_progress_message} >&2
+ set_ui_bootstrap_error "${bs_progress_message}" >&2
+- if fuel-bootstrap -v --debug build --activate >>"$bs_build_log" 2>&1; then
++ if fuel-bootstrap -v --debug build --target_arch arm64 --activate >>"$bs_build_log" 2>&1; then
+ ret=0
+ fuel notify --topic "done" --send "${bs_done_message}"
+ else
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0006-bootstrap-Use-public-Ubuntu-ports-mirrors.patch b/patches/opnfv-fuel/0006-bootstrap-Use-public-Ubuntu-ports-mirrors.patch
new file mode 100644
index 00000000..253267d1
--- /dev/null
+++ b/patches/opnfv-fuel/0006-bootstrap-Use-public-Ubuntu-ports-mirrors.patch
@@ -0,0 +1,51 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Thu, 3 Mar 2016 19:18:27 +0100
+Subject: [PATCH] bootstrap: Use public Ubuntu-ports mirrors.
+
+Instead of relying on 127.0.0.1 partial Ubuntu mirror, use
+public archives.
+While doing so, switch to Ubuntu-ports, enabling building arm64
+bootstraps.
+
+NOTE: This disables the abillity to build amd64 bootstraps with
+current config.
+---
+ build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml b/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
+index aa12c45..2e4843d 100644
+--- a/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
++++ b/build/f_isoroot/f_repobuild/fuel_bootstrap_cli.yaml
+@@ -36,19 +36,19 @@
+ repos:
+ - name: ubuntu
+ section: "main universe multiverse"
+- uri: "http://127.0.0.1:8080/mirrors/ubuntu"
++ uri: "http://ports.ubuntu.com/ubuntu-ports"
+ priority:
+ suite: trusty
+ type: deb
+ - name: ubuntu-updates
+ section: "main universe multiverse"
+- uri: "http://127.0.0.1:8080/mirrors/ubuntu"
++ uri: "http://ports.ubuntu.com/ubuntu-ports"
+ priority:
+ suite: trusty-updates
+ type: deb
+ - name: ubuntu-security
+ section: "main universe multiverse"
+- uri: "http://127.0.0.1:8080/mirrors/ubuntu"
++ uri: "http://ports.ubuntu.com/ubuntu-ports"
+ priority:
+ suite: trusty-security
+ type: deb
+@@ -60,4 +60,5 @@
+ type: deb
+ skip_default_img_build: true
+ direct_repo_addresses:
++ - "ports.ubuntu.com"
+ - "127.0.0.1"
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0007-Allow-customizing-fuel-plugin-qemu.patch b/patches/opnfv-fuel/0007-Allow-customizing-fuel-plugin-qemu.patch
new file mode 100644
index 00000000..130c354d
--- /dev/null
+++ b/patches/opnfv-fuel/0007-Allow-customizing-fuel-plugin-qemu.patch
@@ -0,0 +1,24 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Fri, 4 Mar 2016 14:27:48 +0100
+Subject: [PATCH] Allow customizing fuel-plugin-qemu
+
+---
+ build/f_isoroot/f_qemupluginbuild/config.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/build/f_isoroot/f_qemupluginbuild/config.mk b/build/f_isoroot/f_qemupluginbuild/config.mk
+index e9c4356..c23e9c2 100644
+--- a/build/f_isoroot/f_qemupluginbuild/config.mk
++++ b/build/f_isoroot/f_qemupluginbuild/config.mk
+@@ -7,6 +7,6 @@
+ # http://www.apache.org/licenses/LICENSE-2.0
+ ##############################################################################
+
+-QEMU_BRANCH=292b588b5fe444651cca92d7511383ac42253984
+-QEMU_REPO=https://review.openstack.org/openstack/fuel-plugin-qemu
++QEMU_BRANCH:=292b588b5fe444651cca92d7511383ac42253984
++QEMU_REPO:=https://review.openstack.org/openstack/fuel-plugin-qemu
+ QEMU_CHANGE=
+--
+1.9.1
+
diff --git a/patches/opnfv-fuel/0008-Allow-customizing-fuel-plugin-ovsnfv.patch b/patches/opnfv-fuel/0008-Allow-customizing-fuel-plugin-ovsnfv.patch
new file mode 100644
index 00000000..dde9c5a0
--- /dev/null
+++ b/patches/opnfv-fuel/0008-Allow-customizing-fuel-plugin-ovsnfv.patch
@@ -0,0 +1,25 @@
+From: Stanislaw Kardach <stanislaw.kardach@caviumnetworks.com>
+Date: Sat, 5 Mar 2016 15:08:10 +0100
+Subject: [PATCH] Allow customizing fuel-plugin-ovsnfv
+
+---
+ build/f_isoroot/f_ovsnfv-dpdk-pluginbuild/config.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/build/f_isoroot/f_ovsnfv-dpdk-pluginbuild/config.mk b/build/f_isoroot/f_ovsnfv-dpdk-pluginbuild/config.mk
+index 1893fce..f29dab5 100644
+--- a/build/f_isoroot/f_ovsnfv-dpdk-pluginbuild/config.mk
++++ b/build/f_isoroot/f_ovsnfv-dpdk-pluginbuild/config.mk
+@@ -7,7 +7,7 @@
+ # http://www.apache.org/licenses/LICENSE-2.0
+ ##############################################################################
+
+-OVSNFV_DPDK_BRANCH=stable/brahmaputra
+-OVSNFV_DPDK_REPO=https://gerrit.opnfv.org/gerrit/p/ovsnfv.git
++OVSNFV_DPDK_BRANCH:=stable/brahmaputra
++OVSNFV_DPDK_REPO:=https://gerrit.opnfv.org/gerrit/p/ovsnfv.git
+ OVSNFV_DPDK_DIR=fuel-plugin-ovsnfv
+ OVSNFV_DPDK_CHANGE=
+--
+1.9.1
+