OpenWRT Build System for CentOS 7: Difference between revisions

 
(7 intermediate revisions by the same user not shown)
Line 3: Line 3:
==Other Tutorials==
==Other Tutorials==


*General Guide for building firmware: https://openwrt.org/docs/guide-user/additional-software/beginners-build-guide
*General{{Citation needed}} Guide for building firmware: https://openwrt.org/docs/guide-user/additional-software/beginners-build-guide
**Start of detailed Information: https://openwrt.org/docs/guide-developer/build-system/start
**Start of detailed Information: https://openwrt.org/docs/guide-developer/build-system/start
**Pre-requisites for a : https://openwrt.org/docs/guide-developer/build-system/install-buildsystem
**Pre-requisites for a<span> </span>: https://openwrt.org/docs/guide-developer/build-system/install-buildsystem
**Some additional granular detail for working with specific versions: https://openwrt.org/docs/guide-developer/build-system/use-buildsystem
**Some additional granular detail for working with specific versions: https://openwrt.org/docs/guide-developer/build-system/use-buildsystem
*Build environment tips: https://openwrt.org/docs/guide-developer/env
*Build environment tips: https://openwrt.org/docs/guide-developer/env
Line 48: Line 48:
===Obtain Source Files from OpenWRT===
===Obtain Source Files from OpenWRT===


*To clone into the current directory: git clone -b 19.07.3 <nowiki>https://github.com/openwrt/openwrt.git</nowiki> (downloads the 19.07 branch of OpenWRT, which also includes the latest version, 19.07.3)
*To clone into the current directory: git clone -b openwrt-19.07 <nowiki>https://github.com/openwrt/openwrt.git</nowiki> (downloads the 19.07 branch of OpenWRT, which also includes the latest version, 19.07.3)


