From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6613620343774904320 X-Received: by 2002:a1c:8253:: with SMTP id e80-v6mr181002wmd.2.1540468259516; Thu, 25 Oct 2018 04:50:59 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:8b88:: with SMTP id n130-v6ls24003wmd.0.canary-gmail; Thu, 25 Oct 2018 04:50:59 -0700 (PDT) X-Google-Smtp-Source: AJdET5fSF+oSQAKng0TdPwYoE6WffZs8PTnRXBB9g6O5CGr3qVPC3Pod/ug85tSG0DGZCUDo60eA X-Received: by 2002:a1c:1d50:: with SMTP id d77-v6mr180896wmd.1.1540468259011; Thu, 25 Oct 2018 04:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540468258; cv=none; d=google.com; s=arc-20160816; b=OaZazfuyxJ/2SL3OKEbo82IECKPNARLDTkv9KqN7dPRE0E8jTgalrAmkxj8e66jIht x+JNzLsMHNk8GovNI7R5MHhIjUbzUsnK+q4LDKaDsGezSbHVCZFlEisaYrpzH47EuFw+ +yXG0zohNL63JNDGWrtFyGjQzLwFpYK6oypcwIYEdA1RsLi7oE2EK/AeJhdKlLT5d1PU DptwJ9rmuERIgNu7JuHlpUICSg9U/98FCldoPT98IK/VlgIUzDMH1CuBVV5iIoQdnLZv QstrxU/2feX2Cf5f6O5TGoiSjnINBHF/M/pWfnbe823bQDXTwh6eRfftk76jdp9BpR0G pUSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:dkim-signature; bh=gVIxi0ZhiqV9UD4lcvIkW6C/dP2iIAllH0BmY37LD2Q=; b=XBhCmcQz9mTxC6TB5OA0Ge695eaHIa06a1yAF1CICptG7KuFTbHBGpG0pmIfaqcLBL PCxY3gcLc2eB/RCXVAFIJ9wU0xcoBJCgHNRFCrcuaG/dZ9nPeSNuhSebB0hvw3j2wWzb 2uSbQ5+nQDfjFT6P5dNi5c+Nv4TVZmOgtDwfA6YU9ewRnG1c4sWcVW2hj4zPLWkGKg3T hO+IpSYkmA0uZqKRehZ9S9KxC6sKWrxsFRW9HbnhSoQplZzllVveJg5WqRgaxVApYtEO o8RorgPfng/sV12fKBhs7kTlVGAcUSuNw7lxCf5sOK5lc77JMLK/ew3fR7TgMbAT6wwA ND/g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="S4/UXM87"; spf=pass (google.com: domain of chombourger@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) smtp.mailfrom=chombourger@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com. [2a00:1450:4864:20::342]) by gmr-mx.google.com with ESMTPS id r3-v6si251180wrl.5.2018.10.25.04.50.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 04:50:58 -0700 (PDT) Received-SPF: pass (google.com: domain of chombourger@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) client-ip=2a00:1450:4864:20::342; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="S4/UXM87"; spf=pass (google.com: domain of chombourger@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) smtp.mailfrom=chombourger@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-wm1-x342.google.com with SMTP id y140-v6so1767580wmd.0 for ; Thu, 25 Oct 2018 04:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=gVIxi0ZhiqV9UD4lcvIkW6C/dP2iIAllH0BmY37LD2Q=; b=S4/UXM87319kHyA8CcsjmbVbFg71ahQrt6iiDPXCBWNOKa4YiaFBbaGGATxlzgmTk1 QhvyUyLZ9ssFEHGoyjZ2hufj2BeNU15vG2Xclvu/6EfQ7ZPcqCYnz4V4EpoBvyFSHmQP /+Ov85HDT34QDSkxfBSSHvSupB8GA1dzeIYXQgkv/PwCeN1rk17wrR+WMSKjjaTjdZqZ XPJHNfwCcUjemzQHeLZB7lFtGGK8q3ks8yGelHmDTtPpkkDlpe1uHlsO5/DCYKKj95p/ tQ1N4OUGhlpGlAj7LxU5SRAhAawQ3FLKNbBHERycmpd7Lu3Ama+OD1SYGZF0ICvLEpj0 8Zpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=gVIxi0ZhiqV9UD4lcvIkW6C/dP2iIAllH0BmY37LD2Q=; b=bD0synX/YUhCr7DhK05X1uFKptuyORfWi44tZV2FwoyXQphZGuXlxvfZhtiD/FLnd0 JyNm1wAkIR8wlz4EHWuK3kUiV96ppSrwi66pQI6exe9SZv4vPgnTxKrN+9mAYXGMf9Rs FvmYDnOjVtPSTqlLSpZJ5zFE7zKEBFMQqdLt2rlgcV3D5M1yzGQPh37JbyW7FRNv3LZe QUyDw/maxncXQ4LwKHU4QQ5y56+yCyYrd7kWDRajGvj4Q9uaZezV2bBF1t34empZf1Z3 7kNjdLXP+iF3W0EAp+x1rWZQlWu9WL74HXCRGDxQ489M0QUuoBoE5ZegBUt2KZtG6Vfk V+7g== X-Gm-Message-State: AGRZ1gK7Wbtmjs7Gin754rZRdS7x6+G+Q7hMVasRwhP+erZWOpb27fjh yUlkWqonAIJ/Wf9XzB2vmM4= X-Received: by 2002:a1c:2501:: with SMTP id l1-v6mr1570029wml.133.1540468258415; Thu, 25 Oct 2018 04:50:58 -0700 (PDT) Return-Path: Received: from [172.17.0.20] (nat-ies.mentorg.com. [192.94.31.2]) by smtp.gmail.com with ESMTPSA id p8-v6sm8425289wre.50.2018.10.25.04.50.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 04:50:57 -0700 (PDT) From: Cedric Hombourger Message-Id: <17645BE3-1A51-4DA6-9A63-F7ABD536C061@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_E2F1B213-426F-4A41-A1E3-EDBAB4F6B6F0" Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: Re: [PATCH v2] image: include image name in the kernel/initrd image copies Date: Thu, 25 Oct 2018 13:50:41 +0200 In-Reply-To: <20181022172441.7eba0f77@md1pvb1c.ad001.siemens.net> Cc: Cedric Hombourger , isar-users@googlegroups.com To: Henning Schild References: <27912c86-2c53-4986-bf9c-2f9b9796bd50@siemens.com> <1539883436-305-1-git-send-email-Cedric_Hombourger@mentor.com> <20181022172441.7eba0f77@md1pvb1c.ad001.siemens.net> X-Mailer: Apple Mail (2.3445.100.39) X-TUID: urNN+wbG8Q5U --Apple-Mail=_E2F1B213-426F-4A41-A1E3-EDBAB4F6B6F0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Henning, Are you suggesting that the first patch should define IMAGE_FULLNAME as = ${DISTRO}-${MACHINE} and replace relevant occurrences of = ${DISTRO}-${MACHINE} with ${IMAGE_FULLNAME}? I am asking because it would no longer be the full name of the image but = something more like a suffix; e.g. EXT4_IMAGE_FILE =3D = "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img=E2=80=9D would become EXT4_IMAGE_FILE =3D = "${DEPLOY_DIR_IMAGE}/${PN}-${IMAGE_FULLNAME}.ext4.img" I am happy to go ahead with this but it may be more confusing in the end Cedric > On Oct 22, 2018, at 5:24 PM, Henning Schild = wrote: >=20 > I would suggest so make that two patches, one to introduce > IMAGE_FULLNAME and the actual change in the next. >=20 > Henning >=20 > Am Thu, 18 Oct 2018 19:23:56 +0200 > schrieb Cedric Hombourger >: >=20 >> The kernel and initrd images are really image-specific (especially >> the later as the initrd is created/updated as packages get installed >> into the root file-system). Make sure we retain a per-image copy of >> these images in the image deploy directory by inserting the name of >> the image (${PN}) into the full name of the artifacts (set in >> ${KERNEL_IMAGE} and ${INITRD_IMAGE}). >>=20 >> In addition, an IMAGE_FULLNAME variable is introduced to combine the >> three components of the image name: the (base) name of the image, the >> name of the distribution and the name of the machine. This variable >> is now used in the start_vm script and the image classes (image, >> ext4-img and wic-img). >>=20 >> Signed-off-by: Cedric Hombourger >> --- >> meta/classes/ext4-img.bbclass | 2 +- >> meta/classes/image.bbclass | 7 ++++--- >> meta/classes/wic-img.bbclass | 6 +++--- >> 3 files changed, 8 insertions(+), 7 deletions(-) >>=20 >> diff --git a/meta/classes/ext4-img.bbclass >> b/meta/classes/ext4-img.bbclass index 78036a2..29e5f77 100644 >> --- a/meta/classes/ext4-img.bbclass >> +++ b/meta/classes/ext4-img.bbclass >> @@ -1,7 +1,7 @@ >> # This software is a part of ISAR. >> # Copyright (C) 2015-2017 ilbers GmbH >>=20 >> -EXT4_IMAGE_FILE =3D >> "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img" >> +EXT4_IMAGE_FILE =3D "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.ext4.img"=20= >> do_ext4_image[stamp-extra-info] =3D "${DISTRO}-${MACHINE}" >>=20 >> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass >> index 05ff06f..ad19f3d 100644 >> --- a/meta/classes/image.bbclass >> +++ b/meta/classes/image.bbclass >> @@ -7,6 +7,9 @@ IMAGE_ROOTFS =3D "${WORKDIR}/rootfs" >>=20 >> IMAGE_INSTALL +=3D "${@ ("linux-image-" + d.getVar("KERNEL_NAME", >> True)) if d.getVar("KERNEL_NAME", True) else ""}"=20 >> +# Name of the image including distro&machine names >> +IMAGE_FULLNAME =3D "${PN}-${DISTRO}-${MACHINE}" >> + >> # These variables are used by wic and start_vm >> KERNEL_IMAGE ?=3D "${@get_image_name(d, 'vmlinuz')[1]}" >> INITRD_IMAGE ?=3D "${@get_image_name(d, 'initrd.img')[1]}" >> @@ -21,9 +24,7 @@ def get_image_name(d, name_link): >> path_link =3D os.path.join(S, name_link) >> if os.path.exists(path_link): >> base =3D os.path.basename(os.path.realpath(path_link)) >> - full =3D base >> - full +=3D "_" + d.getVar("DISTRO", True) >> - full +=3D "-" + d.getVar("MACHINE", True) >> + full =3D d.getVar("IMAGE_FULLNAME", True) + "." + base >> return [base, full] >> if os.path.islink(path_link): >> return get_image_name(d, >> os.path.relpath(os.path.realpath(path_link), diff --git >> a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index >> d0747e2..e7527c8 100644 --- a/meta/classes/wic-img.bbclass >> +++ b/meta/classes/wic-img.bbclass >> @@ -63,7 +63,7 @@ addtask do_rootfs_wicenv after do_copy_boot_files >> before do_wic_image do_rootfs_wicenv[vardeps] +=3D "${WICVARS}" >> do_rootfs_wicenv[prefuncs] =3D 'set_image_size' >>=20 >> -WIC_IMAGE_FILE >> =3D"${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.wic.img" >> +WIC_IMAGE_FILE =3D"${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic.img"=20 >> do_build[stamp-extra-info] =3D "${DISTRO}-${DISTRO_ARCH}" >>=20 >> @@ -81,10 +81,10 @@ do_wic_image() { >> sudo -E chroot ${BUILDCHROOT_DIR} \ >> ${ISARROOT}/scripts/wic create ${WKS_FULL_PATH} \ >> --vars "${STAGING_DIR}/${MACHINE}/imgdata/" \ >> - -o /tmp/${PN}-${DISTRO}-${MACHINE}.wic/ \ >> + -o /tmp/${IMAGE_FULLNAME}.wic/ \ >> -e ${IMAGE_BASENAME} ${WIC_CREATE_EXTRA_ARGS} >> sudo chown -R $(stat -c "%U" ${ISARROOT}) ${ISARROOT}/meta >> ${ISARROOT}/meta-isar ${ISARROOT}/scripts || true >> - cp -f $(ls -t -1 >> ${BUILDCHROOT_DIR}/tmp/${PN}-${DISTRO}-${MACHINE}.wic/*.direct | head >> -1) ${WIC_IMAGE_FILE} >> + cp -f $(ls -t -1 >> ${BUILDCHROOT_DIR}/tmp/${IMAGE_FULLNAME}.wic/*.direct | head -1) >> ${WIC_IMAGE_FILE} }=20 >> do_wic_image[file-checksums] +=3D "${WKS_FULL_PATH}:True" >=20 > --=20 > You received this message because you are subscribed to a topic in the = Google Groups "isar-users" group. > To unsubscribe from this topic, visit = https://groups.google.com/d/topic/isar-users/_FHjvycAyeg/unsubscribe = . > To unsubscribe from this group and all its topics, send an email to = isar-users+unsubscribe@googlegroups.com = . > To post to this group, send email to isar-users@googlegroups.com = . > To view this discussion on the web visit = https://groups.google.com/d/msgid/isar-users/20181022172441.7eba0f77%40md1= pvb1c.ad001.siemens.net = . > For more options, visit https://groups.google.com/d/optout = . --Apple-Mail=_E2F1B213-426F-4A41-A1E3-EDBAB4F6B6F0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = Henning,

