编译openwrt程序报错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编译openwrt程序报错相关的知识,希望对你有一定的参考价值。

ot@buyuehang-CP65S:/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64# make V=s
#
# configuration written to .config
#
make[1]: Entering directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64'
make[2]: Entering directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64'
make[3]: Entering directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/package/capsulator'
make[4]: Entering directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/build_dir/target-mips_34kc_musl-1.1.10/capsulater'
mips-openwrt-linux-musl-gcc -MM -c -Wall mips -D_LITTLE_ENDIAN_ -g -D_DEBUG_ main.c > .main.d
mips-openwrt-linux-musl-gcc: error: mips: No such file or directory
Makefile:94: recipe for target '.main.d' failed
make[4]: *** [.main.d] Error 1
make[4]: Leaving directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/build_dir/target-mips_34kc_musl-1.1.10/capsulater'
Makefile:20: recipe for target '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/build_dir/target-mips_34kc_musl-1.1.10/capsulater/.built' failed
make[3]: *** [/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/build_dir/target-mips_34kc_musl-1.1.10/capsulater/.built] Error 2
make[3]: Leaving directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/package/capsulator'
package/Makefile:191: recipe for target 'package/capsulator/compile' failed
make[2]: *** [package/capsulator/compile] Error 2
make[2]: Leaving directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64'
package/Makefile:188: recipe for target '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile' failed
make[1]: *** [/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/staging_dir/target-mips_34kc_musl-1.1.10/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64'
/home/buyuehang/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-generic_gcc-4.8-linaro_musl-1.1.10.Linux-x86_64/include/toplevel.mk:174: recipe for target 'world' failed
make: *** [world] Error 2
求大神指教哪里错了

参考技术A 主要原因可能上是因为内存不足, 临时使用交换分区来解决 sudo dd if=/dev/zero of=/swapfile bs=64M count=16 sudo mkswap /swapfile sudo swapon /swapfile 编译结束后关闭并删除 sudo swapoff /swapfile sudo rm /swapfile

openwrt编译 固件太大报错 .bin is too big

openwrt只选中SSH LUCI 编译 报错 无法生成固件

问题出在:openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin

这个固件也没用 。

修改方法:

进入./target/linux/ramips/image

打开makefile 

找到ex2700_mtd_size=3866624  改为8126464即可。影响未知

 

技术分享

error log:

if [ `stat -c%s "/home/l/linux/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin"` -gt 3866624 ]; then echo "Warning: /home/l/linux/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin is too big" >&2; else cp -fpR /home/l/linux/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin /home/l/linux/bin/ramips/openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin; fi
Warning: /home/l/linux/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620/openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin is too big
/home/l/linux/staging_dir/host/bin/mkdniimg -B EX2700 -H 29764623+4+0+32+2x2+0 -v OpenWrt -i /home/l/linux/bin/ramips/openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin -o /home/l/linux/bin/ramips/openwrt-ramips-mt7620-ex2700-squashfs-factory.bin
[mkdniimg] *** error: stat failed on /home/l/linux/bin/ramips/openwrt-ramips-mt7620-ex2700-squashfs-sysupgrade.bin
Makefile:1075: recipe for target ‘install‘ failed
make[5]: *** [install] Error 1
make[5]: Leaving directory ‘/home/l/linux/target/linux/ramips/image‘
Makefile:26: recipe for target ‘install‘ failed
make[4]: *** [install] Error 2
make[4]: Leaving directory ‘/home/l/linux/target/linux/ramips‘
Makefile:13: recipe for target ‘install‘ failed
make[3]: *** [install] Error 2
make[3]: Leaving directory ‘/home/l/linux/target/linux‘
target/Makefile:21: recipe for target ‘target/linux/install‘ failed
make[2]: *** [target/linux/install] Error 2
make[2]: Leaving directory ‘/home/l/linux‘
target/Makefile:17: recipe for target ‘/home/l/linux/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.target_install‘ failed
make[1]: *** [/home/l/linux/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.target_install] Error 2
make[1]: Leaving directory ‘/home/l/linux‘
/home/l/linux/include/toplevel.mk:181: recipe for target ‘world‘ failed
make: *** [world] Error 2





















以上是关于编译openwrt程序报错的主要内容,如果未能解决你的问题,请参考以下文章

OpenWrt编译报错:Package airfly_receiver is missing dependencies for the following libraries

如何编译openwrt的u-boot

openwrt 编译newifi 应用程序

openwrt编译 固件太大报错 .bin is too big

如何编译OpenWrt

openwrt编译固件过大