public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Cedric Hombourger <chombourger@gmail.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: Cedric Hombourger <Cedric_Hombourger@mentor.com>,
	isar-users@googlegroups.com
Subject: Re: [PATCH v2] image: include image name in the kernel/initrd image copies
Date: Thu, 25 Oct 2018 13:50:41 +0200	[thread overview]
Message-ID: <17645BE3-1A51-4DA6-9A63-F7ABD536C061@gmail.com> (raw)
In-Reply-To: <20181022172441.7eba0f77@md1pvb1c.ad001.siemens.net>

[-- Attachment #1: Type: text/plain, Size: 5956 bytes --]

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 = "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.ext4.img”

would become

EXT4_IMAGE_FILE = "${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 <mailto: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 =
>> "${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"
> 
> -- 
> 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 <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 <mailto:isar-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to isar-users@googlegroups.com <mailto:isar-users@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20181022172441.7eba0f77%40md1pvb1c.ad001.siemens.net <https://groups.google.com/d/msgid/isar-users/20181022172441.7eba0f77%40md1pvb1c.ad001.siemens.net>.
> For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.


[-- Attachment #2: Type: text/html, Size: 23090 bytes --]

  reply	other threads:[~2018-10-25 11:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18  9:04 [PATCH] " Cedric Hombourger
2018-10-18  9:27 ` Jan Kiszka
2018-10-18  9:46   ` chombourger
2018-10-18 10:29     ` Jan Kiszka
2018-10-18 10:37       ` Jan Kiszka
2018-10-18 11:45       ` chombourger
2018-10-18 13:53         ` Jan Kiszka
2018-10-18 17:23           ` [PATCH v2] " Cedric Hombourger
2018-10-22 12:49             ` cedric_hombourger
2018-10-22 13:52               ` Jan Kiszka
2018-10-25 11:19                 ` Maxim Yu. Osipov
2018-10-25 11:20                   ` Cedric Hombourger
2018-10-22 15:24             ` Henning Schild
2018-10-25 11:50               ` Cedric Hombourger [this message]
2018-10-25 14:22                 ` Henning Schild
2018-10-25 14:46                   ` [PATCH v3] " Cedric Hombourger
2018-10-26 12:58                     ` Maxim Yu. Osipov
2018-11-09 11:04                       ` Jan Kiszka
2018-10-22 15:48       ` [PATCH] " Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17645BE3-1A51-4DA6-9A63-F7ABD536C061@gmail.com \
    --to=chombourger@gmail.com \
    --cc=Cedric_Hombourger@mentor.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox