We are trying to build and add a external kernel module to a custom image with torizoncore-builder.
torizoncore-builder build command fails because it can’t download the toolchain it needs.
2022-08-03 10:48:59,836 - torizon.tcbuilder.backend.kernel - INFO - A toolchain is required to build the module.
Downloading toolchain from http://sources.toradex.com/tcb/toolchains/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz.
Please wait this could take a while...
2022-08-03 10:49:20,843 - root - ERROR - Error: The requested toolchain could not be downloaded
2022-08-03 10:49:20,845 - root - DEBUG - Traceback (most recent call last):
File "/usr/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/lib/python3.9/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.9/http/client.py", line 950, in send
self.connect()
File "/usr/lib/python3.9/http/client.py", line 921, in connect
self.sock = self._create_connection(
File "/usr/lib/python3.9/socket.py", line 843, in create_connection
raise err
File "/usr/lib/python3.9/socket.py", line 831, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/builder/tcbuilder/backend/kernel.py", line 128, in download_toolchain
urllib.request.urlretrieve(url, filename=tarball, reporthook=progress)
File "/usr/lib/python3.9/urllib/request.py", line 239, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/usr/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/lib/python3.9/urllib/request.py", line 1375, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.9/urllib/request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/builder/torizoncore-builder", line 213, in <module>
mainargs.func(mainargs)
File "/builder/tcbuilder/cli/build.py", line 492, in do_build
raise exc
File "/builder/tcbuilder/cli/build.py", line 469, in do_build
build(args.config_fname, args.storage_directory,
File "/builder/tcbuilder/cli/build.py", line 439, in build
fs_changes = handle_customization_section(
File "/builder/tcbuilder/cli/build.py", line 173, in handle_customization_section
handle_kernel_customization(props["kernel"], storage_dir=storage_dir)
File "/builder/tcbuilder/cli/build.py", line 229, in handle_kernel_customization
kernel_cli.kernel_build_module(
File "/builder/tcbuilder/cli/kernel.py", line 94, in kernel_build_module
kernel.build_module(
File "/builder/tcbuilder/backend/kernel.py", line 56, in build_module
download_toolchain(c_c, toolchain_path)
File "/builder/tcbuilder/backend/kernel.py", line 131, in download_toolchain
raise TorizonCoreBuilderError("The requested toolchain could not be downloaded")
tcbuilder.errors.TorizonCoreBuilderError: The requested toolchain could not be downloaded
All http (not https) request have to go through our corporate proxy.
How do we configure torizoncore-builder to use a proxy for http requests?