Are you = suggesting that the first patch should define IMAGE_FULLNAME as = ${DISTRO}-${MACHINE} and replace relevant occurrences of = ${DISTRO}-${MACHINE} with ${IMAGE_FULLNAME}?

I am asking because it would no longer = be the full name of the image but something more like a suffix; = e.g.

EXT4_IMAGE_FILE =3D = "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img=E2=80=9D

would become

EXT4_IMAGE_FILE =3D = "${DEPLOY_DIR_IMAGE}/${PN}-${IMAGE_FULLNAME}.ext4.img"

I am happy to go ahead = with this but it may be more confusing in the end
Cedric

On Oct = 22, 2018, at 5:24 PM, Henning Schild <henning.schild@siemens.com> wrote:

I would suggest so make that two = patches, one to introduce
IMAGE_FULLNAME and the actual change in the next.

Henning

Am Thu, 18 Oct 2018 19:23:56 = +0200
schrieb = Cedric Hombourger <Cedric_Hombourger@mentor.com>:

The kernel and initrd images are = really image-specific (especially
the later as the initrd = is created/updated as packages get installed
into the root = file-system). Make sure we retain a per-image copy of
these = images in the image deploy directory by inserting the name of
the image (${PN}) into the full name of the artifacts (set = in
${KERNEL_IMAGE} and ${INITRD_IMAGE}).

