From 204ed0d1d6cf5b8347303cfe197724df77ad96a0 Mon Sep 17 00:00:00 2001 From: Josef Holzmayr Date: Wed, 7 Aug 2024 13:05:34 +0200 Subject: [PATCH] feat: make boot partition mount point configurable The MENDER_BOOT_PART_MOUNTPOINT variable can be used to configure the mount point for the boot partition which is written to the fstab. If it is not set, the previous hardcoded defaults of /boot/efi respectively /uboot will be used. Changelog: Title Ticket: None Signed-off-by: Josef Holzmayr --- configs/mender_convert_config | 14 ++++++++++++++ mender-convert-modify | 10 +++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/configs/mender_convert_config b/configs/mender_convert_config index 008be538a7..d175f3ba4d 100644 --- a/configs/mender_convert_config +++ b/configs/mender_convert_config @@ -230,6 +230,20 @@ MENDER_ENABLE_PARTUUID="n" # Partition used as the boot partition. MENDER_BOOT_PART="" +# Path to mount the boot partition in the root filesystem +# +# In order to access the boot partition from the running system, +# it needs to be mounted to a defined directory location. +# By default, this is +# - /boot/efi: for GRUB-EFI based integrations +# - /uboot: for all other integrations +# +# The value of this variable overrides all defaults. +# Example: +# MENDER_BOOT_PART_MOUNT_LOCATION="/boot/firmware" +# +#MENDER_BOOT_PART_MOUNT_LOCATION="" + # Partition used as the first (A) rootfs partition. MENDER_ROOTFS_PART_A="" diff --git a/mender-convert-modify b/mender-convert-modify index cc86939818..d91fdd2fd8 100755 --- a/mender-convert-modify +++ b/mender-convert-modify @@ -186,10 +186,14 @@ run_and_log_cmd "echo -n ${VERSION_STRING} | sudo tee work/rootfs/etc/mender/scr log_info "Installing a custom /etc/fstab (see ${MENDER_CONVERT_LOG_FILE} for more info)" -if [ "${MENDER_GRUB_EFI_INTEGRATION}" == "y" ]; then - boot_part_mountpoint="/boot/efi" +if [ -n "${MENDER_BOOT_PART_MOUNT_LOCATION:-}" ]; then + boot_part_mountpoint="${MENDER_BOOT_PART_MOUNT_LOCATION}" else - boot_part_mountpoint="/uboot" + if [ "${MENDER_GRUB_EFI_INTEGRATION}" == "y" ]; then + boot_part_mountpoint="/boot/efi" + else + boot_part_mountpoint="/uboot" + fi fi run_and_log_cmd "sudo mkdir -p work/rootfs/${boot_part_mountpoint}"