diff --git a/ports/azure_sdk.md b/ports/azure_sdk.md index 7dce4d91..1b3b6cca 100644 --- a/ports/azure_sdk.md +++ b/ports/azure_sdk.md @@ -45,99 +45,16 @@ are: `busybox`, `openssl`, `curl` and `azure_sdk`. [Here](https://github.com/phoenix-rtos/phoenix-rtos-doc/blob/master/building/script.md) you can find more about building scripts. -Next, you will need an internet connection. Here is an example of how to set up a network connection on -`ia32-generic-qemu`: +Next, you will need an internet connection. +[Here](../quickstart/ia32-generic-qemu.md#network-setup-on-ia32-generic-qemu) +is an example of how to set up a network connection on `ia32-generic-qemu`. -## Network setup on ia32-generic-qemu +- To complete the configuration please set the current date using `date` applet, like below: -- Note: This guide was tested on `Ubuntu 20.04 LTS` host OS. + ![Image](_images/azure_date.png) -There are few steps to follow: - - 1. Create and set up `vibr0` bridge on a host using `qemu-bridge-helper`: - - - Install the required package and ensure that `libvirtd` is running: - - ```console - sudo apt-get update - sudo apt-get install qemu-system-common - systemctl enable libvirtd.service - systemctl start libvirtd.service - ``` - - - Start the default network bridge, and configure it to run on startup. - - ```console - sudo virsh net-autostart --network default - sudo virsh net-start --network default - ``` - - - After that verify that the IP range `192.168.122.1/24` is reported by the `vibr0` bridge: - - ```console - ip addr show virbr0 - ``` - - - The expected output: - - ```console - virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000 - link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff - inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 - valid_lft forever preferred_lft forever - ``` - - - Set up `qemu-bridge-helper` (`chmod` is used here to allow running QEMU without root privileges) - - ```console - echo "allow virbr0" > /etc/qemu/bridge.conf - sudo chmod a+rw /etc/qemu/bridge.conf - ``` - - - If `/etc/qemu` directory does not exist, create it and provide required privileges: - - ```console - sudo mkdir /etc/qemu - sudo chmod a+rw /etc/qemu - echo "allow virbr0" > /etc/qemu/bridge.conf - sudo chmod a+rw /etc/qemu/bridge.conf - ``` - - ![Image](_images/azure_sdk_vibr_setup.png) - - - Sources: , - - - 2. Launch `qemu` using a starting script with `net` suffix: - - ```console - ./scripts/ia32-generic-qemu-net.sh - ``` - - 3. Configure network and run `ash` (Busybox applet) using `rc` script: - - - Note: By default `IP` is assigned using `DHCP`. For other possibilities please check the configuration file - located in `_projects/ia32-generic-qemu/rootfs-overlay/etc/rc.conf.d/network` - - - Note: There are other programs executed by the script. For more information please check the content of the `rc` - file for `ia32-generic-qemu` in `_projects/ia32-generic-qemu/rootfs-overlay/etc/rc` - - ```console - /linuxrc - ``` - - - As you can see, the advanced version of `Phoenix-RTOS` with `POSIX` shell has been started: - - ![Image](_images/azure_linuxrc.png) - - - Now you can check the internet connection using the `ping` applet. - - - To complete the configuration please set the current date using `date` applet, like below: - - ![Image](_images/azure_date.png) - - - Note: The required argument entered after `@` is EPOCH (POSIX time format) - you can gt it for example from - [here](https://www.epochconverter.com/). +- Note: The required argument entered after `@` is EPOCH (POSIX time format) - you can gt it for example from + [here](https://www.epochconverter.com/). ## Running the IoThub Client sample diff --git a/ports/_images/azure_linuxrc.png b/quickstart/_images/ia32_linuxrc.png similarity index 100% rename from ports/_images/azure_linuxrc.png rename to quickstart/_images/ia32_linuxrc.png diff --git a/ports/_images/azure_sdk_vibr_setup.png b/quickstart/_images/ia32_sdk_vibr_setup.png similarity index 100% rename from ports/_images/azure_sdk_vibr_setup.png rename to quickstart/_images/ia32_sdk_vibr_setup.png diff --git a/quickstart/ia32-generic-qemu.md b/quickstart/ia32-generic-qemu.md index ca614a9d..6ccba415 100644 --- a/quickstart/ia32-generic-qemu.md +++ b/quickstart/ia32-generic-qemu.md @@ -126,6 +126,140 @@ The number of detected cores is presented during kernel initialization. ![Image](_images/qemu-ia32-generic-smp.png) +## Network setup on `ia32-generic-qemu` + +- Note: This guide was tested on `Ubuntu 24.04 LTS` host OS. + +There are few steps to follow: + + 1. Create and set up `vibr0` bridge on a host using `qemu-bridge-helper`: + + - Install the required package and ensure that `libvirtd` is running: + + ```bash + sudo apt update + sudo apt install qemu-system-common + sudo apt install libvirt-clients libvirt-daemon + systemctl enable libvirtd.service + systemctl start libvirtd.service + ``` + + - Start the default network bridge, and configure it to run on startup. + + ```bash + sudo virsh net-autostart --network default + sudo virsh net-start --network default + ``` + + - If IPv6 is needed change the configuration of `virbr0` + + ```bash + sudo virsh net-destroy default + sudo virsh net-edit default + ``` + + The commands above open the editor of the configuration file of `virbr0`. There are two necessary changes: + + - Add IPv6 address to the bridge interface: + + ```XML + + ``` + + - Enable NAT for IPv6: + + ```XML + + + + ``` + + The overall config should look something like this: + + ```XML + + default + a9e032b7-e32f-4f91-a273-e6c6f15b8904 + + + + + + + + + + + + + ``` + + Save the config file and start the bridge by running: + + ```bash + sudo virsh net-start default + ``` + + - After that verify that the IP range `192.168.122.1/24` is reported by the `vibr0` bridge: + + ```bash + ip addr show virbr0 + ``` + + - The expected output: + + ```bash + virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000 + link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff + inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 + valid_lft forever preferred_lft forever + ``` + + - Set up `qemu-bridge-helper` (`chmod` is used here to allow running QEMU without root privileges) + + ```bash + echo "allow virbr0" > /etc/qemu/bridge.conf + sudo chmod a+rw /etc/qemu/bridge.conf + ``` + + - If `/etc/qemu` directory does not exist, create it and provide required privileges: + + ```bash + sudo mkdir /etc/qemu + sudo chmod a+rw /etc/qemu + echo "allow virbr0" > /etc/qemu/bridge.conf + sudo chmod a+rw /etc/qemu/bridge.conf + ``` + + ![Image](_images/ia32_sdk_vibr_setup.png) + + - Sources: , + + + 2. Launch `qemu` using a starting script with `net` suffix: + + ```bash + ./scripts/ia32-generic-qemu-net.sh + ``` + + 3. Configure network and run `ash` (Busybox applet) using `rc` script: + + - Note: By default `IP` is assigned using `DHCP`. For other possibilities please check the configuration file + located in `_projects/ia32-generic-qemu/rootfs-overlay/etc/rc.conf.d/network` + + - Note: There are other programs executed by the script. For more information please check the content of the `rc` + file for `ia32-generic-qemu` in `_projects/ia32-generic-qemu/rootfs-overlay/etc/rc` + + ```bash + /linuxrc + ``` + + - As you can see, the advanced version of `Phoenix-RTOS` with `POSIX` shell has been started: + + ![Image](_images/ia32_linuxrc.png) + + - Now you can check the internet connection using the `ping` applet. + ## Running image on regular hardware To run the image on regular hardware please be sure that a target system is equipped with an ATA disk supporting the