openwrt系统移植
在GitHub中找到最新的openwrt源码。
GitHub网站:GitHub - openwrt/openwrt at v22.03.5
下载openwrt-22.03.5稳定发行版源码:
git clone https://github.com/openwrt/openwrt.git
这样操作需要切换分支,还有一种方法就是直接下载源码包,直接解压即可。本次采用的为下载源码包,同样在GitHub网址中有下载链接。
更新feeds
Feeds是OpenWrt源代码中的一个重要部分,它是一组软件包源代码的集合,包含了许多常用的软件包和工具。
Feeds的作用是为OpenWrt提供软件包编译和打包的支持。通过Feeds,用户可以轻松地添加、删除或更新软件包,以满足自己的需求。Feeds中包含了许多常用的软件包和工具,例如网络服务、文件系统、编程语言、多媒体等,用户可以根据自己的需要选择适合自己的软件包进行编译和安装。
Feeds的源代码存储在OpenWrt源代码的package目录下,每个Feeds都有一个对应的Makefile文件,用于指定软件包的编译选项和依赖关系。用户在编译OpenWrt时,可以选择编译某个Feeds中的软件包,也可以自定义添加新的Feeds和软件包。
总之,Feeds是OpenWrt源代码中的一个重要组成部分,提供了丰富的软件包和工具,方便用户进行定制和扩展。
./scripts/feeds update -a
./scripts/feeds install -a
接下来是 OpenWRT 官方源码的编译
配置内核
make menuconfig #开始配置内核
注:
- 内核配置参考ls1046的openwrt系统配置即可。
- 在openwrt源码中有自己的交叉编译器,所以直接make即可。
在源码下执行make menuconfig之后的首选配置
首先是平台相关的必要配置:
Target System (NXP Layerscape)
Subtarget (ARMv8 64-bit based boards)
Target Profile (NXP LS1043A-RDB Default)
然后是启用LUCI web图形界面
-> LuCI
-> 1. Collections
<*> luci................... LuCI interface with Uhttpd as Webserver (default)
内核模块打开ath10k和iwlwifi驱动的支持,其他的依赖项会自动选择
-> Kernel modules
-> Wireless Drivers
-*- kmod-ath...................................... Atheros common driver part --->
<*> kmod-ath10k...................... Atheros 802.11ac wireless cards support
-*- kmod-cfg80211...................... cfg80211 - wireless configuration API
<*> kmod-iwlwifi.................................. Intel AGN Wireless support --->
-*- kmod-mac80211..................... Linux 802.11 Wireless Networking Stack --->
启用hostapd和wpa-supplicant,还有ethtool
-> Network
<*> ethtool......................... Display or change ethernet card settings
<*> iperf3........................ Internet Protocol bandwidth measuring tool
-> Network
-> WirelessAPD
<*> hostapd........................ IEEE 802.1x Authenticator (built-in full)
-*- hostapd-common............... hostapd/wpa_supplicant common support files
<*> wpa-supplicant............................................ WPA Supplicant
增加QCA988x和iwlwifi固件的选择
-> Firmware
<*> ath10k-firmware-qca988x.............. ath10k firmware for QCA988x devices
<*> iwlwifi-firmware-iwl3168.................... Intel Wireless 3168 firmware
<*> iwlwifi-firmware-iwl8260c.......... Intel Wireless 8260 and 4165 firmware
<*> iwlwifi-firmware-iwl9260.................... Intel Wireless 9260 firmware
添加对gpio-leds的支持,支持控制灯或者上电引脚
-> Kernel modules
-> LED modules
<*> kmod-leds-gpio.......................................... GPIO LED support
选择一些我们常用的命令
-> Base system
-> busybox................................ Core utilities for embedded Linux (PACKAGE_busybox [=y])
-> Linux Module Utilities
[*] insmod
[*] lsmod
[*] rmmod
-> Linux System Utilities
[*] lspci
[*] lsusb
再安装一个docker
-> Utilities
<*> docker-compose............................................ Docker Compose
<*> dockerd.................................. Docker Community Edition Daemon --->
[*] Enable available kernel support for CGroupsV1
[*] Enable optional kernel support for Docker
Network --->
下面的全选
Storage --->
下面的全选
设置OpenWRT的系统语言支持
LuCI --->
2. Modules --->
Translations --->
<*> English (en)
<*> Chinese Simplified (zh_Hans)
安装一些luci app
LuCI --->
3. Applications --->
<*> luci-app-aria2.................................... LuCI Support for Aria2
<*> luci-app-dockerman............................... LuCI Support for docker
<*> luci-app-samba4..