diff options
author | Florin Dumitrascu <florin.dumitrascu@enea.com> | 2016-03-13 18:49:38 +0100 |
---|---|---|
committer | Florin Dumitrascu <florin.dumitrascu@enea.com> | 2016-03-13 17:55:05 +0000 |
commit | c715e7bb460f499f4fd20f7ab000d7a6d670636a (patch) | |
tree | 79ec69ccb6f19278ac7f0d025fdab9e0f2cbe57b /patches/fuel-agent/0003-Fix-qemu-user-static-replacement.patch | |
parent | 1732427ab05ed1301bf9d53fcf47128f44d04811 (diff) |
Initial code commit
This brings initial code base for Armband project that allows building
an OPNFV Fuel 8 iso based on Brahmaputra components to be deployed on
arm64 servers.
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Signed-off-by: Alexandru Avadanii <alexandru.avadanii@enea.com>
Signed-off-by: Florin Dumitrascu <florin.dumitrascu@enea.com>
JIRA:FUEL-39
Diffstat (limited to 'patches/fuel-agent/0003-Fix-qemu-user-static-replacement.patch')
-rw-r--r-- | patches/fuel-agent/0003-Fix-qemu-user-static-replacement.patch | 58 |
1 files changed, 58 insertions, 0 deletions
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 + |