拉取Openwrt官方源码 编译固件速通

Source

Openwrt 24.10上星期出了,但是恩山没几个人更新,自己编译一个,记录一下方法。

一切从简,不添加任何插件,资源扔恩山了。

【   】红米AX6000 openwrt V24.10.0 uboot大分区固件-小米无线路由器及小米网络设备-恩山无线论坛

GitHub - openwrt/openwrt: This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into openwrt.git.

Highlights in OpenWrt 24.10

General changes

  • Upgrades of many components to new versions like the Linux kernel from version 5.15 to 6.6
  • TLS 1.3 support in default images
    • mbedtls was updated to version 3.6 which includes support for TLS 1.3
  • Activate POSIX Access Control Lists and file system security attributes for all file systems on devices with big flash sizes. This is needed by docker nowadays.
    • This is activated for all targets which do not have the small_flash feature flag. small_flash is set for the ath79/tiny, bcm47xx/legacy, lantiq/ase, lantiq/xrx200_legacy, lantiq/xway_legacy, ramips/mt76x8, ramips/rt288x, ramips/rt305x and ramips/rt3883 targets.
  • Activate kernel support for Multipath TCP on devices with big flash sizes.
  • Improved support for WiFi6 (802.11ax) and initial support for WiFi7 (802.11be)
    • Not many Wifi7 devices are supported by OpenWrt yet
  • Improved Link Layer Discovery Protocol (LLDP) support
  • OpenWrt 24.10 uses OPKG only, APK packages are not supported. Only main branch was changed to APK.

下载编译依赖

apt update
apt upgrade
apt install gcc g++ build-essential asciidoc  binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch flex bison make autoconf texinfo unzip sharutils subversion ncurses-term zlib1g-dev ccache upx lib32gcc-s1 libc6-dev-i386 uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev libglib2.0-dev xmlto qemu-utils automake libtool  -y
#安装编译依赖

 拉取源码

mkdir openwrt #此为当前用户主文件夹下,也可其他路径
chmod 777 openwrt #提权

cd openwrt
#官方(选一)
git clone https://github.com/openwrt/openwrt.git openwrt2410 
#lede(选一)
git clone https://github.com/coolsnowwolf/lede.git openwrt2410 
#clone到./openwrt/openwrt2410文件夹

满足feeds 配置固件

cd openwrt2410

./scripts/feeds update -a #下载feeds列表依赖
./scripts/feeds install -a #安装依赖

make defconfig #根据defconfig生成.config
make menuconfig #GUI配置

选择 处理器架构 机型

注意target profile机型选择 同一机型有官方分区/UBOOT大分区(刷过不死底包的都懂吧 不懂就选官方分区)

target Profile可以选择输出文件格式,一般选完机型他就自动选择好了用不着自己配

添加Luci界面web管理

注意:选择时 M为包含不使用,要 * 才是包含且使用

Luci界面选择语言

保存

编译固件

make -j16 download V=s  #预下载编译所需软件包到dl
make -j16 V=s #编译
# -j <cpu核心数>   多了报错 少了慢 几个框写几
# V=s 详细日志

编译完成后看看日志往上翻翻能看到输出路径 

厂包,更新包,都在。

写在最后

 笑死 是上班时候开远程桌面连NAS机顶盒在里面开个hyperv虚拟机跑ubuntu编译出来的。hyperv导入导出不方便还不能粘贴,最后只能在虚拟机里开浏览器用搭的alist上传到主机