summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Thomas <james.thomas@codethink.co.uk>2014-07-22 17:17:12 (GMT)
committerJames Thomas <james.thomas@codethink.co.uk>2014-07-24 09:37:55 (GMT)
commit9b90b34f8492632a5c054a16f21e60f2b1fd69a1 (patch)
tree3d68e9f13a48ccf8150aafc186cbb160e641ed3c
parent392dab606ee09bca4ed29db57d6a4a691dcec600 (diff)
downloadtbdiff-baserock/james/jetson_update.tar.gz
Add support for device treesbaserock/james/jetson_update
-rwxr-xr-xsystem-version-manager/system-version-manager19
1 files changed, 19 insertions, 0 deletions
diff --git a/system-version-manager/system-version-manager b/system-version-manager/system-version-manager
index abb3e52..cdf453b 100755
--- a/system-version-manager/system-version-manager
+++ b/system-version-manager/system-version-manager
@@ -168,6 +168,9 @@ class SystemVersionManager(object):
kernel_args += ('root=UUID=%s ' % self.device_uuid)
else:
kernel_args += ('root=%s ' % self.device)
+ if 'DTB_PATH' in deployment_config:
+ f.write('devicetree /systems/%s/dtb\n' % system)
+
kernel_args += deployment_config.get('KERNEL_ARGS', '')
f.write('append %s\n' % kernel_args)
os.rename(temp_config, config)
@@ -243,6 +246,10 @@ class SystemVersionManager(object):
self.status(msg="Installing the initramfs")
self._install_initramfs(deployment_config['INITRAMFS_PATH'],
version_root)
+ if 'DTB_PATH' in deployment_config:
+ self.status(msg="Installing the device tree")
+ self._install_dtb(deployment_config['DTB_PATH'],
+ version_root)
except Exception as e:
# We are not controlling if deleting the suvolume fails
@@ -266,6 +273,18 @@ class SystemVersionManager(object):
shutil.copy2(try_path, kernel_dest)
break
+ def _install_dtb(self, dtb_path, version_root):
+ '''Install the devicetree outside of 'orig' or 'run' subvolumes
+
+ This code is kind of duplicated in morphlib/writeexts.py.
+
+ '''
+ self.status(msg='Installing devicetree')
+ self.status(msg='Device tree path=%s' % dtb_path)
+ dtb_dest = os.path.join(version_root, 'dtb')
+ try_path = os.path.join(version_root, 'run', dtb_path)
+ shutil.copy2(try_path, dtb_dest)
+
def _install_initramfs(self, initramfs_path, version_root):
'''Install the initramfs outside of 'orig' or 'run' subvolumes