Файлы, относящиеся к демону аудита, отсутствуют в rootfs - PullRequest
0 голосов
/ 10 мая 2019

Я пытаюсь установить демон аудита на платформе Renases RZ / G1E

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "iwg22m"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.1"
TUNE_FEATURES     = "armv7a vfp neon callconvention-hard cortexa7"
TARGET_FPU        = "vfp-neon"
meta              
meta-yocto        
meta-yocto-bsp    = "tmp:c4f1f0f491f988901bfd6965f7d10f60cb94a76f"
meta-renesas      
meta-rzg1         = "tmp:19bf1ed97d04009722bb88a780268822ee60ff83"
meta-oe           
meta-multimedia   = "tmp:dca466c074c9a35bc0133e7e0d65cca0731e2acf"
meta-linaro-toolchain = "tmp:8a0601723c06fdb75e62aa0f0cf15fc9d7d90167"

когда я даю команду

$bitbake audit

Установлен демон аудита, и я могу видеть файлы в папке с изображениями аудита

ls tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/audit/2.8.4-r0/image/*
tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/audit/2.8.4-r0/image/etc:
audisp  audit  default  init.d  libaudit.conf

tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/audit/2.8.4-r0/image/lib:
libaudit.a  libaudit.la  libaudit.so  libaudit.so.1  libaudit.so.1.0.0  libauparse.a  libauparse.la  libauparse.so  libauparse.so.0  libauparse.so.0.0.0

tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/audit/2.8.4-r0/image/sbin:
audispd  audisp-remote  auditctl  auditd  augenrules  aureport  ausearch  autrace

tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/audit/2.8.4-r0/image/usr:
bin  include  lib  share

когда я собираю rootfs и добавляю демон аудита, добавив следующую строку в conf / local.conf

CORE_IMAGE_EXTRA_INSTALL += " audit"

Я получаю только следующий файл внутри rootfs /etc/libaudit.conf

Audit_2.8.4.bb

SUMMARY = "User space tools for kernel auditing"
DESCRIPTION = "The audit package contains the user space utilities for \
storing and searching the audit records generated by the audit subsystem \
in the Linux kernel."
HOMEPAGE = "http://people.redhat.com/sgrubb/audit/"
SECTION = "base"
LICENSE = "GPLv2+ & LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"

SRC_URI = "http://people.redhat.com/sgrubb/${BPN}/${BPN}-${PV}.tar.gz \
           file://audit-python-configure.patch \
           file://audit-python.patch \
           file://fix-swig-host-contamination.patch \
           file://auditd \
           file://auditd.service \
           file://audit-volatile.conf \
"
SRC_URI[md5sum] = "ec9510312564c3d9483bccf8dbda4779"
SRC_URI[sha256sum] = "a410694d09fc5708d980a61a5abcb9633a591364f1ecc7e97ad5daef9c898c38"

inherit autotools pythonnative update-rc.d systemd

UPDATERCPN = "auditd"
INITSCRIPT_NAME = "auditd"
INITSCRIPT_PARAMS = "defaults"

SYSTEMD_PACKAGES = "auditd"
SYSTEMD_SERVICE_auditd = "auditd.service"

DEPENDS += "python tcp-wrappers libcap-ng linux-libc-headers (>= 2.6.30) swig-native"

EXTRA_OECONF += "--without-prelude \
        --with-libwrap \
        --enable-gssapi-krb5=no \
        --with-libcap-ng=yes \
        --with-python=yes \
        --libdir=${base_libdir} \
        --sbindir=${base_sbindir} \
        --without-python3 \
        --disable-zos-remote \
        "
EXTRA_OECONF_append_arm = " --with-arm=yes"
EXTRA_OECONF_append_aarch64 = " --with-aarch64=yes"

EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' \
    PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \
    pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
    STDINC='${STAGING_INCDIR}' \
    pkgconfigdir=${libdir}/pkgconfig \
    "

SUMMARY_audispd-plugins = "Plugins for the audit event dispatcher"
DESCRIPTION_audispd-plugins = "The audispd-plugins package provides plugins for the real-time \
interface to the audit system, audispd. These plugins can do things \
like relay events to remote machines or analyze events for suspicious \
behavior."

PACKAGES =+ "audispd-plugins"
PACKAGES += "auditd ${PN}-python"

FILES_${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*"
FILES_auditd += "${bindir}/* ${base_sbindir}/* ${sysconfdir}/*"
FILES_audispd-plugins += "${sysconfdir}/audisp/audisp-remote.conf \
    ${sysconfdir}/audisp/plugins.d/au-remote.conf \
    ${sbindir}/audisp-remote ${localstatedir}/spool/audit \
    "
FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug"
FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}"

CONFFILES_auditd += "${sysconfdir}/audit/audit.rules"
RDEPENDS_auditd += "bash"

do_install_append() {
    rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a
    rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la

    # reuse auditd config
    [ ! -e ${D}/etc/default ] && mkdir ${D}/etc/default
    mv ${D}/etc/sysconfig/auditd ${D}/etc/default
    rmdir ${D}/etc/sysconfig/

    # replace init.d
    install -D -m 0755 ${S}/../auditd ${D}/etc/init.d/auditd
    rm -rf ${D}/etc/rc.d

    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
        install -d ${D}${sysconfdir}/tmpfiles.d/
        install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
    fi

    # install systemd unit files
    install -d ${D}${systemd_unitdir}/system
    install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system

    # audit-2.5 doesn't install any rules by default, so we do that here
    mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d
    cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules

    chmod 750 ${D}/etc/audit ${D}/etc/audit/rules.d
    chmod 640 ${D}/etc/audit/auditd.conf ${D}/etc/audit/rules.d/audit.rules

    # Based on the audit.spec "Copy default rules into place on new installation"
    cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules
}

1 Ответ

0 голосов
/ 10 мая 2019

Audit_2.8.4.bb - это рецепт. Вы запускаете получатели с помощью bitbake. Рецепты изготовления> = 1 упаковки. Вы устанавливаете пакеты в образе.

Вы можете заглянуть в каталог packages-split в tmp / work / cortexa7hf-vfp-neon-poky-linux-gnueabi / audit / 2.8.4-r0 /, чтобы узнать, что входит в какой пакет.

...