public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH v2] Avoid name collisions of deployed kernels and initrds
Date: Tue, 27 Mar 2018 18:43:34 +0200	[thread overview]
Message-ID: <a7534cba-f4a6-b359-f5c5-ed68fd3b3217@web.de> (raw)

From: Jan Kiszka <jan.kiszka@siemens.com>

While distro kernels tend to have individualizing version names, this
need not be the case for custom kernels. If we deploy them as is into
the common image folder, they can easily overwrite each other when
building images for different distro-machine tuples.

Avoid this by appending <distro>-<machine> to the deployed image names.
Take this into account when using the images in the start_vm script.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - rebased over next

 meta/classes/image.bbclass | 4 ++--
 scripts/start_vm           | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 6a705fc..e1bb5f6 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -34,12 +34,12 @@ do_rootfs[deptask] = "do_deploy_deb"
 do_copy_boot_files() {
     KERNEL_IMAGE=${@get_image_name(d, 'vmlinuz')}
     if [ -n "${KERNEL_IMAGE}" ]; then
-        cp -f ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}
+        cp -f ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE}_${DISTRO}-${MACHINE}
     fi
 
     INITRD_IMAGE=${@get_image_name(d, 'initrd.img')}
     if [ -n "${INITRD_IMAGE}" ]; then
-        sudo cp -f ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}
+        sudo cp -f ${IMAGE_ROOTFS}/boot/${INITRD_IMAGE} ${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}_${DISTRO}-${MACHINE}
     fi
 }
 
diff --git a/scripts/start_vm b/scripts/start_vm
index f996ee4..4cb05ae 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -118,9 +118,9 @@ readonly ROOTFS_IMAGE=isar-image-base-debian-$DISTRO-qemu$ARCH.ext4.img
 
 eval $(bitbake -e multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep "^KERNEL_IMAGE=")
 eval $(bitbake -e multiconfig:qemu$ARCH-$DISTRO:isar-image-base | grep "^INITRD_IMAGE=")
-QKERNEL=$IMAGE_DIR/$KERNEL_IMAGE
+QKERNEL=$IMAGE_DIR/${KERNEL_IMAGE}_debian-$DISTRO-qemu$ARCH
 QINITRD=/dev/null
-[ -n "$INITRD_IMAGE" ] && QINITRD=$IMAGE_DIR/$INITRD_IMAGE
+[ -n "$INITRD_IMAGE" ] && QINITRD=$IMAGE_DIR/${INITRD_IMAGE}_debian-$DISTRO-qemu$ARCH
 
 readonly ISARROOT="$(dirname "$0")"/..
 
-- 
2.13.6

                 reply	other threads:[~2018-03-27 16:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=a7534cba-f4a6-b359-f5c5-ed68fd3b3217@web.de \
    --to=jan.kiszka@web.de \
    --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