diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-06-25 14:27:44 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-06-25 14:27:44 +0100 |
commit | abd56fc61fe65d75fe372fd5e2c5c2dbd31865f0 (patch) | |
tree | d06247ea067f7f8bf41a3868c8aefb55fb25ab1a | |
parent | 73e8bed080a2f5e19266646f306296c68637e8d0 (diff) | |
parent | 563293f6848ad97e0d9dea6df2c6595aae3f18d5 (diff) | |
download | morph-abd56fc61fe65d75fe372fd5e2c5c2dbd31865f0.tar.gz |
Merge remote branch 'remotes/origin/baserock/feature/S2938-system-artifact-splitting'
-rwxr-xr-x | morphlib/app.py | 5 | ||||
-rw-r--r-- | morphlib/builder2.py | 14 | ||||
-rwxr-xr-x | tests.as-root/arm-system-writes-kernel.script | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index 443b1733..bcacbea1 100755 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -568,7 +568,10 @@ class Morph(cliapp.Application): for artifact in artifacts: artifact.cache_key = ckc.compute_key(artifact) if the_one(artifact.source, repo_name, ref, filename): - return artifact + a = morphlib.artifact.Artifact(artifact.source, + artifact.source.morphology['name']+'-rootfs') + a.cache_key = artifact.cache_key + return a artifact1 = get_artifact(repo_name1, ref1, filename1) artifact2 = get_artifact(repo_name2, ref2, filename2) diff --git a/morphlib/builder2.py b/morphlib/builder2.py index d11ba97b..3bc8bb10 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -435,7 +435,9 @@ class SystemBuilder(BuilderBase): # pragma: no cover arch = self.artifact.source.morphology['arch'] - handle = self.local_artifact_cache.put(self.artifact) + rootfs_artifact = self.new_artifact( + self.artifact.source.morphology['name'] + '-rootfs') + handle = self.local_artifact_cache.put(rootfs_artifact) image_name = handle.name self._create_image(image_name) @@ -461,13 +463,9 @@ class SystemBuilder(BuilderBase): # pragma: no cover if arch in ('x86', 'x86_64', None): self._install_extlinux(mount_point) if arch in ('arm',): - # write the kernel as metadata to the cache - # it should probably be a full artifact, but - # that would require altering the artifact - # resolver - lac = self.local_artifact_cache - a = self.artifact - with lac.put_artifact_metadata(a, 'kernel') as dest: + a = self.new_artifact( + self.artifact.source.morphology['name']+'-kernel') + with self.local_artifact_cache.put(a) as dest: with open(os.path.join(factory_path, 'boot', 'zImage')) as kernel: diff --git a/tests.as-root/arm-system-writes-kernel.script b/tests.as-root/arm-system-writes-kernel.script index 06a7ba44..7f9c79b2 100755 --- a/tests.as-root/arm-system-writes-kernel.script +++ b/tests.as-root/arm-system-writes-kernel.script @@ -76,4 +76,4 @@ git commit --quiet -m 'Make the kernel create a dummy zImage' "$SRCDIR/scripts/test-morph" \ build test:morphs-repo arm arm-system.morph -[ -e "$cache"/*system.arm-system.kernel ] +[ -e "$cache"/*system.arm-system-kernel ] || find "$cache" |