diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-10-25 11:06:57 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-10-26 13:43:58 +0100 |
commit | c67afe0431f4abfc16eb9994239c3f21b56ad303 (patch) | |
tree | 4dcc13c491a68211e375f8ceda0f04491d66a4af /morphlib/builder2.py | |
parent | 2bcc7ba44734c73a4a80b40b80a42b1376af5e00 (diff) | |
download | morph-c67afe0431f4abfc16eb9994239c3f21b56ad303.tar.gz |
Write metadata for the rootfs itself into the rootfs
This makes it easier to identify what version of a system we are running.
Tests are updated to check inside the contents of the rootfs we created,
and the code to mount the rootfs as a loopback device was extracted out
into tests.as-root/lib
Diffstat (limited to 'morphlib/builder2.py')
-rw-r--r-- | morphlib/builder2.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py index 565fdf4f..d3768054 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -662,8 +662,8 @@ class DiskImageBuilder(SystemKindBuilder): # pragma: no cover with self.build_watch('overall-build'): arch = self.artifact.source.morphology['arch'] - rootfs_artifact = self.new_artifact( - self.artifact.source.morphology['name'] + '-rootfs') + rootfs_name = self.artifact.source.morphology['name'] + '-rootfs' + rootfs_artifact = self.new_artifact(rootfs_name) handle = self.local_artifact_cache.put(rootfs_artifact) (image_file_fd, image_name) = \ tempfile.mkstemp(dir=self.app.settings['tempdir']) @@ -682,6 +682,7 @@ class DiskImageBuilder(SystemKindBuilder): # pragma: no cover factory_path = os.path.join(mount_point, 'factory') self._create_subvolume(factory_path) self.unpack_strata(factory_path) + self.write_metadata(factory_path, rootfs_name) self.create_fstab(factory_path) self._create_bootloader_config(factory_path) self._create_subvolume_snapshot( |