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
Next revisionBoth sides next revision
ru:docs:guide-developer:adding_new_device [2019/12/30 09:00] – [/target/linux/<arch_name>/base-files/lib/…] mkobyakovru:docs:guide-developer:adding_new_device [2019/12/30 10:20] – [Testing images] mkobyakov
Line 55: Line 55:
 ==== /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.+Эта папка содержит файлы и папки, которые будут интегрированы в папку firmware /sbin, обычно общие < arch_name> сценарии и инструменты sbin.
  
 ==== /target/linux/<arch_name>/dts/ ==== ==== /target/linux/<arch_name>/dts/ ====
  
-Device tree source filesor dts for short.+Исходные файлы дерева устройствили сокращенно dts.
  
-//Certain architectures have the DTS directory deeper down. ARM devicesfor exampletypically have it located at ''files-X.yy/arch/arm/boot/dts/''//+//Некоторые архитектуры имеют каталог DTS глубже внизУстройства ARM, напримеробычно имеют его расположение на''files-X.yy/arch/arm/boot/dts/''//
  
-//If the DTS or DTSI file is already present in upstream Linux, they will usually not be present in the OpenWrt sourceConfiguring for the target and running ''make target/linux/{clean,prepare}'' will download and patch Linux, allowing the resulting file to be found in the ''build_dir''//+//Если файл DTS или DTSI уже присутствует в вышестоящем Linux, они обычно не будут присутствовать в исходном коде OpenWrt. Настройка для целевого объекта и запуск''make target/linux/{clean,prepare}'' будет скачиваться и исправляться Linux, что позволит найти полученный файл в ''build_dir''//
 ==== /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+Arch- специфичный файл конфигурации ядра для менюконфиг 
 += = = = Создание нового устройства в make menuconfig ====
  
-==== Making new device appear in make menuconfig ==== +После редактирования файловуказанных выше, вы должны ввести команду
- +
-After edit the files aboveyou need to touch the makefiles+
  
   touch target/linux/*/Makefile   touch target/linux/*/Makefile
  
-===== Patches ===== +===== Патчи ===== 
-The patches-* subdirectories contain the kernel patches applied for every target.\\  +Подкаталоги patches-* содержат патчи ядра, применяемые для каждого целевого объекта.\\  
-All patches should be named 'NNN-lowercase_shortname.patch' and sorted into the following categories:+Все патчи должны быть названы 'NNN-lowercase_short name.patch" и отсортированы по следующим категориям:
  
-**0xx** - upstream backports\\ +**0xx** - бэкпортов вверх \\ 
-**1xx** - code awaiting upstream merge\\ +**1xx** - код, ожидающий слияния в восходящем потоке\\ 
-**2xx** - kernel build config header patches\\ +**2xx* * - патчи для сборки ядра конфигурации заголовков\\ 
-**3xx** - architecture specific patches\\ +**3xx* * - патчи, специфичные для архитектуры\\ 
-**4xx** - mtd related patches (subsystem and drivers)\\ +**4xx* * - патчи, связанные с mtd (подсистема и драйверы)\\ 
-**5xx** - filesystem related patches\\ +****5xx* * - патчи, связанные с файловой системой\\ 
-**6xx** - generic network patches\\ +**6xx* * - общие сетевые патчи\\ 
-**7xx** - network / phy driver patches\\ +**7xx* * - патчи сетевых / phy драйверов\\ 
-**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 upstreamablemeaning:+Все патчи должны быть написаны таким образомчтобы они были потенциально доступны для распространения, т. е.:
  
   - they must contain a **proper subject**   - they must contain a **proper subject**
Line 105: Line 104:
 </WRAP> </WRAP>
  
-===== Testing images ===== += = = = = Тестирование изображений ==== =  
-Test firmware images without writing them to flash by using ramdisk images.+Тестовые изображения прошивки без записи их в Flash при использовании RAMDisk изображений.
  
-In **make menuconfig** select **Target Images** and then you can select the **ramdisk** option. +В * * make menuconfig * * выберите * * целевые изображения**, а затем вы можете выбрать опцию * * ramdisk**.
- +
-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.+
  
 +Это создаст образ с ядром + initramfs, который будет иметь **initramfs** в имени. Полученный образ может быть загружен в устройство через функцию bootloader tftp и должен загрузиться в приглашение, не полагаясь на поддержку flash/файловой системы.
 ===== Tips and tricks ===== ===== Tips and tricks =====
 ==== Getting a shell on the target device ==== ==== Getting a shell on the target device ====
Line 144: Line 142:
 With [[https://github.com/jclehner/nmrpflash|nmrpflash]] many Netgear devices can be flashed. Devices that are compatible with this tool become effectively unbrickable. With [[https://github.com/jclehner/nmrpflash|nmrpflash]] many Netgear devices can be flashed. Devices that are compatible with this tool become effectively unbrickable.
  
-==== Collecting relevant data ==== += = = = Сбор соответствующих данных ==== 
-On [[https://wikidevi.com/wiki/Main_Page|WikiDevi]] lots of information can be founde.g. the FCC ID is very useful when searching for documentationdatasheets and internal photo'(to be able to distinguish used chips without having to open the casing).+На [[https://wikidevi.com/wiki/Main_Page/WikiDevi]] можно найти много информациинапример, идентификатор FCC очень полезен при поиске документацииописаний и внутренних фотографий (чтобы иметь возможность различать используемые чипы без необходимости открывать корпус).
  
-Typically one can use the following commands:+Обычно можно использовать следующие команды:
  
 <code bash> <code bash>
Line 164: Line 162:
 </code> </code>
  
-**Note 1:** Often the log buffer is to small and the earliest messages may be missing from the information retrieved with ''dmesg''If one build a stock image from the sources the vendor has publisheda larger buffer size can be set within the kernel config. +** Примечание 1: * * часто буфер журнала слишком мал, и самые ранние сообщения могут отсутствовать в информации, полученной с помощью "dmesg"Если вы создаете исходное изображение из источниковопубликованных поставщиком, то в конфигурации ядра можно установить больший размер буфера.
- +
-**Note 2:** [[http://lxr.free-electrons.com/source/Documentation/ABI/testing/sysfs-class-mtd]]+
  
-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/ABI/testing/sysfs-class-mtd]]
  
 +Еще одним полезным инструментом для получения информации для настройки светодиодов может быть [[https://github.com/jclehner/gpiodump-mt7620/gpiodump]], Дампер регистра MT7620 GPIOMODE (RAMIPS).
 ==== Getting collected data from a device ==== ==== Getting collected data from a device ====
 Because of the limited space, common file transfer utilities such as rsync/curl/ssh/scp/ftp/http/tftp may not be available, a stripped down version/applet may be available from busybox. Because of the limited space, common file transfer utilities such as rsync/curl/ssh/scp/ftp/http/tftp may not be available, a stripped down version/applet may be available from busybox.
  • Last modified: 2020/01/01 13:36
  • by mkobyakov