Added a simple check to log a warning when an image is generated with the client
installed, and the version installed will lead to the image being unusable.
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
Changelog: A bootstrap Artifact is now installed in
/data/mender/bootstrap.mender, on every conversion, adding the ability to have
the Mender client bootstrap the database without running an update first, thus
enabling delta-updates to be installed without first running a full rootfs
update. Please note that this will require a minimum of the Mender client at
version 3.4.x. However, the generated Artifact is still usable in any case.
Ticket: MEN-5594
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
The issue is a bit complicated. The naming still uses sdimg for
historical reasons. However, we need to put `uefiimg` in
`IMAGE_FSTYPES` because it is required for feature selection. This bug
previously prevented the test_secure_boot test from running.
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
This already broke once in our pipeline, so let's add this job
configuration so that we keep testing it.
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
This simply writes the GPT UUID of the boot partition to be the same as the UUID
of the first partition in the original disk image.
Changelog: Keep the UUID of the original first partition on the boot partition
of the converted image when the partition table is GPT.
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
This reverts commit 417b82ae76.
Without this file, Mender can not be used out of the box.
Changelog: None
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
Update tests accordingly.
Changelog: raspberrypi_raspbian_config: Remove /etc/mender/artifact_info
from image. For pre-converted images, the file is expected to be
populated at setup time.
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
Changelog: Now it is possible to to select a custom filename for the deployed files by using a DEPLOY_IMAGE_NAME string in the config file.
Signed-off-by: nils olav <nils.olav@northern.tech>
Changelog: Now it is possible to write multiple device types in the config file using a space seperated string. Filenames for files in the deploy dir will contain all the device names seperated with +.
Signed-off-by: nils olav <nils.olav@northern.tech>
As this value is known during modify but not during package, a new
testscfg module has been implemented to take care of adding variables
and exporting the final cfg file.
Changelog: None
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
- Issue: #MEN-3725
The following new config variables have been added which closely mirror those used in meta-mender
to give fine grained controll over partition device paths. If partuuid support is enabled then
these partition variables must be used as format doesnt fit device/number variables scheme.
If partuuid support is disabled then partition variables are optional liek in meta-mender.
MENDER_ENABLE_PARTUUID
MENDER_BOOT_PART
MENDER_ROOTFS_PART_A
MENDER_ROOTFS_PART_B
MENDER_DATA_PART
Example:
MENDER_BOOT_PART="/dev/disk/by-partuuid/26445670-f37c-408b-be2c-3ef419866620" #gpt
MENDER_BOOT_PART="/dev/disk/by-partuuid/26445670-01" #dos
MENDER_BOOT_PART="/dev/sda1" #partuuid support disabled
Changelog: Partition UUID support added for gpt/dos partition tables for deterministic booting
Signed-off-by: Dell Green <dell.green@ideaworks.co.uk>
Previously the user would have to manually decompress an input image prior to
handing it over to mender-convert. With this change, files compressed in the
formats: lzma, gzip, or zip archives will be automatically decompressed,
converted, and then recompressed.
Note that the zip archive can only contain one image file, otherwise the
conversion will fail. Thus if the archive contains multiple files, human
interaction is required. This simply involves unzipping the archive yourself,
and then pass in the image, just like in the old workflow.
Ticket: https://tracker.mender.io/browse/MEN-3052
Changelog: Added automatic decompression of input images, so that the convert
tool now accepts compressed input images in the formats: lzma, gzip, and zip.
The images will also be recompressed to the input format automatically.
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
Partition scheme can be forced by setting MENDER_PARTITION_SCHEME="gpt" or MENDER_PARTITION_SCHEME="dos", otherwise it will use the scheme from the input image.
Changelog: Add support for GPT partition tables
Signed-off-by: Nate Baker <bakern@gmail.com>
This extends the current functionality of the platform_ function
functionality into using hooks, so that each modification step can be called
from multiple configuration files.
The valid hooks are:
* PLATFORM_MODIFY_HOOKS
* PLATFORM_PACKAGE_HOOKS
* USER_LOCAL_MODIFY_HOOKS
and can be appended to as a regular bash array.
Changelog: Commit
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
This change retains the name of the converted input image, and adds the device
type and a mender suffix, so that the user can both recognize the converted
image, and is aware of what the device the converted image supports.
Changelog: None
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
Previously this was '.sdimg'. But due to this not being a standard fileformat,
and unfamiliar to Debian users, the decision was made so standardize it on a
custom 'filename-mender.img' image naming convention.
Changelog: Title
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
This variable is actually used to detect that we are building with
Yocto. With the mender-convert rewrite, the relevant section started
working in mender-convert as well, so remove this, and also remove the
check in mender-image-tests.
Changelog: None
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
Make it clear that these are partition sizes, not filesystem sizes
(mainly important for the rootfs), and fix the ambiguous placement of
"x 2" (the existing placement made it look like there were 3892
partitions of 2 MiB each).
Changelog: None
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
* `IMAGE_ROOTFS_SIZE` - The base size of the rootfs. The other two
variables modify this value
* `IMAGE_ROOTFS_EXTRA_SIZE` - The amount of free space to add to the
base size of the rootfs
* `IMAGE_OVERHEAD_FACTOR` - Factor determining the amount of free
space to add to the base size of the rootfs
The final size will be the largest of the two calculations. Please see
the `mender_convert_config` file comments for more information.
Changelog: Commit
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
Not using this option produces a more realistic result, because block
padding has to be taken into account when calculating the totals. It
is not a perfect method however, since the calculation becomes
dependent on the block size of the filesystem on the build machine.
4096 is a *very* common size though, and almost certainly will be the
size used both on the build host and in the resulting filesystem.
Changelog: Changed the calculation of occupied space on the rootfs
partition to a more accurate formula.
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
Previously there was a mix between two, and four spaces.
This commits unifies all scripts to use two-spaces for indentation.
Changelog: None
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
Previously some scripts were calling env and bash, some were only calling bash.
This commit unifies the scripts to all use `#! /usr/bin/env bash`
Changelog: None
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
This is necessary for the U-boot -> EFI -> GRUB integration to be
complete as many boards embedd the U-Boot binary at the start
of the SD/eMMC a.k.a boot-gap.
When MENDER_COPY_BOOT_GAP is enabled, it will be copied from the
input disk image to the output ".sdimg"
MEN-2784
Changelog: Title
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
Current logic actually fails when no '-c/--config' options are provided, with this error:
$ MENDER_ARTIFACT_NAME="test-1" ./mender-convert --disk-image input/Armbian_5.95_Tinkerboard_Debian_buster_next_4.19.69_minimal.img
Running mender-convert-extract: --disk-image input/Armbian_5.95_Tinkerboard_Debian_buster_next_4.19.69_minimal.img
2019-10-02 12:46:39 [INFO] [mender-convert-extract] Using configuration file: configs/mender_convert_config
2019-10-02 12:46:39 [INFO] [mender-convert-extract] Using configuration file: ''
modules/config.sh: line 28: '': No such file or directory
The 'configs' array is actually not empty when passed to modules/config.sh
as it will contain "''", which will be translated as a array element and
hence the above failure.
This commit ensures that we set a valid default value to 'configs',
which is the 'mender_convert_config'. This is moved from modules/config.sh,
to the calling scripts that define the array of configs.
Fixes: 9b944615a8 ("configs: Support multiple config files on command line.")
Changelog: None
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
The current support for this fails due to incorrect use
of bash arrays.
Also, use the printf '%q' formatting code to add proper quotes
to the config file names to ensure that it works properly
with spaces in the file names.
Signed-off-by: Drew Moseley <drew.moseley@northern.tech>
Changelog: Title
The goals of the re-write was to achieve the following:
1. It should be easy to extend the tool to support other boards or distributions
2. We should not compile code in the tool (rely on binaries built elsewhere)
compiling code increases complexity, due to requirement of toolchains etc.
3. The tool shall not be designed around specific hardware/platform types
- This is the case today with the usage of --device-type flag
4 The tool should be to convert images without knowing anything about the hardware/platform
relates to above 3.
5. Configuration interface should be simplified
- command line flags -> configuration files
6. Platform specific code shall be provided trough “hooks”, and are not part of the “core” mender-convert code
7. It shall be easy to extend functionality
- support for rootfs overlay to inject user applications/configurations
- ability to override how the Mender Artifact is generated (to be able to sign and include state-scripts)
8. Code structure should be modular
- Eases Maintenance and possibility of making isolated changes
Changelog: Title
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>