Skip to content

Commit

Permalink
docs(yocto/qemu): add all instructions for QEMU 32-bit and QEMU 64-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
nikAizuddin committed Jul 19, 2023
1 parent 3bf3f5b commit ba5db09
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 15 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ git clone --recursive https://github.com/extra2000/yocto-ros2-minimal.git
* [Raspberry Pi 4 B](docs/yocto/specifics/rpi4b.md)
* Pine64:
* [Rock64](docs/yocto/specifics/rock64.md)
* QEMU:
* [ARM 32-bit](docs/yocto/specifics/qemuarm.md)
* [ARM 64-bit](docs/yocto/specifics/qemuarm64.md)
* All Yocto targets: [Yocto Building for All Targets](docs/yocto/all-targets.md)
15 changes: 0 additions & 15 deletions docs/yocto/all-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,6 @@ bitbake mc:*:ros2-image -c populate_sdk
```


## Testing with QEMU

To start QEMU with SELinux enforcing, use the following `runqemu` command:
```
runqemu qemuarm slirp nographic qemuparams="-m 512 -net nic,netdev=eth0 -netdev user,id=eth0,hostfwd=tcp:127.0.0.1:1534-:1534 -net nic"
```

To start QEMU with SELinux permissive, use the following `runqemu` command:
```
runqemu qemuarm slirp nographic qemuparams="-m 512 -net nic,netdev=eth0 -netdev user,id=eth0,hostfwd=tcp:127.0.0.1:1534-:1534 -net nic" bootparams="selinux=1 enforcing=0"
```

Login as `yocto` user with password `yocto`. Then follow testing instructions in [Testing](common/testing.md).


## Flashing to SD Card

Image files and instructions how to flash to SD card are as follows:
Expand Down
55 changes: 55 additions & 0 deletions docs/yocto/specifics/qemuarm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# QEMU ARM 32-bit


## Building

Create container:
```
podman run -it --rm \
--network=host \
--userns="keep-id:uid=1000,gid=1000" \
-v ${PWD}/project:${PWD}/project:rw \
--workdir ${PWD}/project/yocto \
--security-opt label=disable \
localhost/extra2000/yocto-toolkit:latest \
bash
source layers/poky/oe-init-build-env build
```

Check dependencies:
```
bitbake -p mc:qemuarm:ros2-image
```

Build:
```
bitbake mc:qemuarm:ros2-image
```


## Testing

The following `runqemu` commands should be executed using `yocto-toolkit` Podman container.

To start QEMU with SELinux enforcing, use the following `runqemu` command:
```
runqemu \
qemuarm \
slirp \
nographic \
qemuparams="-m 512 -net nic -net user,hostfwd=tcp:127.0.0.1:1534-:1534,hostfwd=tcp:127.0.0.1:22222-:22,hostfwd=tcp:127.0.0.1:2345-:2345"
```

To start QEMU with SELinux permissive, use the following `runqemu` command:
```
runqemu \
qemuarm \
slirp \
nographic \
qemuparams="-m 512 -net nic -net user,hostfwd=tcp:127.0.0.1:1534-:1534,hostfwd=tcp:127.0.0.1:22222-:22,hostfwd=tcp:127.0.0.1:2345-:2345" \
bootparams="selinux=1 enforcing=0"
```

**NOTE: If the port forwarding doesn't work, try shutdown QEMU, respawn the `yocto-toolkit` Podman container, and re-execute the same `runqemu` command again.**

Login as `yocto` user with password `yocto`. Then follow testing instructions in [Testing](../common/testing.md).
55 changes: 55 additions & 0 deletions docs/yocto/specifics/qemuarm64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# QEMU ARM 64-bit


## Building

Create container:
```
podman run -it --rm \
--network=host \
--userns="keep-id:uid=1000,gid=1000" \
-v ${PWD}/project:${PWD}/project:rw \
--workdir ${PWD}/project/yocto \
--security-opt label=disable \
localhost/extra2000/yocto-toolkit:latest \
bash
source layers/poky/oe-init-build-env build
```

Check dependencies:
```
bitbake -p mc:qemuarm64:ros2-image
```

Build:
```
bitbake mc:qemuarm64:ros2-image
```


## Testing

The following `runqemu` commands should be executed using `yocto-toolkit` Podman container.

To start QEMU with SELinux enforcing, use the following `runqemu` command:
```
runqemu \
qemuarm64 \
slirp \
nographic \
qemuparams="-m 512 -net nic -net user,hostfwd=tcp:127.0.0.1:1534-:1534,hostfwd=tcp:127.0.0.1:22222-:22,hostfwd=tcp:127.0.0.1:2345-:2345"
```

To start QEMU with SELinux permissive, use the following `runqemu` command:
```
runqemu \
qemuarm64 \
slirp \
nographic \
qemuparams="-m 512 -net nic -net user,hostfwd=tcp:127.0.0.1:1534-:1534,hostfwd=tcp:127.0.0.1:22222-:22,hostfwd=tcp:127.0.0.1:2345-:2345" \
bootparams="selinux=1 enforcing=0"
```

**NOTE: If the port forwarding doesn't work, try shutdown QEMU, respawn the `yocto-toolkit` Podman container, and re-execute the same `runqemu` command again.**

Login as `yocto` user with password `yocto`. Then follow testing instructions in [Testing](../common/testing.md).

0 comments on commit ba5db09

Please sign in to comment.