linux - 添加用户以在 Buildroot 中为自定义包创建

标签 linux buildroot

我正在 buildroot 中添加一个包。特别是 fcron-3.2.1。文档说将其放入包 makefile (fcron.mk) 中:

LIBFOO_USERS

Lists the users to create for this package, if it 
installs a program you want to run as a specific user (e.g. as a 
daemon, or as a cron-job). The syntax is similar in spirit to the 
makedevs one, and is described in the Chapter 24, Makeusers syntax 
documentation. This variable is optional.

所以我的 fcron.mk 文件看起来像这样:

#############################################################
#
# fcron
#
#############################################################

FCRON_VERSION = 3.2.1
FCRON_OVERRIDE_SRCDIR = ../fcron-3.2.1
FCRON_OVERRIDE_RSYNC = YES
FCRON_INSTALL_STAGING = YES
FCRON_INSTALL_TARGET = YES
FCRON_SITE_METHOD = local
FCRON_CONF_OPTS = --enable-shared
FCRON_SITE = www.nomad-digital.com

define FCRON_USERS
    fcron -1 fcron -1 * - - - Fcron daemon
endef

$(eval $(autotools-package))

当我尝试在 buildroot 中安装时,出现以下错误。

>>> fcron custom Installing to staging directory
Checking if group fcron exists ... no.
Would you like to add fcron in /etc/passwd with the following command ?
    groupadd fcron
If you use NYS, ldap, etc, you should add the group manually (say no here)
Please answer with 'y' or 'n' (default: 'y'): y
groupadd: Permission denied
groupadd cannot lock /etc/group; try again later.
Group "fcron" does not exists : please create it or choose another groupname with configure script.

我有一种感觉,我试图在主机上创建一个用户,而不是在我的 buildroot 镜像中,但即使我在上面回答“n”,它仍然没有通过,只是说请创建一个用户.我是否在 buildroot 中正确创建了所需的用户和组?

最佳答案

fcron 构建系统尝试将用户和组添加到主机,因为它显然不考虑在暂存目录中安装。您需要告诉 fcron 构建系统不要在安装期间添加用户和组。如果这在 fcron 配置选项中不是很明显,您可以看看发行版是如何解决它的,它们也会有同样的问题。可能您需要修补其 Makefile.am 并在 fcron.mk 中设置 FCRON_AUTORECONF = YES

关于linux - 添加用户以在 Buildroot 中为自定义包创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45611275/

相关文章:

php - 在 linux cli 中延迟执行我的 php 代码

python - 将 Python 包添加到 Buildroot

linux - 在 RPI 中启动时不显示内核 Logo

linux - 如何将 GNU Screen 复制缓冲区复制到剪贴板?

linux - 多个子目录下的原图如何批量制作缩略图?

java - JxBrowser 6.14.2 系统要求不明确。在多个 Linux 发行版上创建浏览器失败

audio - arecord 创建的多个文件

linux-kernel - buildroot 中的内核 defconfig(arm 目标)

linux - 用于 aws-iot-device-sdk-cpp 的 Buildroot MakeFile

php - 在 php 中使用 Linux awk 命令