From: Jan Kiszka 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 - to the deployed image names. Take this into account when using the images in the start_vm script. Signed-off-by: Jan Kiszka --- meta/classes/image.bbclass | 4 ++-- scripts/start_vm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 2c255f4..3c73ae3 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -31,12 +31,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 0717193..98fc463 100755 --- a/scripts/start_vm +++ b/scripts/start_vm @@ -25,8 +25,8 @@ qemu-system-$QEMU_ARCH \\\\\n\ -M $QEMU_MACHINE \\\\\n\ $QCPU\\\\\n\ -nographic \\\\\n\ - -kernel \$IMAGE_DIR/$KERNEL_IMAGE \\\\\n\ - -initrd \$IMAGE_DIR/$INITRD_IMAGE \\\\\n\ + -kernel \$IMAGE_DIR/${KERNEL_IMAGE}_debian-$DISTRO-qemu$ARCH \\\\\n\ + -initrd \$IMAGE_DIR/${INITRD_IMAGE}_debian-$DISTRO-qemu$ARCH \\\\\n\ -append \"console=$MACHINE_SERIAL root=/dev/$ROOTFS_DEV rw\" \\\\\n\ $EXTRA_ARGS \\\\\n\ $root1" @@ -38,8 +38,8 @@ qemu-system-$QEMU_ARCH \\\\\n\ -M $QEMU_MACHINE \ $QCPU \ -nographic \ - -kernel $IMAGE_DIR/$KERNEL_IMAGE \ - -initrd $IMAGE_DIR/$INITRD_IMAGE \ + -kernel $IMAGE_DIR/${KERNEL_IMAGE}_debian-$DISTRO-qemu$ARCH \ + -initrd $IMAGE_DIR/${INITRD_IMAGE}_debian-$DISTRO-qemu$ARCH \ -append "console=$MACHINE_SERIAL root=/dev/$ROOTFS_DEV rw" \ $EXTRA_ARGS \ $root2 -- 2.13.6