generate kernel id when initramfs is built

This commit is contained in:
Bruce Leidl 2019-01-15 12:32:32 -05:00
parent 564049319c
commit 468b36fceb

View File

@ -123,10 +123,15 @@ remove_blk_availability() {
rm ${IMAGE_ROOTFS}${systemd_system_unitdir}/blk-availability.service 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() { append_initrd_release() {
KERNEL_ID=$(generate_kernel_id) KERNEL_ID=$(generate_kernel_id)
cat >> ${IMAGE_ROOTFS}/etc/initrd-release << EOF cat >> ${IMAGE_ROOTFS}/etc/initrd-release << EOF
CITADEL_KERNEL_VERSION="${CITADEL_KERNEL_VERSION}" CITADEL_KERNEL_VERSION="${CITADEL_KERNEL_VERSION}"
CITADEL_KERNEL_ID="${KERNEL_ID}" CITADEL_KERNEL_ID="${KERNEL_ID}"
EOF EOF
echo "${KERNEL_ID}" > ${DEPLOY_DIR_IMAGE}/kernel.id
} }