Current location

narf Source control manager Git

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Valleroy <jvalleroy@mailbox.org>2015-01-25 16:37:54 -0500
committerJames Valleroy <jvalleroy@mailbox.org>2015-01-25 16:37:54 -0500
commitd4ec43edb78cc3496cb8e3cc6666a2b28befdcdf (patch)
treec91d8338e4d7ebaa0d818b12d58c17818cfc3525
parent6a55ddbc951b56289edda50304bc65050cef0efb (diff)
parent3a1065b30abc6b62e895574a81b814857f7dcb01 (diff)
Merge pull request #10 from vignanl/repo_archive
Allows us to enable/disable non-free components.
-rw-r--r--Makefile7
-rwxr-xr-xbin/freedombox-customize10
-rwxr-xr-xbin/mk_freedombox_image2
3 files changed, 16 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 92848a3..3cabde4 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,8 @@ ARCHITECTURE = armel
MACHINE = dreamplug
# card usb hdd
DESTINATION = card
+# yes no
+ENABLE_NONFREE = no
BUILD = $(MACHINE)-$(ARCHITECTURE)-$(DESTINATION)
TODAY := `date +%Y-%m-%d`
NAME = build/freedombox-unstable_$(TODAY)_$(BUILD)
@@ -27,7 +29,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) \
+ BUILD_MIRROR=$(BUILD_MIRROR) ENABLE_NONFREE=$(ENABLE_NONFREE) \
taskset 0x01 bin/mk_freedombox_image $(NAME)
# build DreamPlug USB or SD card image
@@ -35,6 +37,7 @@ dreamplug: prep
$(eval ARCHITECTURE = armel)
$(eval MACHINE = dreamplug)
$(eval DESTINATION = card)
+ $(eval ENABLE_NONFREE = yes)
$(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE)
@echo ""
@@ -46,6 +49,7 @@ raspberry: prep
$(eval ARCHITECTURE = armel)
$(eval MACHINE = raspberry)
$(eval DESTINATION = card)
+ $(eval ENABLE_NONFREE = yes)
$(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE)
@echo ""
@@ -57,6 +61,7 @@ beaglebone: prep
$(eval ARCHITECTURE = armhf)
$(eval MACHINE = beaglebone)
$(eval DESTINATION = card)
+ $(eval ENABLE_NONFREE = yes)
$(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE)
@echo ""
diff --git a/bin/freedombox-customize b/bin/freedombox-customize
index 10a2a83..587cac1 100755
--- a/bin/freedombox-customize
+++ b/bin/freedombox-customize
@@ -48,9 +48,15 @@ disable_eatmydata_override() {
set_apt_sources() {
NEW_MIRROR="$1"
+ COMPONENTS="main"
+ if [ "$ENABLE_NONFREE" = "yes" ]
+ then
+ COMPONENTS="main contrib non-free"
+ fi
+
cat <<EOF > etc/apt/sources.list
-deb $NEW_MIRROR $SUITE main contrib non-free
-deb-src $NEW_MIRROR $SUITE main contrib non-free
+deb $NEW_MIRROR $SUITE $COMPONENTS
+deb-src $NEW_MIRROR $SUITE $COMPONENTS
#deb http://security.debian.org/ $SUITE/updates main
#deb-src http://security.debian.org/ $SUITE/updates main
diff --git a/bin/mk_freedombox_image b/bin/mk_freedombox_image
index 8b4bed8..861b32d 100755
--- a/bin/mk_freedombox_image
+++ b/bin/mk_freedombox_image
@@ -23,6 +23,7 @@ export DESTINATION
export MACHINE
export SOURCE
export SUITE
+export ENABLE_NONFREE
# Locate vmdebootstrap program fetched in Makefile
basedir=`pwd`
@@ -121,6 +122,7 @@ sudo -H \
DESTINATION="$DESTINATION" \
MACHINE="$MACHINE" \
ARCHITECTURE="$ARCHITECTURE" \
+ ENABLE_NONFREE="$ENABLE_NONFREE" \
$VMDEBOOTSTRAP \
--log $(dirname $IMAGE)/freedombox.log \
--log-level debug \