You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/learn/deploy/offline-updates.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ With the offline updates process, the device still resets to a default factory s
18
18
3. Inserting the custom `config.json` file into the downloaded balenaOS image.
19
19
4. Running `balena preload` on the image, pointing to whichever version of your code you want to deploy to the device.
20
20
5. Flashing this preloaded image to an SD card, a device's eMMC or a separate (flasher) USB drive.
21
-
6. Updating device state on balenaCloud and optionally tag the device.
21
+
6. Updating device state on balenaCloud and optionally tagging the device.
22
22
23
23
When you insert the SD card or USB drive into your device and boot it, the device will be reflashed, retaining its balena identity, and all your updates will be in place and running.
24
24
@@ -30,7 +30,7 @@ If this is the case, mount an external mass storage (USB) device into a privileg
30
30
31
31
## Performing an Offline Update
32
32
33
-
To perform an offline update, we will be using [balena-cli](https://www.balena.io/docs/reference/balena-cli/). All commands should work on Linux distributions running Docker on Linux Kernel with AUFS and overlay filesystem support. For Windows and macOS, the last version of Docker Desktop supporting AUFS is 18.06.1
33
+
To perform an offline update, we will be using [balena-cli][balena-cli]. All commands should work on Linux distributions running Docker on Linux Kernel with AUFS and overlay filesystem support. For Windows and macOS, the last version of Docker Desktop supporting AUFS is 18.06.1
34
34
35
35
> Note: In an offline updates process, all data on the device is wiped at this point, making this different from a typical software update process in the balena ecosystem. Any additional user data and system settings written to various device partitions would be lost in this process.
36
36
@@ -46,6 +46,8 @@ Offline update includes the following steps:
46
46
-[Process of reprovisioning](#process-of-reprovisioning)
The process needs some prerequiste knowledge of the balena ecosystem, [balena-cli][balena-cli] commands and shell commands. Please read all instructions carefully and make sure to try the update process first on a test device.
50
+
49
51
### Setup
50
52
51
53
> Download and install [balena-cli][balena-cli] on a Linux distribution. The commands have been tested to work on Ubuntu 20.04.
@@ -68,7 +70,7 @@ $ ssh_key=id_ed25519.pub
68
70
69
71
### Create/Use Pre-existing Application
70
72
71
-
Initialize the `arch` and `device-type` environment variable with correct CPU architecture (`aarch64`, `armv7l`, etc.) and device type (`raspberrypi4-64`, `raspberrypi3`, etc.). The list of names for supported device types and their architectures can be found on the [hardware][supporteddeviceslist] page.
73
+
Initialize the `arch` and `device-type` environment variable with correct CPU architecture (`aarch64`, `armv7l`, etc.) and device type (`raspberrypi4-64`, `raspberrypi3`, etc.). The list of names for supported device types and their architectures can be found on the [hardware][supported-devices-list] page.
72
74
73
75
If a pre-existing application needs to be re-used, then initialize the `app_name` variable with that application's name.
74
76
@@ -102,7 +104,7 @@ OR
102
104
$ uuid=<UUID OF YOUR DEVICE>
103
105
```
104
106
105
-
With `balena device register`, devices can be preregistered to a balenaCloud application involving a simple call with a unique identifier for the device. You can read more about the full process of pre-registering a device in the [balena-cli advanced masterclass][balena-cli advanced masterclass]. This step can be skipped if a pre-existing device is needed to be updated.
107
+
With [`balena device register`][balena-device-register], devices can be preregistered to a balenaCloud application involving a simple call with a unique identifier for the device. You can read more about the full process of pre-registering a device in the [balena-cli advanced masterclass][balena-cli advanced masterclass]. This step can be skipped if a pre-existing device is needed to be updated.
@@ -123,7 +125,7 @@ $ balena os download ${device_type} \
123
125
124
126
### Configure balenaOS Image
125
127
126
-
Configure the downloaded image by injecting a [config.json][config-file] file using the [`balena os configure`][balena-os-configure] command. Most common system settings can be (re)specified via [config.json](config-file). To preserve the pre-existing registered device's identity, the same `uuid` initialized earlier will be used to generate a config.json file.
128
+
Configure the downloaded image by injecting a [config.json][config-file] file using the [`balena os configure`][balena-os-configure] command. Most common system settings can be (re)specified via [config.json][config-file]. To preserve the pre-existing registered device's identity, the same `uuid` initialized earlier will be used to generate a config.json file.
127
129
128
130
```bash
129
131
$ tmpconfig=$(mktemp)
@@ -158,7 +160,7 @@ Offline update revolve around the concept of [balena preload][balena-preload]. P
158
160
159
161
> Important note: [balena preload](https://github.com/balena-io/balena-cli/blob/master/INSTALL-MAC.md#balena-preload) functionality requires Docker with AUFS support.
160
162
161
-
Since preload involves flashing an application release with the balenaOS image, if the pre-existing application doesn't have any releases, then a release needs to be created. If release is present already, then the next step can be skipped.
163
+
Since preload involves flashing an application release with the balenaOS image, if the pre-existing application doesn't have any releases, then a release needs to be created using [`balena deploy`][balena-deploy]. Navigate to the directory of your source code folder and run the command below to deploy the latest release of your application. If a release is present already, then the next step can be skipped.
@@ -184,7 +186,6 @@ Next, a USB flash drive, an SD card or any relevant storage media needs to be pr
184
186
```bash
185
187
# list the devices available to flash
186
188
$ balena util available-drives
187
-
/dev/...
188
189
189
190
# Please make sure `--drive` is really the disk you want to write to.
190
191
$ sudo balena local flash ${tmpimg} \
@@ -199,15 +200,15 @@ $ rm ${tmpimg}
199
200
200
201
With the update media ready having the latest release of the application preloaded. Follow the device's provisioning instructions present on balenaCloud dashboard for your specific device.
201
202
202
-
For example: For Raspberrypi devices, insert the recently flashed SD card and power up the device. When the process is complete, (re)connect any mass storage devices containing user data back to the device. Reconnect the device to the local air-gapped network(s). Later, use SSH to connect and inspect application logs, etc.
203
+
For example: For Raspberry Pi devices, insert the recently flashed SD card and power up the device. When the process is complete, (re)connect any mass storage devices containing user data back to the device. Reconnect the device to the local air-gapped network(s). Later, use SSH to connect and inspect application logs, etc.
203
204
204
205
#### Strategies to remotely update with an SD card or USB device
205
206
206
207
If a device isn't locally deployed, one can ship the flashed SD cards or USB sticks/drives to a remote location. There someone can run the update by simply inserting them into the devices and booting.
207
208
208
-
If the target device exists on an air-gapped or Internet restricted network, inserting [ssh](https://www.balena.io/docs/reference/OS/configuration/#sshkeys) keys during the configuration step will allow fleet managers at the remote site to connect into the device directly via OpenSSH and verify the update by examining container logs, etc.
209
+
If the target device exists on an air-gapped or Internet restricted network, [inserting ssh keys][insert-ssh-key] during the configuration step will allow fleet managers at the remote site to connect into the device directly via OpenSSH and verify the update by examining container logs, etc.
209
210
210
-
If the target device is connected via a low-bandwidth connection, it should eventually establish a connection to balenaCloud. Depending on the connection's quality, it may respond to [Web Terminal][web-terminal] commands and output container logs to the dashboard.
211
+
If the target device is connected via a low-bandwidth connection, it should eventually establish a connection to balenaCloud. Depending on the connection's quality, it may respond to [web terminal][web-terminal] commands and output container logs to the dashboard.
211
212
212
213
### Update Device Registration(s)
213
214
@@ -260,13 +261,16 @@ $ balena tag set 'offline:hostOS' "${os_version}" \
260
261
261
262
Read more about how the process can work better for your usecase in the [offline updates](https://balena.io/blog/offline-updates-make-it-easier-to-update-balena-devices-without-the-internet) blog.
0 commit comments