Current location

narf Source control manager Git

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVignan Lavu <vignan.lavu@gmail.com>2015-01-16 17:56:26 +0530
committerVignan Lavu <vignan.lavu@gmail.com>2015-01-18 00:02:36 +0530
commit3a1065b30abc6b62e895574a81b814857f7dcb01 (patch)
tree260eb81b3fef83eacbcd8003325d69c83760a9f8
parentdbfa5d26ea5bb1b6d0bdcb0f03d6330cb7bf52f6 (diff)
Ability to set specific components based on targets
main component for virtualbox target main contrib non-free components for others targets.
-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 93c2a16..dd6830b 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 7d71cd1..896d4f5 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 f0badf9..1497891 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 \