From: Jan Kiszka <jan.kiszka@web.de>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH] Avoid name collisions of deployed kernels and initrds
Date: Mon, 26 Mar 2018 09:01:21 +0200 [thread overview]
Message-ID: <ca90cc40-d6b4-7c33-e24c-5be472a2b081@web.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2515 bytes --]
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>
---
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
reply other threads:[~2018-03-26 7:01 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=ca90cc40-d6b4-7c33-e24c-5be472a2b081@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