Current location

narf Source control manager Git

diff options
authorVignan Lavu <>2015-01-10 23:01:57 +0530
committerVignan Lavu <>2015-01-10 23:01:57 +0530
commitdbfa5d26ea5bb1b6d0bdcb0f03d6330cb7bf52f6 (patch)
tree7cee70494df667a286c17b7a0b8b163e56ace909 /bin/freedombox-customize
parent0569813436e7b7c283dc827bba15ec54667f1ddb (diff)
Add ability to set build and image mirrors separately
Currently if a local Debian mirror such as apt-cacher-ng is set during build, the resulting images will also contain the same mirror which is not desirable. This patch separates the mirror used to build the image from the mirror used inside the final image. By default build mirror and image mirror are the same. However, build mirror can be specified by passing an environment variable BUILD_MIRROR to the make command. make -e BUILD_MIRROR=<build_mirror> user concern to set mirrors.
Diffstat (limited to 'bin/freedombox-customize')
1 files changed, 15 insertions, 7 deletions
diff --git a/bin/freedombox-customize b/bin/freedombox-customize
index 06cd706..7d71cd1 100755
--- a/bin/freedombox-customize
+++ b/bin/freedombox-customize
@@ -46,6 +46,17 @@ disable_eatmydata_override() {
sync # Flush file buffers before continuing
+set_apt_sources() {
+ cat <<EOF > etc/apt/sources.list
+deb $NEW_MIRROR $SUITE main contrib non-free
+deb-src $NEW_MIRROR $SUITE main contrib non-free
+#deb $SUITE/updates main
+#deb-src $SUITE/updates main
# Set to true/false to control if eatmydata is used during build
@@ -79,13 +90,7 @@ case "$MACHINE" in
-cat <<EOF > etc/apt/sources.list
-deb $MIRROR $SUITE main contrib non-free
-deb-src $MIRROR $SUITE main contrib non-free
-#deb $SUITE/updates main
-#deb-src $SUITE/updates main
+set_apt_sources $BUILD_MIRROR
chroot $rootdir apt-get update
cat > $rootdir/usr/sbin/policy-rc.d <<EOF
@@ -109,6 +114,9 @@ if $use_eatmydata ; then
+set_apt_sources $MIRROR
+chroot $rootdir apt-get update
cd /
echo "info: killing leftover processes in chroot"
# 2014-11-04 this killed /usr/lib/erlang/erts-6.2/bin/epmd, see