From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6613620343774904320 X-Received: by 2002:a05:6402:6d9:: with SMTP id n25mr332569edy.0.1540466385270; Thu, 25 Oct 2018 04:19:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:e2d9:: with SMTP id gr25-v6ls1642313ejb.4.gmail; Thu, 25 Oct 2018 04:19:44 -0700 (PDT) X-Google-Smtp-Source: AJdET5c2iMIe1bdEDW5OjzYG3gOeAccSKZIy+M8u3VAAA3FUVhJJEDq0D/hCLKvlfgTb5wmKDqK2 X-Received: by 2002:a17:906:28cf:: with SMTP id p15-v6mr260185ejd.11.1540466384813; Thu, 25 Oct 2018 04:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540466384; cv=none; d=google.com; s=arc-20160816; b=T2UNlk+5tjjVIw2uZGCARxLun4eRWAz5aZI7oLBMIuZ4V8JeyKvykjHhNuT2gRC/ok qhK3pt0uIYQ+t5KuEg8Exhy9o7qsRqiBeT+z8khotYhseueumyzy/29VzFHeHqVpDLiT wl2ZUcddN+Xe6WkuudFPIAS0bZHizkNDa31EVTwbOM6n+MIV10hgQetQU5dbjVLFaFVz gdnv7yKHrOgh/LN31jNR+S5K6NxQRhC14k9/S6I2MMdqyLGR+dqTtg1WRv5YIuFws3QH QP3yOk7Q+oWhtWShwLBC2lc/GiZxD5Oa01/LlexoZ0TO0Q7T6mN45Sl1I8T7OaCcvPzQ 6Qmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:references:to:subject; bh=whtjy3MmsTVzTvcFfowToFHWVjcOcCQnVD9LDaVLCyA=; b=nq2FuRGsMnk35p1py5MdcBMkFrRABRQGg+4C0BGel2vag4TG1PfrEMonqluFo0Dadr JAkhet7G6V1j6Nc5RSeHrwmsPRk2Cu93POs6nv9LngcwA4AaztwswwT9FGFA2UD0q4Kp fQg4WBFJPFvllR/m+2OfAIgrIRL0rRGsfdqlve2rHZWfWqcI8qh86BfLr+juKvxRpfr4 UZ4D2dFgMU57a6KNLn6ucqG784m1U/ElD1qFJjKTxWOyS6khFElYzLq3l8CssAVLbldV xWk6M2A+Xd46klhVshq3C+zv6yYqdHm/0UmX1rokEdPM6/2O9dfbSW67dcM5Hc9NBH3l rIZA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id n20-v6si150702edt.3.2018.10.25.04.19.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 04:19:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from [192.168.50.180] (nat-ppp-217.71.235.199-satnet-spb.ru [217.71.235.199] (may be forged)) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w9PBJfxR029880 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 25 Oct 2018 13:19:43 +0200 Subject: Re: [PATCH v2] image: include image name in the kernel/initrd image copies To: cedric_hombourger@mentor.com, isar-users References: <27912c86-2c53-4986-bf9c-2f9b9796bd50@siemens.com> <1539883436-305-1-git-send-email-Cedric_Hombourger@mentor.com> <5d88d529-1dcc-8fd6-9eef-7a00f5584863@siemens.com> From: "Maxim Yu. Osipov" Organization: ilbers GmbH Message-ID: <49365eab-5224-457b-271c-7e841eac08f3@ilbers.de> Date: Thu, 25 Oct 2018 14:19:36 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <5d88d529-1dcc-8fd6-9eef-7a00f5584863@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: sEml+UYwm3s9 Hi Cedric, Are you going to send V3 of the patch to address Jan's and Henning's suggestions to v2? Kind regards, Maxim. On 10/22/18 4:52 PM, Jan Kiszka wrote: > On 22.10.18 13:49, cedric_hombourger@mentor.com wrote: >> Hi Jan, >> >> Did you have a chance to look at v2? >> Did I manage to address your initial review findings? > > Sorry, we were/are busy for ELC-E preparations: On first sight, it looks > good to me. > > Just wondering: Do we want/need to document the renaming of > kernel/initrd somewhere, maybe in RECIPE-API-CHANGELOG.md? > > Jan > >> >> Thanks >> Cedric >> >> On Thursday, October 18, 2018 at 7:24:12 PM UTC+2, Cedric Hombourger >> wrote: >> >>     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 >     > >>     --- >>       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 = >> "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img" >>     +EXT4_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.ext4.img" >> >>       do_ext4_image[stamp-extra-info] = "${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   = "${WORKDIR}/rootfs" >> >>       IMAGE_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME", >> True)) if >>     d.getVar("KERNEL_NAME", True) else ""}" >> >>     +# Name of the image including distro&machine names >>     +IMAGE_FULLNAME = "${PN}-${DISTRO}-${MACHINE}" >>     + >>       # These variables are used by wic and start_vm >>       KERNEL_IMAGE ?= "${@get_image_name(d, 'vmlinuz')[1]}" >>       INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')[1]}" >>     @@ -21,9 +24,7 @@ def get_image_name(d, name_link): >>           path_link = os.path.join(S, name_link) >>           if os.path.exists(path_link): >>               base = os.path.basename(os.path.realpath(path_link)) >>     -        full = base >>     -        full += "_" + d.getVar("DISTRO", True) >>     -        full += "-" + d.getVar("MACHINE", True) >>     +        full = 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] += "${WICVARS}" >>       do_rootfs_wicenv[prefuncs] = 'set_image_size' >> >>     -WIC_IMAGE_FILE >> ="${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.wic.img" >>     +WIC_IMAGE_FILE ="${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic.img" >> >>       do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" >> >>     @@ -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} >>       } >> >>       do_wic_image[file-checksums] += "${WKS_FULL_PATH}:True" >>     --     2.11.0 >> >> -- >> You received this message because you are subscribed to the Google >> Groups "isar-users" group. >> To unsubscribe from this group and stop receiving emails from it, 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/d09c4a2f-4249-4914-9ceb-b5dfdf8924fa%40googlegroups.com >> . >> >> For more options, visit https://groups.google.com/d/optout. > -- Maxim Osipov ilbers GmbH Maria-Merian-Str. 8 85521 Ottobrunn Germany +49 (151) 6517 6917 mosipov@ilbers.de http://ilbers.de/ Commercial register Munich, HRB 214197 General Manager: Baurzhan Ismagulov