Skip to contentSkip to conversation

qemuboot.bbclass: Fix QB_DEFAULT_KERNEL expansion

PATCH Mark Hatle 1 participant 1 message Feb 3, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mark Hatle

author
#1 lore raw

Note, INITRAMFS_LINK_NAME is set in kernel-artifact-names.bbclass.

An alternative implementation of this could be to:

qemuboot:
QB_DEFAULT_KERNEL ??= "${KERNEL_IMAGETYPE}"

kernel-artifact-names:
QB_DEFAULT_KERNEL ?= "${@bb.utils.contains("INITRAMFS_IMAGE_BUNDLE", "1",
"${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin", "${KERNEL_IMAGETYPE}", d)}"

I'm not sure that is any better or easier to maintain, but if anyone has strong feels, I'm happy to create a V2 patch based on that instead.

--Mark

Quoted 34 lines · Mark Hatle

QB_DEFAULT_KERNEL was not being expanded unless INITRAMFS_LINK_NAME was defined. This only happens when building a kernel with an integrated (bundled) initramfs.

---
  meta/classes-recipe/qemuboot.bbclass | 3 +++
  1 file changed, 3 insertions(+)
meta/classes-recipe/qemuboot.bbclass +3 -1
index 0f80c60..ee71a2f 100644
@@ -96,6 +96,9 @@
  QB_MEM ?= "-m 256"
  QB_SMP ?= ""
  QB_SERIAL_OPT ?= "-serial mon:stdio -serial null"
+# Define INITRAMFS_LINK_NAME to ensure that QB_DEFAULT_KERNEL expands,
+# even when INITRAMFS_LINK_NAME would not otherwise be defined.
+INITRAMFS_LINK_NAME ??= ""
  QB_DEFAULT_KERNEL ?= "${@bb.utils.contains("INITRAMFS_IMAGE_BUNDLE", "1", "${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin", "${KERNEL_IMAGETYPE}", d)}"
  QB_DEFAULT_FSTYPE ?= "ext4"
  QB_RNG ?= "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#210725): https://lists.openembedded.org/g/openembedded-core/message/210725
Mute This Topic: https://lists.openembedded.org/mt/110975972/3616948
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-