base-files: only apply the bbappend if ima distro flag set

When the meta-integrity layer is included but feature ima is not set, we
would get the following error when the system startup:

  qemux86-64 systemd-remount-fs[81]: mount: /sys/kernel/security: mount point does not exist.
  qemux86-64 systemd-remount-fs[81]: /bin/mount for /sys/kernel/security exited with exit status 32.

Rename base-files_%.bbappend to base-files-integrity.inc and add a new
bbappend. Make sure this piece of code should be applied only if the ima
feature is set.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
This commit is contained in:
Yi Zhao
2017-10-13 08:56:06 +08:00
committed by Jia Zhang
parent eed5579529
commit 5209d236d2
2 changed files with 6 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
# Append iversion option for auto types
do_install_append() {
sed -i 's/\s*auto\s*defaults/&,iversion/' "${D}${sysconfdir}/fstab"
echo 'securityfs /sys/kernel/security securityfs defaults 0 0' >> "${D}${sysconfdir}/fstab"
}

View File

@@ -1,5 +1 @@
# Append iversion option for auto types
do_install_append() {
sed -i 's/\s*auto\s*defaults/&,iversion/' "${D}${sysconfdir}/fstab"
echo 'securityfs /sys/kernel/security securityfs defaults 0 0' >> "${D}${sysconfdir}/fstab"
}
require ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'base-files-integrity.inc', '', d)}