2018-12-31 23:37:43 +00:00
|
|
|
|
2019-01-17 16:47:49 +00:00
|
|
|
DEPENDS_append = " citadel-tools-native mtools-native cryptsetup-native coreutils-native"
|
2018-12-31 23:37:43 +00:00
|
|
|
|
|
|
|
# Block size must be 4096 or dm-verity won't work
|
|
|
|
EXTRA_IMAGECMD_ext2 = "-i 4096 -b 4096"
|
|
|
|
IMAGE_FSTYPES = "ext2"
|
2019-01-15 17:05:28 +00:00
|
|
|
IMAGE_OVERHEAD_FACTOR = "1.1"
|
2018-12-31 23:37:43 +00:00
|
|
|
|
|
|
|
inherit image
|
|
|
|
|
|
|
|
CITADEL_IMAGE_CHANNEL ??= "dev"
|
2019-01-15 17:05:28 +00:00
|
|
|
CITADEL_IMAGE_COMPRESS ??= "true"
|
2019-01-06 23:20:41 +00:00
|
|
|
|
2018-12-31 23:37:43 +00:00
|
|
|
do_citadel_mkimage() {
|
|
|
|
cat > ${B}/mkimage.conf << EOF
|
|
|
|
image-type = "${CITADEL_IMAGE_TYPE}"
|
|
|
|
channel = "${CITADEL_IMAGE_CHANNEL}"
|
|
|
|
version = ${CITADEL_IMAGE_VERSION}
|
2019-01-07 23:57:38 +00:00
|
|
|
timestamp = "${DATETIME}"
|
2019-01-06 03:32:59 +00:00
|
|
|
source = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.ext2"
|
2019-01-15 17:05:28 +00:00
|
|
|
compress = ${CITADEL_IMAGE_COMPRESS}
|
2018-12-31 23:37:43 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
ver=$(printf "%03d" ${CITADEL_IMAGE_VERSION})
|
|
|
|
|
2019-01-06 23:20:41 +00:00
|
|
|
if [ "${CITADEL_IMAGE_TYPE}" = "kernel" ]; then
|
2019-01-15 17:05:28 +00:00
|
|
|
KERNEL_ID=$(cat ${DEPLOY_DIR_IMAGE}/kernel.id)
|
2018-12-31 23:37:43 +00:00
|
|
|
echo "kernel-version = \"${CITADEL_KERNEL_VERSION}\"" >> ${B}/mkimage.conf
|
2019-01-06 23:20:41 +00:00
|
|
|
echo "kernel-id = \"${KERNEL_ID}\"" >> ${B}/mkimage.conf
|
|
|
|
fname="citadel-kernel-${CITADEL_KERNEL_VERSION}-${CITADEL_IMAGE_CHANNEL}-${ver}.img"
|
2018-12-31 23:37:43 +00:00
|
|
|
else
|
|
|
|
fname="citadel-${CITADEL_IMAGE_TYPE}-${CITADEL_IMAGE_CHANNEL}-${ver}.img"
|
|
|
|
fi
|
|
|
|
citadel-image build ${B}
|
|
|
|
mv ${B}/${fname} ${IMGDEPLOYDIR}
|
|
|
|
}
|
|
|
|
|
|
|
|
addtask do_citadel_mkimage after do_image_ext2 before do_image_complete
|
2019-01-06 23:20:41 +00:00
|
|
|
do_citadel_mkimage[cleandirs] = "${B}"
|
2019-01-07 23:57:38 +00:00
|
|
|
do_citadel_mkimage[vardepsexclude] = "DATETIME"
|
2019-01-06 23:20:41 +00:00
|
|
|
|
2019-01-17 02:32:42 +00:00
|
|
|
IMAGE_POSTPROCESS_COMMAND += " generate_shasum_buildhistory ;"
|
|
|
|
|
|
|
|
generate_shasum_buildhistory() {
|
|
|
|
mkdir -p ${BUILDHISTORY_DIR_IMAGE}
|
|
|
|
( cd ${IMAGE_ROOTFS} && find . -type f -exec sha1sum '{}' \; | sort -k2 > ${BUILDHISTORY_DIR_IMAGE}/image-shasums.txt )
|
|
|
|
}
|