Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 1 | DESCRIPTION = "Simple initramfs image for mounting the rootfs over the verity device mapper." |
| 2 | |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 3 | inherit core-image |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 4 | |
| 5 | PACKAGE_INSTALL = " \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 6 | base-files \ |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 7 | base-passwd \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 8 | busybox \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 9 | cryptsetup \ |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 10 | initramfs-module-dmverity \ |
| 11 | initramfs-module-udev \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 12 | lvm2-udevrules \ |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 13 | udev \ |
| 14 | util-linux-mount \ |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 15 | " |
| 16 | |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 17 | # We want a clean, minimal image. |
| 18 | IMAGE_FEATURES = "" |
| 19 | IMAGE_LINGUAS = "" |
| 20 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 21 | # Can we somehow inspect reverse dependencies to avoid these variables? |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 22 | python __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 Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 30 | |
| 31 | # Ensure dm-verity.env is updated also when rebuilding DM_VERITY_IMAGE |
| 32 | do_image[nostamp] = "1" |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 33 | |
| 34 | IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" |
| 35 | |
Andrew Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 36 | deploy_verity_hash() { |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 37 | 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 Geissler | 1fe918a | 2020-05-15 14:16:47 -0500 | [diff] [blame] | 40 | } |
Andrew Geissler | cc58928 | 2020-09-18 13:34:40 -0500 | [diff] [blame] | 41 | IMAGE_PREPROCESS_COMMAND += "deploy_verity_hash;" |