blob: 58cbe6e9581ee1270cfe6c25535be328f1678f40 [file] [log] [blame]
Brad Bishop15ae2502019-06-18 21:44:24 -04001# This recipe creates a module for the initramfs-framework in OE-core
2# which initializes IMA by loading a policy before transferring
3# control to the init process in the rootfs. The advantage over having
4# that init process doing the policy loading (which systemd could do)
5# is that already the integrity of the init binary itself will be
6# checked by the kernel.
7
8SUMMARY = "IMA module for the modular initramfs system"
9LICENSE = "MIT"
10LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
11
12# This policy file will get installed as /etc/ima/ima-policy.
13# It is located via the normal file search path, so a .bbappend
14# to this recipe can just point towards one of its own files.
Brad Bishop1fdf4aa2019-09-09 14:56:41 -040015IMA_POLICY ?= "ima-policy-hashed"
Brad Bishop15ae2502019-06-18 21:44:24 -040016
Andrew Geisslerf1e44062021-04-15 15:52:46 -050017# Force proceed IMA procedure even 'no_ima' boot parameter is available.
18IMA_FORCE ?= "false"
19
Brad Bishop15ae2502019-06-18 21:44:24 -040020SRC_URI = " file://ima"
21
Brad Bishopa48c0142020-01-06 09:48:41 -050022inherit features_check
23REQUIRED_DISTRO_FEATURES = "ima"
24
Brad Bishop15ae2502019-06-18 21:44:24 -040025do_install () {
26 install -d ${D}/${sysconfdir}/ima
27 install -d ${D}/init.d
28 install ${WORKDIR}/ima ${D}/init.d/20-ima
Andrew Geisslerf1e44062021-04-15 15:52:46 -050029
30 sed -i "s/@@FORCE_IMA@@/${IMA_FORCE}/g" ${D}/init.d/20-ima
Brad Bishop15ae2502019-06-18 21:44:24 -040031}
32
Patrick Williams213cb262021-08-07 19:21:33 -050033FILES:${PN} = "/init.d ${sysconfdir}"
Brad Bishop15ae2502019-06-18 21:44:24 -040034
Patrick Williams213cb262021-08-07 19:21:33 -050035RDEPENDS:${PN} = "keyutils ima-evm-keys ${IMA_POLICY}"
36RDEPENDS:${PN} += "initramfs-framework-base"