Add prepare-emmc-qemu

prepare-emmc-qemu is a script that assembles a bootable eMMC image from
the WIC and u-boot artefacts of an eMMC-based build of OpenBMC:

```
andrew@mistburn:~/src/openbmc/openbmc/build/p10bmc $ prepare-emmc-qemu -h
NAME
        prepare-emmc-qemu: Assemble an OpenBMC eMMC image that can be booted under QEMU

SYNOPSYS
        prepare-emmc-qemu <TARGET> <BUILDDIR> [IMAGESIZE]

DESCRIPTION
        TARGET:         The name of the target machine, used to locate the required images.
        BUILDDIR:       The path to the OpenBMC build directory.
        IMAGESIZE:      The output image size, may be specified with units. Defaults to 16G.

EXAMPLE:
        prepare-emmc-qemu p10bmc ~/src/openbmc/openbmc/build/p10bmc
andrew@mistburn:~/src/openbmc/openbmc/build/p10bmc $ prepare-emmc-qemu p10bmc .
+ target=p10bmc
+ build_dir=.
+ image_size=16G
+ fw_dir=./tmp/deploy/images/p10bmc
+ wicxz=./tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc.wic.xz
+ mmc=mmc-p10bmc.img
+ dd of=mmc-p10bmc.img if=/dev/zero bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (134 MB, 128 MiB) copied, 0.115718 s, 1.2 GB/s
+ dd of=mmc-p10bmc.img if=./tmp/deploy/images/p10bmc/u-boot-spl.bin conv=notrunc
107+0 records in
107+0 records out
54784 bytes (55 kB, 54 KiB) copied, 0.00642483 s, 8.5 MB/s
+ dd of=mmc-p10bmc.img if=./tmp/deploy/images/p10bmc/u-boot.bin conv=notrunc bs=1K seek=64
411+1 records in
411+1 records out
421275 bytes (421 kB, 411 KiB) copied, 0.0129515 s, 32.5 MB/s
+ xzdec ./tmp/deploy/images/p10bmc/obmc-phosphor-image-p10bmc.wic.xz
+ dd of=mmc-p10bmc.img conv=notrunc bs=1M seek=2
0+1846910 records in
0+1846910 records out
15167689728 bytes (15 GB, 14 GiB) copied, 100.126 s, 151 MB/s
+ truncate --size 16G mmc-p10bmc.img
+ set +x

For an AST2600-based machine, invoke QEMU with the following parameters:

        -drive file=/home/andrew/src/openbmc/openbmc/build/p10bmc/mmc-p10bmc.img,if=sd,format=raw,index=2
```

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I9dff01b4f85aa51e3253a6989bcd80bb2c48b6a9
1 file changed
tree: 8197ef73711f27e14025529ca06005911c37eec7
  1. adcapp/
  2. altitude/
  3. autojson/
  4. bi2cp/
  5. cla-signers/
  6. dbus-pcap/
  7. dbusView/
  8. ddconvnotrunc/
  9. expectedJsonChecker/
  10. format-yaml/
  11. maintainers/
  12. netboot/
  13. openbmc-autobump/
  14. openbmc-events/
  15. openbmctool/
  16. overlay/
  17. pldm/
  18. prepare-emmc-qemu/
  19. pretty-journal/
  20. pwmtachtool/
  21. reboot/
  22. reboot-ping-pong/
  23. rootfs_size/
  24. sensor_yaml_config/
  25. tracing/
  26. upload_and_update/
  27. witherspoon-debug/
  28. LICENSE
  29. MAINTAINERS
  30. README.md
README.md

The OpenBMC Tools Collection

The goal of this repository is to collect the two-minute hacks you write to automate interactions with OpenBMC systems.

It's highly likely the scripts don't meet your needs - they could be undocumented, dysfunctional or utterly broken. Please help us improve!

Repository Rules

  • Always inspect what you will be executing
  • Some hacking on your part is to be expected

If you're still with us

Then this repository aims to be the default destination for your otherwise un-homed scripts. As such we are setting the bar for submission pretty low, and we aim to make the process as easy as possible.

Sending patches

Please use gerrit for all patches to this repository:

Do note that you will need to be party to the OpenBMC CLA before your contributions can be accepted. See Gerrit Setup and CLA for more information.

What we will do once we have your patches

So long as your patches look sane with a cursory glance you can expect them to be applied. We may push back in the event that similar tools already exist or there are egregious issues.

What you must have in your patches

We don't ask for much, but you need to give us at least a Signed-off-by, use SPDX markers in your source files and put your work under an Apache 2.0 compatible license.

How you consume the repository

There's no standard way to install the scripts housed here, and adding parts of the repository to your PATH might be a bit of a dice-roll. We may also move or remove scripts from time to time as part of housekeeping. It's probably best to copy things out if you need stability.