萝卜大侠 发表于 2022-7-6 12:46:48

【03.21更新】怎样快速编译出带glinet页面的固件

一直有朋友想在固件中加入自己的东西,同时保留GLINET的UI界面,昨天肝了一天,论坛帖子都没来得及回,终于实现了大家这个诉求。
目前AX1800, AXT1800,MT2500,A1300,MT3000支持集成GLINET的4.x固件,下面是编译及集成步骤(编译环境ubuntu 20.4)
熟悉glinet源码环境的小伙伴特别注意,请仔细核对每一个步骤,以下步骤和之前常规的编译步骤有细微差别

1. 依赖环境安装
sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml如果编译环境没有git账户配置,请执行以下命令配置自己的邮箱和用户名git config --global user.email 'youremail.com'
git config --global user.name 'your name'
2. 克隆最新源代码并部署git clone https://github.com/gl-inet/gl-infra-builder.git
cd gl-infra-builder
根据自己的型号执行相应的配置步骤(执行其中一个即可)
AXT1800 配置python3 setup.py -c configs/config-wlan-ap.yml
cd wlan-ap/openwrt
AX1800 配置
python3 setup.py -c configs/config-wlan-ap.yml
cd wlan-ap/openwrt
MT2500配置python3 setup.py -cconfigs/config-mt798x-7.6.6.1.yml
cd mt798x
A1300配置python3 setup.py -c configs/config-21.02.2.yml
cd openwrt-21.02/openwrt-21.02.2
MT3000配置
python3 setup.py -c configs/config-mt798x-7.6.6.1.yml
cd mt798x


3. 加入自己需要的软件包
    a. 执行完第2步之后,可以通过make menuconfig菜单选择自己的软件包
    b. 或者直接在2步中gen_config的阶段直接加入自己的配置,具体可以参考以下俩个链接
      https://forum.gl-inet.cn/forum.p ... &pid=2710&fromuid=1
      https://forum.gl-inet.cn/forum.p ... id=6&extra=page%3D1

4. 克隆glinet私有软件包(我这里克隆下来存放在/home/glinet/work/glinet4.x目录,这个目录非常重要,下一步编译会用到)
git clone https://github.com/gl-inet/glinet4.x.git5. 编译(编译时通过GL_PKGDIR参数指定GLINTE私有软件包的绝对路径,我的glinet4.x克隆在源码的同级目录,后面跟的子目录代表芯片方案)
根据自己的型号选择编译(执行其中一个即可)
AX1800cp ./glinet4.x/pkg_config/gl_pkg_config_ax1800.mk./glinet4.x/ipq60xx/gl_pkg_config.mk
cp ./glinet4.x/pkg_config/glinet_depends_ax1800.yml./profiles/glinet_depends.yml
./scripts/gen_config.py glinet_depends
make V=s -j5 GL_PKGDIR=`pwd`/glinet4.x/ipq60xx/
AXT1800cp ./glinet4.x/pkg_config/gl_pkg_config_axt1800.mk./glinet4.x/ipq60xx/gl_pkg_config.mk
cp ./glinet4.x/pkg_config/glinet_depends_axt1800.yml./profiles/glinet_depends.yml
./scripts/gen_config.py glinet_depends
make V=s -j5 GL_PKGDIR=`pwd`/glinet4.x/ipq60xx/

MT2500cp ./glinet4.x/pkg_config/gl_pkg_config_mt2500.mk./glinet4.x/mt7981/gl_pkg_config.mk
cp ./glinet4.x/pkg_config/glinet_depends_mt2500.yml./profiles/glinet_depends.yml
./scripts/gen_config.py glinet_depends
make V=s -j5 GL_PKGDIR=`pwd`/glinet4.x/mt7981/mt3000
cp ./glinet4.x/pkg_config/gl_pkg_config_mt3000.mk./glinet4.x/mt7981/gl_pkg_config.mk
cp ./glinet4.x/pkg_config/glinet_depends_mt3000.yml./profiles/glinet_depends.yml
./scripts/gen_config.py glinet_depends
make -j5 V=s GL_PKGDIR=`pwd`/glinet4.x/mt7981/
A1300
cp ./glinet4.x/pkg_config/gl_pkg_config_a1300.mk./glinet4.x/ipq40xx/gl_pkg_config.mk
cp ./glinet4.x/pkg_config/glinet_depends_a1300.yml./profiles/glinet_depends.yml
./scripts/gen_config.py glinet_depends
make V=s -j5 GL_PKGDIR=`pwd`/glinet4.x/ipq40xx/
6. 镜像文件
    a. 编译完成后可以在bin/targets/ipq807x/ipq60xx/目录下找到编译好的镜像文件,镜像文件的使用请参考其他主题帖 第二点描述的内容
    b. 编译出来的镜像不包含glinet的版本信息以及签名信息,因此,glinet总是可以识别出镜像是否为第三方编译
    c. 除b点中提到的不同,理论上固件其他功能与glinet的界面完全一样,如果发现其他问题,请在帖子中报告给我,我会及时修复

7.效果演示


8. 视频教程
不具备编译环境的小伙伴可以参考github云编译视频教程
https://www.bilibili.com/video/B ... id_from=333.999.0.0

更新记录
2022.10.20 更新私有包到4.1.0版本
2022.11.14 支持MT2500
2023.1.16 添加nas相关依赖,添加A1300
2023.1.29 支持MT3000
2023.03.21 支持4.2.0版本编译,统一编译命令流程2023.03.22 mt7981目录变更为mt798x






















