adding "device support" dev documentation
[web.git] / docs / development_new_device.txt
1 === Adding a new device
2
3 A good all-round advice would be to start by looking at recent commits about adding a new device, to see what files where changed and how.
4 Many files try to be as self-explanatory as possible, most of the times just opening them will be enough to understand their function.
5
6
7 This is a general map of where most important files are located:
8
9 ==== /target/linux/<arch_name>/base-files/etc/...
10 This folder contains files and folders that will be integrated in the firmware's /etc folder.
11
12 These are its subfolders and files:
13
14 * **...board.d/** scripts for defining device-specific default hardware, like leds and network interfaces.
15 * **...hotplug.d/** scripts for defining device-specific actions to be done automatically on hotplugging of devices
16 * **...init.d/** scripts for defining device-specific actions to be done automatically on boot
17 * **...uci-defaults/** files for defining device-specific uci configuration defualts
18 * **...diag.sh** defines what is the led to use for error codes for each board
19
20 === /target/linux/<arch_name>/base-files/lib/...
21 This folder contains files and folders that will be integrated in the firmware's /lib folder.
22
23 These are its subfolders and files:
24
25 * **...<arch_name>.sh** human-readable full board name associated to script-safe board name
26 * **...preinit/** common <arch_name> preinit startup scripts
27 * **...upgrade/** common <arch_name> upgrade scripts
28
29 === /target/linux/<arch_name>/base-files/sbin
30 This folder contains files and folders that will be integrated in the firmware's /sbin folder, usually common <arch_name> sbin scripts and tools.
31
32 ==== /target/linux/<arch_name>/dts/
33 Device tree source files, or dts for short.
34
35 === /target/linux/<arch_name>/image/
36 Configuration needed to build device-specific flashable images.
37
38 === /target/linux/<arch_name>/<board_name>/
39 Board-specific configuration.
40
41 === /target/linux/<arch_name>/modules.mk
42 Arch-specific kernel module config file for menuconfig