In addition, an IMAGE_FULLNAME variable is introduced to = combine the
three components of the image name: the (base) = name of the image, the
name of the distribution and the = name of the machine. This variable
is now used in the = start_vm script and the image classes (image,
ext4-img and = wic-img).

Signed-off-by: Cedric Hombourger = <Cedric_Hombourger@mentor.com>
---
meta/classes/ext4-img.bbclass | 2 +-
meta/classes/image.bbclass    | 7 ++++---
meta/classes/wic-img.bbclass  | 6 +++---
3 = files changed, 8 insertions(+), 7 deletions(-)

diff --git a/meta/classes/ext4-img.bbclass
b/meta/classes/ext4-img.bbclass index 78036a2..29e5f77 = 100644
--- a/meta/classes/ext4-img.bbclass
+++= b/meta/classes/ext4-img.bbclass
@@ -1,7 +1,7 @@
# This software is a part of ISAR.
# Copyright = (C) 2015-2017 ilbers GmbH

-EXT4_IMAGE_FILE = =3D
"${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img"
+EXT4_IMAGE_FILE =3D = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.ext4.img" 
do_ext4_image[stamp-extra-info] =3D "${DISTRO}-${MACHINE}"

diff --git a/meta/classes/image.bbclass = b/meta/classes/image.bbclass
index 05ff06f..ad19f3d = 100644
--- a/meta/classes/image.bbclass
+++ = b/meta/classes/image.bbclass
@@ -7,6 +7,9 @@ IMAGE_ROOTFS =   =3D "${WORKDIR}/rootfs"

