public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] Avoid name collisions of deployed kernels and initrds
@ 2018-03-27 16:43 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2018-03-27 16:43 UTC (permalink / raw)
  To: isar-users

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-27 16:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-27 16:43 [PATCH v2] Avoid name collisions of deployed kernels and initrds Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox