From 468b36fceb5118e4f84f46e74b377992d067015b Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Tue, 15 Jan 2019 12:32:32 -0500 Subject: [PATCH] generate kernel id when initramfs is built --- .../recipes-initrd/images/citadel-initramfs-image.bb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-citadel/recipes-initrd/images/citadel-initramfs-image.bb b/meta-citadel/recipes-initrd/images/citadel-initramfs-image.bb index ccca9e6..652202b 100644 --- a/meta-citadel/recipes-initrd/images/citadel-initramfs-image.bb +++ b/meta-citadel/recipes-initrd/images/citadel-initramfs-image.bb @@ -123,10 +123,15 @@ remove_blk_availability() { rm ${IMAGE_ROOTFS}${systemd_system_unitdir}/blk-availability.service } +generate_kernel_id() { + sha256sum ${DEPLOY_DIR_IMAGE}/bzImage-intel-corei7-64.bin | cut -d' ' -f1 +} + append_initrd_release() { KERNEL_ID=$(generate_kernel_id) cat >> ${IMAGE_ROOTFS}/etc/initrd-release << EOF CITADEL_KERNEL_VERSION="${CITADEL_KERNEL_VERSION}" CITADEL_KERNEL_ID="${KERNEL_ID}" EOF + echo "${KERNEL_ID}" > ${DEPLOY_DIR_IMAGE}/kernel.id }