From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6613620343774904320 X-Received: by 2002:a1c:b5c9:: with SMTP id e192-v6mr816122wmf.22.1540558735042; Fri, 26 Oct 2018 05:58:55 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:32c4:: with SMTP id y187-v6ls349937wmy.11.gmail; Fri, 26 Oct 2018 05:58:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5e/fdaFxhsMMhWRu3zqNeSeW5W83QXmxLsZEIuhJLinbSkG/AobtOKfBatSRzGpU8RytB3T X-Received: by 2002:a1c:e3c1:: with SMTP id a184-v6mr869156wmh.9.1540558734643; Fri, 26 Oct 2018 05:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540558734; cv=none; d=google.com; s=arc-20160816; b=isU1604zIq2/OjVnVIXqxHSxNpoapOxCf42LEk712xHNgrD0lAshEVlkD+xNbCDFbU riT4rt2mVWVvvTf8SkDXV9dG/C7wGaBkc80zoFOqhMzMwx2BqPt46o1DFvv2zUVrSPGf 1aqGmVSTgHIFEw1kpAUxSudqmJ1VKNO7u5AJk7M418uja1KM7wiDAPSr8FOsCqwyMrKY jvX+LuXz1V8SDNs9BEgLcNO/oaw7B9ufbsSkt0ay0wgMQBiteCQZEVn+9E6L4jMC2a6T 4JGqdDrzqoGXfdJBzXRhFa549Xhz0ZmR0wQHOvdTYqYA8OfmfeDnjpOXu/s9emWsj/2R WASg== 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=PHwQgD5q9MbLvQ+B9XT2jkfrxxvLwNDS366QYDFJpJA=; b=jhvRf2sZWZSJBBPYlOy7QoNz0vE7S3LItccmKbf08Zo1kyd293x07yZn6vw2WFcq7A X1yVRwxG0UM4oEOjiZFkMl2Py8Uo+tIwBrzQKOrBbsL4CkKojxfDiw2rN21HUecJTg6G yiXYz/6HLxkd9LcGrxPEyL9HIizKoSZ+01Fmm+tE95A2Ct56BJ7KSx2p0herkJ/kmOKO t45eyo17Mp75Yf+XQsDgqKczGNMXGVSOyNA0dofNiT+nj3uy02DPlD/zpNEm/iLwZ/z/ FECV2zu2NQwTw+tUG+/Y6EWOL4LrTJPGox8Dkm8SUZ1AZ2rlfMMvNN5Q8FaRBiYLKeDM r1vQ== 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 h137-v6si150174wmd.1.2018.10.26.05.58.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 05:58:54 -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 w9QCwpZ1000996 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 26 Oct 2018 14:58:53 +0200 Subject: Re: [PATCH v3] image: include image name in the kernel/initrd image copies To: Cedric Hombourger , isar-users@googlegroups.com References: <20181025162204.7d823466@md1pvb1c.ad001.siemens.net> <1540478818-257-1-git-send-email-Cedric_Hombourger@mentor.com> From: "Maxim Yu. Osipov" Organization: ilbers GmbH Message-ID: <012d3fdc-9740-938d-da25-e826efdce0de@ilbers.de> Date: Fri, 26 Oct 2018 15:58:46 +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: <1540478818-257-1-git-send-email-Cedric_Hombourger@mentor.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: PeWaVYRO6Jep On 10/25/18 5:46 PM, 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). Applied to the 'next', Regards, Maxim. > Signed-off-by: Cedric Hombourger > --- > RECIPE-API-CHANGELOG.md | 24 ++++++++++++++++++++++++ > meta/classes/ext4-img.bbclass | 2 +- > meta/classes/image.bbclass | 7 ++++--- > meta/classes/wic-img.bbclass | 6 +++--- > 4 files changed, 32 insertions(+), 7 deletions(-) > > diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md > index 8d93ef4..c7b7552 100644 > --- a/RECIPE-API-CHANGELOG.md > +++ b/RECIPE-API-CHANGELOG.md > @@ -3,6 +3,30 @@ Recipe API Changelog > > Baseline: Release v0.5 > > +Upcoming changes (v0.7) > +----------------------- > + > +### more consistent artifact names > + > +multiconfig image artifacts are all placed in tmp/deploy/images. They include > +kernel, initrd and ext4/wic images. A consistent naming scheme is now used: > +`IMAGE-DISTRO-MACHINE.TYPE`. This scheme was already used for ext4/wic images > +so no visible changes there. Kernel and initrd images are however affected; for > +instance: > + > +``` > +vmlinuz-4.9.0-8-armmp_debian-stretch-qemuarm > +``` > + > +is now > + > +``` > +isar-image-base-debian-stretch-qemuarm.vmlinuz-4.9.0-8-armmp > +``` > + > +It should be noted that the `KERNEL_IMAGE` and `INITRD_IMAGE` variables were > +updated hence recipes using them shouldn't be impacted per se. > + > Changes in v0.6 > --------------- > > 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" > -- 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