xiaoqingfengATGH / HomeLede

An Openwrt firmware for home use scenarios.
https://github.com/xiaoqingfengATGH/HomeLede/wiki
Other
1.05k stars 185 forks source link
homelede lede openwrt

HomeLede (Kernel 6.x) 版本说明

license PRs Welcome Issue Welcome Release Version Contact Me

固件使用说明

对家庭路由高频功能进行了测试(x86软路由),保证可用。

固件内置功能


编译说明

注意:

  1. 要用 root 用户 git 和编译!!!
  2. 国内用户编译前最好准备好梯子
  3. 默认登陆IP 192.168.1.1, 密码 password

编译命令

编译前:

  1. 首先装好 Ubuntu 64bit,推荐 Ubuntu 24 LTS x64
  2. 至少30G空闲硬盘空间
  3. 2G以上内存,建议4G

编译时:

  1. 更新apt-get包信息,命令行输入 sudo apt-get update

  2. 安装编译依赖包,命令行输入

    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 python3 \
    python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo \
    uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
  3. git clone https://github.com/xiaoqingfengATGH/HomeLede.git HomeLede命令下载好源代码,然后 cd HomeLede 进入目录

  4. git checkout -b k5 origin/k5

  5. ./prepareCompile.sh

  6. make download V=s 下载dl库(国内请尽量全局科学上网,如果程序下载失败,也可以提取网址自行下载后放入dl文件夹,此文件夹通常不需要删除)

  7. make menuconfig 配置软件包

  8. make -j1 V=s (-j1 后面是线程数。第一次编译推荐用单线程,国内请尽量全局科学上网)即可开始编译你要的固件了。

编译成功后,再次编译可以启动多线程编译。如4核心8线程i7上开启16线程使用make -j16 V=sc


使用Windows子系统(WSL、WSL2)编译:

由于 WSL 的 PATH 中包含带有空格的 Windows 路径,有可能会导致编译失败,请在 make 前面加上:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

二次编译:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make -j$(($(nproc) + 1)) V=s

macOS 原生系统进行编译:

1.在 AppStore 中安装 Xcode

由于默认情况下,装载到 WSL 发行版的 NTFS 格式的驱动器将不区分大小写,因此大概率在 WSL/WSL2 的编译检查中会返回以下错误:

Build dependency: OpenWrt can only be built on a case-sensitive filesystem

一个比较简洁的解决方法是,在 git clone 前先创建 Repository 目录,并为其启用大小写敏感:

# 以管理员身份打开终端
PS > fsutil.exe file setCaseSensitiveInfo <your_local_lede_path> enable
# 将本项目 git clone 到开启了大小写敏感的目录 <your_local_lede_path> 中
PS > git clone git@github.com:coolsnowwolf/lede.git <your_local_lede_path>

对已经 git clone 完成的项目目录执行 fsutil.exe 命令无法生效,大小写敏感只对新增的文件变更有效。

macOS 原生系统进行编译

  1. 在 AppStore 中安装 Xcode

  2. 安装 Homebrew:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. 使用 Homebrew 安装工具链、依赖与基础软件包:

    brew unlink awk
    brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep make ncurses pkg-config wget quilt xz
    brew install gcc@11
  4. 然后输入以下命令,添加到系统环境变量中:

    • intel 芯片的 mac
    echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc
    • apple 芯片的 mac
    echo 'export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc
    echo 'export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc

重新加载一下 shell 启动文件 source ~/.bashrc,然后输入 bash 进入 bash shell,就可以和 Linux 一样正常编译了

固件下载

如需直接编译完成的固件,请访问Google网盘

链接:https://drive.google.com/open?id=1iUDsgh1y5qouP48V61aTsswi3IekscKk

Stargazers over time

Stargazers over time

交流