From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6613620343774904320 X-Received: by 2002:a1c:7d2:: with SMTP id 201-v6mr269900wmh.16.1540477331310; Thu, 25 Oct 2018 07:22:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:eb04:: with SMTP id s4-v6ls41634wrn.7.gmail; Thu, 25 Oct 2018 07:22:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5e66RBQW7nC09AE4k2eCHWPNK3SfL9deRSRmZRE7IHFoNpGcUaJz2ZG5k778y6tH7NRV4Xe X-Received: by 2002:a5d:5287:: with SMTP id c7-v6mr256388wrv.14.1540477330673; Thu, 25 Oct 2018 07:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477330; cv=none; d=google.com; s=arc-20160816; b=QZYaT/7ENCh0pr/bUNd7yq4TPLMlPf9PdbLJwroCqmmn4eu37vC1VtYrsIF7z7VNyV +B3oHBIlkAF5Ykp/cM3CMmjCApbK+8ML/ZTB8XkrRBKBCIYNwOLAFRCVi5RWT2sdtr1z osSmiPCZB8QMrTxedN7Um9NDHktGuu8C4TXvov+22Vq+HUlMBUpgaXqrZvM0atzAgCmn cB5EjNtCxogoDvZcnS2IonzKCH7ZOTC+7lYkwj9C6bqkXdeLD8fCM4C4ZJmbsg1MUk5a 88uKp8T6VyxdcM+LDTpsx+agjeDc7LGjBU4J+2xyXLzM9ZnBNfwMvmdsRmKWk+RcAICW B1Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=Iq9kY7kxCDpcI5cdKNoklKJIvOWZ1IpcPJ79l0YZWFM=; b=m7cJYma4HfzlzOxEwY+dUOQIxW7evTBbE1n1mjSkAFBQcKlccbN76HpW3/FzfJJHJf MR7JTl92oEgU1j9REY3fhqCLiUlFpyxOIUIlghAfwkWDlBcWere/L2xd817seftjydat 4COzyqUpkf+1GaklwvYopIo+1Z1zaBM8IKcUzROiKKrmaCplgpRjzwpAINKoim0MYX+l 4LIjnCCvRvhk7Qfs/NrRufCmc0ffjn57oTsu6BxYi2xJQQ17FS9PRKWILUpVongbBU03 dLxS5SRuas+x54CX3KVN7zgQxlcpEXpfNEPs4zjXaVjCW6u2h5qw+ubkxNRKcWJY/4nQ kJmA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id h137-v6si51014wmd.1.2018.10.25.07.22.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 07:22:10 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id w9PEM9rS031749 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Oct 2018 16:22:09 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTPS id w9PEM6QV021238 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Oct 2018 16:22:09 +0200 Date: Thu, 25 Oct 2018 16:22:04 +0200 From: Henning Schild To: Cedric Hombourger Cc: Cedric Hombourger , Subject: Re: [PATCH v2] image: include image name in the kernel/initrd image copies Message-ID: <20181025162204.7d823466@md1pvb1c.ad001.siemens.net> In-Reply-To: <17645BE3-1A51-4DA6-9A63-F7ABD536C061@gmail.com> References: <27912c86-2c53-4986-bf9c-2f9b9796bd50@siemens.com> <1539883436-305-1-git-send-email-Cedric_Hombourger@mentor.com> <20181022172441.7eba0f77@md1pvb1c.ad001.siemens.net> <17645BE3-1A51-4DA6-9A63-F7ABD536C061@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TUID: jxorrBAuMyrQ Am Thu, 25 Oct 2018 13:50:41 +0200 schrieb Cedric Hombourger : > Hi Henning, >=20 > Are you suggesting that the first patch should define IMAGE_FULLNAME > as ${DISTRO}-${MACHINE} and replace relevant occurrences of > ${DISTRO}-${MACHINE} with ${IMAGE_FULLNAME}? >=20 > I am asking because it would no longer be the full name of the image > but something more like a suffix; e.g. >=20 > EXT4_IMAGE_FILE =3D > "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img=E2=80=9D >=20 > would become >=20 > EXT4_IMAGE_FILE =3D > "${DEPLOY_DIR_IMAGE}/${PN}-${IMAGE_FULLNAME}.ext4.img" >=20 > I am happy to go ahead with this but it may be more confusing in the > end Just wanted to propose a split, if you think it does not provide a benefit just leave it the way it is. Henning > Cedric >=20 > > 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" > >> 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 > > --=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%40= md1pvb1c.ad001.siemens.net > > . > > For more options, visit https://groups.google.com/d/optout > > . =20 >=20