Skip to content

Commit

Permalink
update README.md with cross compilation information
Browse files Browse the repository at this point in the history
Fixes #1649

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
  • Loading branch information
rminnich authored and hugelgupf committed May 3, 2020
1 parent d865ec1 commit 3d272ec
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Expand Up @@ -173,6 +173,28 @@ qemu-system-x86_64 -kernel $KERNEL -initramfs /tmp/initramfs.linux_amd64.cpio -n
(It fails to do that because some initialization is missing when the shell is
started without a proper init.)

## Cross Compilation (targeting different architectures and OSes)

Cross-OS and -architecture compilation comes for free with Go. In fact, every PR
to the u-root repo is built against the following architectures: amd64, x86
(i.e. 32bit), mipsle, armv7, arm64, and ppc64le.

Further, we run integration tests on linux/amd64, freebsd/amd64 and linux/arm64,
using several CI systems. If you need to add another CI system, processor or OS,
please let us know.

To cross compile for an ARM, on Linux:

```shell
GOARCH=arm u-root
```

If you are on OSX, and wish to build for Linux on AMD64:

```shell
GOOS=linux GOARCH=amd64 u-root
```

## Testing in QEMU

A good way to test the initramfs generated by u-root is with qemu:
Expand Down

0 comments on commit 3d272ec

Please sign in to comment.