Changelog: User must now supply the overlay generated by a
bootstrap script to mender-convert with the --overlay option in
order for the scripts to take effect.
Additionally, the bootstrap scripts may now be called from any
directory.
BREAKING CHANGE: see changelog
Ticket: MEN-5109
Signed-off-by: Mikael Torp-Holte <mikael.torp-holte@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>
Add a unit to systemd that checks whether /data is mounted before
starting mender client.
Changelog: None
Ticket: MEN-5519
Signed-off-by: Mikael Torp-Holte <mikael.torp-holte@northern.tech>
Note that we will still use EFI, since Mender doesn't support anything
else, but we will avoid grub.d integration since it won't be prepared
for it in this configuration. Instead the legacy method with a custom
Mender boot script will be used.
Inspired by this thread on Mender Hub:
https://hub.mender.io/t/problems-converting-a-packer-debian11-img-with-mender-convert/5054
Changelog: Title
Ticket: None
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
When introducing grub.d integration, we switched to using the already-
installed grub binary if it existed. But this is not a good idea,
because it may come with hardcoded paths which may fail to load the
script that we put in `/EFI/BOOT`. So revert to the old behavior,
install our own pre-compiled grub binary if grub.d integration is off.
No changelog, since we never released this regression.
Changelog: None
Ticket: None
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
This means that `grub-install` and `update-grub` no longer risk
bricking the device, but will produce boot scripts with Mender support
integrated. It also means that the standard GRUB menu will be
available.
It is supported on x86_64 platforms where `grub.d` is available, and
can be turned on and off with `MENDER_GRUB_D_INTEGRATION`. The default
is to use it if available.
Devices that did not previously use `grub.d` integration won't be
upgraded correctly with it turned on, so it is advised to set
`MENDER_GRUB_D_INTEGRATION=n` if you are upgrading existing devices.
Changelog: Commit
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
The presence of the shim depends on whether Secure Boot is enabled or
not, plus the configuration of the distro. GRUB itself however, will
always be present if the distro uses GRUB with UEFI at all. So check
for that instead.
Of course, without the shim, Secure Boot will not work out of the box,
but this is a misconfigured platform, not a problem with Mender.
Cancel-Changelog: 2b805e29dc
Changelog: If `grub*.efi` preexists on the EFI partition, keep it
instead of installing our own. In all other cases, we fall back to the
old functionality of installing mender-grub and nuking the existing
bootloader.
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
In the case a boot shim is found on the boot partition, we do keep the boot
partition pristine, and only install the generated mender `grub.cfg` file we need.
In all other cases, we fall back to the old functionality of installing
mender-grub and nuking the existing bootloader.
Changelog: commit
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
Changelog: The fstab file from the image being converted is now preserved across convertions, with the Mender specific additions merged with the existing fstab file, as opposed to replacing it completely. Which was the previous approach.
Signed-off-by: Simon Ensslen <simon.ensslen@griesser.ch>
It has been broken since the introduction of mender-configure.
This add-on is architecture independent, so when downloading the .deb
directly from the pool we need to look for "all" suffix instead of the
target architecture. This worked fine for "latest" and "master" versions
because the filename for these were resolved via repository's Packages.
Changelog: title
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
Changelog: Download and install Debian packages taking into account the
target OS. Now downloads.mender.io serves four distributions: the two
latests releases for Debian and Ubuntu. Probe /etc/os-release to figure
out the correct package to install, and fallback to Debian Buster
packages which was the previous default.
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
Fixes MEN-5078
According to `ln` man page, the correct way to create a link on a
directory is with `ln [OPTION]... TARGET... DIRECTORY`.
Create first `DIRECTORY`, and then use the above form for the link. This
way a successive run of `ln ...` will not end up creating a
`.../mender/mender` kind of link.
Changelog: Title
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
This moves the device configuration to a config script in configs/, from the
previous setup in the bootstrap scripts.
It does so by creating a new resources/ folder in the top-level directory, which
is then populated with the configuration file, and the server parameters only.
When the conversion is run with the demo configuration
configs/mender_convert_demo_config the conversion will install all the add-on's
available, and modify the configuration file in resources to align with our
regular Mender demo configuration.
Changelog: Add a demo configuration in configs/mender_convert_demo_config which
when added at run time creates a Mender demo setup in the converted image. This
includes short polling intervals, and all add-on's installed by default.
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
This adds the:
* `MENDER_CLIENT_INSTALL` option, to allow an image to come without the
mender-client installed by default.
The option is on by default, but turned off for the custom image configuration
we use for building the images we provide as a part of our documentation onboarding.
Changelog: Added an option `MENDER_CLIENT_INSTALL=y/n`, in order to
configure the installation of the Mender client into the converted image.
Defaults to `yes`.
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
Changelog: Always create symlinks from `/var/lib/mender-configure` to
`/data/mender-configure`. They always need to installed in a
rootfs-image prepared image, even if the software isn't, because if
the package is installed later, the links must be present or it will
act as if it is a non-rootfs image, and store the settings on the
rootfs partition, when they should be stored on the data partition.
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
Changelog: Support installing mender-configure addon. Not installed by
default, it can be configured using MENDER_ADDON_CONFIGURE_INSTALL and
MENDER_ADDON_CONFIGURE_VERSION variables.
Changelog: Set mender-configure version to master
Signed-off-by: Lluis Campos <lluis.campos@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>
The 'rmdir' call should be enough, and just because there is an
empty dir in the boot part, does not mean that it exists in
rootfs/boot, so just remove this.
Changelog: Fix error when removing empty directories in rootfs/boot
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
The current checks will not work when multiple options are used. Ignore
the '-O ' and check only for the option values.
Changelog: None
Signed-off-by: Drew Moseley <drew.moseley@northern.tech>
Making more explicit the two different use cases that the previous
optional arguments were trying to support.
Changelog: None
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
Changelog: Support installing mender-shell addon. Not installed by
default, it can be configured using MENDER_ADDON_SHELL_INSTALL and
MENDER_ADDON_SHELL_VERSION variables.
Changelog: Set mender-shell version to master
Changelog: Create demo configuration for Mender Shell addon in
bootstrap-rootfs-overlay-demo-server.sh script
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
Add a deb module with reverse engineered logic to download a given deb
package from an APT repository, and modify mender-client download to use
this method instead of the legacy wget direct download.
Changelog: None
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
The latest package does not have the Debian version suffixed.
Therefore, simply remove it in the case where it is needed.
Changelog: None
Signed-off-by: Ole Petter <ole.orhagen@northern.tech>
As probe_initrd_in_boot_and_root indicates, this is not always required.
Adding the check for the ln not to throw an error.
Changelog: None
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
... not just for EFI configuration. This doesn't fix any immediate
problems, but some U-Boot configurations seem to make a reference to
this, so this is just being proactive.
Changelog: None
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
Because we hardcode the name in the boot loader script, you can never
upgrade to a kernel with a different version string. Fix by using a
generic name and symlinking instead.
Changelog: Title
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
Changelog: Warn user when converting read-only file systems that would
result in unstable checksums, making the image incompatible with Mender
Delta updates.
Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
Changelog: Title
CentOS 8 converted image cannot boot to login shell:
user: no shell: permission denied
It turns out that issue was caused by selinux. Idea for relabeling rootfs
was inspired by this post:
https://forums.centos.org/viewtopic.php?t=48714
Removing of /.autorelabel after action is done automatically and it's necessary.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
- 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>