Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| ru:docs:guide-developer:adding_new_device [2019/12/27 15:46] – [Search by grep locally] mkobyakov | ru:docs:guide-developer:adding_new_device [2019/12/30 10:20] – [Testing images] mkobyakov | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Добавление нового устройства ====== | ====== Добавление нового устройства ====== | ||
| - | Хорошим всесторонним советом было бы начать с просмотра недавних коммитов о добавлении нового устройства, | + | Хорошим всесторонним советом было бы начать с просмотра недавних комментариев о добавлении нового устройства, |
| ===== Учитесь на примере ===== | ===== Учитесь на примере ===== | ||
| Line 24: | Line 24: | ||
| </ | </ | ||
| - | ==== Search by Git commit ==== | + | ==== Поиск по git commit ==== |
| - | [[https:// | + | [[https:// |
| + | ===== Важный файлы ===== | ||
| - | ===== Important files ===== | + | Это общая карта расположения наиболее важных файлов: |
| - | + | ||
| - | This is a general map of where most important files are located: | + | |
| ==== / | ==== / | ||
| - | This folder contains files and folders that will be integrated in the firmware’s /etc folder. | + | Эта папка содержит файлы и папки, которые будут интегрированы в папку |
| - | These are its subfolders and files: | + | Это его вложенные папки и файлы: |
| - | * **…board.d/ | + | * **…board.d/ |
| - | * **…hotplug.d/ | + | * **…hotplug.d/ |
| - | * **…init.d/ | + | * **…init.d/ |
| - | * **…uci-defaults/ | + | * **…uci-defaults/ |
| - | * **…diag.sh** | + | * **…diag.sh** |
| - | + | | |
| - | //Note that some of these functions are now done in the DTS for the board.// | + | //Обратите внимание, |
| ==== / | ==== / | ||
| - | This folder contains files and folders that will be integrated in the firmware’s /lib folder. | + | Эта папка содержит файлы и папки, которые будут интегрированы в папку |
| - | + | ||
| - | These are its subfolders and files: | + | |
| - | * **…< | + | Это его вложенные папки и файлы: |
| - | * **…preinit/ | + | |
| - | * **…upgrade/ | + | |
| + | * **…< | ||
| + | * **…preinit/ | ||
| + | * **…upgrade/ | ||
| ==== / | ==== / | ||
| - | This folder contains files and folders that will be integrated in the firmware’s /sbin folder, usually common | + | Эта папка содержит файлы и папки, которые будут интегрированы в папку |
| ==== / | ==== / | ||
| - | Device tree source files, or dts for short. | + | Исходные файлы дерева устройств, или сокращенно |
| - | //Certain architectures have the DTS directory deeper down. ARM devices, for example, typically have it located at '' | + | //Некоторые архитектуры имеют каталог |
| - | //If the DTS or DTSI file is already present in upstream | + | //Если файл |
| ==== / | ==== / | ||
| - | Configuration needed to build device-specific flashable images. | + | Конфигурация, |
| ==== / | ==== / | ||
| - | Board-specific configuration. | + | Конфигурация для конкретной платы. |
| ==== / | ==== / | ||
| - | Arch-specific kernel module config file for menuconfig | + | Arch- специфичный файл конфигурации ядра для менюконфиг |
| + | = = = = Создание нового устройства в make menuconfig | ||
| - | ==== Making new device appear in make menuconfig ==== | + | После редактирования файлов, указанных выше, вы должны ввести команду |
| - | + | ||
| - | After edit the files above, you need to touch the makefiles | + | |
| touch target/ | touch target/ | ||
| - | ===== Patches | + | ===== Патчи |
| - | The patches-* | + | Подкаталоги |
| - | All patches should be named 'NNN-lowercase_shortname.patch' and sorted into the following categories: | + | Все патчи должны быть названы |
| - | **0xx** - upstream backports\\ | + | **0xx** - бэкпортов вверх |
| - | **1xx** - code awaiting upstream merge\\ | + | **1xx** - код, ожидающий слияния в восходящем потоке\\ |
| - | **2xx** - kernel build / config | + | **2xx* * - патчи для сборки ядра |
| - | **3xx** - architecture specific patches\\ | + | **3xx* * - патчи, специфичные для архитектуры\\ |
| - | **4xx** - mtd related patches | + | **4xx* * - патчи, связанные с mtd (подсистема и драйверы)\\ |
| - | **5xx** - filesystem related patches\\ | + | ****5xx* * - патчи, связанные с файловой системой\\ |
| - | **6xx** - generic network patches\\ | + | **6xx* * - общие сетевые патчи\\ |
| - | **7xx** - network | + | **7xx* * - патчи сетевых |
| - | **8xx** - other drivers\\ | + | **8xx** - другие драйверы\\ |
| - | **9xx** - uncategorized other patches\\ | + | **9xx* * - другие патчи без категорий\\ |
| <WRAP center round tip 80%> | <WRAP center round tip 80%> | ||
| - | All patches must be written in a way that they are potentially upstreamable, meaning: | + | Все патчи должны быть написаны таким образом, чтобы они были потенциально доступны для распространения, |
| - they must contain a **proper subject** | - they must contain a **proper subject** | ||
| Line 107: | Line 104: | ||
| </ | </ | ||
| - | ===== Testing images | + | = = = = = Тестирование изображений |
| - | Test firmware images without writing them to flash by using ramdisk images. | + | Тестовые изображения прошивки без записи их в Flash при использовании RAMDisk изображений. |
| - | In **make menuconfig** | + | В * * make menuconfig * * выберите |
| - | + | ||
| - | 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' | + | |
| + | Это создаст образ с ядром + initramfs, который будет иметь **initramfs** в имени. Полученный образ может быть загружен в устройство через функцию bootloader tftp и должен загрузиться в приглашение, | ||
| ===== Tips and tricks ===== | ===== Tips and tricks ===== | ||
| ==== Getting a shell on the target device ==== | ==== Getting a shell on the target device ==== | ||
| Line 146: | Line 142: | ||
| With [[https:// | With [[https:// | ||
| - | ==== Collecting relevant data ==== | + | = = = = Сбор соответствующих данных |
| - | On [[https:// | + | На [[https:// |
| - | Typically one can use the following commands: | + | Обычно можно использовать следующие команды: |
| <code bash> | <code bash> | ||
| Line 166: | Line 162: | ||
| </ | </ | ||
| - | **Note 1:** Often the log buffer is to small and the earliest messages may be missing from the information retrieved with '' | + | ** Примечание |
| - | + | ||
| - | **Note 2:** [[http:// | + | |
| - | Another useful tool for getting information for setting LEDs might be [[https://github.com/jclehner/gpiodump-mt7620|gpiodump]], a MT7620 GPIOMODE register dumper (RAMIPS). | + | ** Примечание 2:* * [[http://lxr.free-electrons.com/source/Documentation/ |
| + | Еще одним полезным инструментом для получения информации для настройки светодиодов может быть [[https:// | ||
| ==== Getting collected data from a device ==== | ==== Getting collected data from a device ==== | ||
| Because of the limited space, common file transfer utilities such as rsync/ | Because of the limited space, common file transfer utilities such as rsync/ | ||