Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable virtIO for macOS in CI #109

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Install dependencies (via Homebrew)
# 'expect' is only a dependency for CI testing
run: |
brew install llvm qemu dtc make expect
brew install llvm qemu dtc make dosfstools expect
echo "/usr/local/opt/llvm/bin:$PATH" >> $GITHUB_PATH
- name: Install Zig
run: |
Expand Down
10 changes: 2 additions & 8 deletions ci/examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,10 @@ simulate_zig "release" "ReleaseSafe"
build_zig "release" "ReleaseSmall"
simulate_zig "release" "ReleaseSmall"

# The setup for virtIO block does not currently work on macOS due to
# Linux-specific utilities not being available.
# if [ "$(uname)" == "Linux" ]; then

# build_virtio "qemu_virt_aarch64" "debug"
# build_virtio "qemu_virt_aarch64" "release"
build_virtio "qemu_virt_aarch64" "debug"
build_virtio "qemu_virt_aarch64" "release"
# build_virtio "odroidc4" "debug"
# build_virtio "odroidc4" "release"

# fi

echo ""
echo "CI|INFO: Passed all VMM tests"
40 changes: 37 additions & 3 deletions examples/virtio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,40 @@ The example currently works on the following platforms:
* QEMU virt AArch64
* HardKernel Odroid-C4

## Dependencies

In addition to the dependencies outlined in the top-level README, the following dependencies
are needed:
* Zig (for cross-compiling for Linux user-space)
* mkfs.fat

### Linux

Zig can be installed manually or via a package manager, see
[here](https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager).

You may already have `mkfs.fat`, if not and you use `apt` try the following command:
```sh
sudo apt-get install dosfstools
```

### macOS

Zig can be installed manually or via a package manager, see
[here](https://github.com/ziglang/zig/wiki/Install-Zig-from-a-Package-Manager).

To install `mkfs.fat` run:
```sh
brew install dosfstools
```

### Nix

The top-level `shell.nix` has everything necessary:
```sh
nix-shell ../../shell.nix
```

## Building

```sh
Expand Down Expand Up @@ -59,10 +93,10 @@ serial device.
When you boot the example, you will see different coloured output for each guest.
The Linux logs will be interleaving like so:
```
Starting klogd: OKStarting klogd:
Starting klogd: OKStarting klogd:
OK
Running sysctl: Running sysctl: OK
OKSaving random seed:
OKSaving random seed:
Saving random seed: [ 4.070358] random: crng init done
[ 4.103992] random: crng init done
OK
Expand All @@ -71,7 +105,7 @@ Starting network: OK
OK

Welcome to Buildroot
buildroot login:
buildroot login:
Welcome to Buildroot
buildroot login:
```
Expand Down
2 changes: 2 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ in
llvm.lld
llvm.libllvm
llvm.libclang
dosfstools
util-linux
# expect is only needed for CI testing but we include it for
# completeness
expect
Expand Down
Loading