User Tools

Site Tools


zh:docs:guide-developer:adding_new_device

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
zh:docs:guide-developer:adding_new_device [2018/07/12 08:56]
hejian2150663 [/target/linux/<arch_name>/base-files/etc/…]
zh:docs:guide-developer:adding_new_device [2018/08/10 07:17] (current)
miroky [Tips and tricks]
Line 1: Line 1:
 FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)// FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)//
  
-====== ​添加新设备 ======+====== ​新设备添加OpenWrt支持 ​======
  
-一个好的全面建议是从最近关于添加新设备的提交开始,看哪些文件发生了变化以及如何变更。 许多文件试图尽可能不言自明,大多数时候只是打开它们就足以理解它们的功能。(先机器翻译一次,后面再来修改,“海涵”)+为了全面了解如何添加新设备支持我们建议您查一台新设备相关的最新的commit,摸清楚哪些文件发生了修改和如何修改它们这些文件尽可能不言自明,大多数时候只是打开它们就足以理解它们的功能。(先机器翻译一次,后面再来修改,“海涵”)
  
-===== 实例学习 =====+===== 通过实例进行学习 =====
  
-一个好方法是通过示例学习,我们通过搜索mt300a ​这个版型文件来,找出需要修改的文件,所以你可以这样做:+一个好方法是通过示例学习,我们通过搜索__mt300a__这个版型文件来,找出需要修改的文件,所以你可以这样做:
  
 grep -lri mt300a target/ grep -lri mt300a target/
Line 27: Line 27:
 ===== 重要文件 ===== ===== 重要文件 =====
  
-这是大多数重要文件所在位置的一般目录:+重要文件一般存放于以下目录:
  
 ==== /​target/​linux/<​arch_name>/​base-files/​etc/​… ==== ==== /​target/​linux/<​arch_name>/​base-files/​etc/​… ====
  
-文件夹包含集成在固件中’包含一些重要配置,(/etc/目录+该目录的文件和文件夹最终会存放于设备固件/etc/目录
  
-这些是它的文件和文件:+一般包含下列的文件和文件
  
-  * **…board.d/​** ​用于定义特定于设备的默认硬件的脚本,如LED和网络接口。 +  * **…board.d/​** 定义设备专用的默认硬件的脚本,如LED和网络接口。 
-  * **…hotplug.d/​** ​用于定义特定于设备的操作的脚本这些操作将设备的热插拔时自动完成 +  * **…hotplug.d/​** 定义设备专用的,在插入热插拔设备时自动运行的脚本 
-  * **…init.d/​** ​用于定义在引导时自动完成的特定于设备的操作的脚本 +  * **…init.d/​** 定义设备专用的启动时自动运行的脚本 
-  * **…uci-defaults/​** ​用于定义特定于设备的uci配置默认值的文件 +  * **…uci-defaults/​** 定义设备专用UCI默认设置 
-  * **…diag.sh** ​用于每个板的错误代码的文件+  * **…diag.sh** ​定义设备显示的错误代码
 ==== /​target/​linux/<​arch_name>/​base-files/​lib/​… ==== ==== /​target/​linux/<​arch_name>/​base-files/​lib/​… ====
  
-This folder contains files and folders that will be integrated in the firmware’s ​/lib folder.+该文件夹下的文件夹和文件对应固件中的/lib文件夹。
  
-These are its subfolders and files:+它的子文件夹和文件有:
  
-  * **…<​arch_name>​.sh** ​human-readable full board name associated to script-safe board name +  * **…<​arch_name>​.sh** ​将__阅读友好的设备名__转化为__脚本安全的设备名__的脚本 
-  * **…preinit/​** ​common ​<​arch_name> ​preinit startup scripts +  * **…preinit/​** ​通用<​arch_name>​预初始化脚本 
-  * **…upgrade/​** ​common ​<​arch_name> ​upgrade scripts+  * **…upgrade/​** ​通用<​arch_name>​升级脚本
  
 ==== /​target/​linux/<​arch_name>/​base-files/​sbin ==== ==== /​target/​linux/<​arch_name>/​base-files/​sbin ====
  
-This folder contains files and folders that will be integrated in the firmware’s ​/sbin folderusually common ​<​arch_name>​ sbin scripts and tools.+该文件夹对应固件中的/sbin文件夹一般为通用的<​arch_name>​ sbin脚本和工具.
  
 ==== /​target/​linux/<​arch_name>/​dts/​ ==== ==== /​target/​linux/<​arch_name>/​dts/​ ====
  
-Device tree source files, ​or dts for short.+设备树源文件(Device tree source files, ​简写为dts).
  
 ==== /​target/​linux/<​arch_name>/​image/​ ==== ==== /​target/​linux/<​arch_name>/​image/​ ====
  
-Configuration needed to build device-specific flashable images. +用于构建写入用镜像的设置文件。
 ==== /​target/​linux/<​arch_name>/<​board_name>/​ ==== ==== /​target/​linux/<​arch_name>/<​board_name>/​ ====
  
-Board-specific configuration.+设备专用的设置文件
  
 ==== /​target/​linux/<​arch_name>/​modules.mk ==== ==== /​target/​linux/<​arch_name>/​modules.mk ====
  
-Arch-specific ​kernel module config file for menuconfig+__menuconfig__中使用的架构专用(Arch-specific)配置文件
  
  
-==== Making new device appear in make menuconfig ====+==== 使新设备出现在make menuconfig中 ====
  
-After edit the files aboveyou need to touch the makefiles+在编辑了上述的文件后你需要对Makefile使用touch命令
  
 touch target/​linux/​*/​Makefile touch target/​linux/​*/​Makefile
Line 107: Line 106:
 This will create an image with kernel + initramfs, that will have **initramfs** in the name. The resulting image can be loaded in the device through the bootloader'​s tftp function and should boot to a prompt without relying on flash/​filesystem support. This will create an image with kernel + initramfs, that will have **initramfs** in the name. The resulting image can be loaded in the device through the bootloader'​s tftp function and should boot to a prompt without relying on flash/​filesystem support.
  
-===== Tips and tricks ​=====+===== 豆知识 ​=====
 ==== Getting a shell on the target device ==== ==== Getting a shell on the target device ====
 In order to collect relevant data for a port of LEDE to the device of interest one wants shell access. Most devices though do not offer a way to get a shell with telnet or ssh. In order to collect relevant data for a port of LEDE to the device of interest one wants shell access. Most devices though do not offer a way to get a shell with telnet or ssh.
zh/docs/guide-developer/adding_new_device.1531385773.txt.gz · Last modified: 2018/07/12 08:56 by hejian2150663