liuasktao 发表于 2025-3-12 16:49:18


很好,感谢大佬

Easonll 发表于 2023-11-4 15:31:31

试着学习自己编译吧、适合自己的才是最好的

Easonll 发表于 2023-11-4 14:37:11

很好,感谢大佬

sinavis 发表于 2023-6-13 03:52:54

很好,感谢大佬

Justin 发表于 2023-5-31 22:33:30

很好,感谢大佬

萝卜大侠 发表于 2023-5-30 20:27:15

山语 发表于 2023-5-30 15:41
drivers/crypto/msm/ice.c:1461:12: error: 'disable_ice_setup' defined but not used [-Werror=unused-fu ...

看错误提示,把不用的函数去掉应该就可以了

山语 发表于 2023-5-30 15:41:14

drivers/crypto/msm/ice.c:1461:12: error: 'disable_ice_setup' defined but not used [-Werror=unused-function]
static int disable_ice_setup(struct ice_device *ice_dev)
            ^~~~~~~~~~~~~~~~~
drivers/crypto/msm/ice.c:1404:12: error: 'enable_ice_setup' defined but not used [-Werror=unused-function]
static int enable_ice_setup(struct ice_device *ice_dev)
            ^~~~~~~~~~~~~~~~
drivers/crypto/msm/ice.c:1383:27: error: 'get_ice_device_from_storage_type' defined but not used [-Werror=unused-function]
static struct ice_device *get_ice_device_from_storage_type
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** Error 1
make: *** Error 2
make: *** Error 2
make: *** Error 2

编译到这里出错了,怎么解决啊?

hansome 发表于 2023-4-19 20:13:50

hghghg 发表于 2023-4-15 10:28
这个写的感觉有点乱,第2步里哪里有gen_config啊,第3步点进去也没几个软件包能选 ...

cd 到openwrt编译目录先

hghghg 发表于 2023-4-15 10:28:40

这个写的感觉有点乱,第2步里哪里有gen_config啊,第3步点进去也没几个软件包能选:L

jafarm 发表于 2023-3-24 21:05:53

编译的时候,如何配置不带编译出glinet imagebuilder么,GitHub 的 actions空间不够用了:'(

jafarm 发表于 2023-3-21 11:30:30

萝卜大侠 发表于 2023-3-21 11:26
不需要再加

ok{:6_208:}

萝卜大侠 发表于 2023-3-21 11:26:59

jafarm 发表于 2023-3-21 10:58
感谢~,话说glinet_nas配置不用再加入了么

不需要再加

jafarm 发表于 2023-3-21 10:58:02

萝卜大侠 发表于 2023-3-21 10:36
是的,已经更新了帖子

感谢~,话说glinet_nas配置不用再加入了么

萝卜大侠 发表于 2023-3-21 10:36:19

jafarm 发表于 2023-3-21 10:10
现在应该变了编译方式吧,MT2500直接是

是的,已经更新了帖子

jafarm 发表于 2023-3-21 10:10:38

现在应该变了编译方式吧,MT2500直接是
git clone https://github.com/gl-inet/gl-infra-builder.git && cd gl-infra-builder
python3 setup.py -c configs/config-mt798x-7.6.6.1.yml

git clone https://github.com/gl-inet/glinet4.x.git
cp ./glinet4.x/pkg_config/gl_pkg_config_mt2500.mk./glinet4.x/mt7981/gl_pkg_config.mk
cp ./glinet4.x/pkg_config/glinet_depends_mt2500.yml./profiles/glinet_depends.yml
cd mt7981
./scripts/gen_config.py glinet_depends

make V=s -j5 GL_PKGDIR=`pwd`/glinet4.x/mt7981/

duke 发表于 2023-3-19 13:11:08

设置下面的参数, 允许root编译

export FORCE_UNSAFE_CONFIGURE=1

7918 发表于 2023-3-17 10:02:41

萝卜大侠 发表于 2023-3-16 19:45
./scripts/gen_config.py target_wlan_ap-gl-axt1800 glinet_depends glinet_nas可以换成
./scripts/gen_ ...

大侠,是不是cd gl-infra-builder后,gitpull更新,
不用执行python3 setup.py -c configs/config-wlan-ap.yml这一步

直接cd wlan-ap/openwrt
./scripts/gen_config.py target_wlan_ap-gl-axt1800 glinet_depends glinet_nas添加keepfeeds就可以继续make编译了

以上所说步骤都是在已经编译过官方更新的基础上需要执行的

萝卜大侠 发表于 2023-3-16 19:45:42

7918 发表于 2023-3-16 09:34
求助萝卜大侠

./scripts/gen_config.py target_wlan_ap-gl-axt1800 glinet_depends glinet_nas可以换成
./scripts/gen_config.py keepfeeds target_wlan_ap-gl-axt1800 glinet_depends glinet_nas
这样快很多

7918 发表于 2023-3-16 09:34:59

萝卜大侠 发表于 2023-3-14 09:38
DOCKER肯定也是可以的,之前尝试过,但其实问题更多

求助萝卜大侠

7918 发表于 2023-3-14 14:43:52

萝卜大侠,进入cd gl-infra-builder之后,每次更新,gitpull,正常拉取以后,python3 setup.py -c configs/config-wlan-ap.yml
cd wlan-ap/openwrt
./scripts/gen_config.py target_wlan_ap-gl-axt1800 glinet_depends glinet_nas,,还需要做什么吗?每还是每次都要从新上述步骤从头开始,从头开始效率太低了
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: 【03.21更新】怎样快速编译出带glinet页面的固件