@@ -27,17 +27,17 @@ esac
. /scripts/functions
-ovl_partition_label="${INITRAMFS_OVERLAY_STORAGE_PARTITION_LABEL}"
+ovl_partition_device="${INITRAMFS_OVERLAY_STORAGE_DEVICE}"
ovl_storage_path="${INITRAMFS_OVERLAY_STORAGE_PATH}"
ovl_lower_dirs="${INITRAMFS_OVERLAY_PATHS}"
root_mount_storage=${rootmnt}${ovl_storage_path}
-if ! mountpoint -q "${rootmnt}/${ovl_partition_label}"; then
- if ! mount -t $(get_fstype /dev/disk/by-label/${ovl_partition_label}) \
- /dev/disk/by-label/${ovl_partition_label} \
- ${rootmnt}/${ovl_partition_label}; then
- panic "Can't mount /${ovl_partition_label} partition - overlay will not work!"
+if ! mountpoint -q "${rootmnt}/var"; then
+ if ! mount -t $(get_fstype ${ovl_partition_device}) \
+ ${ovl_partition_device} \
+ ${rootmnt}/var; then
+ panic "Can't mount /var partition - overlay will not work!"
fi
fi
@@ -19,12 +19,13 @@ SRC_URI += " \
INITRAMFS_OVERLAY_PATHS ??= "/etc"
INITRAMFS_OVERLAY_STORAGE_PATH ??= "/var/local"
-INITRAMFS_OVERLAY_STORAGE_PARTITION_LABEL ??= "var"
+# override this to switch to UUID or PARTUUID based mounts
+INITRAMFS_OVERLAY_STORAGE_DEVICE ??= "/dev/disk/by-label/var"
TEMPLATE_FILES = "overlay.script.tmpl"
TEMPLATE_VARS += " INITRAMFS_OVERLAY_STORAGE_PATH \
INITRAMFS_OVERLAY_PATHS \
- INITRAMFS_OVERLAY_STORAGE_PARTITION_LABEL"
+ INITRAMFS_OVERLAY_STORAGE_DEVICE"
DEBIAN_DEPENDS = "initramfs-tools, awk, coreutils, util-linux"
Previously, the /var mount is only located by the partition label. This is problematic, as collisions on this label might happen when working with multiple disks. This patch makes the method to find the /var partition configurable. By that, downstream implementations can use UUID or PARTUUID based mounting. For backwards compatibility we keep the current label-based mounting as default. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> --- .../initramfs-overlay-hook/files/overlay.script.tmpl | 12 ++++++------ .../initramfs-overlay-hook_0.1.bb | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-)