Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of compiling OpenWRT process

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to solve the problem of compiling OpenWRT process, I believe that many inexperienced people are at a loss about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

My operating system is CentOS 6.4.I haven't changed it for a long time. I also started to download and compile OpenWRT according to the instructions of the awesome people on the Internet.

The following is the information on the Internet:

Sudo apt-get update (update)

Install the components required for compilation:

Sudo apt-get install gcc

Sudo apt-get install gathers +

Sudo apt-get install binutils

Sudo apt-get install patch

Sudo apt-get install bzip2

Sudo apt-get install flex

Sudo apt-get install bison

Sudo apt-get install make

Sudo apt-get install autoconf

Sudo apt-get install gettext

Sudo apt-get install texinfo

Sudo apt-get install unzip

Sudo apt-get install sharutils

Sudo apt-get install subversion

Sudo apt-get install libncurses5-dev

Sudo apt-get install ncurses-term

Sudo apt-get install zlib1g-dev

Sudo apt-get install gawk

Sudo apt-get install asciidoc

Sudo apt-get install libz-dev

The compilation environment is completed.

Mkdir openwrt creates an openwrt folder

Cd openwrt enters the openwrt folder

Svn co svn://svn.openwrt.org/openwrt/branches/backfire downloads the source code of the official website

. / scripts/feeds update-a update package

. / scripts/feeds install-an installation package

Make menuconfig enters the customized interface (in which you can select the chip model, integrated components, etc., according to the actual situation)

Defconfig

Make version 99 (start compilation)

All that's left is to wait. the first compilation takes a relatively long time, which has something to do with your computer configuration and Internet speed.

Since the original author uses Ubuntu as the development environment, apt-get is used to install the above dependency toolkits and yum is used in CentOS. In fact, it's all the same, as long as you know which packages to rely on.

The path to the OpenWRT source database of my checkout is: svn://svn.openwrt.org/openwrt/trunk

Follow the above steps for everything else.

Here are some of the problems I have encountered:

. / scripts/feeds update-a failed

Newspaper:

$. / scripts/feeds update-aUpdating feed 'packages' from' https://github.com/openwrt/packages.git'... Cloning into'. / feeds/packages'...fatal: Unable to find remote helper for 'https'failed.

It may be that the path to the git warehouse is incorrect. Just replace https with git.

Search with grep command

