diff mbox series

[meta-ti,master,v5,1/3] dm-verity-upstream: Add dynamic layer for meta-security dm-verity

Message ID 20261005121218.844998-1-a-dubey@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master,v5,1/3] dm-verity-upstream: Add dynamic layer for meta-security dm-verity | expand

Commit Message

Atharv Dubey Oct. 5, 2026, 12:12 p.m. UTC
Add an optional dynamic layer enabling dm-verity block-level integrity
verification of the root filesystem for TI K3 platforms, using
meta-security's stock dm-verity mechanism as-is. Requires meta-security
to be present in bblayers.conf.

dm-verity hashes the rootfs at build time; at boot, a dedicated
initramfs loads the root hash and the kernel checks every block read
against it. Set DM_VERITY_IMAGE to enable all the verity-related
recipes for that image; other images build as usual.

Signed-off-by: Atharv Dubey <a-dubey@ti.com>

---
v5:
 - unify the python functions
v4:
 - Use ti-core-initramfs instead of a separate dm-verity initramfs
 - Instead of a DISTRO_FEATURE, just check if DM_VERITY_IMAGE is set
v3:
 - Disabled the automount rules from udev-aragoconf, so don't need the
   ignorelist for dm-verity
v2:
 - Replaced hardcoded /dev/mmcblk1p2 with a PARTUUID
---
 meta-ti-bsp/conf/layer.conf                   |  3 +++
 meta-ti-bsp/conf/machine/include/k3.inc       |  7 +++++++
 .../conf/include/dm-verity-upstream.inc       | 21 +++++++++++++++++++
 .../udev/udev-aragoconf_%.bbappend            |  5 +++++
 .../udev/udev-extraconf_%.bbappend            |  6 ++++++
 meta-ti-bsp/files/wic/k3-verity.wks.in        |  5 +++++
 6 files changed, 47 insertions(+)
 create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc
 create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend
 create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend
 create mode 100644 meta-ti-bsp/files/wic/k3-verity.wks.in

Comments

PRC Automation Oct. 5, 2026, 12:15 p.m. UTC | #1
meta-ti / na / 20261005121218.844998-1-a-dubey

PRC Results: FAIL

=========================================================
  check-yocto-patches: PASS
=========================================================
Patches
----------------------------------------
WARN - [meta-ti][master][PATCH v5 2/3] linux-ti-staging: Add dm-verity kernel config
    WARN: Revised patch missing a comment. (REVISION-1)
        patch
    
    For details on the above errors/warnings visit: https://lists.yoctoproject.org/g/meta-ti/wiki/40887
WARN - [meta-ti][master][PATCH v5 3/3] ti-core-initramfs: Extend with dm-verity support
    WARN: Revised patch missing a comment. (REVISION-1)
        patch
    
    For details on the above errors/warnings visit: https://lists.yoctoproject.org/g/meta-ti/wiki/40887



=========================================================
  apply-yocto-patch: FAIL
=========================================================
master
=====================
Summary:
- Patch Series: [meta-ti][master][PATCH v5 1/3] dm-verity-upstream: Add dynamic layer for meta-security dm-verity
- Submitter: From: Atharv Dubey <a-dubey@ti.com>
- Date: Date: Mon, 5 Oct 2026 17:42:16 +0530
- Num Patches: 3
- Mailing List (public inbox) Commit SHA: 6bfeb0fa5fcac6b3358c309aea755c4242d896df

Applied to:
- Repository: lcpd-prc-meta-ti
- Base Branch: master
- Commit Author: LCPD Automation Script <lcpdbld@list.ti.com>
- Commit Subject: CI/CD Auto-Merger: cicd.master.202609251030
- Commit SHA: 9a970370942d7ff753a64b31bc367e1e27aa3048

Patches
----------------------------------------
FAIL - [meta-ti][master][PATCH v5 1/3] dm-verity-upstream: Add dynamic layer for meta-security dm-verity
    error: patch failed: meta-ti-bsp/conf/layer.conf:20
    error: meta-ti-bsp/conf/layer.conf: patch does not apply
    Applying: dm-verity-upstream: Add dynamic layer for meta-security dm-verity
    Patch failed at 0001 dm-verity-upstream: Add dynamic layer for meta-security dm-verity
