Description
Repartition a live system into dual partition layout!
Example use-cases:
- You have already shipped a bunch of devices, but you did not integrate with Mender before you did, and now you need a way to update them
Specification
Specification | |
---|---|
Module name | dual-rootfs-repartition |
Supports rollback | limited1 |
Requires reboot | yes |
Artifact generation script | yes |
Full system updater | no |
Source code | Repository |
Maintainer | Community |
Warning: This Update Module is highly experimental, and if the operation fails or is interrupted your device can easily get bricked. Do not attempt to use it in production unless you are prepared to deal with this situation.
1 The Update Module is able to roll back if it detects a condition early on which prevents the partitioning. However, this checking is quite limited, and once it gets started on writing to the storage, not only can it not roll back, but in most cases it will brick the device if something goes wrong.
Platform support
This Update Module has only been tested with Beaglebone Black, and will almost certainly not work on any other board. However, the general approach is applicable to a wide array of different boards, and it should be possible to adapt the Update Module and Artifact to other boards with only a modest effort. There is some level of skill required to do this, but most people who have at least some experience with boot loaders and the Linux boot process should be able to work it out.
Prepare the development environment on your workstation
This section describes how to set up your development environment on your workstation.
All commands outlined in this section should be run in the development environment.
Prerequisites
This Update Module has the following prerequisites for the development environment:
System packages
- Docker
- GCC
- GCC for ARM (if you want to build for ARM)
On Ubuntu, these can be installed with:
sudo apt install docker.io build-essential crossbuild-essential-armhf
sudo usermod -a -G docker $USER
Note: You may need to log out and back in again to get Docker to work.
Mender tools
- Install mender-artifact , version 3.0.0 or later
Repository
Run this to clone the repository:
git clone https://github.com/mendersoftware/mender-dual-rootfs-repartition
cd mender-dual-rootfs-repartition
git submodule update --init
Create the Mender Artifact
Create an Artifact which will perform the live dual rootfs repartitioning:
./build-repartition-artifact --arm -- -o dual-rootfs-partition.mender
Artifact technical details
When the Update Module shuts down the system, output will no longer go to the logs, because there is nowhere to store these logs (it is running from RAM). For instructions on how to set up local debugging, see “Debugging tips” in the README.
Prepare the device
Note: The Update Module will currently not work if Mender is run in standalone mode. This is because standalone mode does not support custom ArtifactReboot
functions, which the Update Module uses extensively to do its job.
On the device you only need a running embedded Linux distribution. In theory any compatible distribution should work, but in practice there may be small tweaks and adjustments needed unless you run the one that this module was tested with.
The module was tested with these two images, downloaded from the Beagleboard website:
Prerequisites
This update module has the following prerequisites for the device environment:
- Install the Mender client, version 2.0 or later
-
Install the
dual-rootfs-repartition
Update Module (see README if you do not know how)