[PATCH docs] Enhancing instructions on QEMU

OpenBMC Patches openbmc-patches at stwcx.xyz
Thu Jul 14 06:20:12 AEST 2016


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
+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




More information about the openbmc mailing list