首页
/ OpenWrt 配置项目教程

OpenWrt 配置项目教程

2025-04-15 15:39:53作者:龚格成
.config
# # Automatically generated file; DO NOT EDIT. # OpenWrt Configuration # CONFIG_MODULES=y CONFIG_HAVE_DOT_CONFIG=y # CONFIG_TARGET_sunxi is not set # CONFIG_TARGET_apm821xx is not set # CONFIG_TARGET_ath25 is not set CONFIG_TARGET_ar71xx=y # CONFIG_TARGET_ath79 is not set # CONFIG_TARGET_bcm27xx is not set # CONFIG_TARGET_bcm53xx is not set # CONFIG_TARGET_brcm47xx is not set # CONFIG_TARGET_brcm63xx is not set # CONFIG_TARGET_cns3xxx is not set # CONFIG_TARGET_octeon is not set # CONFIG_TARGET_gemini is not set # CONFIG_TARGET_mpc85xx is not set # CONFIG_TARGET_imx6 is not set # CONFIG_TARGET_mxs is not set # CONFIG_TARGET_ixp4xx is not set # CONFIG_TARGET_lantiq is not set # CONFIG_TARGET_malta is not set # CONFIG_TARGET_pistachio is not set # CONFIG_TARGET_mvebu is not set # CONFIG_TARGET_kirkwood is not set # CONFIG_TARGET_mediatek is not set # CONFIG_TARGET_ramips is not set # CONFIG_TARGET_at91 is not set # CONFIG_TARGET_rb532 is not set # CONFIG_TARGET_tegra is not set # CONFIG_TARGET_layerscape is not set # CONFIG_TARGET_octeontx is not set # CONFIG_TARGET_oxnas is not set # CONFIG_TARGET_armvirt is not set # CONFIG_TARGET_ipq40xx is not set # CONFIG_TARGET_ipq806x is not set # CONFIG_TARGET_ipq807x is not set # CONFIG_TARGET_samsung is not set # CONFIG_TARGET_arc770 is not set # CONFIG_TARGET_archs38 is not set # CONFIG_TARGET_ar7 is not set # CONFIG_TARGET_omap is not set # CONFIG_TARGET_uml is not set # CONFIG_TARGET_zynq is not set # CONFIG_TARGET_x86 is not set CONFIG_TARGET_ar71xx_generic=y # CONFIG_TARGET_ar71xx_tiny is not set # CONFIG_TARGET_ar71xx_nand is not set # CONFIG_TARGET_ar71xx_mikrotik is not set # CONFIG_TARGET_MULTI_PROFILE is not set # CONFIG_TARGET_ar71xx_generic_Default is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_carambola2 is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_lima is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_ALFAAP120C is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_ap121f is not set # CONFIG_TARGET_ar71xx_ge...

1. 项目的目录结构及介绍

本项目是基于 Lean 的 OpenWrt 源代码构建的配置项目。项目目录结构如下:

.config/
├── .github/
│   └── workflows/
│       └── build.yml  # GitHub Actions 自动构建配置文件
├── LICENSE           # 项目许可证文件
├── README.md         # 项目说明文件
├── diy-part1.sh       # DIY 脚本第一部分,用于自定义编译选项
├── diy-part2.sh       # DIY 脚本第二部分,用于自定义固件包
└── build.log         # 构建日志文件
  • .github/workflows/build.yml:GitHub Actions 的配置文件,用于自动化构建过程。
  • LICENSE:项目的许可证文件,本项目遵循 MIT 许可。
  • README.md:项目的说明文件,介绍了项目的使用方法和相关说明。
  • diy-part1.sh:自定义编译选项的脚本,用户可以根据需要修改编译选项。
  • diy-part2.sh:自定义固件包的脚本,用户可以根据需要添加或删除固件包。
  • build.log:构建日志文件,记录构建过程中的详细信息。

2. 项目的启动文件介绍

项目的启动主要是通过 GitHub Actions 自动化构建。以下是启动文件的简要介绍:

  • build.yml:GitHub Actions 的配置文件,定义了构建过程的步骤,包括安装依赖、配置编译环境、编译固件等。

