mirror of
https://github.com/jiazhang0/meta-secure-core.git
synced 2026-04-20 18:08:17 +00:00
util-linux: only apply the bbappend if ima distro flag set
Run yocto-check-layer-wrapper to check layer compliance of Yocto will report the signatures error: util-linux:do_compile: 9c04caa1d37ca0fa0caa2f48a01912d1b3d35de2ac668c4cddd6158bbac9c374 -> 53de68708253461d617177c02a60d0e798f5f7727c14cc8e6b9a8bbedc53de99 bitbake-diffsigs --task util-linux do_compile --signature 9c04caa1d37ca0fa0caa2f48a01912d1b3d35de2ac668c4cddd6158bbac9c374 53de68708253461d617177c02a60d0e798f5f7727c14cc8e6b9a8bbedc53de99 Rename util-linux_%.bbappend to util-linux-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:
@@ -0,0 +1,19 @@
|
||||
CFLAGS_remove += "-pie -fpie"
|
||||
|
||||
# We need -no-pie in case the default is to generate pie code.
|
||||
#
|
||||
do_compile_append_class-target() {
|
||||
${CC} ${CFLAGS} ${LDFLAGS} -no-pie -static \
|
||||
sys-utils/switch_root.o \
|
||||
-o switch_root.static
|
||||
}
|
||||
|
||||
do_install_append_class-target() {
|
||||
install -d "${D}${sbindir}"
|
||||
install -m 0700 "${B}/switch_root.static" \
|
||||
"${D}${sbindir}/switch_root.static"
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-switch-root.static"
|
||||
|
||||
FILES_${PN}-switch-root.static = "${sbindir}/switch_root.static"
|
||||
@@ -1,19 +1 @@
|
||||
CFLAGS_remove += "-pie -fpie"
|
||||
|
||||
# We need -no-pie in case the default is to generate pie code.
|
||||
#
|
||||
do_compile_append_class-target() {
|
||||
${CC} ${CFLAGS} ${LDFLAGS} -no-pie -static \
|
||||
sys-utils/switch_root.o \
|
||||
-o switch_root.static
|
||||
}
|
||||
|
||||
do_install_append_class-target() {
|
||||
install -d "${D}${sbindir}"
|
||||
install -m 0700 "${B}/switch_root.static" \
|
||||
"${D}${sbindir}/switch_root.static"
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-switch-root.static"
|
||||
|
||||
FILES_${PN}-switch-root.static = "${sbindir}/switch_root.static"
|
||||
require ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'util-linux-integrity.inc', '', d)}
|
||||
|
||||
Reference in New Issue
Block a user