Browse Source

Merge pull request #129 from kacf/1.2.x

Merge master into 1.2.x, and update to Mender 2.2.0
1.2.x 1.2.1
Kristian Amlie 5 years ago
committed by GitHub
parent
commit
ed7ee6d2f1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .travis.yml
  2. 2
      Dockerfile
  3. 2
      README.md
  4. 2
      device-image-shell/Dockerfile
  5. 2
      docker-build
  6. 22
      mender-convert
  7. 3
      mender-convert-functions.sh
  8. 2
      rpi-convert-stage-5.sh

10
.travis.yml

@ -9,6 +9,16 @@ dist: trusty
before_script:
- git clone git://github.com/mendersoftware/mendertesting
# Rename the branch we're on, so that it's not in the way for the
# subsequent fetch. It's ok if this fails, it just means we're not on any
# branch.
- git branch -m temp-branch || true
# Git trick: Fetch directly into our local branches instead of remote
# branches.
- git fetch origin 'refs/heads/*:refs/heads/*'
# Get last remaining tags, if any.
- git fetch --tags origin
script:
# Check commit compliance.
- mendertesting/check_commits.sh

2
Dockerfile

@ -1,6 +1,6 @@
FROM ubuntu:18.04
ARG MENDER_ARTIFACT_VERSION=3.1.0
ARG MENDER_ARTIFACT_VERSION=3.2.0
ARG GOLANG_VERSION=1.11.2
RUN apt-get update && apt-get install -y \

2
README.md

@ -10,7 +10,7 @@ image by restructuring partition table and injecting the necessary files.
Currently official Raspberry Pi 3 and BeagleBone Black images are supported and this will be extended.
![Mender logo](https://mender.io/user/pages/resources/06.digital-assets/mender.io.png)
![Mender logo](https://github.com/mendersoftware/mender/raw/master/mender_logo.png)
## Getting started

2
device-image-shell/Dockerfile

@ -1,6 +1,6 @@
FROM ubuntu:18.04
ARG MENDER_ARTIFACT_VERSION=3.1.0
ARG MENDER_ARTIFACT_VERSION=3.2.0
RUN apt-get update && apt-get install -y \
wget \

2
docker-build

@ -6,7 +6,7 @@ if [ -z "$IMAGE_NAME" ]; then
IMAGE_NAME=mender-convert
fi
MENDER_CLIENT_VERSION="2.1.0"
MENDER_CLIENT_VERSION="2.1.1"
DOCKER_ARGS="--build-arg mender_client_version=${MENDER_CLIENT_VERSION}"

22
mender-convert

@ -140,20 +140,19 @@ do_raw_disk_image_shrink_rootfs() {
get_raw_disk_sizes ${raw_disk_image} raw_disk_counts raw_disk_sizes
local sector_size=${raw_disk_sizes[sector_size]}
# Find first available loopback device.
loopdevice=($(losetup -f))
[ $? -ne 0 ] && { log "Error: inaccesible loopback device"; return 1; }
# Mount appropriate partition.
if [[ $raw_disk_counts -eq 1 ]]; then
sudo losetup $loopdevice $raw_disk_image -o $((${raw_disk_sizes[pboot_start]} * $sector_size))
offset=${raw_disk_sizes[pboot_start]}
elif [[ $raw_disk_counts -eq 2 ]]; then
sudo losetup $loopdevice $raw_disk_image -o $((${raw_disk_sizes[prootfs_start]} * $sector_size))
offset=${raw_disk_sizes[prootfs_start]}
else
log "Warning: invalid/unsupported embedded raw disk image. Skipping resize..."
return 0
fi
# Find first available loopback device and mount appropriate partition.
loopdevice=$(sudo losetup --show -f -o $((${offset} * $sector_size)) $raw_disk_image)
[ $? -ne 0 ] && { log "Error: inaccesible loopback device"; return 1; }
block_size=($(sudo dumpe2fs -h $loopdevice | grep 'Block size' | tr -s ' ' | cut -d ' ' -f3))
min_size_blocks=($(sudo resize2fs -P $loopdevice | awk '{print $NF}'))
@ -170,7 +169,7 @@ do_raw_disk_image_shrink_rootfs() {
sudo e2fsck -y -f $loopdevice >> "$build_log" 2>&1
sudo losetup -d $loopdevice
sudo losetup $loopdevice $raw_disk_image
loopdevice=$(sudo losetup --show -f $raw_disk_image)
if [[ $raw_disk_counts -eq 1 ]]; then
create_single_disk_partition_table $loopdevice \
@ -622,14 +621,13 @@ do_mender_disk_image_to_artifact() {
[[ $ret -ne 0 ]] && \
{ log "Error: checking $mender_rootfs_basename file system failed. Aborting."; }
# Find first available loopback device.
loopdevice=($(sudo losetup -f || ret=$?))
# Find first available loopback device and use it.
loopdevice=($(sudo losetup --show -f ${mender_rootfs_image} || ret=$?))
[[ $ret -ne 0 ]] && \
{ log "Error: cannot find an unused loop device. Aborting."; }
if [ $ret -eq 0 ]; then
#Mount extracted ext4 partition to verify 'artifact_info' file content.
sudo losetup $loopdevice ${mender_rootfs_image}
# Mount extracted ext4 partition to verify 'artifact_info' file content.
rootfs_mountpoint=${output_dir}/mnt/${rootfs_partition_id}
mkdir -p ${rootfs_mountpoint}
sudo mount $loopdevice ${rootfs_mountpoint}

3
mender-convert-functions.sh

@ -589,7 +589,8 @@ create_device_maps() {
local -n mappings=$2
if [[ -n "$1" ]]; then
mapfile -t mappings < <( sudo kpartx -v -a $1 | grep 'loop' | cut -d' ' -f3 )
loopdevice=$(sudo losetup --show -f $1)
mapfile -t mappings < <( sudo kpartx -s -v -a $loopdevice | grep 'loop' | cut -d' ' -f3 )
[[ ${#mappings[@]} -eq 0 ]] \
&& { log "Error: partition mappings failed. Aborting."; exit 1; }
else

2
rpi-convert-stage-5.sh

@ -34,7 +34,7 @@ build_uboot_files() {
local CROSS_COMPILE=${1}-
local ARCH=arm
local branch="mender-rpi-2018.07"
local commit="884893e54a"
local commit="50f05ab10e"
local uboot_repo_vc_dir=$uboot_dir/.git
local defconfig="rpi_3_32b_defconfig"

Loading…
Cancel
Save