Patchwork [1/1] image_types: ensure .rootfs.ext3 is created before vmdk is created.

login
register
mail settings
Submitter Dexuan Cui
Date March 9, 2012, 7:19 a.m.
Message ID <6d24f6bd75d4c9da78368d3cae9dbbc8a470b2b6.1331277565.git.dexuan.cui@intel.com>
Download mbox | patch
Permalink /patch/22945/
State Accepted
Commit 39f14c66d5df226689238810b759f502644deb5c
Headers show

Comments

Dexuan Cui - March 9, 2012, 7:19 a.m.
In the case of self-hosted-image.bb, IMAGE_FSTYPES = "vmdk", so the
variables alltypes and subimages don't contain ext3, and  .rootfs.ext3
won't be created, and finally the generated .hddimg and .vmdk don't have
an actual rootfs -- the size of the .vmdk file is only about 9MB.

[YOCTO #2067]

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/classes/image_types.bbclass |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Saul Wold - March 9, 2012, 7:30 a.m.
On 03/08/2012 11:19 PM, Dexuan Cui wrote:
> In the case of self-hosted-image.bb, IMAGE_FSTYPES = "vmdk", so the
> variables alltypes and subimages don't contain ext3, and  .rootfs.ext3
> won't be created, and finally the generated .hddimg and .vmdk don't have
> an actual rootfs -- the size of the .vmdk file is only about 9MB.
>
> [YOCTO #2067]
>
> Signed-off-by: Dexuan Cui<dexuan.cui@intel.com>

Nice Catch!

Acked-by: Saul Wold <sgw@linux.intel.com>

Sau!
> ---
>   meta/classes/image_types.bbclass |    6 ++++++
>   1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
> index 8b82018..e92f519 100644
> --- a/meta/classes/image_types.bbclass
> +++ b/meta/classes/image_types.bbclass
> @@ -26,13 +26,19 @@ def get_imagecmds(d):
>       # Live and VMDK images will be processed via inheriting
>       # bbclass and does not get processed here.
>       # vmdk depend on live images also depend on ext3 so ensure its present
> +    # Note: we need to ensure ext3 is in alltypes, otherwise, subimages may
> +    # not contain ext3 and the .rootfs.ext3 file won't be created.
>       if "vmdk" in types:
>           if "ext3" not in types:
>               types.append("ext3")
> +        if "ext3" not in alltypes:
> +            alltypes.append("ext3")
>           types.remove("vmdk")
>       if "live" in types:
>           if "ext3" not in types:
>               types.append("ext3")
> +        if "ext3" not in alltypes:
> +            alltypes.append("ext3")
>           types.remove("live")
>
>       if d.getVar('IMAGE_LINK_NAME', True):
Dexuan Cui - March 9, 2012, 7:40 a.m.
Saul Wold wrote on 2012-03-09:
> On 03/08/2012 11:19 PM, Dexuan Cui wrote:
>> In the case of self-hosted-image.bb, IMAGE_FSTYPES = "vmdk", so the
>> variables alltypes and subimages don't contain ext3, and
>> .rootfs.ext3 won't be created, and finally the generated .hddimg and
>> .vmdk don't have an actual rootfs -- the size of the .vmdk file is only about 9MB.
>> 
>> [YOCTO #2067]
>> 
>> Signed-off-by: Dexuan Cui<dexuan.cui@intel.com>
> 
> Nice Catch!
> 
> Acked-by: Saul Wold <sgw@linux.intel.com>
BTW, I didn't find the bug in my previous test because I didn't build
From scratch, so actually I already had a file
tmp/deploy/image/self-hosted-image-qemux86.ext3, and according to 
bootimg.bbclass's populate(), we used it -- but we should use a new .ext3 file.

Thanks,
-- Dexuan

Patch

diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
index 8b82018..e92f519 100644
--- a/meta/classes/image_types.bbclass
+++ b/meta/classes/image_types.bbclass
@@ -26,13 +26,19 @@  def get_imagecmds(d):
     # Live and VMDK images will be processed via inheriting
     # bbclass and does not get processed here.
     # vmdk depend on live images also depend on ext3 so ensure its present
+    # Note: we need to ensure ext3 is in alltypes, otherwise, subimages may
+    # not contain ext3 and the .rootfs.ext3 file won't be created.
     if "vmdk" in types:
         if "ext3" not in types:
             types.append("ext3")
+        if "ext3" not in alltypes:
+            alltypes.append("ext3")
         types.remove("vmdk")
     if "live" in types:
         if "ext3" not in types:
             types.append("ext3")
+        if "ext3" not in alltypes:
+            alltypes.append("ext3")
         types.remove("live")
 
     if d.getVar('IMAGE_LINK_NAME', True):