2018-12-31 18:37:43 -05:00
|
|
|
|
2022-05-28 11:20:07 -04:00
|
|
|
DEPENDS:append = " citadel-tools-native mtools-native cryptsetup-native coreutils-native"
|
2018-12-31 18:37:43 -05:00
|
|
|
|
|
|
|
# Block size must be 4096 or dm-verity won't work
|
2022-05-28 11:20:07 -04:00
|
|
|
EXTRA_IMAGECMD:ext4 = "-i 4096 -b 4096"
|
2019-04-02 15:51:11 -04:00
|
|
|
IMAGE_FSTYPES = "ext4"
|
|
|
|
IMAGE_OVERHEAD_FACTOR = "1.2"
|
2018-12-31 18:37:43 -05:00
|
|
|
|
|
|
|
inherit image
|
|
|
|
|
|
|
|
CITADEL_IMAGE_CHANNEL ??= "dev"
|
2019-01-15 12:05:28 -05:00
|
|
|
CITADEL_IMAGE_COMPRESS ??= "true"
|
2019-01-06 18:20:41 -05:00
|
|
|
|
2018-12-31 18:37:43 -05: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 18:57:38 -05:00
|
|
|
timestamp = "${DATETIME}"
|
2019-04-02 15:51:11 -04:00
|
|
|
source = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.ext4"
|
2019-01-15 12:05:28 -05:00
|
|
|
compress = ${CITADEL_IMAGE_COMPRESS}
|
2018-12-31 18:37:43 -05:00
|
|
|
EOF
|
|
|
|
|
|
|
|
ver=$(printf "%03d" ${CITADEL_IMAGE_VERSION})
|
|
|
|
|
2019-01-06 18:20:41 -05:00
|
|
|
if [ "${CITADEL_IMAGE_TYPE}" = "kernel" ]; then
|
2020-11-30 10:10:56 -05:00
|
|
|
KERNEL_ID=$(generate_kernel_id)
|
2018-12-31 18:37:43 -05:00
|
|
|
echo "kernel-version = \"${CITADEL_KERNEL_VERSION}\"" >> ${B}/mkimage.conf
|
2019-01-06 18:20:41 -05:00
|
|
|
echo "kernel-id = \"${KERNEL_ID}\"" >> ${B}/mkimage.conf
|
|
|
|
fname="citadel-kernel-${CITADEL_KERNEL_VERSION}-${CITADEL_IMAGE_CHANNEL}-${ver}.img"
|
2018-12-31 18:37:43 -05:00
|
|
|
else
|
|
|
|
fname="citadel-${CITADEL_IMAGE_TYPE}-${CITADEL_IMAGE_CHANNEL}-${ver}.img"
|
|
|
|
fi
|
2019-04-02 15:51:11 -04:00
|
|
|
citadel-mkimage ${B}
|
2018-12-31 18:37:43 -05:00
|
|
|
mv ${B}/${fname} ${IMGDEPLOYDIR}
|
|
|
|
}
|
|
|
|
|
2019-04-02 15:51:11 -04:00
|
|
|
addtask do_citadel_mkimage after do_image_ext4 before do_image_complete
|
2019-01-06 18:20:41 -05:00
|
|
|
do_citadel_mkimage[cleandirs] = "${B}"
|
2019-01-07 18:57:38 -05:00
|
|
|
do_citadel_mkimage[vardepsexclude] = "DATETIME"
|
2019-01-06 18:20:41 -05:00
|
|
|
|
2019-01-16 21:32:42 -05:00
|
|
|
IMAGE_POSTPROCESS_COMMAND += " generate_shasum_buildhistory ;"
|
|
|
|
|
2022-05-28 11:20:07 -04:00
|
|
|
BUILDHISTORY_CURRENT_IMAGE_DIR = "${TOPDIR}/buildhistory/images/${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}"
|
|
|
|
|
2019-01-16 21:32:42 -05:00
|
|
|
generate_shasum_buildhistory() {
|
2022-05-28 11:20:07 -04:00
|
|
|
mkdir -p ${BUILDHISTORY_CURRENT_IMAGE_DIR}
|
|
|
|
( cd ${IMAGE_ROOTFS} && find . -type f -exec sha1sum '{}' \; | sort -k2 > ${BUILDHISTORY_CURRENT_IMAGE_DIR}/image-shasums.txt )
|
2019-01-16 21:32:42 -05:00
|
|
|
}
|