* bitbake and proxy
Posted on June 20th, 2009 by Alex. Filed under Linux, openmoko.
Currently interns are trying to use bitbake to create an openembedded image for the beagle board. After setting up everything according to the step-by-step instructions, they run into a major problem: the proxy of the Indian Institute of Science.
bitbake uses wget to download the necessary packages. To tell wget that is has to send all requests to the proxy, environment variable are set:
export http_proxy=”http://proxy.example.com:8080″
export ftp_proxy=”http://proxy.example.com:8080″
However if wget is executed by bitbake to download a missing package, the environment variables are gone and wget tries to connect to the HTTP servers directly. A search in the Internet for that particular problem was not successful. A workaround (and not a solution) is to export the variables again, before wget is executed. Changing the recipes might be a never ending task. An easier way is to change the wget executable itself:
- Open a terminal and type
cd /usr/bin/. If the file is not there, you can usewhich wgetto figure out, where it is hidden. mv wget wget.executable(for this you need root permission, getting them by either executingsudo(Ubuntu) or by becoming root withsu).- Open an editor of your choice and type:
#!/bin/bash
echo “Using alternative wget…”
export http_proxy=”http://proxy.example.com:8080″
export ftp_proxy=”http://proxy.example.com:8080″/usr/bin/wget.executable $@
- Save this file as
wgetin/usr/bin/(for that you need to be root again). - Change the permission for this file by entering
chmod +x wgetin the terminal (also as root). - Execute
bitbakeas usual. Theechodirective just prints out a message, so you can check, ifbitbakeis taking the right executable.
I hope, it helps and saves you some time.
September 11th, 2009 at 5:05 pm
Do you tried to set http_proxy and ftp_proxy in the configuration file /etc/wgetrc ou ~/.wgetrc?
[REPLY]
jitu Reply:
September 13th, 2009 at 10:39 pm
Oh, I do not remember. I would have taken such a shortcut, if I either knew or if it worked in that particular situation. But seriously I do not remember…
[REPLY]
sami Reply:
May 20th, 2010 at 11:23 am
Old thread but since I just spent an hour before realizing it for posterity’s sake setting proxies in .wgetrc does indeed work.
[REPLY]
November 7th, 2011 at 12:36 pm
Hi,
I tried this as you said.
Adding proxy details just before every call of wget.
But, no luck.
Any alternative ..?
[REPLY]
Alex Reply:
November 11th, 2011 at 6:38 am
Hey, did you try out the solution in the comments above?
[REPLY]