Skip to content

Commit 13cd805

Browse files
README: Add Running BlueOS
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent 785e023 commit 13cd805

File tree

1 file changed

+107
-1
lines changed

1 file changed

+107
-1
lines changed

README.md

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ BlueOS is a modular, robust, and efficient platform for managing a vehicle or ro
3131
- [Contributions](https://blueos.cloud/docs/latest/development/core/#contributions)
3232
- [Code of Conduct](./CoC.md)
3333
- [Registered Extensions](https://docs.bluerobotics.com/BlueOS-Extensions-Repository)
34-
- [Install directory](https://github.com/bluerobotics/BlueOS/blob/master/install) (for custom installations)
34+
- [Custom installation](#custom-installation)
3535

3636
## Principles and Goals 📖
3737

@@ -82,6 +82,112 @@ BlueOS provides generic support for a wide variety of terrestrial, aerial, and m
8282

8383
>**Note:** Specific vehicle configuration may be necessary to ensure optimal performance with BlueOS.
8484
85+
## Custom installation
86+
87+
### Raspberry Pi and hardware preparation
88+
89+
For installations that need hardware configuration and preparation of the operating system, it´s highly recommended to use [the installation script](https://github.com/bluerobotics/BlueOS/blob/master/install) and customize it as necessary to perform the necessary changes for your system.
90+
91+
### Running BlueOS
92+
93+
It's highly recommended to have debian, debian based (like ubuntu) or any linux distribution with similar services and tools to run BlueOS. This is necessary since BlueOS use specific components on the host computer to do software configuration and take control of the system.
94+
95+
#### Running via Docker Compose (`docker compose`)
96+
97+
1. Clone the repository with git
98+
- `git clone --depth=1 --recurse-submodules --shallow-submodules https://github.com/bluerobotics/blueos`
99+
2. Modify [core/compose/compose.yml](core/compose/compose.yml) example file.
100+
- `BLUEOS_DISABLE_SERVICES`: Comment or remove this line if you want BlueOS to have full access of the system, including wifi and ethernet configuration.
101+
- `BLUEOS_DISABLE_MEMORY_LIMIT`: Comment or remove this line if running in a system with 4GB of RAM memory or less.
102+
- `BLUEOS_DISABLE_STARTUP_UPDATE`: This environment variable is necessary, "startup update" procedure is only required when bootstrap is running to manage the system (not the case when using docker compose).
103+
- `SSH_USER`: Uncomment and update the value for the SSH user, required for BlueOS to run commands and access the host computer if necessary.
104+
- `SSH_PASSWORD`: Uncomment and update the value for the SSH user password.
105+
3. Run docker compose
106+
- ```bash
107+
cd core/compose/ && docker compose pull && cd - # Ensure that docker is up-to-date
108+
docker compose -f core/compose/compose.yml up
109+
```
110+
111+
In the end, your docker compose file should look like this
112+
113+
```compose
114+
version: "3.7"
115+
services:
116+
blueos-core:
117+
container_name: blueos-core
118+
image: bluerobotics/blueos-core:master
119+
privileged: true
120+
network_mode: host
121+
pid: host
122+
restart: unless-stopped
123+
environment:
124+
- BLUEOS_DISABLE_MEMORY_LIMIT=true
125+
- BLUEOS_DISABLE_STARTUP_UPDATE=true
126+
- SSH_USER=pi
127+
- SSH_PASSWORD=raspberry
128+
volumes:
129+
- ./workspace/.config:/root/.config
130+
- ./workspace/etc/blueos:/etc/blueos
131+
- ./workspace/tmp/wpa_playground:/tmp/wpa_playground
132+
- ./workspace/usr/blueos/bin:/usr/blueos/bin
133+
- ./workspace/usr/blueos/extensions:/usr/blueos/extensions
134+
- ./workspace/usr/blueos/userdata:/usr/blueos/userdata
135+
- ./workspace/var/logs/blueos:/var/logs/blueos
136+
- /dev:/dev
137+
- /etc/dhcpcd.conf:/etc/dhcpcd.conf
138+
- /etc/machine-id:/etc/machine-id:ro
139+
- /etc/resolv.conf.host:/etc/resolv.conf.host:ro
140+
- /run/udev:/run/udev:ro
141+
- /sys:/sys
142+
- /var/run/dbus:/var/run/dbus
143+
- /var/run/docker.sock:/var/run/docker.sock
144+
- /var/run/wpa_supplicant:/var/run/wpa_supplicant
145+
- /home/patrick/.ssh:/home/pi/.ssh
146+
```
147+
148+
The system should be accessible now via `0.0.0.0:80` or via the network using the IP address of the device.
149+
150+
151+
#### Running via Docker (`docker run`)
152+
153+
You can update the script to follow your board configuration. Here, we are creating temporary folders for the binds, but it's highly recommended to create a workspace environment where you can set the binds to be persistent.
154+
155+
```bash
156+
# Prepare workspace
157+
mkdir -p /tmp/workspace/var/logs/blueos
158+
mkdir -p /tmp/workspace/.config
159+
mkdir -p /tmp/workspace/tmp/wpa_playground
160+
mkdir -p /tmp/workspace/etc/blueos
161+
mkdir -p /tmp/workspace/usr/blueos/{bin,extensions,userdata}
162+
163+
# Docker command
164+
docker run --privileged --network=host --pid=host --name=blueos-core \
165+
--mount type=bind,source=/dev/,target=/dev/,readonly=false \ # Required for hardware access
166+
--mount type=bind,source=/sys/,target=/sys/,readonly=false \ # Required for system access
167+
--mount type=bind,source=/var/run/wpa_supplicant,target=/var/run/wpa_supplicant,readonly=false \ # Required for wifi control
168+
--mount type=bind,source=/tmp/workspace/tmp/wpa_playground,target=/tmp/wpa_playground,readonly=false \ # Required for wifi control
169+
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock,readonly=false \ # Required for docker control
170+
--mount type=bind,source=/tmp/workspace/var/logs/blueos,target=/var/logs/blueos,readonly=false \ # Required for BlueOS log files
171+
--mount type=bind,source=/run/udev,target=/run/udev,readonly=true \ # Required for hardware information
172+
--mount type=bind,source=$HOME/.ssh,target=/home/pi/.ssh,readonly=false \ # Required for host computer access from BlueOS
173+
--mount type=bind,source=/tmp/workspace/etc/blueos,target=/etc/blueos,readonly=false \ # Required for bash history and other files
174+
--mount type=bind,source=/etc/machine-id,target=/etc/machine-id,readonly=true \ # Required for hardware / system information
175+
--mount type=bind,source=/etc/dhcpcd.conf,target=/etc/dhcpcd.conf,readonly=false \ # Required for ethernet control
176+
--mount type=bind,source=/tmp/workspace/usr/blueos/userdata,target=/usr/blueos/userdata,readonly=false \ # Required for extension data
177+
--mount type=bind,source=/tmp/workspace/usr/blueos/extensions,target=/usr/blueos/extensions,readonly=false \ # Required for extension data
178+
--mount type=bind,source=/tmp/workspace/usr/blueos/bin,target=/usr/blueos/bin,readonly=false \ # Required for custom binaries
179+
--mount type=bind,source=/etc/resolv.conf.host,target=/etc/resolv.conf.host,readonly=true \ # Required for ethernet configuration
180+
--mount type=bind,source=/var/run/dbus,target=/var/run/dbus,readonly=false \ # Required for wifi and others services access
181+
--mount type=bind,source=/tmp/workspace/.config,target=/root/.config,readonly=false \ # Required for persistent BlueOS configuration
182+
-e BLUEOS_DISABLE_MEMORY_LIMIT=true \
183+
-e BLUEOS_DISABLE_STARTUP_UPDATE=true \
184+
-e SSH_USER=pi \
185+
-e SSH_PASSWORD=raspberry \
186+
bluerobotics/blueos-core:master
187+
```
188+
189+
After running BlueOS like this, the system should be accessible now via `0.0.0.0:80` or via the network using the IP address of the device.
190+
85191
## Supported Architectures 👨🏻‍💻
86192
87193
BlueOS is designed to perform optimally across a wide range of systems. Our latest releases are automatically built for the following architectures:

0 commit comments

Comments
 (0)