IMAGE_INSTALL +=3D "${@ ("linux-image-" + = d.getVar("KERNEL_NAME",
True)) if d.getVar("KERNEL_NAME", = True) else ""}" 
+# Name of the image including distro&machine names
+IMAGE_FULLNAME =3D "${PN}-${DISTRO}-${MACHINE}"
+
# These variables are used by wic and = start_vm
KERNEL_IMAGE ?=3D "${@get_image_name(d, = 'vmlinuz')[1]}"
INITRD_IMAGE ?=3D "${@get_image_name(d, = 'initrd.img')[1]}"
@@ -21,9 +24,7 @@ def get_image_name(d, = name_link):
    path_link =3D = os.path.join(S, name_link)
    if = os.path.exists(path_link):
        base =3D = os.path.basename(os.path.realpath(path_link))
- =        full =3D base
- =        full +=3D "_" + = d.getVar("DISTRO", True)
- =        full +=3D "-" + = d.getVar("MACHINE", True)
+ =        full =3D = d.getVar("IMAGE_FULLNAME", True) + "." + base
        return [base, = full]
    if = os.path.islink(path_link):
        return = get_image_name(d,
os.path.relpath(os.path.realpath(path_link), diff --git
a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass = index
d0747e2..e7527c8 100644 --- = a/meta/classes/wic-img.bbclass
+++ = b/meta/classes/wic-img.bbclass
@@ -63,7 +63,7 @@ addtask = do_rootfs_wicenv after do_copy_boot_files
before = do_wic_image do_rootfs_wicenv[vardeps] +=3D "${WICVARS}"
do_rootfs_wicenv[prefuncs] =3D 'set_image_size'

-WIC_IMAGE_FILE
=3D"${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.wic.img"
+WIC_IMAGE_FILE = =3D"${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic.img" 
do_build[stamp-extra-info] =3D "${DISTRO}-${DISTRO_ARCH}"

@@ -81,10 +81,10 @@ do_wic_image() {
    sudo -E chroot ${BUILDCHROOT_DIR} = \
        ${ISARROOT}/scr= ipts/wic create ${WKS_FULL_PATH} \
          &nb= sp; --vars "${STAGING_DIR}/${MACHINE}/imgdata/" \
- =            -o = /tmp/${PN}-${DISTRO}-${MACHINE}.wic/ \
+ =            -o = /tmp/${IMAGE_FULLNAME}.wic/ \
          &nb= sp; -e ${IMAGE_BASENAME} ${WIC_CREATE_EXTRA_ARGS}
    sudo chown -R $(stat -c "%U" = ${ISARROOT}) ${ISARROOT}/meta
${ISARROOT}/meta-isar = ${ISARROOT}/scripts || true
-    cp -f $(ls = -t -1
${BUILDCHROOT_DIR}/tmp/${PN}-${DISTRO}-${MACHINE}.wic/*.direct = | head
-1) ${WIC_IMAGE_FILE}
+ =    cp -f $(ls -t -1
${BUILDCHROOT_DIR}/tmp/${IMAGE_FULLNAME}.wic/*.direct | head = -1)
${WIC_IMAGE_FILE} } 
do_wic_image[file-checksums] +=3D "${WKS_FULL_PATH}:True"

-- You received this message = because you are subscribed to a topic in the Google Groups "isar-users" = group.
To = unsubscribe from this topic, visit https://groups.google.com/d/topic/isar-users/_FHjvycAyeg/unsubs= cribe.
To unsubscribe from this group = and all its topics, send an email to isar-users+unsubscribe@googlegroups.com.
To post to this group, send email to isar-users@googlegroups.com.
To view this = discussion on the web visit https://groups.google.com/d/msgid/isar-users/20181022172441.7eb= a0f77%40md1pvb1c.ad001.siemens.net.
For more = options, visit https://groups.google.com/d/optout.

= --Apple-Mail=_E2F1B213-426F-4A41-A1E3-EDBAB4F6B6F0--