diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2015-02-24 08:55:57 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-04-20 14:07:40 +0000 |
commit | a2c69fb20002f679698c8774f61c7f186f23100d (patch) | |
tree | d01e63ec5aecbe7fe98ccae290ca9a2192587c76 /morphlib/builder.py | |
parent | 6821d8234848a7e657434001cc9a904dc670db44 (diff) | |
download | morph-a2c69fb20002f679698c8774f61c7f186f23100d.tar.gz |
Create device nodes in staging area
We can't store devices nodes in OSTree, so we can't create them at
artifact build time and store them in the chunk artifacts anymore.
Instead, we should create them in the staging area when installing
an artifact with a source which has a morphology which defines
them into the staging area.
Change-Id: I423c5e4b8d6595b95894935329c3bf3517cfa475
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r-- | morphlib/builder.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py index 524e85a3..735e70aa 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -246,28 +246,6 @@ class ChunkBuilder(BuilderBase): '''Build chunk artifacts.''' - def create_devices(self, destdir): # pragma: no cover - '''Creates device nodes if the morphology specifies them''' - morphology = self.source.morphology - perms_mask = stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO - if 'devices' in morphology and morphology['devices'] is not None: - for dev in morphology['devices']: - destfile = os.path.join(destdir, './' + dev['filename']) - mode = int(dev['permissions'], 8) & perms_mask - if dev['type'] == 'c': - mode = mode | stat.S_IFCHR - elif dev['type'] == 'b': - mode = mode | stat.S_IFBLK - else: - raise IOError('Cannot create device node %s,' - 'unrecognized device type "%s"' - % (destfile, dev['type'])) - self.app.status(msg="Creating device node %s" - % destfile) - os.mknod(destfile, mode, - os.makedev(dev['major'], dev['minor'])) - os.chown(destfile, dev['uid'], dev['gid']) - def build_and_cache(self): # pragma: no cover with self.build_watch('overall-build'): @@ -286,7 +264,6 @@ class ChunkBuilder(BuilderBase): try: self.get_sources(builddir) self.run_commands(builddir, destdir, temppath, stdout) - self.create_devices(destdir) os.rename(temppath, logpath) except BaseException as e: |