.github/workflows/build.yml 文件中,你可以看到以下内容:

name: Build OpenWrt

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      # 其他构建步骤...

这段代码定义了一个 GitHub Actions 工作流,当用户手动触发 workflow_dispatch 事件时,工作流开始执行。它会在最新的 Ubuntu 环境中运行,首先检出代码,然后执行后续的构建步骤。

3. 项目的配置文件介绍

项目的配置文件主要是 .config 文件,它是 OpenWrt 编译系统的基础配置文件。以下是配置文件的简要介绍:

  • .config:OpenWrt 的配置文件,包含了编译选项、固件包选择等配置信息。

.config 文件中,你可以看到以下内容:

CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y

# 以下为 Target System 的配置,根据实际情况选择
CONFIG_TARGET_ar71xx=y
# CONFIG_TARGET_ath79 is not set
# CONFIG_TARGET_bcm27xx is not set
# CONFIG_TARGET_bcm53xx is not set

# 其他配置...

这个文件定义了编译系统的基础配置,例如是否启用模块化编译、目标系统的选择等。用户可以根据自己的需求修改这个文件,添加或删除固件包,以及调整编译选项。

.config
# # Automatically generated file; DO NOT EDIT. # OpenWrt Configuration # CONFIG_MODULES=y CONFIG_HAVE_DOT_CONFIG=y # CONFIG_TARGET_sunxi is not set # CONFIG_TARGET_apm821xx is not set # CONFIG_TARGET_ath25 is not set CONFIG_TARGET_ar71xx=y # CONFIG_TARGET_ath79 is not set # CONFIG_TARGET_bcm27xx is not set # CONFIG_TARGET_bcm53xx is not set # CONFIG_TARGET_brcm47xx is not set # CONFIG_TARGET_brcm63xx is not set # CONFIG_TARGET_cns3xxx is not set # CONFIG_TARGET_octeon is not set # CONFIG_TARGET_gemini is not set # CONFIG_TARGET_mpc85xx is not set # CONFIG_TARGET_imx6 is not set # CONFIG_TARGET_mxs is not set # CONFIG_TARGET_ixp4xx is not set # CONFIG_TARGET_lantiq is not set # CONFIG_TARGET_malta is not set # CONFIG_TARGET_pistachio is not set # CONFIG_TARGET_mvebu is not set # CONFIG_TARGET_kirkwood is not set # CONFIG_TARGET_mediatek is not set # CONFIG_TARGET_ramips is not set # CONFIG_TARGET_at91 is not set # CONFIG_TARGET_rb532 is not set # CONFIG_TARGET_tegra is not set # CONFIG_TARGET_layerscape is not set # CONFIG_TARGET_octeontx is not set # CONFIG_TARGET_oxnas is not set # CONFIG_TARGET_armvirt is not set # CONFIG_TARGET_ipq40xx is not set # CONFIG_TARGET_ipq806x is not set # CONFIG_TARGET_ipq807x is not set # CONFIG_TARGET_samsung is not set # CONFIG_TARGET_arc770 is not set # CONFIG_TARGET_archs38 is not set # CONFIG_TARGET_ar7 is not set # CONFIG_TARGET_omap is not set # CONFIG_TARGET_uml is not set # CONFIG_TARGET_zynq is not set # CONFIG_TARGET_x86 is not set CONFIG_TARGET_ar71xx_generic=y # CONFIG_TARGET_ar71xx_tiny is not set # CONFIG_TARGET_ar71xx_nand is not set # CONFIG_TARGET_ar71xx_mikrotik is not set # CONFIG_TARGET_MULTI_PROFILE is not set # CONFIG_TARGET_ar71xx_generic_Default is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_carambola2 is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_lima is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_ALFAAP120C is not set # CONFIG_TARGET_ar71xx_generic_DEVICE_ap121f is not set # CONFIG_TARGET_ar71xx_ge...
登录后查看全文
热门项目推荐
相关项目推荐