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/source/rootfs.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/source/rootfs.py')
-rw-r--r-- | scripts/lib/mic/plugins/source/rootfs.py | 18 |
1 files changed, 15 insertions, 3 deletions
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) |