coolsnowwolf / lede

Lean's LEDE source
Other
29.83k stars 19.53k forks source link

最新源码编译错误:openwrt/include/toplevel.mk:231:world] 错误 2 #11891

Closed jiaopengzi closed 9 months ago

jiaopengzi commented 9 months ago

详细叙述

大佬您好,

使用 sh 脚本编译 参考了: #11764 但是还是报错。

#!/bin/bash

# 更新软件包 & 安装依赖
sudo apt update -y
sudo apt full-upgrade -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
    bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
    git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev \
    libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev \
    libssl-dev libtool lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 \
    python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo \
    uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev llvm clang
sudo apt-get -y autoremove --purge
sudo apt-get clean

# 下载源码
git clone --depth 1 https://github.com/coolsnowwolf/lede -b master openwrt
cd openwrt
# 打印当前目录
pwd

# 更新软件包 & 安装依赖
./scripts/feeds update -a
./scripts/feeds install -a

# 向 .config 文件追加配置覆盖写入 自定义定制 - x86_64.config
# 删除原来的 .config 文件
sudo rm -rf .config
sudo touch .config
cat >>.config <<EOF
# x86_64.config
CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_64=y
CONFIG_TARGET_x86_64_Generic=y
CONFIG_PACKAGE_grub2-efi=y
CONFIG_EFI_IMAGES=y
CONFIG_TARGET_IMAGES_GZIP=y
CONFIG_TARGET_KERNEL_PARTSIZE=16
CONFIG_TARGET_ROOTFS_PARTSIZE=300
# CONFIG_GRUB_CONSOLE is not set
CONFIG_PACKAGE_luci-app-docker=y
CONFIG_PACKAGE_luci-i18n-docker-zh-cn=y
# CONFIG_PACKAGE_luci-app-qbittorrent is not set
CONFIG_PACKAGE_luci-app-ssr-plus=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks_Rust=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_V2ray_plugin=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Xray=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Trojan=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Redsocks2=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_NaiveProxy=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Kcptun=y
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Server=y
CONFIG_PACKAGE_luci-i18n-ssr-plus-zh-cn=y
CONFIG_PACKAGE_luci-theme-argon=y
CONFIG_PACKAGE_luci-app-mwan3=y
CONFIG_PACKAGE_luci-app-mwan3helper=y
CONFIG_PACKAGE_luci-i18n-mwan3-zh-cn=y
CONFIG_PACKAGE_luci-i18n-mwan3helper-zh-cn=y
CONFIG_PACKAGE_luci-app-syncdial=y
CONFIG_PACKAGE_luci-app-ttyd=y
CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y
CONFIG_PACKAGE_luci-app-webadmin=y
CONFIG_PACKAGE_luci-i18n-webadmin-zh-cn=y
CONFIG_PACKAGE_dnsmasq_full_auth=y
CONFIG_PACKAGE_dnsmasq_full_conntrack=y
CONFIG_PACKAGE_dnsmasq_full_dnssec=y
CONFIG_PACKAGE_ddns-scripts_cloudflare.com-v4=y
CONFIG_PACKAGE_ddns-scripts_freedns_42_pl=y
CONFIG_PACKAGE_ddns-scripts_godaddy.com-v1=y
CONFIG_PACKAGE_ddns-scripts_no-ip_com=y
CONFIG_PACKAGE_ddns-scripts_nsupdate=y
CONFIG_PACKAGE_ddns-scripts_route53-v1=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_htop=y
CONFIG_PACKAGE_nano=y
CONFIG_PACKAGE_wget=y
CONFIG_PACKAGE_kmod-kvm-amd=y
CONFIG_PACKAGE_kmod-kvm-intel=y
CONFIG_PACKAGE_kmod-kvm-x86=y
CONFIG_OPENSSL_ENGINE_CRYPTO=y
CONFIG_OPENSSL_ENGINE_DIGEST=y
CONFIG_OPENSSL_WITH_CAMELLIA=y
CONFIG_OPENSSL_WITH_COMPRESSION=y
CONFIG_OPENSSL_WITH_DTLS=y
CONFIG_OPENSSL_WITH_EC2M=y
CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y
CONFIG_OPENSSL_WITH_GOST=y
CONFIG_OPENSSL_WITH_IDEA=y
CONFIG_OPENSSL_WITH_MDC2=y
CONFIG_OPENSSL_WITH_RFC3779=y
CONFIG_OPENSSL_WITH_SEED=y
CONFIG_OPENSSL_WITH_WHIRLPOOL=y
CONFIG_OPENVPN_openssl_ENABLE_DEF_AUTH=y
CONFIG_OPENVPN_openssl_ENABLE_FRAGMENT=y
CONFIG_OPENVPN_openssl_ENABLE_LZ4=y
CONFIG_OPENVPN_openssl_ENABLE_LZO=y
CONFIG_OPENVPN_openssl_ENABLE_MULTIHOME=y
CONFIG_OPENVPN_openssl_ENABLE_PF=y
CONFIG_OPENVPN_openssl_ENABLE_PORT_SHARE=y
CONFIG_OPENVPN_openssl_ENABLE_SERVER=y
CONFIG_OPENVPN_openssl_ENABLE_SMALL=y
CONFIG_KERNEL_BUILD_USER="jpz"
CONFIG_GRUB_TITLE="OpenWrt by https://github.com/coolsnowwolf/lede"
CONFIG_PACKAGE_kmod-usb-ohci=y
CONFIG_PACKAGE_kmod-usb-ohci-pci=y
CONFIG_PACKAGE_kmod-usb-storage-uas=y
CONFIG_PACKAGE_kmod-usb-uhci=y
CONFIG_PACKAGE_kmod-sdhci=y
CONFIG_PACKAGE_kmod-usb-ehci=y
CONFIG_PACKAGE_kmod-usb2=y
CONFIG_PACKAGE_kmod-usb2-pci=y
CONFIG_PACKAGE_kmod-usb3=y
CONFIG_PACKAGE_luci-app-frpc=y
#CONFIG_PACKAGE_luci-app-passwall=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Brook=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ChinaDNS_NG=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Kcptun=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_NaiveProxy=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_PDNSD=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Server=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_GO=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray=y
#CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray_Plugin=y
EOF

