[PATCH docs] Enhancing instructions on QEMU

Joel Stanley joel at jms.id.au
Fri Jul 15 02:18:42 AEST 2016


On Thu, Jul 14, 2016 at 5:50 AM, OpenBMC Patches
<openbmc-patches at stwcx.xyz> wrote:
> From: Chris Austen <austenc at us.ibm.com>
>
> Added step by step details on using QEMU in both a virtual
> bridge and tap environment.  Latest features of QEMU palmetto
> integration now allow for uboot flash support and ftgmac100
> device support.  That means you can start the qemu session
> from uboot and run the real ftgmac ethernet device.
>
> Signed-off-by: Chris Austen <austenc at us.ibm.com>
> ---
>  cheatsheet.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>
> diff --git a/cheatsheet.md b/cheatsheet.md
> index 873fbf9..37a9c60 100644
> --- a/cheatsheet.md
> +++ b/cheatsheet.md
> @@ -105,6 +105,65 @@ qemu-system-arm \
>
>  To quit, type `Ctrl-a c` to switch to the QEMU monitor, and then `quit` to exit.
>
> +## Using QEMU With Network capabilities
> +
> +In an attempt to get a palmetto working model with network capabilties a fork
> +was created.  The plan is to merge it back in to the qemu repo but for right now
> +the steps required to build, launch and verify are as follows.
> +
> +Compile a Palmetto flash image via Yocto and locate the file...
> +>build/tmp/deploy/images/palmetto/flash-palmetto
> +
> +```
> +git clone git at github.com:legoater/qemu.git

I support the idea of better documentation on how to use Qemu.
However, this is Cedric's personal development tree. I'd be hesitant
to point users at this - it's his space for doing development, so at
any one moment it may be broken.

We are aggressively upstreaming our Qemu code. I'd suggest pointing
users to upstream for their testing.

Cheers,

Joel

> +cd qemu
> +git checkout aspeed
> +mkdir build
> +cd build
> +../configure --target-list=arm-softmmu
> +make
> +cd arm-softmmu
> +```
> +
> +### Use a bridge device
> +Using a bridge device requires a bit of root access to set it up.  The benefit
> +is your qemu session runs in the bridges subnet so no port forwarding is needed.
> +There are packages needed to yourself a virbr0 such as
> +```
> +apt-get install libvirt libvirt-bin bridge-utils uml-utilities qemu-system-common
> +```
> +
> +```
> +./qemu-system-arm -m 256 -M palmetto-bmc -nographic \
> +-drive file=<path>/flash-palmetto,format=raw,if=mtd \
> +-net nic,macaddr=C0:FF:EE:00:00:02,model=ftgmac100  \
> +-net bridge,id=net0,helper=/usr/lib/qemu-bridge-helper,br=virbr0
> +```
> +
> +### Use a tap device
> +When running in an environment that does not support you having root you will
> +need to forward the model ports.
> +```
> +./qemu-system-arm -m 256 -M palmetto-bmc -nographic \
> +-drive file=<path>/flash-palmetto,format=raw,if=mtd \
> +-net nic \
> +-net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostname=qemu \
> +
> +```
> +Now you just need to redirect to communicate...
> +```
> +curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST https://localhost:2443/login -d "{\"data\": [ \"root\", \"0penBmc\" ] }"
> +```
> +or
> +```
> +ssh -p 2222 root at localhost
> +```
> +
> +There are some other useful parms like that can redirect the console to another
> +window.  This results in having an easily accessible qemu command session.
> +-monitor stdio -serial pty -nodefaults
> +
> +
>  ## Booting the host
>
>  Login:
> --
> 2.9.0
>
>
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc


More information about the openbmc mailing list