$grep 'https://github.com' feeds/*-Rfeeds/packages.tmp/location: https://github.com/openwrt/packages.git

Then change this place.

Try again. The result is still the same, I thought for a moment, this feeds/packages.tmp/location is probably a temporary text. It won't work to change it.

I think I found it in the feeds.conf.default file, too.

$grep 'https://github.com' feeds.conf.default-Rsrc-git packages https://github.com/openwrt/packages.gitsrc-git luci https://github.com/openwrt/luci.gitsrc-git routing https://github.com/openwrt-routing/packages.gitsrc-git telephony https://github.com/openwrt/telephony.gitsrc-git management https://github.com/openwrt-management/packages.gitsrc-git targets https://github.com/openwrt/targets.git

Replace all https in it with git.

Try again, OK.

Postscript: in fact, there is a more fundamental solution, as detailed in the later blog post "git error: Unable to find remote helper for 'https'"

Gconvert.c libiconv

When I first compiled OpenWRT, I got the following error:

Gconvert.c:66:2: error: # error GNU libiconv not in use but included iconv.h is from libiconv

I look for a solution on the Internet, and the result is to say, re-configure:

. / configure-enable-iconv=no-with-libiconv=gnumake

But the crux of the problem is: there is no configure under the trunk path of OpenWRT.

Later, after careful deliberation, it was found that I failed in compiling glib.

$find-name "gconvert.c". / build_dir/host/pkg-config-0.28/glib/glib/gconvert.c

Then I will go directly to the. / build_dir/host/pkg-config-0.28/glib/ path and find that there is a configure file under that path.

Then I say compile glib directly under that path.

$cd build_dir/host/pkg-config-0.28/glib/./configure-enable-iconv=no-with-libiconv=gnumake

In this way, glib successfully passed the compilation.

Go back to the trunk path of OpenWRT and continue make.

Libubox installation error

Error report:

Mkdir-p / home/hevake_lcj/Workspace/OpenWRT/trunk/dlecho "Checking out files from the git repository..." Mkdir-p / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl & & cd / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl & & rm-rf libubox-2015-03-22 & & [\!-d libubox-2015-03-22] & & git clone http://git.openwrt.org/project/libubox.git libubox-2015-03-22-- recursive & & (cd libubox-2015-03-22 & & git checkout b8d9b382e39823850331edc2a92379173daf1be3 & & git submodule update ) & & echo "Packing checkout..." & & rm-rf libubox-2015-03-22/.git & & tar czf / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl/libubox-2015-03-22-b8d9b382e39823850331edc2a92379173daf1be3.tar.gz libubox-2015-03-22 & & mv / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl/libubox-2015-03-22-b8d9b382e39823850331edc2a92379173daf1be3.tar.gz / home/hevake_lcj/Workspace/OpenWRT/trunk/dl/ & & rm-rf libubox-2015-03-22 Checking out files from the git repository...Cloning into 'libubox-2015-03-22'...fatal: Unable to find remote helper for' http'make [3]: * * [/ home/hevake_lcj/Workspace/OpenWRT/trunk/dl/libubox-2015-03-22-b8d9b382e39823850331edc2a92379173daf1be3.tar.gz] Error 128

As you can see from the second line, the git clone project is used:

Git clone http://git.openwrt.org/project/libubox.git

The whole third line is to package the source code from clone into the tar.gz package.

So I visited: sure enough, http://git.openwrt.org/project/libubox appeared on the 404 page. Don't you think so?

I visited again: http://git.openwrt.org/ results, found this project in the list:

Go to the link project/libubox.git:

I'll git clone it myself.

$cd dl$ mkdir tmp$ cd tmp$ git clone http://git.openwrt.org/project/libubox.git libuboxCloning into 'libubox'...fatal: Unable to find remote helper for' http'

I found a solution to "fatal: Unable to find remote helper for 'http'" on the Internet. Learn that "http:" >

So, I git clone again.

$git clone git://git.openwrt.org/project/libubox.git

As a result, it succeeded in clone.

Then, complete the compilation command process manually:

Mkdir-p / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dlcd / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dlrm-rf libubox-2015-03-22git clone git://git.openwrt.org/project/libubox.git libubox-2015-03-22 echo "Packing checkout..." Rm-rf libubox-2015-03-22/.gittar czf libubox-2015-03-22-b8d9b382e39823850331edc2a92379173daf1be3.tar.gz libubox-2015-03-22mv libubox-2015-03-22-b8d9b382e39823850331edc2a92379173daf1be3.tar.gz. /.. / dl/rm-rf libubox-2015-03-22

Then, go back to the trunk path of OpenWRT to continue make.

Fatal: Unable to find remote helper for 'http'

Compilation error:

Make [3]: Entering directory `/ home/hevake_lcj/Workspace/OpenWRT/trunk/package/network/config/netifd'mkdir-p / home/hevake_lcj/Workspace/OpenWRT/trunk/dlecho "Checking out files from the git repository..." Mkdir-p / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl\ & & cd / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl\ & & rm-rf netifd-2015-03-31\ & & [\!-d netifd-2015-03-31]\ & & git clone http://git.openwrt.org/project/netifd.git netifd-2015-03-31-- recursive\ & (cd netifd-2015-03-31) \ & & git checkout 3a0f953722698eab6f3f623a1d6ec5a1b7102b77\ & & git submodule update) & & echo "Packing checkout..."\ & & rm-rf netifd-2015-03-31/.git\ & & tar czf / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl/netifd-2015-03-31-3a0f953722698eab6f3f623a1d6ec5a1b7102b77.tar.gz netifd-2015-03-31\ & & mv / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl/netifd-2015-03-31-3a0f953722698eab6f3f623a1d6ec5a1b7102b77.tar .gz / home/hevake_lcj/Workspace/OpenWRT/trunk/dl/\ & & rm-rf netifd-2015-03-31

Find package/network/config/netifd/Makefile and open it.

Replace "http:" in line 8 with "git:", then go back to the OpenWRT directory and make.

Note: I will encounter this problem again and again later. It's hot! Replace all one order!

$grep-E "http:.*\ .git" `find-name Makefile | xargs` |\ awk-F:'! / .svn / {print $1}'| uniq | xargs\ sed-I 's/http\ (:. *\ .git\) / git\ 1andg'

In the trunk directory, find the files with "http:xxxxx.git" in Makefile, and replace all "http:xxxxx.git" with "git:xxxxx.git"

$grep-E "https:.*\ .git" `find-name Makefile | xargs` |\ awk-F:'! / .svn / {print $1}'| uniq | xargs\ sed-I 's/https\ (:. *\)\ .git / git\ 1\ .git / g'

Replace https with git

Opkg download failed Checking out files from the git repository...Cloning into 'opkg-9c97d5ecd795709c8584e972bfdf3aee3a5b846d'...fatal: Could not read from remote repository.

Now take a look up to see where make is.

Make [3]: Entering directory `/ home/hevake_lcj/Workspace/OpenWRT/trunk/package/system/opkg'

It turns out that when opkg is in git clone, it may be a problem with the path and failed.

I tried to open Makefile under the opkg path and set the

PKG_SOURCE_URL:= http://git.yoctoproject.org/git/opkg

Change it to:

PKG_SOURCE_URL:=git://git.yoctoproject.org/git/opkg

It still didn't work.

I manually searched opkg and found the official website: http://git.yoctoproject.org/cgit/cgit.cgi/opkg/ opened and saw the following at the bottom of the page:

So I changed the trunk/package/system/opkg/Makefile file and changed the PKG_SOURCE_URL to:

PKG_SOURCE_URL:=git://git.yoctoproject.org/opkg

Go ahead, make, pass!

Linux-firmware clone failed

Fatal: Unable to look up git.kernel.org (port 9418) (Temporary failure in name resolution)

I went to the git.kernel.org website and found linux-firmware 's warehouse https://git.kernel.org/cgit/linux/kernel/git/balbi/linux-firmware.git/.

See the description of the git path at the bottom:

This is not consistent with what is specified in Makefile. So change the git path in Makefile.

Re-make

I've summed up my experience now.

If git clone fails, if it is the problem of http header, replace http with git and try again.

If it still doesn't work, check that the path to git is correct. The simple way is to go to the root node of the git path to find the source code repository and get its real and effective git path.

And change the content in Makefile to OK.

Linux-firmware fatal: reference is not a tree problem

Make [3]: Entering directory `/ home/hevake_lcj/Workspace/OpenWRT/trunk/package/kernel/mac80211'mkdir-p / home/hevake_lcj/Workspace/OpenWRT/trunk/dlecho "Checking out files from the git repository..." Mkdir-p / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl\ & & cd / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl\ & & rm-rf linux-firmware-f404336ba808cbd57547196e13367079a23b822c\ & & [\!-d linux-firmware-f404336ba808cbd57547196e13367079a23b822c]\ & git clone git://git.kernel.org/pub/scm/linux/kernel/git/balbi/linux-firmware.git linux-firmware-f404336ba808cbd57547196e13367079a23b822c-- recursive\ & & (cd linux -firmware-f404336ba808cbd57547196e13367079a23b822c\ & & git checkout f404336ba808cbd57547196e13367079a23b822c\ & & git submodule update)\ & & echo "Packing checkout..."\ & & rm-rf linux-firmware-f404336ba808cbd57547196e13367079a23b822c/.git\ & & tar cjf / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl/linux-firmware-2015-03-20-f404336ba808cbd57547196e13367079a23b822c.tar.bz2 linux-firmware-f404336ba808cbd57547196e13367079a23b822c\ & & mv / home/hevake_lcj/Workspace/OpenWRT/trunk/tmp/dl/linux-firmware-2015 -03-20-f404336ba808cbd57547196e13367079a23b822c.tar.bz2 / home/hevake_lcj/Workspace/OpenWRT/trunk/dl/\ & & rm-rf linux-firmware-f404336ba808cbd57547196e13367079a23b822c Checking out files from the git repository...Cloning into 'linux-firmware-f404336ba808cbd57547196e13367079a23b822c'...remote: Counting objects: 2344, done.remote: Compressing objects: 100% (1164 KiB/s), done.remote: Total 2344 (delta 1182), reused 2272 (delta 1145) Receiving objects: 100% (2344 MiB), 42.07 MiB | 26 KiB/s, done.Resolving deltas: 100% (1182 delta 1182) Done.fatal: reference is not a tree: f404336ba808cbd57547196e13367079a23b822cmake [3]: * [/ home/hevake_lcj/Workspace/OpenWRT/trunk/dl/linux-firmware-2015-03-20-f404336ba808cbd57547196e13367079a23b822c.tar.bz2] Error 128make [3]: Leaving directory `/ home/hevake_lcj/Workspace/OpenWRT/trunk/package/kernel/mac80211'

Fatal: reference is not a tree: f404. 22c, which seems to mean that there is no such version of f404. 22c in the git project. Then I have to check to see if this version number is correct.

The linux-firmware downloaded under the trunk/tmp/dl path has not been deleted, so we enter the directory. And check the submission log with git log to get:

Commit b8ac7c7e27dcd13fa3c843aaf62457e9c57ea4dbAuthor: Rasesh Mody Date: Tue Sep 10 16:10:54 2013-0700 linux-firmware: Add Brocade FC/FCOE Adapter firmware files This patch adds firmware files for Brocade HBA and CNA drivers (BFA and BNA). Signed-off-by: Rasesh Mody Signed-off-by: Ben Hutchings commit 8ff6cc3a5e1d9452ae8fb993532afc1f3ab3a71fMerge: 1461bed e7c85b2Author: Ben Hutchings Date: Mon Sep 30 04:50:51 2013 + 0100 Merge branch 'moxa' of https://github.com/lunn/linux-firmwarecommit 1461bed1300097efeba59c82ffa30c90cc7e3ae5Author: Alex Deucher Date: Mon Aug 26 10:45:33 2013-0400 radeon: add ucode for KAVERI GPUs Add new ucode files and update the WHENCE entry. Signed-off-by: Alex Deucher Signed-off-by: Ben Hutchings commit 66f87a226160b545ac02f3844ea601cbe10a5da2Author: Alex Deucher Date: Mon Aug 26 10:42:44 2013-0400 radeon: add smc ucode for BONAIRE

The version number of f404336ba808cbd57547196e13367079a23b822c was not found in this file.

Well, I'll change it to the latest version number, b8ac7c7e27dcd13fa3c843aaf62457e9c57ea4db. I hope there's no problem.

At the same time, rename the original download directory under trunk/tmp/dl/ (avoid repeated downloads),

$cd tmp/dl$ mv linux-firmware-f404336ba808cbd57547196e13367079a23b822c/ linux-firmware-b8ac7c7e27dcd13fa3c843aaf62457e9c57ea4db

good! Let's make again.

After reading the above, do you know how to solve the problem of compiling OpenWRT process? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report