summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2019-01-14 12:25:01 +0100
committerGitHub <noreply@github.com>2019-01-14 12:25:01 +0100
commitc6cbeda3876003f9d5a179f96a406432549ae68b (patch)
tree6f8f2cce9bd0127d95b5e3f5de261a2e57b709e5
parentab0ddf01030f972b95af3c4f4d801c8ae56eadb2 (diff)
parent6cc3ab1c90f84feed212ea5cc2b4e6b1af1b2b2e (diff)
downloadmeta-updater-c6cbeda3876003f9d5a179f96a406432549ae68b.tar.gz
Merge pull request #454 from LukaPivk/fix-checksum
classes/image_types_ostree.bbclass: fix checksum calculation
-rw-r--r--classes/image_types_ostree.bbclass25
1 files changed, 13 insertions, 12 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 5cb4d51..138e02e 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -104,26 +104,27 @@ IMAGE_CMD_ostree () {
104 ln -sf var/roothome root 104 ln -sf var/roothome root
105 fi 105 fi
106 106
107 checksum=`sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " "`
108
109 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum}
110
111 if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then 107 if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then
112 # this is a hack for ostree not to override init= in kernel cmdline - 108 # this is a hack for ostree not to override init= in kernel cmdline -
113 # make it think that the initramfs is present (while it is in FIT image) 109 # make it think that the initramfs is present (while it is in FIT image)
110 # since initramfs is fake file, it does not need to be included in checksum
111 checksum=$(sha256sum ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} | cut -f 1 -d " ")
114 touch boot/initramfs-${checksum} 112 touch boot/initramfs-${checksum}
115 else 113 else
116 cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum} 114 if [ "${OSTREE_DEPLOY_DEVICETREE}" = "1" ] && [ -n "${KERNEL_DEVICETREE}" ]; then
117 if [ "${OSTREE_DEPLOY_DEVICETREE}" = "1" ]; then 115 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ")
118 if test -n "${KERNEL_DEVICETREE}"; then 116 for DTS_FILE in ${KERNEL_DEVICETREE}; do
119 for DTS_FILE in ${KERNEL_DEVICETREE}; do 117 DTS_FILE_BASENAME=$(basename ${DTS_FILE})
120 DTS_FILE_BASENAME=$(basename ${DTS_FILE}) 118 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum}
121 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} 119 done
122 done 120 else
123 fi 121 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} | sha256sum | cut -f 1 -d " ")
124 fi 122 fi
123 cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} boot/initramfs-${checksum}
125 fi 124 fi
126 125
126 cp ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} boot/vmlinuz-${checksum}
127
127 # Copy image manifest 128 # Copy image manifest
128 cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest 129 cat ${IMAGE_MANIFEST} | cut -d " " -f1,3 > usr/package.manifest
129} 130}