xref: /openbmc/docs/cheatsheet.md (revision a91308a902b0d647ea9663e3b26545b72cee49de)
1cdfa8079SJeremy Kerr
2cdfa8079SJeremy Kerr# OpenBMC cheatsheet
3cdfa8079SJeremy Kerr
4cdfa8079SJeremy KerrThis document is intended to provide a set of recipes for common OpenBMC
5cdfa8079SJeremy Kerrcustomisation tasks, without having to know the full yocto build process.
6cdfa8079SJeremy Kerr
7cdfa8079SJeremy Kerr## Using a local kernel build
8cdfa8079SJeremy Kerr
9cdfa8079SJeremy KerrThe kernel recipe is in:
10cdfa8079SJeremy Kerr
11cdfa8079SJeremy Kerr```
12cdfa8079SJeremy Kerr meta-phosphor/common/recipes-kernel/linux/linux-obmc_4.2.bb
13cdfa8079SJeremy Kerr```
14cdfa8079SJeremy Kerr
15cdfa8079SJeremy KerrTo use a local git tree, change the `SRC_URI` to a git:// URL without
16cdfa8079SJeremy Kerra hostname. For example:
17cdfa8079SJeremy Kerr
18cdfa8079SJeremy Kerr```
19cdfa8079SJeremy KerrSRC_URI = "git:///home/jk/devel/linux;protocol=git;branch=${KBRANCH}"
20cdfa8079SJeremy Kerr```
21cdfa8079SJeremy Kerr
22cdfa8079SJeremy KerrThe `SRCREV` variable can be used to set an explicit git commit. The
23cdfa8079SJeremy Kerrdefault (`${AUTOREV}`) will use the latest commit in `KBRANCH`.
24cdfa8079SJeremy Kerr
257b22067aSJoel Stanley## Building for Palmetto
26cdfa8079SJeremy Kerr
277b22067aSJoel StanleyThe Palmetto target is `palmetto`.
287b22067aSJoel Stanley
297b22067aSJoel StanleyIf you are starting from scratch without a `build/conf` directory you can just:
307b22067aSJoel Stanley```
317b22067aSJoel Stanley$ cd openbmc
327b22067aSJoel Stanley$ TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-ibm/meta-palmetto/conf . oe-init-build-env
3335abff5fSJeremy Kerr$ bitbake obmc-phosphor-image
347b22067aSJoel Stanley```
357b22067aSJoel Stanley
360ea78f3aSChris Austen## Building the OpenBMC SDK
370ea78f3aSChris AustenLooking for a way to compile your programs for 'ARM' but you happen to be running on a 'PPC' or 'x86' system?  You can build the sdk receive a fakeroot environment.
380ea78f3aSChris Austen```
390ea78f3aSChris Austen$ bitbake -c populate_sdk obmc-phosphor-image
400ea78f3aSChris Austen$ ./tmp/deploy/sdk/openbmc-phosphor-glibc-x86_64-obmc-phosphor-image-armv5e-toolchain-1.8+snapshot.sh
410ea78f3aSChris Austen```
420ea78f3aSChris AustenFollow the prompts.  After it has been installed the default to setup your env will be similar to this command
430ea78f3aSChris Austen```
440ea78f3aSChris Austen. /opt/openbmc-phosphor/1.8+snapshot/environment-setup-armv5e-openbmc-linux-gnueabi
450ea78f3aSChris Austen```
460ea78f3aSChris Austen
477b22067aSJoel Stanley## Rebuilds & Reconfiguration
487b22067aSJoel Stanley
497b22067aSJoel StanleyYou can reconfigure your build by removing the build/conf dir:
507b22067aSJoel Stanley```
517b22067aSJoel Stanleyrm -rf build/conf
527b22067aSJoel Stanley```
53*a91308a9SJoel Stanleyand running `oe-init-build-env` again (possibly with `TEMPLATECONF` set).
548196be3eSJeremy Kerr
558196be3eSJeremy Kerr## Useful dbus CLI tools
568196be3eSJeremy Kerr
578196be3eSJeremy Kerr## `busctl`
588196be3eSJeremy Kerr
598196be3eSJeremy Kerrhttp://www.freedesktop.org/software/systemd/man/busctl.html
608196be3eSJeremy Kerr
61111325b5SBrad BishopGreat tool to issue dbus commands via cli. That way you don't have to wait for
628196be3eSJeremy Kerrthe code to hit the path on the system. Great for running commands with QEMU
638196be3eSJeremy Kerrtoo!
648196be3eSJeremy Kerr
658196be3eSJeremy KerrRun as:
668196be3eSJeremy Kerr
678196be3eSJeremy Kerr```
688196be3eSJeremy Kerrbusctl call <path> <interface> <object> <method> <parameters>
698196be3eSJeremy Kerr```
708196be3eSJeremy Kerr
718196be3eSJeremy Kerr* \<parameters\> example : sssay "t1" "t2" "t3" 2 2 3
72