Xen Zynq Distribution Support Forums
Yocto image as domU - Printable Version

+- Xen Zynq Distribution Support Forums (http://xzdforums.dornerworks.com)
+-- Forum: General Xilinx Support (http://xzdforums.dornerworks.com/forumdisplay.php?fid=1)
+--- Forum: Public Support (http://xzdforums.dornerworks.com/forumdisplay.php?fid=6)
+--- Thread: Yocto image as domU (/showthread.php?tid=687)

Pages: 1 2


Yocto image as domU - pello.heriz - 04-07-2017

Is it possible to add an image created myself with Yocto as a dom1 or dom2 guest? If the answer is yes, which are the steps I need to follow to add this image as a guest?

Best regards,
Pello


RE: Kernel panic when launching QEMU - Nathan.Studer - 04-07-2017

You can adapt the instructions in "Building and Installing the Guest" in the User Manual to copy the Yocto Kernel Image and Yocto RootFS to the Dom0 filesystem and configure the virtual machine.  Let me know if you have specific questions about these instructions.

When building the guest you need to make sure you have Xen kernel support enabled and that the Xen front end modules are included in the RootFS.  If you have the meta-virtualization layer as part of your Yocto setup this should already be taken care of for you.  

You may also want to adjust your kernel to add "console=hvc0" to the default kernel bootline.  As an example you can look at the DomU image recipe in our soon to be announced Yocto layer.  It's the same as meta-virtualization's Xen DomU recipe but with x86 specific functionality removed.

     Nate


RE: Kernel panic when launching QEMU - pello.heriz - 04-11-2017

Hi Nathan,

Thank you once again for your reply, I would try to do these steps and if I have any problem I will let you know.

Best regards,
Pello


RE: Kernel panic when launching QEMU - pello.heriz - 05-03-2017

Hi Nathan,

I have some questions related to the previous post I sent. You told me that including meta-virtualization layer in my Yocto project would be enough in order to create an image that supports Xen and use it as a guest. Anyway, I have seen your post about your new layer called meta-xzd where it is said that it depends on lot of more layers apart of meta-virtualization.

So in order to create an image and copy the kernel and rootfs to the Dom0, is necessary to include all the layers that are mentioned in the meta-xzd readme file on the Yocto project bblayers?

Another question, when you say "You may also want to adjust your kernel to add "console=hvc0" to the default kernel bootline", what are you referring to? Where do I need to change/add "console=hvc0"? in the local.conf file?

Best regards,
Pello


RE: Kernel panic when launching QEMU - Nathan.Studer - 05-03-2017

(05-03-2017, 09:03 AM)pello.heriz Wrote: Hi Nathan,

I have some questions related to the previous post I sent. You told me that including meta-virtualization layer in my Yocto project would be enough in order to create an image that supports Xen and use it as a guest. Anyway, I have seen your post about your new layer called meta-xzd where it is said that it depends on lot of more layers apart of meta-virtualization.

I might not have been clear but you do need more than the meta-virtualization layer; primarily whatever layers Petalinux depends on.  I was assuming that you already had all those layers, but if you don't you probably want to get them.

Quote:pello.heriz


So in order to create an image and copy the kernel and rootfs to the Dom0, is necessary to include all the layers that are mentioned in the meta-xzd readme file on the Yocto project bblayers?

The Yocto recipes will enable you to create a Dom0 image/rootfs (e.g.  bitbake xzd-image-minimal) and a DomU image/rootfs (e.g. bitbake xzd-domu-image-minimal).  There is currently no Yocto support for integrating DomU images/rootfs images into a Dom0, so this needs to be done manually.  Either add it to the Dom0 rootfs produced by Yocto or copy it to the SD card that the Dom0 rootfs was extracted to.

Our Yocto setup currently uses an initramfs for the main rootfs and overlays the first SD card partition on this rootfs to include guests images from the SD card.  If you want to do something different, you will likely need to disable the initramfs in your local.conf file by removing these lines:

Code:
# Build the xzd initramfs
INITRAMFS_IMAGE = "xzd-image-minimal-initramfs"

# Bundle the initramfs with the kernel
INITRAMFS_IMAGE_BUNDLE = "1"

# The initramfs is kind of big
INITRAMFS_MAXSIZE = "262144"


Quote:pello.heriz


Another question, when you say "You may also want to adjust your kernel to add "console=hvc0" to the default kernel bootline", what are you referring to? Where do I need to change/add "console=hvc0"? in the local.conf file?

Xen guests use the "hvc0" console for terminal output, which needs to be specified on the kernel bootline.  See the xzd-domu-image-minimal or xen-domu-image-minimal for how this can be done with your image.

     Nate


RE: Kernel panic when launching QEMU - pello.heriz - 05-17-2017

(05-03-2017, 03:35 PM)Nathan.Studer Wrote:
(05-03-2017, 09:03 AM)pello.heriz Wrote: Hi Nathan,

I have some questions related to the previous post I sent. You told me that including meta-virtualization layer in my Yocto project would be enough in order to create an image that supports Xen and use it as a guest. Anyway, I have seen your post about your new layer called meta-xzd where it is said that it depends on lot of more layers apart of meta-virtualization.

I might not have been clear but you do need more than the meta-virtualization layer; primarily whatever layers Petalinux depends on.  I was assuming that you already had all those layers, but if you don't you probably want to get them.

Quote:pello.heriz


So in order to create an image and copy the kernel and rootfs to the Dom0, is necessary to include all the layers that are mentioned in the meta-xzd readme file on the Yocto project bblayers?

The Yocto recipes will enable you to create a Dom0 image/rootfs (e.g.  bitbake xzd-image-minimal) and a DomU image/rootfs (e.g. bitbake xzd-domu-image-minimal).  There is currently no Yocto support for integrating DomU images/rootfs images into a Dom0, so this needs to be done manually.  Either add it to the Dom0 rootfs produced by Yocto or copy it to the SD card that the Dom0 rootfs was extracted to.

Our Yocto setup currently uses an initramfs for the main rootfs and overlays the first SD card partition on this rootfs to include guests images from the SD card.  If you want to do something different, you will likely need to disable the initramfs in your local.conf file by removing these lines:

Code:
# Build the xzd initramfs
INITRAMFS_IMAGE = "xzd-image-minimal-initramfs"

# Bundle the initramfs with the kernel
INITRAMFS_IMAGE_BUNDLE = "1"

# The initramfs is kind of big
INITRAMFS_MAXSIZE = "262144"


Quote:pello.heriz


Another question, when you say "You may also want to adjust your kernel to add "console=hvc0" to the default kernel bootline", what are you referring to? Where do I need to change/add "console=hvc0"? in the local.conf file?

Xen guests use the "hvc0" console for terminal output, which needs to be specified on the kernel bootline.  See the xzd-domu-image-minimal or xen-domu-image-minimal for how this can be done with your image.

     Nate


Hi Nathan,

I'm trying to build a xen-domu-image-minimal using meta-xzd layer. Anyway, I have try to clone this layer from https://github.com/dornerworks/meta-xzd web page but when I look into the cloned folder, there is nothing inside. This is what I get when I clone the layer:

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$ sudo git clone https://github.com/dornerworks/meta-xzd
Cloning into 'meta-xzd'...
remote: Counting objects: 416, done.
remote: Total 416 (delta 0), reused 0 (delta 0), pack-reused 416
Receiving objects: 100% (416/416), 856.59 KiB | 542.00 KiB/s, done.
Resolving deltas: 100% (182/182), done.
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$
generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$ ls meta-xzd/
generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$


Other thing is that even that you have told me to use xen-domu-image-minimal command, I have the next error:

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$ bitbake xen-domu-image-minimal
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 2865 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:01
Parsing of 2097 .bb files complete (2080 cached, 17 parsed). 2881 targets, 198 skipped, 0 masked, 0 errors.
WARNING: No recipes available for:
  /opt/yocto_GE/poky/master/meta-petalinux/recipes-devtools/python/python-smartpm_%.bbappend
ERROR: Nothing PROVIDES 'xen-domu-image-minimal'. Close matches:
  xen-image-minimal
  xen-guest-image-minimal
  kvm-image-minimal

So I supose that I need to execute the xen-guest-image-minimal option. Is this true?

Finally if I execute the second option, I have the next error:

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$ bitbake xen-guest-image-minimal
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 2865 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:01
Parsing of 2097 .bb files complete (2080 cached, 17 parsed). 2881 targets, 198 skipped, 0 masked, 0 errors.
WARNING: No recipes available for:
  /opt/yocto_GE/poky/master/meta-petalinux/recipes-devtools/python/python-smartpm_%.bbappend
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'xf86-video-vesa' (but /opt/yocto_GE/poky/master/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb RDEPENDS on or otherwise requires it)
ERROR: xf86-video-vesa was skipped: incompatible with host aarch64-poky-linux (not in COMPATIBLE_HOST)
NOTE: Runtime target 'xf86-video-vesa' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['xf86-video-vesa']
ERROR: Required build target 'xen-guest-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['xen-guest-image-minimal', 'xf86-video-vesa']

Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.


I don't know if you can help me, but anywise any answer will be welcome.

Best regards,
Pello


RE: Kernel panic when launching QEMU - Nathan.Studer - 05-17-2017

(05-17-2017, 07:53 AM)pello.heriz Wrote: I'm trying to build a xen-domu-image-minimal using meta-xzd layer. Anyway, I have try to clone this layer from https://github.com/dornerworks/meta-xzd web page but when I look into the cloned folder, there is nothing inside. This is what I get when I clone the layer:

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$ sudo git clone https://github.com/dornerworks/meta-xzd
Cloning into 'meta-xzd'...
remote: Counting objects: 416, done.
remote: Total 416 (delta 0), reused 0 (delta 0), pack-reused 416
Receiving objects: 100% (416/416), 856.59 KiB | 542.00 KiB/s, done.
Resolving deltas: 100% (182/182), done.
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$
generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$ ls meta-xzd/
generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master$

It looks like you are in the master branch, which doesn't have anything in it.  Switch to the `dw-v2016.4` branch and you should see all the layer files.

Quote:pello.heriz

Other thing is that even that you have told me to use xen-domu-image-minimal command, I have the next error:

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$ bitbake xen-domu-image-minimal
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 2865 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:01
Parsing of 2097 .bb files complete (2080 cached, 17 parsed). 2881 targets, 198 skipped, 0 masked, 0 errors.
WARNING: No recipes available for:
  /opt/yocto_GE/poky/master/meta-petalinux/recipes-devtools/python/python-smartpm_%.bbappend
ERROR: Nothing PROVIDES 'xen-domu-image-minimal'. Close matches:
  xen-image-minimal
  xen-guest-image-minimal
  kvm-image-minimal

So I supose that I need to execute the xen-guest-image-minimal option. Is this true?

Once you are in the correct branch you can run 'bitbake xzd-domu-image-minimal', which should work without issue.

You can instead use meta-virtualization's xen-guest-image-minimal, if you wish.

Quote:pello.heriz

Finally if I execute the second option, I have the next error:

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$ bitbake xen-guest-image-minimal
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 2865 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:01
Parsing of 2097 .bb files complete (2080 cached, 17 parsed). 2881 targets, 198 skipped, 0 masked, 0 errors.
WARNING: No recipes available for:
  /opt/yocto_GE/poky/master/meta-petalinux/recipes-devtools/python/python-smartpm_%.bbappend
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'xf86-video-vesa' (but /opt/yocto_GE/poky/master/meta-virtualization/recipes-extended/images/xen-guest-image-minimal.bb RDEPENDS on or otherwise requires it)
ERROR: xf86-video-vesa was skipped: incompatible with host aarch64-poky-linux (not in COMPATIBLE_HOST)
NOTE: Runtime target 'xf86-video-vesa' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['xf86-video-vesa']
ERROR: Required build target 'xen-guest-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['xen-guest-image-minimal', 'xf86-video-vesa']

Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.


I don't know if you can help me, but anywise any answer will be welcome.

Best regards, 
Pello

However, xen-guest-image-minimal will attempt to include some x86 specific packages since x11 is an included feature of the distro, which will result in the errors you posted.  Either create your own image without these packages or remove the packages from the xen-guest-image-minimal.  The former is what xzd-domu-image-minimal is:  xen-guest-image-minimal with x86 specific packages removed.

'xf86-video-vesa' and 'xf86-video-fbdev' are the packages in question.

     Nate


RE: Kernel panic when launching QEMU - pello.heriz - 05-18-2017

Hi Nathan,

I have switch to the dw-v2016.4 branch and cloned the meta-xzd layer correctly. Anyway, I have tried to execute 'bitbake xzd-domu-image-minimal' command and I have a problem related with a license. Here it is:

ou can also run generated qemu images with a command like 'runqemu qemux86'
generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$ bitbake xzd-domu-image-minimal
NOTE: /opt/yocto_GE/poky/master/meta-qt5/recipes-qt/qt5/qtbase_git.bb: base_contains is deprecated, please use bb.utils.contains instead.
NOTE: /opt/yocto_GE/poky/master/meta-qt5/recipes-qt/qt5/qtbase_git.bb: base_contains is deprecated, please use bb.utils.contains instead.
ERROR: /opt/yocto_GE/poky/master/meta-xzd/recipes-bsp/u-boot/u-boot-xlnx_xzd.bb: This recipe does not have the LICENSE field set (u-boot-xlnx)
ERROR: Failed to parse recipe: /opt/yocto_GE/poky/master/meta-xzd/recipes-bsp/u-boot/u-boot-xlnx_xzd.bb

What do I need to do in order to get that license or avoid this issue? Do I need to clone this https://github.com/Xilinx/u-boot-xlnx/tree/master/Licenses and add u-boot-xlnx to my bblayers or something similar to that?

Best regards,
Pello


RE: Kernel panic when launching QEMU - Nathan.Studer - 05-18-2017

(05-18-2017, 07:29 AM)pello.heriz Wrote: Hi Nathan,

I have switch to the dw-v2016.4 branch and cloned the meta-xzd layer correctly. Anyway, I have tried to execute 'bitbake xzd-domu-image-minimal' command and I have a problem related with a license. Here it is:

ou can also run generated qemu images with a command like 'runqemu qemux86'
generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$ bitbake xzd-domu-image-minimal
NOTE: /opt/yocto_GE/poky/master/meta-qt5/recipes-qt/qt5/qtbase_git.bb: base_contains is deprecated, please use bb.utils.contains instead.
NOTE: /opt/yocto_GE/poky/master/meta-qt5/recipes-qt/qt5/qtbase_git.bb: base_contains is deprecated, please use bb.utils.contains instead.
ERROR: /opt/yocto_GE/poky/master/meta-xzd/recipes-bsp/u-boot/u-boot-xlnx_xzd.bb: This recipe does not have the LICENSE field set (u-boot-xlnx)
ERROR: Failed to parse recipe: /opt/yocto_GE/poky/master/meta-xzd/recipes-bsp/u-boot/u-boot-xlnx_xzd.bb

What do I need to do in order to get that license or avoid this issue? Do I need to clone this https://github.com/Xilinx/u-boot-xlnx/tree/master/Licenses and add u-boot-xlnx to my bblayers or something similar to that?

Best regards,
Pello

Do you have the 'rel-v2016.4' branch of the meta-petalinuxmeta-xilinx, and meta-xilinx-tools layers included in your Yocto setup?  The meta-xzd layer is dependent on those layers.  In this case the base u-boot-xlnx information is defined in meta-xilinx and meta-xzd overrides select portions of it.

     Nate


RE: Kernel panic when launching QEMU - pello.heriz - 05-19-2017

Hi Nathan,

I have solved the license issue, but I still have another error in order to compile the xen-domu-image-minimal. Here it is:

generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$ bitbake xzd-domu-image-minimal
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 1341 entries from dependency cache.
WARNING: /opt/yocto_GE/poky/master/meta-petalinux/recipes-external/external-xilinx-toolchain/libgcc-xilinx.bb: LICENSE_libgcov-dev includes licenses (GPL-3.0) that are not listed in LICENSE
Parsing recipes: 100% |##########################################| Time: 0:01:34
Parsing of 2104 .bb files complete (1042 cached, 1062 parsed). 2888 targets, 198 skipped, 0 masked, 0 errors.
WARNING: No recipes available for:
/opt/yocto_GE/poky/master/meta-petalinux/recipes-devtools/python/python-smartpm_%.bbappend
/opt/yocto_GE/poky/master/meta-xzd/recipes-devtools/python/python3_3.5.1.bbappend
/opt/yocto_GE/poky/master/meta-xzd/recipes-kernel/linux/linux-xlnx_4.6.bbappend
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing RPROVIDES 'nativesdk-smartpm' (but /opt/yocto_GE/poky/master/meta/recipes-core/meta/buildtools-tarball.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'nativesdk-smartpm' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['nativesdk-smartpm']
ERROR: Required build target 'xzd-domu-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['xzd-domu-image-minimal', 'buildtools-tarball', 'nativesdk-smartpm']

Summary: There were 2 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
generalelectric@mlan11214m117linux:/opt/yocto_GE/poky/master/build$

Do you have any idea on what is happening?

Thanks,
Pello