Discussion:
Using live-build and apt caching behind a proxy
Nick Bailey
2011-11-18 16:11:27 UTC
Permalink
Hi, I'm trying to build a live hdd image for distribution on USB key
with some of our software and an ability to install a debian system
on the host machine. Unfortunately, my institution has a proxy-enforcing
policy. I also need to use apt-cacher-ng (or similar) to avoid hitting
the repositories hard while tweeking the additional software.

The combinations of institution proxy enforcement and a local cache is
doing my head in :) The best I can do is to get a live image which has
localhost:3142 in its /etc/apt/sources.list.

Here's my configuration:

live-build 3.0~a38-1
platform wheezy

In /etc/apt-cacher-ng/acnc.conf:

proxy: http://wwwcache.gla.ac.uk:8080

In /etc/apt/apt.conf.d/01proxy:

Acquire::http:Proxy::127.0.0.1 "DIRECT";
Acquire::http::Proxy "http://our.slow.annoying.proxy:8080/";


auto/config below. (I'm aware it's overspecified, but I've tried a lot of
different combinations!) having localhost:3142 everywhere works, except
that it ends up in the image of course. I can apt-get update/upgrade the
building machine fine with the above apt Acquire settings.

Nick Bailey
Science and Music Research Group, School of Engineering, Glasgow Uni.

#!/bin/sh

lb config noauto \
--distribution "wheezy" \
--parent-distribution "wheezy" \
--debian-installer-distribution "wheezy" \
--parent-debian-installer-distribution "wheezy" \
--debian-installer "cdrom" \
--binary-images "hdd" \
--package-lists "lxde" \
--architecture "i386" \
--linux-flavours "686" \
--archive-areas "main contrib" \
--parent-archive-areas "main contrib" \
--mirror-bootstrap "http://localhost:3142/ftp.uk.debian.org/debian/" \
--parent-mirror-bootstrap "http://ftp.uk.debian.org/debian/" \
--mirror-chroot "http://ftp.uk.debian.org/debian/" \
--parent-mirror-chroot "http://localhost:3142/ftp.uk.debian.org/debian \
--mirror-binary "http://ftp.uk.debian.org/debian/" \
--parent-mirror-binary "http://localhost:3142/ftp.uk.debian.org/debian \
--mirror-debian-installer "http://ftp.uk.debian.org/debn/" \
--parent-mirror-debian-installer "http://localhost:3142/ftp.uk.debian.g/debian/" \
--parent-mirror-bootstrap "http://localhost:3142/ftp.uk.debian.org/debn/" \
--mirror-chroot "http://ftp.uk.debian.org/debian/" \
--parent-mirror-chroot "http://localhost:3142/ftp.uk.debian.org/debian \
--mirror-binary "http://ftp.uk.debian.org/debian/" \
--parent-mirror-binary "http://localhost:3142/ftp.uk.debian.org/debian \
--mirror-debian-installer "http://ftp.uk.debian.org/debn/" \
--parent-mirror-debian-installer "http://localhost:3142/ftp.uk.debian.g/debian/" \
--apt-indices false \
--bootappend-live "locales=en_GB.UTF-8 keyboard-layouts=gb" \
"${@}"
--
To UNSUBSCRIBE, email to debian-live-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@ingrid.fairholm
intrigeri
2011-11-19 14:31:28 UTC
Permalink
hi,
Post by Nick Bailey
Hi, I'm trying to build a live hdd image for distribution on USB key
with some of our software and an ability to install a debian system
on the host machine. Unfortunately, my institution has a proxy-enforcing
policy. I also need to use apt-cacher-ng (or similar) to avoid hitting
the repositories hard while tweeking the additional software.
The setup I, and several other Tails developers, have been using for
a while, is documented on our website:

https://tails.boum.org/build/squid-deb-proxy/

Hope it helps.

Cheers,
--
intrigeri <***@boum.org>
| GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
| OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc
| Who wants a world in which the guarantee that we shall not
| die of starvation would entail the risk of dying of boredom ?
--
To UNSUBSCRIBE, email to debian-live-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@boum.org
Nick Bailey
2011-11-21 16:58:39 UTC
Permalink
Post by intrigeri
hi,
Post by Nick Bailey
Hi, I'm trying to build a live hdd image for distribution on USB key
with some of our software and an ability to install a debian system
on the host machine. Unfortunately, my institution has a proxy-enforcing
policy. I also need to use apt-cacher-ng (or similar) to avoid hitting
the repositories hard while tweeking the additional software.
The setup I, and several other Tails developers, have been using for
https://tails.boum.org/build/squid-deb-proxy/
Hope it helps.
Cheers,
--
| Who wants a world in which the guarantee that we shall not
| die of starvation would entail the risk of dying of boredom ?
Thanks for the URL, intrigeri.

I had given up on --apt-http-proxy because it didn't work with
apt-cacher-ng, failing at the debootstrap stage as below. Now I see
you are using it with squid, so I investigated further.

It seems that it's possible to get past the debootstrap by settng http_proxy
to point at the local apt-cacher-ng proxy as well. However this fails
at the debian installer phase with the message:

E: Could not download file: http://localhost:3142/ftp.uk.debian.org/debian//dists/wheezy/main/installer-i386/current/images//cdrom/vmlinuz

Is this a bug? I should imagine that most sites don't have the
overly restrictive proxy policy I have to work with, so maybe it
slipped though testing. There again, many people would be using
squid or apt-cacher-ng, I'm sure.

I've tried everything else I can think of, such as setting and unsetting
the http_proxy environment variable during the build, but no dice.

Any hints gratefully appreciated. Meanwhile, I guess I'll have to build
the final image using my cell phone's data modem :P

Failure when environment variable http_proxy is unset:

***@ingrid:~/smrg-live# lb config --apt-http-proxy "http://127.0.0.1:3142/"
P: Executing auto/config script.
P: Considering defaults defined in /etc/live/build.conf
P: Updating config tree
***@ingrid:~/smrg-live# lb build
P: Executing auto/build script.
P: Setting up cleanup function
P: Restoring bootstrap stage from cache...
P: Begin bootstrapping system...
P: If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy.
P: Running debootstrap (download-only)...
I: Retrieving Release
E: Failed getting release file http://ftp.de.debian.org/debian/dists/wheezy/Release
--
To UNSUBSCRIBE, email to debian-live-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@ingrid.fairholm
Loading...