Browse Source

Merge pull request #136 from oleorhagen/updreadme

Some simple Readme updates
2.0.x
oleorhagen 5 years ago
committed by GitHub
parent
commit
ba6cfdf1c5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 49
      README.md
  2. 38
      mender-convert
  3. 4
      mender-convert-extract
  4. 2
      mender-convert-modify
  5. 2
      mender-convert-package
  6. 8
      modules/probe.sh

49
README.md

@ -2,11 +2,22 @@
# mender-convert
Mender is an open source over-the-air (OTA) software updater for embedded Linux devices. Mender comprises a client running at the embedded device, as well as a server that manages deployments across many devices.
Mender is an open source over-the-air (OTA) software updater for embedded Linux
devices. Mender comprises a client running at the embedded device, as well as a
server that manages deployments across many devices.
This repository contains mender-convert, which is used to convert pre-built disk images (Debian, Ubuntu, Raspbian, etc) to a Mender compatible image by restructuring partition table and injecting the necessary files.
This repository contains mender-convert, which is used to convert pre-built disk
images (Debian, Ubuntu, Raspbian, etc) to a Mender compatible image by
restructuring partition table and injecting the necessary files.
For a full list of tested devices and images please visit [Mender Hub](https://hub.mender.io/c/board-integrations/debian-family). If your device and image combination is not listed as supported, this does not necessarily mean that it will not work, it probably just means that no one has tested and reported it back and usually only small tweaks are necessary to get this running on your device.
For a full list of tested devices and images please visit [Mender
Hub](https://hub.mender.io/c/board-integrations/debian-family). If your device
and image combination is not listed as supported, this does not necessarily mean
that it will not work, it probably just means that no one has tested and
reported it back and usually only small tweaks are necessary to get this running
on your device.
-------------------------------------------------------------------------------
![Mender logo](https://github.com/mendersoftware/mender/raw/master/mender_logo.png)
@ -34,7 +45,9 @@ wget https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-0
Extract the raw Raspberry Pi disk image:
```bash
unzip 2019-06-20-raspbian-buster-lite.zip && cd ..
unzip 2019-06-20-raspbian-buster-lite.zip
INPUT_DISK_IMAGE=$(ls *raspbian-buster*.img)
cd ..
```
Bootstrap the demo rootfs overlay that is configured to connect to
@ -47,14 +60,14 @@ Professional.
type you are implementing.
#### Using the [Mender demo server](https://docs.mender.io/getting-started/on-premise-installation/create-a-test-environment)
```
```bash
./scripts/bootstrap-rootfs-overlay-demo-server.sh \
--output-dir ${PWD}/rootfs_overlay_demo \
--server-ip 192.168.1.1
```
#### Using the [Mender production server](https://docs.mender.io/administration/production-installation)
```
```bash
./scripts/bootstrap-rootfs-overlay-production-server.sh \
--output-dir ${PWD}/rootfs_overlay_demo \
--server-url https://foobar.mender.io \
@ -62,7 +75,7 @@ type you are implementing.
```
#### Using [Mender Professional](https://mender.io/products/mender-professional)
```
```bash
./scripts/bootstrap-rootfs-overlay-hosted-server.sh \
--output-dir ${PWD}/rootfs_overlay_demo \
--tenant-token "Paste token from Mender Professional"
@ -86,8 +99,9 @@ Build a container with all required dependencies for `mender-convert`:
./docker-build
```
This will create a container image which you can use to run `mender-convert`
without polluting your host environment with the necessary dependencies.
This will create a container image with the name `mender-convert` which you can
use to run `mender-convert` without polluting your host environment with the
necessary dependencies.
#### Use the mender-convert container image
@ -96,9 +110,9 @@ Run mender-convert from inside the container with your desired options, e.g.
```bash
MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert \
--disk-image input/2019-04-08-raspbian-stretch-lite.img \
--config configs/raspberrypi3_config \
--overlay rootfs_overlay_demo/
--disk-image input/$INPUT_DISK_IMAGE \
--config configs/raspberrypi3_config \
--overlay rootfs_overlay_demo/
```
Conversion will take 10-30 minutes, depending on image size and resources
@ -115,7 +129,7 @@ mender-convert has a few dependencies, and their version and name vary between
Linux distributions. Here is an example of how to install the dependencies on a
Debian based distribution:
```
```bash
sudo apt install $(cat requirements-deb.txt)
```
@ -123,16 +137,17 @@ Start the conversion process with:
```bash
MENDER_ARTIFACT_NAME=release-1 ./mender-convert \
--disk-image input/2019-04-08-raspbian-stretch-lite.img \
--config configs/raspberrypi3_config \
--overlay rootfs_overlay_demo/
--disk-image input/$INPUT_DISK_IMAGE \
--config configs/raspberrypi3_config \
--overlay rootfs_overlay_demo/
```
**NOTE!** You will be prompted to enter `sudo` password during the conversion
process. This is required to be able to loopback mount images and for modifying
them. Our recommendation is to use the provided Docker container, to run the
tool in a isolated environment (at least to some degree).
tool in a isolated environment.
-------------------------------------------------------------------------------
## Contributing

38
mender-convert

@ -54,6 +54,24 @@ function trap_term() {
trap trap_term INT TERM
trap trap_exit EXIT
# We only handle a selection of the arguments here, the rest are passed on
# to the sub-scripts.
while (( "$#" )); do
case "$1" in
-h | --help)
show_help
exit 0
;;
-v | --version)
show_version
exit 0
;;
*)
break;
;;
esac
done
mender_convert_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if [ "${mender_convert_dir}" != "${PWD}" ]; then
echo "You must execute mender-convert from the root directory: ${mender_convert_dir}"
@ -70,24 +88,6 @@ fi
source modules/bootstrap.sh
# We only handle a selection of the arguments here, the rest are passed on
# to the sub-scripts.
while (( "$#" )); do
case "$1" in
-h | --help)
show_help
exit 0
;;
-v | --version)
show_version
exit 0
;;
*)
break;
;;
esac
done
mkdir -p work
touch work/convert.log
@ -95,5 +95,5 @@ touch work/convert.log
./mender-convert-modify "$@"
./mender-convert-package "$@"
echo "Output Artifacts and images can be found in deploy directory:"
echo "Output Artifacts and images can be found in the deploy directory:"
ls -1 deploy/*

4
mender-convert-extract

@ -72,14 +72,14 @@ if [ ${nr_of_parts} -eq 0 ]; then
log_fatal "Sorry, but could not find any valid partitions for: ${disk_image}"
fi
log_info "Disk parsed succesfully"
log_info "Disk parsed successfully"
log_info "NUMBER OF PARTS: ${nr_of_parts} TYPE: $(disk_get_part_value ${disk_image} 1 SCHEME)"
for ((n=1;n<=${nr_of_parts};n++)); do
part_dst_file="work/part-${n}.fs"
if [ "$(disk_get_part_value ${disk_image} ${n} TYPE)" == "0x8e" ]; then
log_fatal "Detected an LVM volume group on disk. Unfortunatly this is not yet supported"
log_fatal "Detected an LVM volume group on disk. Unfortunately this is not yet supported"
fi
log_info "PART ${n}: SIZE: $(disk_get_part_value ${disk_image} ${n} SIZE) TYPE: $(disk_get_part_value ${disk_image} ${n} TYPE)"

2
mender-convert-modify

@ -21,7 +21,7 @@ function platform_modify() {
}
function trap_exit() {
echo "mender-convert-modify has finished. Cleaning..."
echo "mender-convert-modify has finished. Cleaning up..."
sudo umount -f work/boot
sudo umount -f work/rootfs
}

2
mender-convert-package

@ -21,7 +21,7 @@ function platform_package() {
}
function trap_exit() {
echo "mender-convert-package has finished. Cleaning..."
echo "mender-convert-package has finished. Cleaning up..."
sudo umount -f work/boot > /dev/null
sudo umount -f work/rootfs > /dev/null
}

8
modules/probe.sh

@ -193,8 +193,8 @@ probe_kernel_in_boot_and_root() {
log_info "Found Linux kernel image: \n\n\t${kernel_imagetype_path}\n"
kernel_imagetype=$(basename ${kernel_imagetype_path})
else
log_warn "Unfortunatly we where not able to find the Linux kernel image."
log_fatal "Please specifc the image name using MENDER_GRUB_KERNEL_IMAGETYPE"
log_warn "Unfortunately we where not able to find the Linux kernel image."
log_fatal "Please specify the image name using MENDER_GRUB_KERNEL_IMAGETYPE"
fi
echo "${kernel_imagetype}"
}
@ -227,8 +227,8 @@ probe_initrd_in_boot_and_root() {
log_info "Found initramfs image: \n\n\t${initrd_image_path}\n"
initrd_imagetype=$(basename ${initrd_image_path})
else
log_info "Unfortunatly we where not able to find the initrd image."
log_info "Please specifc the image name using MENDER_GRUB_INITRD_IMAGETYPE \
log_info "Unfortunately we where not able to find the initrd image."
log_info "Please specify the image name using MENDER_GRUB_INITRD_IMAGETYPE \
(only required if your board is using this)"
initrd_imagetype=""
fi

Loading…
Cancel
Save