#1. 修改默认 IP
sudo sed -i 's/192.168.1.1/10.10.0.1/g' ./package/base-files/files/bin/config_generate
sudo sed -i 's/255.255.255.0/255.255.0.0/g' ./package/base-files/files/bin/config_generate

#2. 清除登录密码
sudo sed -i 's/$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.//g' ./package/lean/default-settings/files/zzz-default-settings

# default-settings
make defconfig

echo -e "$(nproc) thread build."

# 下载dl库
make download -j$(nproc)

# 删除缓存
make clean
make dirclean

# 打印标识
echo "删除前输出目录"
ls -al

# 删除临时文件
sudo rm -rf tmp
sudo rm -rf staging_dir

# 打印标识
echo "删除后输出目录"
ls -al

# 编译固件
make V=s -j$(nproc)

Ubuntu 版本Ubuntu 22.04.3 LTS (GNU/Linux 6.5.0-17-generic x86_64)

使用最新的源码,在使用如上脚本编译固件的时候一直报错如下:

image

make[8]: Nothing to be done for 'install-data-am'.
make[8]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/lib'
make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/lib'
make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/lib'
Making install in src
make[6]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src'
make[7]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src'
make[7]: Nothing to be done for 'install-data-am'.
 /usr/bin/mkdir -p '/home/jpz/build-openwrt/openwrt/staging_dir/host/bin'
  /home/jpz/build-openwrt/openwrt/staging_dir/host/bin/install -c patch '/home/jpz/build-openwrt/openwrt/staging_dir/host/bin'
make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src'
make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src'
Making install in tests
make[6]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests'
make[7]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests'
make[7]: Nothing to be done for 'install-exec-am'.
make[7]: Nothing to be done for 'install-data-am'.
make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests'
make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests'
make[6]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6'
make[7]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6'
make[7]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/home/jpz/build-openwrt/openwrt/staging_dir/host/share/man/man1'
 /home/jpz/build-openwrt/openwrt/staging_dir/host/bin/install -c -m 644 'patch.man' '/home/jpz/build-openwrt/openwrt/staging_dir/host/share/man/man1/patch.1'