*To clone into a specific directory: git clone -b 19.07.3 <nowiki>https://github.com/openwrt/openwrt.git</nowiki>  WhatEverDirectoryName (downloads the 19.07 branch of OpenWRT, which also includes the latest version, 19.07.3)
*To clone into a specific directory: git clone -b openwrt-19.07 <nowiki>https://github.com/openwrt/openwrt.git</nowiki>  WhatEverDirectoryName (downloads the 19.07 branch of OpenWRT, which also includes the latest version, 19.07.3)
**To see repository, in web browser: https://git.openwrt.org/openwrt/
**To see repository, in web browser: https://git.openwrt.org/openwrt/
**git tag (essentially shows available versions to build)
**git tag (essentially shows available versions to build)
Line 74: Line 74:
**tar xf WhatEverFileName (be sure one is in the ~ directory)
**tar xf WhatEverFileName (be sure one is in the ~ directory)
**OR... Do it manually (based on instructions from: https://openwrt.org/docs/guide-developer/helloworld/chapter1);
**OR... Do it manually (based on instructions from: https://openwrt.org/docs/guide-developer/helloworld/chapter1);
***git clone -b v19.07.3 <nowiki>https://github.com/openwrt/openwrt.git</nowiki> ~/openwrtSDK (NOTE: The instructions at the above address do not provide the correct URL when cloning)
***Remember, if the SDK has already been downloaded an error similar to: destination path X already exists and is not an empty directory.
***git checkout v19.07.3 (If a specific version is specified there is no need to "checkout" a version as specified in the same instructions, plus it appears since the instructions have been written there are other naming conventions too, like openwrt-19.07, but choosing a specific version is better.)
***...so skip to the ./scripts/feeds update -a
***make distclean wipes out all configuration, starts from a clean slate
****git clone -b openwrt-19.07.3 <nowiki>https://github.com/openwrt/openwrt.git</nowiki> ~/openwrtSDK (NOTE: The instructions at the above address do not provide the correct URL when cloning)
***./scripts/feeds update -a: Downloads pa
****git checkout v19.07.3 (If a specific version is specified there is no need to "checkout" a version as specified in the same instructions, plus it appears since the instructions have been written there are other naming conventions too, like openwrt-19.07, but choosing a specific version is better.)
****make distclean wipes out all configuration, starts from a clean slate
****./scripts/feeds update -a: Downloads pa
**
**
**./scripts/feeds update -a
**./scripts/feeds update -a
Line 125: Line 127:
**Feeds Symbolic Links in this Directory (for convenience?): ~/openwrt/package/feeds/packages/ (created when the ''./scripts/feeds update -a'' command is used)
**Feeds Symbolic Links in this Directory (for convenience?): ~/openwrt/package/feeds/packages/ (created when the ''./scripts/feeds update -a'' command is used)


== Notes on 9.7.2020 ==
==Notes on 9.7.2020==
On Monday 9.7.2020 during the late afternoon (UTC-8) it was observed that OpenWRT 19.07.4 was released on Tuesday 9.8.2020.  This would seem to indicate the server for OpenWRT downloads is somewhere in Europe.
On Monday 9.7.2020 during the late afternoon (UTC-8) it was observed that OpenWRT 19.07.4 was released on Tuesday 9.8.2020.  This would seem to indicate the server for OpenWRT downloads is somewhere in Europe.


Line 133: Line 135:
The following interesting observations were made after the above noted event
The following interesting observations were made after the above noted event


*git tag : Lists all "major" and "minor" version branches of OpenWRT available.
*git tag<span> </span>: Lists all "major" and "minor" version branches of OpenWRT available.
**v17.01.0
**v17.01.0
**v17.01.0-rc1
**v17.01.0-rc1
Line 163: Line 165:
**v19.07.4
**v19.07.4


*git branch -r : Shows available "major versions" of OpenWRT available.
*git branch -r<span> </span>: Shows available "major versions" of OpenWRT available.
**  origin/HEAD -> origin/master
**  origin/HEAD -> origin/master
**  origin/lede-17.01
**  origin/lede-17.01
Line 188: Line 190:
**src-git routing <nowiki>https://git.openwrt.org/feed/routing.git;openwrt-19.07</nowiki>
**src-git routing <nowiki>https://git.openwrt.org/feed/routing.git;openwrt-19.07</nowiki>
**src-git telephony <nowiki>https://git.openwrt.org/feed/telephony.git;openwrt-19.07</nowiki>
**src-git telephony <nowiki>https://git.openwrt.org/feed/telephony.git;openwrt-19.07</nowiki>
<br />
==Notes from 9.10.2020==
When using the ./scripts/feeds update -a command, the First Top Tip is: The Directory defined in feeds.conf or feeds.conf.default with the src-link command / directive that contains the path to a feed must have a directory, subdirectory structure, Makefile.
If the Makefile file for a project named helloworld is located in /WhatEverPath/examples/helloworld/Makefile, the the following applies in the feeds.conf or feeds.conf.default file;
*Nope, won't work: src-link examples /WhatEverPath/examples/helloworld
*This will work: examples /WhatEverPath/examples
*Oh, and no trailing / (forward slash)
*If it isn't done correctly, this unhelpful error message will occur: ... *** target pattern contains no `%'.  Stop.
**For the above error, some sites note an issue with leading or trailing spaces on any line (does not include spaces after a command / directive) and recommending TABs instead.  But after testing with leading and trailing spaces in an attempt to produce the error, it appears that the OpenWRT developers corrected this issue within their script (IE, most errors due to spaces seem to have occurred in an era where only MAKE commands were used prior to the existence of the ./scripts/feeds script.
**...however, that above statement only applies to the OpenWRT scripts.  The ''make'' command will cough up a hairball.  And on another odd note, just getting rid of the spaces is not good enough as make expects tabs after some commands / directives.  And to make it even better, when copying the example from OpenWRT, tabs will not be copied, spaces will be copied, and thankfully the OpenWRT documentation on this article (https://openwrt.org/docs/guide-developer/helloworld/chapter3) makes a nice rambling statement about spaces and tabs, when it should read something explicit like this: If you are going to copy and paste the below code, be sure to replace all leading spaces, short or otherwise with tabs.  Why?  Because ''make'' will not work with spaces AND it requires indentations in the form of TABS.
*Also in the feeds.conf or feeds.conf.default file do NOT use a ~ (tilde) in the path (like for a home directory) as it will not allow the ./scripts/feeds update -a command to work properly (plus it won't produce an error message, it just produces a zero byte index file.)
*And be sure to run the ./scripts/feeds update -a and ./scripts/feeds/ install -a command (or instead of -a for ALL, target a specific package
----How do the variables in scripts from OpenWRT get their default values? (https://openwrt.org/docs/guide-developer/packages as noted here, they can be defined in the Makefile file)
''pwd'' is a Linux command to get the current directory.
<br />
*~openwrtSDK/feeds/WhatEverDirectory/MakeFile: Modifications here will be reflected in "make menuconfig"
*The symbolic links originally used in earlier examples are incomplete.  There is NOT a directory to directory equivalent file / directory for symbolic links in ~/openwrtSDK/package/feeds.  IE, the subfolders of all of the symbolic links in ~/openwrtSDK/package/feeds seem to be in a flat structure, where as the directories / files they point to are in a hierarchical structure.
*The README files in the various ~/openWRT/feeds directories make reference to the feeds.conf file which seems to now be titled feeds.conf.default.  Documentation seems to indicate either one of these file names will work, although the one ending in .default seems to trump feeds.conf if both are present.
*In order for a new item to show up in make menuconfig: Add it to /
**NO ./scripts/feeds/update needs to be run, if: something is manually added as a symbolic link.
**OR
**run the ./scripts/feeds install -a command (obviously this is a better choice)
*Error Logs are located: ~/openwrtSDK/logs/package/feeds/
*If duplicating a directory, start by changing the define Package/WhatEverName that contains: SECTION, TITLE, etc. and every other reference to the same WhatEverName
**It was noticed at minimum, the last line: $(eval $(call BuildPackage,WhatEverName)) had to be changed too.
==Notes from 9.11.2020==
<br />
*Name of Package in Makefile
**define Package/openssl-custom
**define Package/openssl-custom/description
**define Package/openssl-custom/install
**$(eval $(call BuildPackage,openssl-custom))
*Name of Directory in "feedscustom" must match items in Makefile
**source "$(SOURCE)/Config.in"
==Notes on 09.13.2020==
'''SOLUTION for the below:''' (from: https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem ):
* ...CD to the SCRIPTS Directory from the "GIT Cloned" version of OpenWRT
** ./feeds update -a
** ./feeds install -a
...all fixed.  Naturally installing 'feeds' solves the issue of missing dependencies, etc.
Here's a stupid error that makes complete sense, yet shouldn't even exist in this situation: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
What's the situation?  This is a build for a WRT3200ACM, with no Broadcom chips.  So what the fuck package is in the official SDK for this same router that has a dependency like this?
Oh, and better yet, what about the below?
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'r8169-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'e100-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'bnx2-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'ar3k-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'mwifiex-sdio-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'edgeport-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb3', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'amdgpu-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'radeon-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'prism54-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'rtl8192su-firmware', which does not exist
Of course none of this shit exists, it's a GOD DAMNED SDK for the WRT3200ACM!
There is no solution to all the above errors.  Just tolerate it amongst all the other fucked up shit.
Also, do NOT delete any of the newly created Directories in the ......feeds Directory as they are actually symbolic links to WhatEver custom Feeds Directory structure was created.
And if one is looking for the OpenSSL package, it is of course intuitively named openssl-util.  And following that very clear path, the Makefile file for openssl is located in /feeds/base/package/libs/openssl
==09.13.2013 - Less Vitriolic Notes==
git clone -b openwrt-19.07 <nowiki>https://github.com/openwrt/openwrt.git</nowiki> /root/openwrtSDK.Manual: Copies the 19.07 (IE, the lateversion of files from the OpenWRT sources at GitHub
git checkout v19.07.3
make distclean: https://stackoverflow.com/questions/51837675/what-are-the-differences-between-make-clean-make-clobber-make-distclean-make
./scripts/feeds update -a: Downloads all the v19.07.3 Makefiles and associated "stuff"
./scripts/feeds install -a: Creates indexes used by "make menuconfig", which in turn creates the visual selections within menuconfig script.
make menuconfig: run the menuconfig script (the Build the OpenWrt SDK will create an SDK PACKAGE)
make toolchain/install V=sc: use the toolchain/Config.in file and install it (see the Config.in file in the root openwrt...  directory, then the /toolchain/Config.in file), the -V=sc enables verbose output with details of what it is compiling instead of a boring command prompt.
staging_dir/host: Seems to contain x86_64 files that are "translated" to other platforms
Another observation that seems a bit obvious, but isn't really explicitly stated anywhere is that the "make menuconfig" "script" settings apply only in certain circumstances.  For instance, when using the above make... ...toolchain/config command, there were no packages compiled and put into a bin directory.  As a test, selected the openssl package (which includes libssl) to be created as a modular package.  And it wasn't created, nor should it have been.