当我按照此处的步骤创建交叉编译环境时,[ http://crosstool-ng.org/ ]
我遇到了这样的错误:
root@gpl-vm:~# ct-ng build
[ERROR] You must NOT be root to run crosstool-NG
[00:00] / make: *** [build] Error 1
当我切换到普通用户时,它说我无权执行该命令。
当我按照此处的步骤创建交叉编译环境时,[ http://crosstool-ng.org/ ]
我遇到了这样的错误:
root@gpl-vm:~# ct-ng build
[ERROR] You must NOT be root to run crosstool-NG
[00:00] / make: *** [build] Error 1
当我切换到普通用户时,它说我无权执行该命令。
CT_ALLOW_BUILD_AS_ROOT=y
从 d5900debd397b8909d9cafeb9a1093fb7a5dc6e6 (2018 年 6 月)开始,如果您真的知道自己在做什么,该选项允许您以 root 身份构建:
CT_EXPERIMENTAL=y
CT_ALLOW_BUILD_AS_ROOT=y
CT_ALLOW_BUILD_AS_ROOT_SURE=y
他们可以通过以下菜单访问:
但是,我建议您仔细阅读该选项的帮助:
│ You normally do *not* need to be root to build a toolchain using │
│ crosstool-NG. In fact, it is *VERY* dangerous to run as root, as │
│ crosstool-NG will, as part of the build process, remove a few │
│ directories. If anything goes wrong, running as root can ruin │
│ your host distribution. │
│ │
│ I can't stress it enough: DO NOT RUN AS ROOT !! │
│ │
│ Do not run as root, you've been warned. │
│ Do not come whining, if it nukes your host system. │
│ Do not come whining, if you lose any data. │
│ Do not run as root. │
│ │
│ Do not run as root, you've been warned. │
│ Do not come whining, if the Earth stops rotating. │
│ Do not come whining, if kittens are smashed. │
│ Do not run as root. │
│ │
│ Do not run as root, do not run as root! │
│ (ad libitum) │
│
也许最可接受的用例是在 Docker 中运行 crosstool-NG,就像我在这里所做的那样。有用。
通过grepping源代码中的错误消息找到:-)
你不能使用root用户。要构建它,请使用普通用户。
尝试
# adduser crosstoolng
# chown crosstoolng:crosstoolng <crosstool-path>
# su crosstoolng
$ ./ct-ng build
您可以以 root 身份构建 ct-ng。您需要明确允许并在 menuconfig 中确认。在路径和杂项选项中有一个条目。
它不在用户肠道下运行,以普通用户身份运行。