0

所以,我有一个自定义的 yocto 层,我需要在其中删除用户帐户修改命令(useradd、userdel、usermod 等)。这些命令存储在 /usr/sbin 中。我一直在尝试的方法是引入一个新配方(或在现有配方中添加相同的逻辑),我这样做:

SUMMARY = "User account modification controls"
DESCRIPTION = "Configures the existence of user modification commands"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=[redacted]"


#SRC_URI += ""

FILES_${PN} += " \
    ${sbindir}/* \
"


do_install() {
    rm -rf ${D}${sbindir}/useradd
}

重要的部分当然是在 do_install 中,useradd 应该从 /usr/sbin 中删除。虽然这不会发生。我已验证该配方已正确解析,并且我已尝试将相同的逻辑添加到我的主图像配方中。Bitbake 成功完成,尽管 rootfs 和引导都显示 /usr/sbin/useradd 仍然存在。也许我对 useradd 的生成方式有些误解。

非常感谢任何见解。

4

0 回答 0