Denys Dmytriyenko Oct. 7, 2026, 8:11 p.m. UTC | #2
Looks good to me, thank you for addressing the feedback comments.


On Mon, Oct 05, 2026 at 05:42:16PM +0530, Atharv Dubey via lists.yoctoproject.org wrote:
> Add an optional dynamic layer enabling dm-verity block-level integrity
> verification of the root filesystem for TI K3 platforms, using
> meta-security's stock dm-verity mechanism as-is. Requires meta-security
> to be present in bblayers.conf.
> 
> dm-verity hashes the rootfs at build time; at boot, a dedicated
> initramfs loads the root hash and the kernel checks every block read
> against it. Set DM_VERITY_IMAGE to enable all the verity-related
> recipes for that image; other images build as usual.
> 
> Signed-off-by: Atharv Dubey <a-dubey@ti.com>
> 
> ---
> v5:
>  - unify the python functions
> v4:
>  - Use ti-core-initramfs instead of a separate dm-verity initramfs
>  - Instead of a DISTRO_FEATURE, just check if DM_VERITY_IMAGE is set
> v3:
>  - Disabled the automount rules from udev-aragoconf, so don't need the
>    ignorelist for dm-verity
> v2:
>  - Replaced hardcoded /dev/mmcblk1p2 with a PARTUUID
> ---
>  meta-ti-bsp/conf/layer.conf                   |  3 +++
>  meta-ti-bsp/conf/machine/include/k3.inc       |  7 +++++++
>  .../conf/include/dm-verity-upstream.inc       | 21 +++++++++++++++++++
>  .../udev/udev-aragoconf_%.bbappend            |  5 +++++
>  .../udev/udev-extraconf_%.bbappend            |  6 ++++++
>  meta-ti-bsp/files/wic/k3-verity.wks.in        |  5 +++++
>  6 files changed, 47 insertions(+)
>  create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc
>  create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend
>  create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend
>  create mode 100644 meta-ti-bsp/files/wic/k3-verity.wks.in
> 
> diff --git a/meta-ti-bsp/conf/layer.conf b/meta-ti-bsp/conf/layer.conf
> index 3cc54aa4..aca35cd3 100644
> --- a/meta-ti-bsp/conf/layer.conf
> +++ b/meta-ti-bsp/conf/layer.conf
> @@ -20,12 +20,15 @@ LAYERDEPENDS_meta-ti-bsp = " \
>  LAYERRECOMMENDS_meta-ti-bsp = " \
>      openembedded-layer \
>      tpm-layer \
> +    security \
>  "
>  
>  BBFILES_DYNAMIC += " \
>      openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes*/*/*.bbappend \
>      tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes*/*/*.bb \
>      tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes*/*/*.bbappend \
> +    security:${LAYERDIR}/dynamic-layers/security-layer/recipes*/*/*.bb \
> +    security:${LAYERDIR}/dynamic-layers/security-layer/recipes*/*/*.bbappend \
>  "
>  
>  SIGGEN_EXCLUDERECIPES_ABISAFE += " \
> diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc
> index 2ebbfb9e..f19db45f 100644
> --- a/meta-ti-bsp/conf/machine/include/k3.inc
> +++ b/meta-ti-bsp/conf/machine/include/k3.inc
> @@ -64,3 +64,10 @@ FALCON_INCLUDE = ""
>  FALCON_INCLUDE:ti-falcon = "conf/machine/include/ti-falcon.inc"
>  
>  require ${FALCON_INCLUDE}
> +
> +# dm-verity protects the rootfs listed in DM_VERITY_IMAGE; see dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc for what that turns on.
> +DM_VERITY_IMAGE ??= ""
> +
> +DM_VERITY_UPSTREAM_INCLUDE = "${@'dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc' if d.getVar('DM_VERITY_IMAGE') else ''}"
> +
> +require ${DM_VERITY_UPSTREAM_INCLUDE}
> diff --git a/meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc b/meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc
> new file mode 100644
> index 00000000..e9353fcc
> --- /dev/null
> +++ b/meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc
> @@ -0,0 +1,21 @@
> +# Enables dm-verity to check the rootfs for tampering on TI K3 boards.
> +DM_VERITY_IMAGE_TYPE = "ext4"
> +IMAGE_CLASSES += "dm-verity-img"
> +
> +# ti-core-initramfs.bbappend already wires the initramfs into the boot partition once dm-verity is enabled, so we don't need to do it here.
> +
> +python () {
> +    import uuid
> +
> +    if d.getVar('PN') != d.getVar('DM_VERITY_IMAGE'):
> +        return
> +
> +    # Derive the root partition's UUID from MACHINE so everyone computes the same one.
> +    if not d.getVar('DM_VERITY_ROOT_PARTUUID'):
> +        d.setVar('DM_VERITY_ROOT_PARTUUID',
> +                 str(uuid.uuid5(uuid.NAMESPACE_DNS, 'dm-verity-root-%s' % d.getVar('MACHINE'))))
> +
> +    d.setVar('WKS_FILE', 'k3-verity.wks.in')
> +    d.appendVar('EXTRA_IMAGE_FEATURES', ' read-only-rootfs')
> +    d.appendVar('WICVARS', ' DM_VERITY_IMAGE DM_VERITY_IMAGE_TYPE IMAGE_NAME_SUFFIX IMGDEPLOYDIR DM_VERITY_ROOT_PARTUUID')
> +}
> diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend
> new file mode 100644
> index 00000000..e5f6c1b2
> --- /dev/null
> +++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend
> @@ -0,0 +1,5 @@
> +do_install:append() {
> +    if ${@'true' if d.getVar('DM_VERITY_IMAGE') else 'false'}; then
> +        : > ${D}${libdir}/udev/rules.d/50-arago.rules
> +    fi
> +}
> diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend
> new file mode 100644
> index 00000000..a14e21ea
> --- /dev/null
> +++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend
> @@ -0,0 +1,6 @@
> +# Nothing should ever get auto-mounted under dm-verity, so just kill the automounter.
> +do_install:append() {
> +    if ${@'true' if d.getVar('DM_VERITY_IMAGE') else 'false'}; then
> +        : > ${D}${sysconfdir}/udev/rules.d/automount.rules
> +    fi
> +}
> diff --git a/meta-ti-bsp/files/wic/k3-verity.wks.in b/meta-ti-bsp/files/wic/k3-verity.wks.in
> new file mode 100644
> index 00000000..62ae0ec1
> --- /dev/null
> +++ b/meta-ti-bsp/files/wic/k3-verity.wks.in
> @@ -0,0 +1,5 @@
> +# Disk layout for a board that boots with dm-verity enabled.
> +
> +bootloader --timeout=3 --append="rootfstype=ext4 root=PARTUUID=${DM_VERITY_ROOT_PARTUUID} ${TI_WKS_BOOTLOADER_APPEND}"
> +part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}${TI_WKS_INITRAMFS}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M
> +part / --source rawcopy --sourceparams="file=${IMGDEPLOYDIR}/${DM_VERITY_IMAGE}-${MACHINE}${IMAGE_NAME_SUFFIX}.${DM_VERITY_IMAGE_TYPE}.verity" --align 1024 --uuid ${DM_VERITY_ROOT_PARTUUID}
> -- 
> 2.34.1
>
Atharv Dubey Oct. 21, 2026, 11:12 a.m. UTC | #3
Hello Ryan & Denys,

