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

編譯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.



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章