summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-08-01 13:29:22 -0500
committerGitHub <noreply@github.com>2016-08-01 13:29:22 -0500
commit5e080664d9fd52160c9bbf41d0d76db40db28796 (patch)
tree3f9c62ca2f8f7c83117d09f8c04e50c6f16965c4
parent481cdd2fe1953cc1d2e0b9cb0ef0fe22cba95f7c (diff)
parent81db7dbabe82d048a708d8f190f85b0e52236337 (diff)
downloadopenbmc-docs-5e080664d9fd52160c9bbf41d0d76db40db28796.tar.gz
openbmc-docs-5e080664d9fd52160c9bbf41d0d76db40db28796.zip
Merge pull request #33 from causten/cheatsheet
Enhancing instructions on QEMU
-rw-r--r--cheatsheet.md55
1 files changed, 45 insertions, 10 deletions
diff --git a/cheatsheet.md b/cheatsheet.md
index 873fbf9..8909da8 100644
--- a/cheatsheet.md
+++ b/cheatsheet.md
@@ -88,23 +88,58 @@ devices to boot a Linux kernel. OpenBMC also [maintains a
tree](https://github.com/openbmc/qemu) with patches on their way upstream or
temporary work-arounds that add to QEMU's capabilities where appropriate.
-QEMU's wiki has instructions for [building from
-source](http://wiki.qemu.org/Documentation/GettingStartedDevelopers).
+```
+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 \
+```
+If you get an error you likely need to build QEMU (see the section in this document). If no error and QEMU starts up just change the port when interacting with the BMC...
-Assuming the current working directory is the `build` directory (from sourcing
-`oe-init-build-env`), a palmetto-bmc machine can be invoked with:
+```
+curl -c cjar -b cjar -k -H "Content-Type: application/json" \
+-X POST https://localhost:2443/login -d "{\"data\": [ \"root\", \"0penBmc\" ] }"
+```
+or
```
-qemu-system-arm \
- -M palmetto-bmc \
- -m 256 \
- -nographic \
- -kernel tmp/deploy/images/palmetto/cuImage-palmetto.bin \
- -initrd tmp/deploy/images/palmetto/obmc-phosphor-image-palmetto.cpio.gz
+ssh -p 2222 root@localhost
```
To quit, type `Ctrl-a c` to switch to the QEMU monitor, and then `quit` to exit.
+## Building QEMU
+
+```
+git clone https://github.com/openbmc/qemu.git
+cd qemu
+git submodule update --init dtc
+mkdir build
+cd build
+../configure --target-list=arm-softmmu
+make
+```
+Built file will be located at: ```arm-softmmu/qemu-system-arm```
+
+### 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
+```
+
+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:
OpenPOWER on IntegriCloud