diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2016-10-01 13:18:11 +0200 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2016-10-09 16:33:43 +0200 |
commit | 42f8585ebb8fffad19a89314659ab9129176c3e9 (patch) | |
tree | e2cf6a4797bcbd036e080541cc3925f8b209549b /patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch | |
parent | 6f3a054fc95622f0c002f72c0fac6074bb36c36f (diff) |
build: Rework patch mechanism for Fuel submodules
While refactoring the patching mechanism, take care of:
- Sync submodule handling with Fuel@OPFNV;
- build: Investigate/prepare for moving patches to Fuel@OPNFV;
- build: Investigate divergent fuel-mirror;
- ISO build: cacheid for Fuel comps should not depend on
Armband git commit;
CHANGE:
Rename/shuffle patches while grouping them in "features",
preparing for upstreaming them to Fuel@OPNFV and beyond.
CHANGE:
Allow linking patches for better representing the dependency
between one patch and different features.
e.g. 0001-Add-arch-to-nailgun-release-and-target-image.patch:
- part of `multiarch-fuel`, because it extends Fuel;
- part of `direct-kernel-boot`, as arch is required for that;
- part of `cross-bootstrap`, target image is arch-dependent;
NOTE: Patch links are not staged to Fuel@OPNFV, they only serve
as markers that a specific patch is part of a feature.
CHANGE:
Kill all Fuel component submodules, now handled in Fuel@OPNFV:
- fuel-agent
- fuel-astute
- fuel-library
- fuel-mirror
- fuel-nailgun-agent
- fuel-web
CHANGE:
Move armband-fuel-config.mk to armband git root.
FIXME: m1.micro-Increase-profile-RAM-size-to-128MB.patch is NOT
part of `cross-bootstrap` feature, but patch context says so ...
FIXME: 0001-Add-arm64-deb-repositories-setup.patch is broken at
`make patches-export` by removing spaces at EOL.
v2 -> v3:
* Phony patch support (links to show a patch belongs to a feature);
* Updated README.md
v3 -> v7:
* Re-export Fuel submodules & plugins patches (update patch context);
* Update Cavium mail addresses (s/caviumnetworks.com/cavium.com/);
* Ignore submodule changes;
* Add armband git repo info to gitinfo_fuel.txt at build time;
Implements: ARMBAND-136
Closes-bug: ARMBAND-95
Closes-bug: ARMBAND-93
Closes-bug: ARMBAND-92
Change-Id: I1a236d9f43b2e6dca22055911f696b43c22b5973
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch')
-rw-r--r-- | patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch | 154 |
1 files changed, 0 insertions, 154 deletions
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 deleted file mode 100644 index 6f28d8a3..00000000 --- a/patches/fuel-agent/0001-Use-qemu-debootstrap-for-image-creation.patch +++ /dev/null @@ -1,154 +0,0 @@ -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,4 +166,12 @@ class BuildCommand(command.Command): - ) -+ 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..6e60fb8 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,5 +18,6 @@ import shutil - - 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 |