diff options
author | João Henrique Ferreira de Freitas <joaohf@gmail.com> | 2014-03-29 00:12:08 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-30 10:10:35 +0100 |
commit | ba65fe654a66102e84582886cb0cc19889f5d3dd (patch) | |
tree | b9ad9aa0452bee7a93d0ebc5227a9700b70e57bb /scripts/lib/mic/plugins/imager/direct_plugin.py | |
parent | 3c0038488491374e745ebcfbd091c3f28cc8c089 (diff) | |
download | poky-ba65fe654a66102e84582886cb0cc19889f5d3dd.tar.gz |
wic: Extend --rootfs-dir to connect rootfs-dirs
The wic command-line param --rootfs-dir gets generalized to support
multiple directories. Each '--rootfs-dir' could be connected using a
special string, that should be present in .wks. I.e:
wic create ... --rootfs-dir rootfs1=/some/rootfs/dir \
--rootfs-dir rootfs2=/some/other/rootfs/dir
part / --source rootfs --rootfs-dir="rootfs1" --ondisk sda --fstype=ext3 \
--label primary --align 1024
part /standby --source rootfs --rootfs-dir="rootfs2" \
--ondisk sda --fstype=ext3 --label secondary --align 1024
The user could use harded-code directory instead of connectors. Like this:
wic create ... hard-coded-path.wks -r /some/rootfs/dir
part / --source rootfs --ondisk sda --fstype=ext3 --label primary --align 1024
part /standby --source rootfs --rootfs-dir=/some/rootfs/dir \
--ondisk sda --fstype=ext3 --label secondary --align 1024
(From OE-Core rev: 719d093c40e4c259a4c97d6c8a5efb5aeef5fd38)
Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/mic/plugins/imager/direct_plugin.py')
-rw-r--r-- | scripts/lib/mic/plugins/imager/direct_plugin.py | 17 |
1 files changed, 16 insertions, 1 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, |