1、首先装好 Ubuntu 64bit,推荐 Ubuntu 20.04 LTS x64,注意,安装英文版本(英文版本适配的是国外源)
apt update -y && apt full-upgrade -y
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
如果使用root用户编译,请执行
export FORCE_UNSAFE_CONFIGURE=1
2、下载源码
git clone https://github.com/coolsnowwolf/lede
cd lede
缝合一些其他插件原地址:https://github.com/kenzok8/openwrt-packages 添加下面代码复制到 lede源码根目录 feeds.conf.default 文件
vim feeds.conf.default
src-git kenzo https://github.com/kenzok8/openwrt-packages
src-git small https://github.com/kenzok8/small
src-git opentopd https://github.com/sirpdboy/sirpdboy-package
src-git nas https://github.com/linkease/nas-packages.git;master
src-git nas_luci https://github.com/linkease/nas-packages-luci.git;main
#src-git cdnspeedtest https://github.com/immortalwrt-collections/openwrt-cdnspeedtest.git
#src-get luci-app-cloudflarespeedtest https://github.com/mingxiaoyu/luci-app-cloudflarespeedtest.git
3、更新下载
./scripts/feeds update -a && ./scripts/feeds install -a
更改LAN口的默认IP地址
vim package/base-files/files/bin/config_generate
编译新版Sing-box和hysteria,需golang版本1.22或者以上版本 ,可以用以下命令
rm -rf feeds/packages/lang/golang
git clone https://github.com/sbwml/packages_lang_golang -b 22.x feeds/packages/lang/golang
下载{下载dl库(国内请尽量全局科学上网)}
make -j8 download V=s
make menuconfig
make -j$(($(nproc) + 1)) V=s
遇到此问题:warning: Your BIOS Boot Partition is under 1 MiB, please increase its size 修改文件,
vi ./target/linux/rockchip/image/Makefile
define Build/combined
(CP)(KDIR)/(KERNELNAME)@.boot/boot/vmlinuz
-$(CP) (STAGINGDIRROOT)/boot/.@.boot/boot/
(CP)(STAGING_DIR_IMAGE)/grub2/boot.img $@.boot/boot/grub/
(CP)(STAGING_DIR_IMAGE)/grub2/$(if (filter(1),efi),gpt,(GRUB2VARIANT))−core.img@.boot/boot/grub/core.img
(if(filter $(1),efi),
(INSTALLDIR)@.boot/efi/boot
(CP)(STAGING_DIR_IMAGE)/grub2/boot$(if (CONFIGx8664),x64,ia32).efi@.boot/efi/boot/
)
PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)"
(if(filter (1),efi),GUID="(IMG_PART_DISKGUID)") (SCRIPTDIR)/genimagegeneric.sh@
(CONFIGTARGETKERNELPARTSIZE)@.boot
(CONFIGTARGETROOTFSPARTSIZE)(IMAGE_ROOTFS)
256
endef
找到这行,把256改成1024保存