make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6'
make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6'
make[5]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6'
make[4]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6'
mkdir -p /home/jpz/build-openwrt/openwrt/staging_dir/host/stamp
touch /home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/.built
touch /home/jpz/build-openwrt/openwrt/staging_dir/host/stamp/.patch_installed
make[3]: Leaving directory '/home/jpz/build-openwrt/openwrt/tools/patch'
time: tools/patch/compile#23.71#10.03#24.78
make[2]: Leaving directory '/home/jpz/build-openwrt/openwrt'
make[1]: *** [tools/Makefile:217: /home/jpz/build-openwrt/openwrt/staging_dir/host/stamp/.tools_compile_nyyynyynnyyynynyyyyyyynyynnynyynnynnyyyyyyyyyyyyyyyyynynnyyyyyyyy] Error 2
make[1]: Leaving directory '/home/jpz/build-openwrt/openwrt'
make: *** [/home/jpz/build-openwrt/openwrt/include/toplevel.mk:231:world] 错误 2

在编译前删除了 tmpstaging_dir

删除前输出目录
总计 432
drwxr-xr-x 18 root root   4096  2月 16 00:55 .
drwxrwxr-x  3 jpz  jpz    4096  2月 16 00:22 ..
drwxr-xr-x  3 root root   4096  2月 16 00:25 bin
-rw-r--r--  1 root root    106  2月 16 00:23 BSDmakefile
drwxr-xr-x  2 root root   4096  2月 16 00:55 build_dir
-rw-r--r--  1 root root 265307  2月 16 00:25 .config
drwxr-xr-x  2 root root   4096  2月 16 00:23 config
-rw-r--r--  1 root root    668  2月 16 00:23 Config.in
-rw-r--r--  1 root root   4130  2月 16 00:24 .config.old
-rw-r--r--  1 root root    284  2月 16 00:23 COPYING
drwxr-xr-x  2 root root  12288  2月 16 00:55 dl
drwxr-xr-x  2 root root   4096  2月 16 00:23 doc
drwxr-xr-x 10 root root   4096  2月 16 00:24 feeds
-rw-r--r--  1 root root    546  2月 16 00:23 feeds.conf.default
drwxr-xr-x  8 root root   4096  2月 16 00:23 .git
-rw-r--r--  1 root root      8  2月 16 00:23 .gitattributes
drwxr-xr-x  4 root root   4096  2月 16 00:23 .github
-rw-r--r--  1 root root    278  2月 16 00:23 .gitignore
drwxr-xr-x  3 root root   4096  2月 16 00:23 include
drwxr-xr-x  2 root root   4096  2月 16 00:23 LICENSES
-rw-r--r--  1 root root   4083  2月 16 00:23 Makefile
drwxr-xr-x 16 root root   4096  2月 16 00:24 package
-rw-r--r--  1 root root  12954  2月 16 00:23 README_EN.md
-rw-r--r--  1 root root  14488  2月 16 00:23 README_JA.md
-rw-r--r--  1 root root   5765  2月 16 00:23 README.md
-rw-r--r--  1 root root  14427  2月 16 00:23 rules.mk
drwxr-xr-x  4 root root   4096  2月 16 00:23 scripts
drwxr-xr-x  2 root root   4096  2月 16 00:55 staging_dir
drwxr-xr-x  7 root root   4096  2月 16 00:23 target
drwxr-xr-x 11 root root   4096  2月 16 00:23 toolchain
drwxr-xr-x 71 root root   4096  2月 16 00:23 tools
删除后输出目录
总计 428
drwxr-xr-x 17 root root   4096  2月 16 00:55 .
drwxrwxr-x  3 jpz  jpz    4096  2月 16 00:22 ..
drwxr-xr-x  3 root root   4096  2月 16 00:25 bin
-rw-r--r--  1 root root    106  2月 16 00:23 BSDmakefile
drwxr-xr-x  2 root root   4096  2月 16 00:55 build_dir
-rw-r--r--  1 root root 265307  2月 16 00:25 .config
drwxr-xr-x  2 root root   4096  2月 16 00:23 config
-rw-r--r--  1 root root    668  2月 16 00:23 Config.in
-rw-r--r--  1 root root   4130  2月 16 00:24 .config.old
-rw-r--r--  1 root root    284  2月 16 00:23 COPYING
drwxr-xr-x  2 root root  12288  2月 16 00:55 dl
drwxr-xr-x  2 root root   4096  2月 16 00:23 doc
drwxr-xr-x 10 root root   4096  2月 16 00:24 feeds
-rw-r--r--  1 root root    546  2月 16 00:23 feeds.conf.default
drwxr-xr-x  8 root root   4096  2月 16 00:23 .git
-rw-r--r--  1 root root      8  2月 16 00:23 .gitattributes
drwxr-xr-x  4 root root   4096  2月 16 00:23 .github
-rw-r--r--  1 root root    278  2月 16 00:23 .gitignore
drwxr-xr-x  3 root root   4096  2月 16 00:23 include
drwxr-xr-x  2 root root   4096  2月 16 00:23 LICENSES
-rw-r--r--  1 root root   4083  2月 16 00:23 Makefile
drwxr-xr-x 16 root root   4096  2月 16 00:24 package
-rw-r--r--  1 root root  12954  2月 16 00:23 README_EN.md
-rw-r--r--  1 root root  14488  2月 16 00:23 README_JA.md
-rw-r--r--  1 root root   5765  2月 16 00:23 README.md
-rw-r--r--  1 root root  14427  2月 16 00:23 rules.mk
drwxr-xr-x  4 root root   4096  2月 16 00:23 scripts
drwxr-xr-x  7 root root   4096  2月 16 00:23 target
drwxr-xr-x 11 root root   4096  2月 16 00:23 toolchain
drwxr-xr-x 71 root root   4096  2月 16 00:23 tools

