diff --git a/README.md b/README.md index 292a7ac..d8dc791 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/yocto/all-targets.md b/docs/yocto/all-targets.md index 230fe9c..d231339 100644 --- a/docs/yocto/all-targets.md +++ b/docs/yocto/all-targets.md @@ -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: diff --git a/docs/yocto/specifics/qemuarm.md b/docs/yocto/specifics/qemuarm.md new file mode 100644 index 0000000..851fec3 --- /dev/null +++ b/docs/yocto/specifics/qemuarm.md @@ -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). diff --git a/docs/yocto/specifics/qemuarm64.md b/docs/yocto/specifics/qemuarm64.md new file mode 100644 index 0000000..55fefbb --- /dev/null +++ b/docs/yocto/specifics/qemuarm64.md @@ -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).