blob: 78f7b49b27d6821db53ca419f560706781a552e9 [file] [log] [blame]
Andrew Geissler1fe918a2020-05-15 14:16:47 -05001DESCRIPTION = "Simple initramfs image for mounting the rootfs over the verity device mapper."
2
Andrew Geisslercc589282020-09-18 13:34:40 -05003inherit core-image
Andrew Geissler1fe918a2020-05-15 14:16:47 -05004
5PACKAGE_INSTALL = " \
Andrew Geissler1fe918a2020-05-15 14:16:47 -05006 base-files \
Andrew Geisslercc589282020-09-18 13:34:40 -05007 base-passwd \
Andrew Geissler1fe918a2020-05-15 14:16:47 -05008 busybox \
Andrew Geissler1fe918a2020-05-15 14:16:47 -05009 cryptsetup \
Andrew Geisslercc589282020-09-18 13:34:40 -050010 initramfs-module-dmverity \
11 initramfs-module-udev \
Andrew Geissler1fe918a2020-05-15 14:16:47 -050012 lvm2-udevrules \
Andrew Geisslercc589282020-09-18 13:34:40 -050013 udev \
14 util-linux-mount \
Andrew Geissler1fe918a2020-05-15 14:16:47 -050015"
16
Andrew Geisslercc589282020-09-18 13:34:40 -050017# We want a clean, minimal image.
18IMAGE_FEATURES = ""
19IMAGE_LINGUAS = ""
20
Andrew Geissler1fe918a2020-05-15 14:16:47 -050021# Can we somehow inspect reverse dependencies to avoid these variables?
Patrick Williams2a254922023-08-11 09:48:11 -050022python __anonymous() {
23 verity_image = d.getVar('DM_VERITY_IMAGE')
24 verity_type = d.getVar('DM_VERITY_IMAGE_TYPE')
25
26 if verity_image and verity_type:
27 dep = ' %s:do_image_%s' % (verity_image, verity_type.replace('-', '_'))
28 d.appendVarFlag('do_image', 'depends', dep)
29}
Andrew Geisslercc589282020-09-18 13:34:40 -050030
31# Ensure dm-verity.env is updated also when rebuilding DM_VERITY_IMAGE
32do_image[nostamp] = "1"
Andrew Geissler1fe918a2020-05-15 14:16:47 -050033
34IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
35
Andrew Geissler1fe918a2020-05-15 14:16:47 -050036deploy_verity_hash() {
Andrew Geisslercc589282020-09-18 13:34:40 -050037 install -D -m 0644 \
38 ${STAGING_VERITY_DIR}/${DM_VERITY_IMAGE}.${DM_VERITY_IMAGE_TYPE}.verity.env \
39 ${IMAGE_ROOTFS}${datadir}/misc/dm-verity.env
Andrew Geissler1fe918a2020-05-15 14:16:47 -050040}
Andrew Geisslercc589282020-09-18 13:34:40 -050041IMAGE_PREPROCESS_COMMAND += "deploy_verity_hash;"