Difference between revisions of "OpenWRT and Compiling"

m
no edit summary
m
m
Line 11: Line 11:
****...and finally an index to all development articles: https://openwrt.org/docs/guide-developer/start
****...and finally an index to all development articles: https://openwrt.org/docs/guide-developer/start


<br />
*Show Available Versions;
 
**git ls-remote --heads <nowiki>https://github.com/openwrt/openwrt.git</nowiki>
**...or view it manually: https://git.openwrt.org/?p=openwrt/openwrt.git;a=summary
*The below command will download / clone the 19.07 branch of OpenWRT to a specific directory.   
*The below command will download / clone the 19.07 branch of OpenWRT to a specific directory.   
**git clone -b openwrt-19.07 <nowiki>https://github.com/openwrt/openwrt.git</nowiki> ~/openwrt-19.07.3
**git clone -b openwrt-19.07 <nowiki>https://github.com/openwrt/openwrt.git</nowiki> ~/openwrt-19.07.3
Line 50: Line 51:
On an interesting note, packages can be built for OpenWRT using the Entware build system (which is of course based on OpenWRT), and all of those files will be installed in the /opt directory, which makes it possible to use Entware compiled packages without interfering with OpenWRT.  For instance, if the PATH variable contains /opt at the very end of it (and variations like /opt/bin, etc.), those locations will be used if no existing OpenWRT program exists.  This assumes the full version of BASH is being used instead of the BusyBox version (opkg install bash)
On an interesting note, packages can be built for OpenWRT using the Entware build system (which is of course based on OpenWRT), and all of those files will be installed in the /opt directory, which makes it possible to use Entware compiled packages without interfering with OpenWRT.  For instance, if the PATH variable contains /opt at the very end of it (and variations like /opt/bin, etc.), those locations will be used if no existing OpenWRT program exists.  This assumes the full version of BASH is being used instead of the BusyBox version (opkg install bash)


* PATH=$PATH:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin (still stuff to work on here as dependencies must be in place too)
*PATH=$PATH:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin (still stuff to work on here as dependencies must be in place too)


...on removing LuCI from an OpenWRT Image that accidentally does a great job of explaining the different methods of building OpenWRT: https://hamy.io/post/0016/how-to-properly-remove-luci-from-openwrt/#gsc.tab=0
...on removing LuCI from an OpenWRT Image that accidentally does a great job of explaining the different methods of building OpenWRT: https://hamy.io/post/0016/how-to-properly-remove-luci-from-openwrt/#gsc.tab=0
Line 56: Line 57:
Another article from the same author on a different subject also gives some great insight into other aspects of OpenWRT: https://hamy.io/post/0015/how-to-compile-openwrt-and-still-use-the-official-repository/#gsc.tab=0
Another article from the same author on a different subject also gives some great insight into other aspects of OpenWRT: https://hamy.io/post/0015/how-to-compile-openwrt-and-still-use-the-official-repository/#gsc.tab=0


== Creating a Custom Feed ==
==Creating a Custom Feed==


* edit the feeds.conf.default file (there are references to the old feeds.conf, but feeds.conf.default is the new file name), add the line:src-link custom /root/openwrt-19.07.3/feeds.custom
*edit the feeds.conf.default file (there are references to the old feeds.conf, but feeds.conf.default is the new file name), add the line:src-link custom /root/openwrt-19.07.3/feeds.custom
* create a folder: ~/openwrt-19.07.3/feeds.custom
*create a folder: ~/openwrt-19.07.3/feeds.custom
* Add whatever custom feeds are desired, give them a unique name and edit the Makefile and any other files appropriately
*Add whatever custom feeds are desired, give them a unique name and edit the Makefile and any other files appropriately
* ./scripts/feeds update -a
*./scripts/feeds update -a
* ./scripts/feeds install -a
*./scripts/feeds install -a
* There should now be references to the custom feeds in ~/openwrt-19.07.3/feeds directory
*There should now be references to the custom feeds in ~/openwrt-19.07.3/feeds directory
* make menuconfig (Note, if there is a DEPENDS:= directive in the Makefile file then the item may not show up in the OpenWRT build utility, the .config file can be edited directly to allow for compiling, see next line)
*make menuconfig (Note, if there is a DEPENDS:= directive in the Makefile file then the item may not show up in the OpenWRT build utility, the .config file can be edited directly to allow for compiling, see next line)
* CONFIG_PACKAGE_perlnetssleay=m (as an example)
*CONFIG_PACKAGE_perlnetssleay=m (as an example)
* make package/perlnetssleay/compile
*make package/perlnetssleay/compile
* ...see how it goes, other dependencies as noted in: https://www.cpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.meta, but that's a whole wormhole of other dependencies...
*...see how it goes, other dependencies as noted in: https://www.cpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.88.meta, but that's a whole wormhole of other dependencies...