Current location

narf Source control manager Git

aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2013-10-28 23:47:33 +0100
committerPetter Reinholdtsen <pere@hungry.com>2013-10-28 23:47:33 +0100
commitfa9b14808e30f758a9b3d8fa081a749916401f15 (patch)
treeccf6eb6ba6c50b9b9f8d0a4e3dbef75872fd0c8a /bin
parent29e1eeff7537bbb9926d3dce2c1e3dd570347256 (diff)
Avoid duplicate APT source and suite by passing it using environment variables.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/freedombox-customize10
-rwxr-xr-xbin/mk_freedombox_image16
2 files changed, 15 insertions, 11 deletions
diff --git a/bin/freedombox-customize b/bin/freedombox-customize
index 7da6fd8..9f13649 100755
--- a/bin/freedombox-customize
+++ b/bin/freedombox-customize
@@ -31,14 +31,12 @@ password=frdm
chroot $rootdir adduser --gecos $username --disabled-password $username
echo $username:$password | chroot $rootdir /usr/sbin/chpasswd
-suite=jessie
-
cat <<EOF > etc/apt/sources.list
-deb http://http.debian.net/debian/ $suite main contrib non-free
-deb-src http://http.debian.net/debian/ $suite main contrib non-free
+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
+#deb http://security.debian.org/ $SUITE/updates main
+#deb-src http://security.debian.org/ $SUITE/updates main
EOF
cat <<EOF > etc/apt/sources.list.d/reinholdtsen-freedombox.list
diff --git a/bin/mk_freedombox_image b/bin/mk_freedombox_image
index 14cd78f..05c5f4d 100755
--- a/bin/mk_freedombox_image
+++ b/bin/mk_freedombox_image
@@ -24,8 +24,8 @@ basedir=`pwd`
vendor_dir="${basedir}/vendor"
vmdebootstrap_dir="${vendor_dir}/vmdebootstrap"
-aptsource=http://http.debian.net/debian/
-suite=jessie
+MIRROR=http://http.debian.net/debian
+SUITE=jessie
# Packages to install in all FreedomBox environments
base_pkgs="apt base-files hostname ifupdown initramfs-tools iproute \
@@ -74,17 +74,23 @@ for p in $base_pkgs $extra_pkgs; do
done
# Run vmdebootstrap script to create image
-sudo DESTINATION="$DESTINATION" MACHINE="$MACHINE" ARCHITECTURE="$ARCHITECTURE" $vmdebootstrap_dir/vmdebootstrap \
+sudo \
+ SUITE="$SUITE" \
+ MIRROR="$MIRROR" \
+ DESTINATION="$DESTINATION" \
+ MACHINE="$MACHINE" \
+ ARCHITECTURE="$ARCHITECTURE" \
+ $vmdebootstrap_dir/vmdebootstrap \
--log freedombox.log \
--log-level debug \
--size 2.5G \
--image $IMAGE.img \
--hostname freedombox \
--verbose \
- --mirror $aptsource \
+ --mirror $MIRROR \
--customize "$basedir/bin/freedombox-customize" \
--root-password freedom \
--arch $ARCHITECTURE \
- --distribution $suite \
+ --distribution $SUITE \
$extra_opts \
$pkgopts