diff options
author | James Valleroy <jvalleroy@mailbox.org> | 2015-01-25 16:33:45 -0500 |
---|---|---|
committer | James Valleroy <jvalleroy@mailbox.org> | 2015-01-25 16:33:45 -0500 |
commit | b98fc6653f018afce5dbef0fdcfb1194017f0744 (patch) | |
tree | 8d9e93f27b97de3eb9f99e617118d71f798a9356 | |
parent | 18e2a18972dc2ef606bf19875598519b5c424347 (diff) | |
parent | dbfa5d26ea5bb1b6d0bdcb0f03d6330cb7bf52f6 (diff) |
Merge pull request #7 from vignanl/source_list
Add ability to set build and image mirrors separately
-rw-r--r-- | Makefile | 3 | ||||
-rwxr-xr-x | bin/freedombox-customize | 22 | ||||
-rwxr-xr-x | bin/mk_freedombox_image | 3 |
3 files changed, 19 insertions, 9 deletions
@@ -2,7 +2,7 @@ # Where to fetch packages MIRROR = http://http.debian.net/debian - +BUILD_MIRROR = http://http.debian.net/debian # armel amd64 i386 ARCHITECTURE = armel # dreamplug guruplug virtualbox raspberry(pi) @@ -27,6 +27,7 @@ SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE) # hang. (See Debian bug #769983 for details.) MAKE_IMAGE = ARCHITECTURE=$(ARCHITECTURE) DESTINATION=$(DESTINATION) \ MACHINE=$(MACHINE) SOURCE=$(SOURCE) MIRROR=$(MIRROR) SUITE=$(SUITE) OWNER=$(OWNER) \ + BUILD_MIRROR=$(BUILD_MIRROR) \ taskset 0x01 bin/mk_freedombox_image $(NAME) # build DreamPlug USB or SD card image diff --git a/bin/freedombox-customize b/bin/freedombox-customize index 4408080..10a2a83 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() { + NEW_MIRROR="$1" + cat <<EOF > etc/apt/sources.list +deb $NEW_MIRROR $SUITE main contrib non-free +deb-src $NEW_MIRROR $SUITE main contrib non-free + +#deb http://security.debian.org/ $SUITE/updates main +#deb-src http://security.debian.org/ $SUITE/updates main +EOF +} + # Set to true/false to control if eatmydata is used during build use_eatmydata=true @@ -80,13 +91,7 @@ case "$MACHINE" in ;; esac -cat <<EOF > etc/apt/sources.list -deb $MIRROR $SUITE main contrib non-free -deb-src $MIRROR $SUITE main contrib non-free - -#deb http://security.debian.org/ $SUITE/updates main -#deb-src http://security.debian.org/ $SUITE/updates main -EOF +set_apt_sources $BUILD_MIRROR chroot $rootdir apt-get update cat > $rootdir/usr/sbin/policy-rc.d <<EOF @@ -120,6 +125,9 @@ if $use_eatmydata ; then disable_eatmydata_override fi +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 diff --git a/bin/mk_freedombox_image b/bin/mk_freedombox_image index 5d1d7db..8b4bed8 100755 --- a/bin/mk_freedombox_image +++ b/bin/mk_freedombox_image @@ -117,6 +117,7 @@ echo "starting vmdebootstrap" sudo -H \ SUITE="$SUITE" \ MIRROR="$MIRROR" \ + BUILD_MIRROR="$BUILD_MIRROR"\ DESTINATION="$DESTINATION" \ MACHINE="$MACHINE" \ ARCHITECTURE="$ARCHITECTURE" \ @@ -127,7 +128,7 @@ sudo -H \ --image $IMAGE.img \ --hostname freedombox \ --verbose \ - --mirror $MIRROR \ + --mirror $BUILD_MIRROR \ --customize "$basedir/bin/freedombox-customize" \ --lock-root-password \ --arch $ARCHITECTURE \ |