From 380ee36811939d947024bf78de907e3c071b834f Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 7 Mar 2016 18:07:52 +0100 Subject: image creation: allow overriding .rootfs suffix By default, the image file name contains ".rootfs" to distinguish the image file from other files created during image building. However, for certain image types (for example, .hddimg) the ".rootfs" suffix is redundant because the type suffix alone already uniquely identifies the main image file (core-image-minimal-intel-corei7-64.hddimg instead of core-image-minimal-intel-corei7-64.rootfs.hddimg). With this change, distros that prefer the shorter image name can override the .rootfs suffix unconditionally with IMAGE_NAME_SUFFIX ?= '' in their distro configuration or with some condition check like this: python () { if : d.setVar('IMAGE_NAME_SUFFIX', '') } The exact logic when to remove the extra suffix depends on the distro and how it enables its own image type. Signed-off-by: Patrick Ohly Signed-off-by: Richard Purdie --- meta/classes/image.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'meta/classes/image.bbclass') diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 02612ad2a2..081a0b32c6 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -387,7 +387,7 @@ python () { subimages.append(realt + "." + ctype) if realt not in alltypes: - cmds.append(localdata.expand("\trm ${IMAGE_NAME}.rootfs.${type}")) + cmds.append(localdata.expand("\trm ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}")) else: subimages.append(realt) @@ -474,7 +474,7 @@ python create_symlinks() { manifest_name = d.getVar('IMAGE_MANIFEST', True) taskname = d.getVar("BB_CURRENTTASK", True) subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split() - imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix', True) or ".rootfs." + imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix', True) or "${IMAGE_NAME_SUFFIX}." os.chdir(deploy_dir) if not link_name: -- cgit v1.2.3