您的位置:首页 > 产品设计 > UI/UE

openwrt: Build dependency: Please do not compile as root解决方法

2016-05-28 15:13 357 查看
编译openwrt出现:

Collecting package info: done

Checking 'working-make'... ok.

Checking 'case-sensitive-fs'... ok.

Checking 'getopt'... ok.

Checking 'fileutils'... ok.

Checking 'working-gcc'... ok.

Checking 'working-g++'... ok.

Checking 'ncurses'... ok.

Checking 'zlib'... ok.

Checking 'gawk'... ok.

Checking 'unzip'... ok.

Checking 'bzip2'... ok.

Checking 'patch'... ok.

Checking 'perl'... ok.

Checking 'python'... ok.

Checking 'wget'... ok.

Checking 'git'... ok.

Checking 'gnutar'... ok.

Checking 'svn'... ok.

Checking 'gnu-find'... ok.

Checking 'getopt-extended'... ok.

Checking 'ocamlc'... ok.

Checking 'ocamlfind'... ok.
Checking 'non-root'... failed.

Build dependency: Please do not compile as root.

Prerequisite check failed. Use FORCE=1 to override.

make[1]: *** [tmp/.prereq-build] Error 1

make: *** [deconfig] Error 2

出现这个错误,这是因为openwrt为安全起见,默认对权限进行检查,推荐用非root的权限去编译,这个设置在include/prereq-build.mk 路径之下

解决方法:

命令行中输入vi include/prereq-build.mk 

将prereq-build.mk 文件中,如下图标注的那一行注释掉即可(在前面加上#注释符号)



然后重新在qsdk目录下make defconfig

checking whether mknod can create fifo without root privileges... configure: error: in `/work/openwrt/build_dir/host/tar-1.28':

configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)

Try the command indicated in the error message:

export FORCE_UNSAFE_CONFIGURE=1 && make

This being said, it is true the "unsafe configure" requirement seems a bit strange. Double-check the log (config.log) and see if there is something more explicit in there.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Linux openwrt