path: root/meta/classes/kernel.bbclass
diff options
authorRichard Purdie <>2019-02-21 16:00:02 (GMT)
committerRichard Purdie <>2019-02-25 10:43:06 (GMT)
commita5b7c86f23110cad2aa1d4ee378058ca1eb5f1c1 (patch)
tree63d2249cb75d09d5a79a7c8b0fd2c97d5515adc9 /meta/classes/kernel.bbclass
parent9fdd172fb0cf9fdd270744c11afdfcd5a0ddc954 (diff)
kernel: Ensure an initramfs is added if configured
If ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.cpio does not exist, nor any of the compressed variants, nothing is copied to kernel build's ./usr directory. The code does not fail, but silently proceeds without a bundled initramfs. Change to fail and tell the user something is wrong. Also, if an initramfs is found, contrary to the comments, it does not stop at the first uncompressed/compressed cpio image found. Instead it keeps processing all so the last is used. Fix this to behave as per the comments. [YOCTO #12909] (Patch by Leon Woestenberg) (From OE-Core rev: 5b5604e288af755eb5553a97d26533445b2cf94b) Signed-off-by: Richard Purdie <>
Diffstat (limited to 'meta/classes/kernel.bbclass')
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index c0889bd..a5b1df1 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -224,9 +224,11 @@ copy_initramfs() {
224 break 224 break
225 ;; 225 ;;
226 esac 226 esac
227 break
227 fi 228 fi
228 done 229 done
229 echo "Finished copy of initramfs into ./usr" 230 # Verify that the above loop found a initramfs, fail otherwise
231 [ -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio ] && echo "Finished copy of initramfs into ./usr" || die "Could not find any ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.cpio{.gz|.lz4|.lzo|.lzma|.xz) for bundling; INITRAMFS_IMAGE_NAME might be wrong."
230} 232}
231 233
232do_bundle_initramfs () { 234do_bundle_initramfs () {