I actually forgot to label this patch series for both master & wrynose, 
Should i send

another patch with the wrynose respin tag ?

Regards,
Atharv

On 05/10/26 17:42, Atharv Dubey via lists.yoctoproject.org wrote:
> Add a kernel config fragment enabling dm-verity and its crypto 
> dependencies (CONFIG_DM_VERITY, CONFIG_DM_CRYPT, CONFIG_BLK_DEV_DM). 
> Applied via KERNEL_CONFIG_FRAGMENTS, which setup-defconfig. inc reads 
> and merges directly through merge_config. sh. 
> ZjQcmQRYFpfptBannerStart
> This message was sent from outside of Texas Instruments.
> Do not click links or open attachments unless you recognize the source 
> of this email and know the content is safe.
> Report Suspicious
> <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!updqPBkBOE07CiZkfDODnCz6u-4MvaREVsGIjhhknYZvmYsDHbx0NH2GOz2a703St6SM9xKdTJno3ZkWIzMynIop8_VDlYE$> 
>
> ZjQcmQRYFpfptBannerEnd
> Add a kernel config fragment enabling dm-verity and its crypto
> dependencies (CONFIG_DM_VERITY, CONFIG_DM_CRYPT, CONFIG_BLK_DEV_DM).
> Applied via KERNEL_CONFIG_FRAGMENTS, which setup-defconfig.inc reads
> and merges directly through merge_config.sh.
>
> Gated on DM_VERITY_IMAGE being set, matching the rest of the dm-verity
> dynamic layer.
>
> Signed-off-by: Atharv Dubey<a-dubey@ti.com>
> ---
>   .../security-layer/recipes-kernel/linux/files/dm-verity.cfg  | 5 +++++
>   .../recipes-kernel/linux/linux-ti-staging_%.bbappend         | 5 +++++
>   2 files changed, 10 insertions(+)
>   create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg
>   create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend
>
> diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg
> new file mode 100644
> index 00000000..c50ce403
> --- /dev/null
> +++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg
> @@ -0,0 +1,5 @@
> +CONFIG_MD=y
> +CONFIG_BLK_DEV_DM=y
> +CONFIG_DM_CRYPT=y
> +CONFIG_DM_VERITY=y
> +CONFIG_CRYPTO_SHA256=y
> diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend
> new file mode 100644
> index 00000000..9a380cf6
> --- /dev/null
> +++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend
> @@ -0,0 +1,5 @@
> +# Enable the dm-verity kernel config fragment via KERNEL_CONFIG_FRAGMENTS.
> +FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
> +
> +SRC_URI +="${@'file://dm-verity.cfg' if d.getVar('DM_VERITY_IMAGE') else ''}"
> +KERNEL_CONFIG_FRAGMENTS +="${@'${UNPACKDIR}/dm-verity.cfg' if d.getVar('DM_VERITY_IMAGE') else ''}"
> -- 
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#20433):https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-ti/message/20433__;!!G3vK!TUzKwpPbPsnuozBIxf9XIbdo_pRqSEA1VS7CG6AbY8HsovuLTFbzgGB9dHI9dZojHMn26Ns6AsKV3tiu5vymX2htRJAjDvJp$ 
> Mute This Topic:https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/121589866/10595936__;!!G3vK!TUzKwpPbPsnuozBIxf9XIbdo_pRqSEA1VS7CG6AbY8HsovuLTFbzgGB9dHI9dZojHMn26Ns6AsKV3tiu5vymX2htRFkKduO3$ 
> Group Owner:meta-ti+owner@lists.yoctoproject.org
> Unsubscribe:https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-ti/unsub__;!!G3vK!TUzKwpPbPsnuozBIxf9XIbdo_pRqSEA1VS7CG6AbY8HsovuLTFbzgGB9dHI9dZojHMn26Ns6AsKV3tiu5vymX2htRIMmVjE0$  [a-dubey@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ryan Eatmon Oct. 21, 2026, 3:37 p.m. UTC | #4
On 10/21/2026 6:12 AM, Atharv Dubey via lists.yoctoproject.org wrote:
> Hello Ryan & Denys,
> 
> I actually forgot to label this patch series for both master & wrynose, 
> Should i send
> 
> another patch with the wrynose respin tag ?

No, I can apply them there.


> Regards,
> Atharv
> 
> On 05/10/26 17:42, Atharv Dubey via lists.yoctoproject.org wrote:
>> Add a kernel config fragment enabling dm-verity and its crypto 
>> dependencies (CONFIG_DM_VERITY, CONFIG_DM_CRYPT, CONFIG_BLK_DEV_DM). 
>> Applied via KERNEL_CONFIG_FRAGMENTS, which setup-defconfig. inc reads 
>> and merges directly through merge_config. sh. 
>> ZjQcmQRYFpfptBannerStart
>> This message was sent from outside of Texas Instruments.
>> Do not click links or open attachments unless you recognize the source 
>> of this email and know the content is safe.
>> Report Suspicious
>> <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!updqPBkBOE07CiZkfDODnCz6u-4MvaREVsGIjhhknYZvmYsDHbx0NH2GOz2a703St6SM9xKdTJno3ZkWIzMynIop8_VDlYE$>
>> ZjQcmQRYFpfptBannerEnd
>> Add a kernel config fragment enabling dm-verity and its crypto
>> dependencies (CONFIG_DM_VERITY, CONFIG_DM_CRYPT, CONFIG_BLK_DEV_DM).
>> Applied via KERNEL_CONFIG_FRAGMENTS, which setup-defconfig.inc reads
>> and merges directly through merge_config.sh.
>>
>> Gated on DM_VERITY_IMAGE being set, matching the rest of the dm-verity
>> dynamic layer.
>>
>> Signed-off-by: Atharv Dubey<a-dubey@ti.com>
>> ---
>>   .../security-layer/recipes-kernel/linux/files/dm-verity.cfg  | 5 +++++
>>   .../recipes-kernel/linux/linux-ti-staging_%.bbappend         | 5 +++++
>>   2 files changed, 10 insertions(+)
>>   create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg
>>   create mode 100644 meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend
>>
>> diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg
>> new file mode 100644
>> index 00000000..c50ce403
>> --- /dev/null
>> +++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/files/dm-verity.cfg
>> @@ -0,0 +1,5 @@
>> +CONFIG_MD=y
>> +CONFIG_BLK_DEV_DM=y
>> +CONFIG_DM_CRYPT=y
>> +CONFIG_DM_VERITY=y
>> +CONFIG_CRYPTO_SHA256=y
>> diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend
>> new file mode 100644
>> index 00000000..9a380cf6
>> --- /dev/null
>> +++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-kernel/linux/linux-ti-staging_%.bbappend
>> @@ -0,0 +1,5 @@
>> +# Enable the dm-verity kernel config fragment via KERNEL_CONFIG_FRAGMENTS.
>> +FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
>> +
>> +SRC_URI +="${@'file://dm-verity.cfg' if d.getVar('DM_VERITY_IMAGE') else ''}"
>> +KERNEL_CONFIG_FRAGMENTS +="${@'${UNPACKDIR}/dm-verity.cfg' if d.getVar('DM_VERITY_IMAGE') else ''}"
>> -- 
>> 2.34.1
>>
>>
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#20468): https://lists.yoctoproject.org/g/meta-ti/message/20468
> Mute This Topic: https://lists.yoctoproject.org/mt/121864789/6551054
> Group Owner: meta-ti+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [reatmon@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-ti-bsp/conf/layer.conf b/meta-ti-bsp/conf/layer.conf
index 3cc54aa4..aca35cd3 100644
--- a/meta-ti-bsp/conf/layer.conf
+++ b/meta-ti-bsp/conf/layer.conf
@@ -20,12 +20,15 @@  LAYERDEPENDS_meta-ti-bsp = " \
 LAYERRECOMMENDS_meta-ti-bsp = " \
     openembedded-layer \
     tpm-layer \
+    security \
 "
 
 BBFILES_DYNAMIC += " \
     openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/recipes*/*/*.bbappend \
     tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes*/*/*.bb \
     tpm-layer:${LAYERDIR}/dynamic-layers/tpm-layer/recipes*/*/*.bbappend \
+    security:${LAYERDIR}/dynamic-layers/security-layer/recipes*/*/*.bb \
+    security:${LAYERDIR}/dynamic-layers/security-layer/recipes*/*/*.bbappend \
 "
 
 SIGGEN_EXCLUDERECIPES_ABISAFE += " \
diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc
index 2ebbfb9e..f19db45f 100644
--- a/meta-ti-bsp/conf/machine/include/k3.inc
+++ b/meta-ti-bsp/conf/machine/include/k3.inc
@@ -64,3 +64,10 @@  FALCON_INCLUDE = ""
 FALCON_INCLUDE:ti-falcon = "conf/machine/include/ti-falcon.inc"
 
 require ${FALCON_INCLUDE}
+
+# dm-verity protects the rootfs listed in DM_VERITY_IMAGE; see dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc for what that turns on.
+DM_VERITY_IMAGE ??= ""
+
+DM_VERITY_UPSTREAM_INCLUDE = "${@'dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc' if d.getVar('DM_VERITY_IMAGE') else ''}"
+
+require ${DM_VERITY_UPSTREAM_INCLUDE}
diff --git a/meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc b/meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc
new file mode 100644
index 00000000..e9353fcc
--- /dev/null
+++ b/meta-ti-bsp/dynamic-layers/security-layer/conf/include/dm-verity-upstream.inc
@@ -0,0 +1,21 @@ 
+# Enables dm-verity to check the rootfs for tampering on TI K3 boards.
+DM_VERITY_IMAGE_TYPE = "ext4"
+IMAGE_CLASSES += "dm-verity-img"
+
+# ti-core-initramfs.bbappend already wires the initramfs into the boot partition once dm-verity is enabled, so we don't need to do it here.
+
+python () {
+    import uuid
+
+    if d.getVar('PN') != d.getVar('DM_VERITY_IMAGE'):
+        return
+
+    # Derive the root partition's UUID from MACHINE so everyone computes the same one.
+    if not d.getVar('DM_VERITY_ROOT_PARTUUID'):
+        d.setVar('DM_VERITY_ROOT_PARTUUID',
+                 str(uuid.uuid5(uuid.NAMESPACE_DNS, 'dm-verity-root-%s' % d.getVar('MACHINE'))))
+
+    d.setVar('WKS_FILE', 'k3-verity.wks.in')
+    d.appendVar('EXTRA_IMAGE_FEATURES', ' read-only-rootfs')
+    d.appendVar('WICVARS', ' DM_VERITY_IMAGE DM_VERITY_IMAGE_TYPE IMAGE_NAME_SUFFIX IMGDEPLOYDIR DM_VERITY_ROOT_PARTUUID')
+}
diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend
new file mode 100644
index 00000000..e5f6c1b2
--- /dev/null
+++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-aragoconf_%.bbappend
@@ -0,0 +1,5 @@ 
+do_install:append() {
+    if ${@'true' if d.getVar('DM_VERITY_IMAGE') else 'false'}; then
+        : > ${D}${libdir}/udev/rules.d/50-arago.rules
+    fi
+}
diff --git a/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend
new file mode 100644
index 00000000..a14e21ea
--- /dev/null
+++ b/meta-ti-bsp/dynamic-layers/security-layer/recipes-core/udev/udev-extraconf_%.bbappend
@@ -0,0 +1,6 @@ 
+# Nothing should ever get auto-mounted under dm-verity, so just kill the automounter.
+do_install:append() {
+    if ${@'true' if d.getVar('DM_VERITY_IMAGE') else 'false'}; then
+        : > ${D}${sysconfdir}/udev/rules.d/automount.rules
+    fi
+}
diff --git a/meta-ti-bsp/files/wic/k3-verity.wks.in b/meta-ti-bsp/files/wic/k3-verity.wks.in
new file mode 100644
index 00000000..62ae0ec1
--- /dev/null
+++ b/meta-ti-bsp/files/wic/k3-verity.wks.in
@@ -0,0 +1,5 @@ 
+# Disk layout for a board that boots with dm-verity enabled.
+
+bootloader --timeout=3 --append="rootfstype=ext4 root=PARTUUID=${DM_VERITY_ROOT_PARTUUID} ${TI_WKS_BOOTLOADER_APPEND}"
+part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}${TI_WKS_INITRAMFS}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M
+part / --source rawcopy --sourceparams="file=${IMGDEPLOYDIR}/${DM_VERITY_IMAGE}-${MACHINE}${IMAGE_NAME_SUFFIX}.${DM_VERITY_IMAGE_TYPE}.verity" --align 1024 --uuid ${DM_VERITY_ROOT_PARTUUID}