summaryrefslogtreecommitdiffstats
path: root/scripts/lib/mic/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/mic/plugins')
-rw-r--r--scripts/lib/mic/plugins/imager/direct_plugin.py17
-rw-r--r--scripts/lib/mic/plugins/source/rootfs.py18
2 files changed, 31 insertions, 4 deletions
diff --git a/scripts/lib/mic/plugins/imager/direct_plugin.py b/scripts/lib/mic/plugins/imager/direct_plugin.py
index e015256fa1..fc7c10c3df 100644
--- a/scripts/lib/mic/plugins/imager/direct_plugin.py
+++ b/scripts/lib/mic/plugins/imager/direct_plugin.py
@@ -43,6 +43,19 @@ class DirectPlugin(ImagerPlugin):
43 name = 'direct' 43 name = 'direct'
44 44
45 @classmethod 45 @classmethod
46 def __rootfs_dir_to_dict(self, rootfs_dirs):
47 """
48 Gets a string that contain 'connection=dir' splitted by
49 space and return a dict
50 """
51 krootfs_dir = {}
52 for rootfs_dir in rootfs_dirs.split(' '):
53 k, v = rootfs_dir.split('=')
54 krootfs_dir[k] = v
55
56 return krootfs_dir
57
58 @classmethod
46 def do_create(self, subcmd, opts, *args): 59 def do_create(self, subcmd, opts, *args):
47 """ 60 """
48 Create direct image, called from creator as 'direct' cmd 61 Create direct image, called from creator as 'direct' cmd
@@ -63,11 +76,13 @@ class DirectPlugin(ImagerPlugin):
63 image_output_dir = args[7] 76 image_output_dir = args[7]
64 oe_builddir = args[8] 77 oe_builddir = args[8]
65 78
79 krootfs_dir = self.__rootfs_dir_to_dict(rootfs_dir)
80
66 configmgr._ksconf = ksconf 81 configmgr._ksconf = ksconf
67 82
68 creator = direct.DirectImageCreator(oe_builddir, 83 creator = direct.DirectImageCreator(oe_builddir,
69 image_output_dir, 84 image_output_dir,
70 rootfs_dir, 85 krootfs_dir,
71 bootimg_dir, 86 bootimg_dir,
72 kernel_dir, 87 kernel_dir,
73 native_sysroot, 88 native_sysroot,
diff --git a/scripts/lib/mic/plugins/source/rootfs.py b/scripts/lib/mic/plugins/source/rootfs.py
index 6323811183..75999e03d2 100644
--- a/scripts/lib/mic/plugins/source/rootfs.py
+++ b/scripts/lib/mic/plugins/source/rootfs.py
@@ -45,14 +45,26 @@ class RootfsPlugin(SourcePlugin):
45 45
46 @classmethod 46 @classmethod
47 def do_prepare_partition(self, part, cr, cr_workdir, oe_builddir, bootimg_dir, 47 def do_prepare_partition(self, part, cr, cr_workdir, oe_builddir, bootimg_dir,
48 kernel_dir, rootfs_dir, native_sysroot): 48 kernel_dir, krootfs_dir, native_sysroot):
49 """ 49 """
50 Called to do the actual content population for a partition i.e. it 50 Called to do the actual content population for a partition i.e. it
51 'prepares' the partition to be incorporated into the image. 51 'prepares' the partition to be incorporated into the image.
52 In this case, prepare content for legacy bios boot partition. 52 In this case, prepare content for legacy bios boot partition.
53 """ 53 """
54 if part.rootfs: 54 if part.rootfs is None:
55 rootfs_dir = part.rootfs 55 if not 'ROOTFS_DIR' in krootfs_dir:
56 msg = "Couldn't find --rootfs-dir, exiting"
57 msger.error(msg)
58 rootfs_dir = krootfs_dir['ROOTFS_DIR']
59 else:
60 if part.rootfs in krootfs_dir:
61 rootfs_dir = krootfs_dir[part.rootfs]
62 elif os.path.isdir(part.rootfs):
63 rootfs_dir = part.rootfs
64 else:
65 msg = "Couldn't find --rootfs-dir=%s connection"
66 msg += " or it is not a valid path, exiting"
67 msger.error(msg % part.rootfs)
56 68
57 part.set_rootfs(rootfs_dir) 69 part.set_rootfs(rootfs_dir)
58 part.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir, native_sysroot) 70 part.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir, native_sysroot)