summaryrefslogtreecommitdiffstats
path: root/patches/packetary
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2016-10-30 02:12:39 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2016-11-15 22:00:27 +0100
commitb26467eac82e9b8d7b44878a99dd89dfe9f398b7 (patch)
tree870565429b637fe62c49c081c8b8b22e19254ffe /patches/packetary
parent2024143d673ca86d1e6982f51fd64d66f233ae61 (diff)
AArch64: Ubuntu local partial mirror: Add arm64
NOTE: Temporarily patch "packetary" in Armband until we upstream two small fixes. Bootstrap build, deploy target image build: - Switch from public Ubuntu mirrors to 10.20.0.2. JIRA: ARMBAND-35 Change-Id: I14645cfeebb486063e7b8198de273f68285b11cd Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'patches/packetary')
-rw-r--r--patches/packetary/0001-deb_driver-Translate-repository.architecture.patch30
-rw-r--r--patches/packetary/0002-clone-Create-metadata-for-empty-components.patch43
-rw-r--r--patches/packetary/0003-AArch64-support-api-cli-controllers-drivers.patch76
3 files changed, 149 insertions, 0 deletions
diff --git a/patches/packetary/0001-deb_driver-Translate-repository.architecture.patch b/patches/packetary/0001-deb_driver-Translate-repository.architecture.patch
new file mode 100644
index 00000000..18f20015
--- /dev/null
+++ b/patches/packetary/0001-deb_driver-Translate-repository.architecture.patch
@@ -0,0 +1,30 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Thu, 27 Oct 2016 22:24:28 +0200
+Subject: [PATCH] deb_driver: Translate repository.architecture
+
+When generating repository metadata, the Release file gets the
+architecture list in an untranslated format, ending up with
+'x86_64' instead of 'amd64'.
+
+Closes-bug: 1638628
+
+Change-Id: I8471db6d54157175ff275c969ed5195d4616fa0f
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ packetary/drivers/deb_driver.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/packetary/drivers/deb_driver.py b/packetary/drivers/deb_driver.py
+index ece9fa1..929bdca 100644
+--- a/packetary/drivers/deb_driver.py
++++ b/packetary/drivers/deb_driver.py
+@@ -409,7 +409,8 @@ class DebRepositoryDriver(RepositoryDriverBase):
+ release.setdefault("Description", "The packages repository.")
+
+ keys = ("Architectures", "Components")
+- values = (repository.architecture, repository.section[1])
++ values = (_ARCHITECTURES[repository.architecture],
++ repository.section[1])
+ for key, value in six.moves.zip(keys, values):
+ if key in release:
+ release[key] = utils.append_token_to_string(
diff --git a/patches/packetary/0002-clone-Create-metadata-for-empty-components.patch b/patches/packetary/0002-clone-Create-metadata-for-empty-components.patch
new file mode 100644
index 00000000..70d75fee
--- /dev/null
+++ b/patches/packetary/0002-clone-Create-metadata-for-empty-components.patch
@@ -0,0 +1,43 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Tue, 1 Nov 2016 23:01:58 +0100
+Subject: [PATCH] clone: Create metadata for empty components
+
+In certain scenarios, mirror components (e.g. trusty-security)
+are present in both packetary configuration input, and in target
+system's apt source definitions, but contain no packages of interest.
+
+For such repository/requirements combinations, packetary currently
+skips creating metadata (Release, Packages) for those components,
+which leads to the partial mirror missing some critical files for apt,
+(an empty file would be enough).
+
+e.g.: Using packetary to create a partial Ubuntu mirror, then trying
+to build a bootstrap image from the new mirror leads to:
+
+W: Failed to fetch http://127.0.0.1:8080/mirrors/ubuntu/dists/\
+ trusty-security/multiverse/binary-amd64/Packages 404
+
+Closes-bug: 1638631
+
+Change-Id: I850b43d5b4d8742d99e9a5702cc9ad4de881a401
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ packetary/api/repositories.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/packetary/api/repositories.py b/packetary/api/repositories.py
+index ec8c54c..2c72e29 100644
+--- a/packetary/api/repositories.py
++++ b/packetary/api/repositories.py
+@@ -121,6 +121,11 @@ class RepositoryApi(object):
+ for pkg in all_packages:
+ package_groups[pkg.repository].add(pkg)
+
++ # Make sure we create metadata for all repos, even if empty
++ for repo in repositories:
++ if repo not in package_groups:
++ package_groups[repo] = set()
++
+ stat = CopyStatistics()
+ mirrors = defaultdict(set)
+ options = options or self.CopyOptions()
diff --git a/patches/packetary/0003-AArch64-support-api-cli-controllers-drivers.patch b/patches/packetary/0003-AArch64-support-api-cli-controllers-drivers.patch
new file mode 100644
index 00000000..da01bc33
--- /dev/null
+++ b/patches/packetary/0003-AArch64-support-api-cli-controllers-drivers.patch
@@ -0,0 +1,76 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Thu, 27 Oct 2016 21:51:10 +0200
+Subject: [PATCH] AArch64 support: api, cli, controllers, drivers
+
+Enable new architecture 'aarch64' ('arm64' on Ubuntu).
+Tested with DEB driver.
+
+Closes-bug: 1638635
+
+Change-Id: I9761322020837186c109c18e849128791ab909d8
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ packetary/api/repositories.py | 3 ++-
+ packetary/cli/commands/base.py | 2 +-
+ packetary/controllers/repository.py | 3 ++-
+ packetary/drivers/deb_driver.py | 2 ++
+ 4 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/packetary/api/repositories.py b/packetary/api/repositories.py
+index ec8c54c..d49d8d0 100644
+--- a/packetary/api/repositories.py
++++ b/packetary/api/repositories.py
+@@ -73,7 +73,8 @@ class RepositoryApi(object):
+
+ :param config: the configuration
+ :param repotype: the kind of repository(deb, yum, etc)
+- :param repoarch: the architecture of repository (x86_64 or i386)
++ :param repoarch: the architecture of repository
++ (x86_64, i386 or aarch64)
+ """
+ context = config if isinstance(config, Context) else Context(config)
+ return cls(RepositoryController.load(context, repotype, repoarch))
+diff --git a/packetary/cli/commands/base.py b/packetary/cli/commands/base.py
+index 83c2f38..c2cc497 100644
+--- a/packetary/cli/commands/base.py
++++ b/packetary/cli/commands/base.py
+@@ -56,7 +56,7 @@ class BaseRepoCommand(BaseCommand):
+ '-a',
+ '--arch',
+ type=str,
+- choices=["x86_64", "i386"],
++ choices=["x86_64", "i386", "aarch64"],
+ metavar='ARCHITECTURE',
+ default="x86_64",
+ help='The target architecture.')
+diff --git a/packetary/controllers/repository.py b/packetary/controllers/repository.py
+index 921a5c1..e6cbc9b 100644
+--- a/packetary/controllers/repository.py
++++ b/packetary/controllers/repository.py
+@@ -45,7 +45,8 @@ class RepositoryController(object):
+
+ :param context: the context
+ :param driver_name: the name of required driver
+- :param repoarch: the architecture of repository (x86_64 or i386)
++ :param repoarch: the architecture of repository
++ (x86_64, i386 or aarch64)
+ """
+ if cls._drivers is None:
+ cls._drivers = stevedore.ExtensionManager(
+diff --git a/packetary/drivers/deb_driver.py b/packetary/drivers/deb_driver.py
+index ece9fa1..0df1aa4 100644
+--- a/packetary/drivers/deb_driver.py
++++ b/packetary/drivers/deb_driver.py
+@@ -48,10 +48,12 @@ _OPERATORS_MAPPING = {
+ }
+
+ _ARCHITECTURES = {
++ "aarch64": "arm64",
+ "x86_64": "amd64",
+ "i386": "i386",
+ "source": "Source",
+ "amd64": "x86_64",
++ "arm64": "aarch64",
+ }
+
+ _PRIORITIES = {