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
docs:guide-developer:toolchain:using_the_sdk [2021/10/15 11:44] – [Using the SDK] vgaeteradocs:guide-developer:toolchain:using_the_sdk [2022/04/21 18:11] (current) – [Downloads] updated referenced versions tatami
Line 16: Line 16:
  
 <WRAP important> <WRAP important>
-  * Do everything as a normal user: do not log in as root and do not use sudo. +  * Do everything as an unprivileged usernot root, without sudo. 
-  * Do not build in a directory that has spaces in its full path.+  * Make sure there are no spaces in the full path to the build directory.
 </WRAP> </WRAP>
  
 ===== Obtain the SDK ===== ===== Obtain the SDK =====
- +You can either download a precompiled SDK or compile it yourself from sources. 
-You can either download a precompiled SDK or compile it yourself from sources. Compilation from source is done by simply enabling the menuconfig option ''Build the OpenWrt SDK'' (CONFIG_SDK).+Compilation from source is done by simply enabling the menuconfig option ''Build the OpenWrt SDK'' (CONFIG_SDK).
 The precompiled SDK is found in the same download folder where you find the firmware images for your device. The precompiled SDK is found in the same download folder where you find the firmware images for your device.
- 
  
 ==== Downloads ==== ==== Downloads ====
- 
   * [[https://downloads.openwrt.org/snapshots/targets/| development snapshot SDK]] ->  [[docs:platforms:start|Platforms]] -> Supplementary Files -> openwrt-sdk-<Platform>_gcc-<version>_musl.Linux-x86_64.tar.xz   * [[https://downloads.openwrt.org/snapshots/targets/| development snapshot SDK]] ->  [[docs:platforms:start|Platforms]] -> Supplementary Files -> openwrt-sdk-<Platform>_gcc-<version>_musl.Linux-x86_64.tar.xz
-  * [[https://downloads.openwrt.org/releases/21.02.0/targets/| 21.02.0]] -> [[docs:platforms:start|Platforms]] -> Supplementary Files -> openwrt-sdk-<Platform>_gcc-<version>_musl.Linux-x86_64.tar.xz +  * [[https://downloads.openwrt.org/releases/21.02.3/targets/| 21.02.3]] -> [[docs:platforms:start|Platforms]] -> Supplementary Files -> openwrt-sdk-<Platform>_gcc-<version>_musl.Linux-x86_64.tar.xz 
-  * [[https://downloads.openwrt.org/releases/19.07.7/targets/| 19.07.7]] -> [[docs:platforms:start|Platforms]] -> Supplementary Files -> openwrt-sdk-<Platform>_gcc-<version>_musl.Linux-x86_64.tar.xz+  * [[https://downloads.openwrt.org/releases/19.07.10/targets/| 19.07.10]] -> [[docs:platforms:start|Platforms]] -> Supplementary Files -> openwrt-sdk-<Platform>_gcc-<version>_musl.Linux-x86_64.tar.xz
  
- +==== Package feeds ==== 
- +After decompressing the SDK archive, optionally edit the ''feeds.conf.default'' file to add your package feeds. 
-==== Package Feeds ==== +By default, this will contain the feeds used when the SDK was built. 
- +You can add your own feeds, local or remote, just like using the buildroot. 
-After decompressing the SDK archive, optionally edit the ''feeds.conf.default'' file to add your package feeds.  By default, this will contain the feeds used when the SDK was built. You can add your own feeds, local or remote, just like using the buildroot.  If you are simply rebuilding extra packages, you don't need to do this at all.+If you are simply rebuilding extra packages, you don't need to do this at all.
  
 NOTE: if you want to override packages coming from an existing feed, you must write your custom feed ABOVE the line of the package feed containing the packages you want to override.\\ NOTE: if you want to override packages coming from an existing feed, you must write your custom feed ABOVE the line of the package feed containing the packages you want to override.\\
 For example, you want to make a custom version of a package that is already shipped in Packages feed, this is how your **feeds.conf.default** will look like (the first line is your own custom package feed) For example, you want to make a custom version of a package that is already shipped in Packages feed, this is how your **feeds.conf.default** will look like (the first line is your own custom package feed)
  
-<code>+<code bash>
 src-link local /path/to/local/custom/feed src-link local /path/to/local/custom/feed
 src-git packages https://git.openwrt.org/feed/packages.git src-git packages https://git.openwrt.org/feed/packages.git
Line 52: Line 50:
 #src-link custom /usr/src/openwrt/custom-feed #src-link custom /usr/src/openwrt/custom-feed
 </code> </code>
-==== Load package lists ==== 
  
 +==== Load package lists ====
   * Use ''./scripts/feeds update -a'' command to obtain and update package definitions.   * Use ''./scripts/feeds update -a'' command to obtain and update package definitions.
- 
   * After the definitions have been updated, ''./scripts/feeds install <packagename>'' to prepare the package and its dependencies.   * After the definitions have been updated, ''./scripts/feeds install <packagename>'' to prepare the package and its dependencies.
  
 ''./scripts/feeds install -a'' will make all packages available, again, just like in the buildroot. ''./scripts/feeds install -a'' will make all packages available, again, just like in the buildroot.
- 
  
 ===== Usage ===== ===== Usage =====
 +==== Select packages ====
 +Open a terminal in the SDK's folder and then open the SDK's menu by writing ''make menuconfig''.
 +The SDK menuconfig system is the same as the buildroot.
 +Instructions are at the top and help is available via the ''?'' key.
  
- +You //probably// want to disable some default settings, which build every available package.
-==== Select Packages ==== +
- +
-Open a terminal in the SDK's folder and then open the SDK's menu by writing ''make menuconfig''  The SDK menuconfig system is the same as the buildroot.  Instructions are at the top and help is available via the ''?'' key. +
- +
-You //probably// want to disable some default settings, which build every available package.  +
 Enter ''Global Build Settings'' and in the submenu, deselect/exclude the following options: Enter ''Global Build Settings'' and in the submenu, deselect/exclude the following options:
   * ''Select all target specific packages by default''   * ''Select all target specific packages by default''
Line 74: Line 69:
   * ''Select all userspace packages by default''   * ''Select all userspace packages by default''
  
-Still in the menu, find the package you want to build and select it by pressing "m", this will also select all the dependencies, and you will see that they are all tagged with "<M>" in the menu. You can select multiple packages too.+Still in the menu, find the package you want to build and select it by pressing "m", this will also select all the dependencies, and you will see that they are all tagged with "<M>" in the menu. 
 +You can select multiple packages too.
  
-Save the configuration and exit the menu.  +Save the configuration and exit the menu.
- +
- +
-==== Compile Packages ====+
  
 +==== Compile packages ====
 After the Makefile is in place, the usual buildroot commands apply: After the Makefile is in place, the usual buildroot commands apply:
- 
   * ''make package///example///download'' - download the soures of //example//   * ''make package///example///download'' - download the soures of //example//
   * ''make package///example///prepare'' - extract the sources, apply patches and download if necessary   * ''make package///example///prepare'' - extract the sources, apply patches and download if necessary
Line 89: Line 82:
   * ''make package/index'' - build a repository index to make the output directory usable as local //opkg// source   * ''make package/index'' - build a repository index to make the output directory usable as local //opkg// source
  
-Or, just run ''make'' to build everything selected.  (You can compile faster by writing ''make -j5'' or similar as appopriate for your build host)+Or, just run ''make'' to build everything selected. 
 +You can compile faster by writing ''make -j5'' or similar as appropriate for your build host.
  
 After the compilation is finished, the generated .ipk files are placed in the bin/packages and bin/targets directories inside the directory you extracted the SDK into. After the compilation is finished, the generated .ipk files are placed in the bin/packages and bin/targets directories inside the directory you extracted the SDK into.
  
- 
-===== Troubleshooting ===== 
- 
-:!: Some SDK versions have bugs.... 
  • Last modified: 2021/10/15 11:44
  • by vgaetera