自编译Openwrt 红米A6固件记录,自选固件

在 LEDE 固件里,是移除了 ax6 相关的ipq807x: drop all xiaomi devices support
后面版本添加了IPQ807x相关,在编译时没有选项

修改代码

  • Fork源码,后面方便同步更新代码
  • 修改target/linux/ipq807x/image/generic.mk文件
    define Device/redmi_ax6
    	$(call Device/xiaomi_ax3600)
    	DEVICE_VENDOR := Redmi
    	DEVICE_MODEL := AX6
    	DEVICE_PACKAGES := ipq-wifi-redmi_ax6 uboot-envtools
    endef
    TARGET_DEVICES += redmi_ax6
    
    define Device/xiaomi_ax3600
    	$(call Device/FitImage)
    	$(call Device/UbiFit)
    	DEVICE_VENDOR := Xiaomi
    	DEVICE_MODEL := AX3600
    	BLOCKSIZE := 128k
    	PAGESIZE := 2048
    	DEVICE_DTS_CONFIG := config@ac04
    	SOC := ipq8071
    	DEVICE_PACKAGES := ath10k-firmware-qca9887-ct ipq-wifi-xiaomi_ax3600 \
    	kmod-ath10k-ct uboot-envtools
    endef
    TARGET_DEVICES += xiaomi_ax3600
    
  • 仓库地址

开始配置编译

  1. Ubuntu 20.04

    修改清华源

    sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
    sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list
    

    安装编译依赖

    sudo apt update -y
    sudo apt full-upgrade -y
    sudo apt install -y ack antlr3 aria2 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 libglib2.0-dev libgmp3-dev libltdl-dev \
    libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
    mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip libpython3-dev qemu-utils \
    rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
    
  2. 使用git免费代理,https://ghproxy.com

    git clone https://ghproxy.com/https://github.com/HHXinXin/lede-redmi-ax6 lede
    cd lede
    
  3. 修改feeds.conf.default

    src-git packages https://ghproxy.com/https://github.com/coolsnowwolf/packages
    src-git luci https://ghproxy.com/https://github.com/coolsnowwolf/luci
    src-git routing https://ghproxy.com/https://github.com/coolsnowwolf/routing
    src-git telephony https://git.openwrt.org/feed/telephony.git
    src-git kenzo https://ghproxy.com/https://github.com/kenzok8/openwrt-packages
    src-git small https://ghproxy.com/https://github.com/kenzok8/small
    src-git helloworld https://ghproxy.com/https://github.com/fw876/helloworld.git
    #src-git oui https://github.com/zhaojh329/oui.git
    #src-git video https://github.com/openwrt/video.git
    #src-git targets https://github.com/openwrt/targets.git
    #src-git oldpackages http://git.openwrt.org/packages.git
    #src-link custom /usr/src/openwrt/custom-feed
    

    一键修改

    #增加三方插件
    sed -i '$a src-git kenzo https://github.com/kenzok8/openwrt-packages' feeds.conf.default
    sed -i '$a src-git small https://github.com/kenzok8/small' feeds.conf.default
    #设置代理
    sed -i "s/https:\/\/github.com/https:\/\/ghproxy.com\/https:\/\/github.com/" feeds.conf.default
    
  4. 更新配置

    git pull
    ./scripts/feeds update -a
    ./scripts/feeds install -a
    make defconfig
    
  5. 生成配置:

    1. Target System (Qualcomm Atheros IPQ807x)
    2. Target Profile (Redmi AX6)
    3. 开启IPv6:Extra packages > ipv6helper
    4. 主题:LuCI > Themes > luci-theme-argon-mod
    5. 插件:LuCI > Applications > 选择需要,Y 选择编译进固件,N 取消
    6. 保存配置
  6. 编译

    make download -j8
    make V=s -j1
    
  7. 云编译
    不需要https://ghproxy.com/加速,很稳定
    https://github.com/HHXinXin/Actions-OpenWrt-Ax6
    3个小时左右。

     cat .config
     #把.config文件替换了,就可以开始编译
    
  8. 其它记录

    make clean #清除上次的make命令所产生的object文件
    make distclean # 类似make clean,但同时也将configure生成的文件全部删除掉,包括Makefile文件。
    ./scripts/feeds clean #删除已经下载的和生成的文件
    
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值