image

应该如何修改.sh 文件 ?或者是其他什么办法?

重复 issue

具体型号

x86_64

详细日志

make[8]: Nothing to be done for 'install-data-am'. make[8]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/lib' make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/lib' make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/lib' Making install in src make[6]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src' make[7]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src' make[7]: Nothing to be done for 'install-data-am'. /usr/bin/mkdir -p '/home/jpz/build-openwrt/openwrt/staging_dir/host/bin' /home/jpz/build-openwrt/openwrt/staging_dir/host/bin/install -c patch '/home/jpz/build-openwrt/openwrt/staging_dir/host/bin' make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src' make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/src' Making install in tests make[6]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests' make[7]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests' make[7]: Nothing to be done for 'install-exec-am'. make[7]: Nothing to be done for 'install-data-am'. make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests' make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/tests' make[6]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6' make[7]: Entering directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6' make[7]: Nothing to be done for 'install-exec-am'. /usr/bin/mkdir -p '/home/jpz/build-openwrt/openwrt/staging_dir/host/share/man/man1' /home/jpz/build-openwrt/openwrt/staging_dir/host/bin/install -c -m 644 'patch.man' '/home/jpz/build-openwrt/openwrt/staging_dir/host/share/man/man1/patch.1' make[7]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6' make[6]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6' make[5]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6' make[4]: Leaving directory '/home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6' mkdir -p /home/jpz/build-openwrt/openwrt/staging_dir/host/stamp touch /home/jpz/build-openwrt/openwrt/build_dir/host/patch-2.7.6/.built touch /home/jpz/build-openwrt/openwrt/staging_dir/host/stamp/.patch_installed make[3]: Leaving directory '/home/jpz/build-openwrt/openwrt/tools/patch' time: tools/patch/compile#23.71#10.03#24.78 make[2]: Leaving directory '/home/jpz/build-openwrt/openwrt' make[1]: [tools/Makefile:217: /home/jpz/build-openwrt/openwrt/staging_dir/host/stamp/.tools_compile_nyyynyynnyyynynyyyyyyynyynnynyynnynnyyyyyyyyyyyyyyyyynynnyyyyyyyy] Error 2 make[1]: Leaving directory '/home/jpz/build-openwrt/openwrt' make: [/home/jpz/build-openwrt/openwrt/include/toplevel.mk:231:world] 错误 2

12123ads commented 3 months ago

@jiaopengzi 大佬你好,请问这个问题您解决了吗

jiaopengzi commented 3 months ago

@jiaopengzi 大佬你好,请问这个问题您解决了吗

参考:https://github.com/jiaopengzi/build-openwrt

Gao-Siqi commented 1 month ago

能说明下详细的解决方案嘛,我也遇到了这个问题

jiaopengzi commented 1 month ago

能说明下详细的解决方案嘛,我也遇到了这个问题

多半是没有全程梯子,可以看下我楼上我写的的脚本。