diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2014-12-06 10:29:06 +0100 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2014-12-06 10:29:30 +0100 |
commit | 78b269e1aac36b6e1a70d7bf5e8db5d6a3a8f5e7 (patch) | |
tree | ba049d7049976f90fe18dce6859da97bbc87ea94 | |
parent | 253453e28b9f957f3985384ba675610f0906cfd7 (diff) | |
parent | 7088815ac7f40283c631c1bdadbbe1e8352f4048 (diff) |
Merge branch 'master' of github.com:freedombox/freedom-maker.
-rw-r--r-- | Makefile | 69 | ||||
-rwxr-xr-x | bin/freedombox-customize | 8 | ||||
-rwxr-xr-x | bin/mk_freedombox_image | 27 |
3 files changed, 65 insertions, 39 deletions
@@ -1,12 +1,11 @@ #! /usr/bin/make # Where to fetch packages -MIRROR=http://http.debian.net/debian -SUITE=unstable +MIRROR = http://http.debian.net/debian # armel amd64 i386 ARCHITECTURE = armel -# dreamplug guruplug virtualbox +# dreamplug guruplug virtualbox raspberry(pi) MACHINE = dreamplug # card usb hdd DESTINATION = card @@ -17,47 +16,63 @@ WEEKLY_DIR = torrent/freedombox-unstable_$(TODAY) IMAGE = $(NAME).img ARCHIVE = $(NAME).tar.bz2 SIGNATURE = $(ARCHIVE).sig +SUITE = sid +SOURCE = false +OWNER = 1000 +TAR = tar --checkpoint=1000 --checkpoint-action=dot -cjvf +SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE) # Using taskset to pin build process to single core. This is a # workaround for a qemu-user-static issue that causes builds to # hang. (See Debian bug #769983 for details.) +MAKE_IMAGE = ARCHITECTURE=$(ARCHITECTURE) DESTINATION=$(DESTINATION) \ + MACHINE=$(MACHINE) SOURCE=$(SOURCE) MIRROR=$(MIRROR) SUITE=$(SUITE) OWNER=$(OWNER) \ + taskset 0x01 bin/mk_freedombox_image $(NAME) # build DreamPlug USB or SD card image -dreamplug-image: prep +dreamplug: prep $(eval ARCHITECTURE = armel) $(eval MACHINE = dreamplug) $(eval DESTINATION = card) - ARCHITECTURE=$(ARCHITECTURE) MACHINE=$(MACHINE) DESTINATION=$(DESTINATION) \ - MIRROR=$(MIRROR) SUITE=$(SUITE) \ - taskset 0x01 bin/mk_freedombox_image $(NAME) - tar -cjvf $(ARCHIVE) $(IMAGE) - -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE) + $(MAKE_IMAGE) + $(TAR) $(ARCHIVE) $(IMAGE) + @echo "" + $(SIGN) @echo "Build complete." # build Raspberry Pi SD card image -raspberry-image: prep +raspberry: prep $(eval ARCHITECTURE = armel) $(eval MACHINE = raspberry) $(eval DESTINATION = card) - ARCHITECTURE=$(ARCHITECTURE) MACHINE=$(MACHINE) DESTINATION=$(DESTINATION) \ - MIRROR=$(MIRROR) SUITE=$(SUITE) \ - taskset 0x01 bin/mk_freedombox_image $(NAME) - tar -cjvf $(ARCHIVE) $(IMAGE) - -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE) + $(MAKE_IMAGE) + $(TAR) $(ARCHIVE) $(IMAGE) + @echo "" + $(SIGN) + @echo "Build complete." + +# build Beaglebone SD card image +beaglebone: prep + $(eval ARCHITECTURE = armhf) + $(eval MACHINE = beaglebone) + $(eval DESTINATION = card) + $(MAKE_IMAGE) + $(TAR) $(ARCHIVE) $(IMAGE) + @echo "" + $(SIGN) @echo "Build complete." # build a virtualbox image -virtualbox-image: prep +virtualbox: prep $(eval ARCHITECTURE = i386) $(eval MACHINE = virtualbox) $(eval DESTINATION = hdd) - ARCHITECTURE=$(ARCHITECTURE) MACHINE=$(MACHINE) DESTINATION=$(DESTINATION) \ - MIRROR=$(MIRROR) SUITE=$(SUITE) \ - bin/mk_freedombox_image $(NAME) + $(MAKE_IMAGE) # Convert image to vdi hard drive VBoxManage convertdd $(NAME).img $(NAME).vdi - tar -cjvf $(ARCHIVE) $(NAME).vdi - -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE) + $(TAR) $(ARCHIVE) $(NAME).vdi + @echo "" + $(SIGN) @echo "Build complete." vendor/vmdebootstrap/vmdebootstrap: vendor-patches/vmdebootstrap/*.patch @@ -72,15 +87,3 @@ clean: distclean: clean sudo rm -rf build - -weekly-image: dreamplug-image raspberry-image virtualbox-image - mkdir -p $(WEEKLY_DIR) - mv build/*bz2 build/*sig $(WEEKLY_DIR) - cp weekly_template.org $(WEEKLY_DIR)/README.org - echo "http://betweennowhere.net/freedombox-images/$(WEEKLY_DIR)" > torrent/webseed - @echo "" - @echo "----------" - @echo "When the README has been updated, hit Enter." - read X - mktorrent -a `cat torrent/trackers` -w `cat torrent/webseed` $(WEEKLY_DIR) - mv $(WEEKLY_DIR).torrent torrent/ diff --git a/bin/freedombox-customize b/bin/freedombox-customize index e6e6f16..06cd706 100755 --- a/bin/freedombox-customize +++ b/bin/freedombox-customize @@ -71,6 +71,14 @@ chroot $rootdir adduser --gecos $username --disabled-password $username echo $username:$password | chroot $rootdir /usr/sbin/chpasswd chroot $rootdir adduser $username sudo +case "$MACHINE" in + virtualbox) + # hide irrelevant console keyboard messages. + echo "echo \"4 4 1 7\" > /proc/sys/kernel/printk" \ + >> /etc/init.d/rc.local + ;; +esac + cat <<EOF > etc/apt/sources.list deb $MIRROR $SUITE main contrib non-free deb-src $MIRROR $SUITE main contrib non-free diff --git a/bin/mk_freedombox_image b/bin/mk_freedombox_image index 9a8437b..b550bb5 100755 --- a/bin/mk_freedombox_image +++ b/bin/mk_freedombox_image @@ -18,6 +18,11 @@ set -e # Exit on first error #set -x # Enable debugging IMAGE=$1 +export ARCHITECTURE +export DESTINATION +export MACHINE +export SOURCE +export SUITE # Locate vmdebootstrap program fetched in Makefile basedir=`pwd` @@ -36,14 +41,13 @@ logrotate module-init-tools netbase rsyslog udev debian-archive-keyring" # Packages needed on the dreamplug dreamplug_pkgs="linux-image-kirkwood u-boot-tools u-boot" +# Packages needed on the beaglebone +beaglebone_pkgs="linux-image-armmp u-boot-tools u-boot" + # Packages needed for gui-based self-hosted development dev_pkgs="task-xfce-desktop emacs org-mode git mercurial iceweasel ca-certificates" -if [ -z "$ARCHITECTURE" ] ; then - ARCHITECTURE=i386 -fi - -echo building $MACHINE for $ARCHITECTURE +echo Building $MACHINE FreedomBox for $ARCHITECTURE. case "$MACHINE" in raspberry) @@ -67,6 +71,17 @@ case "$MACHINE" in --foreign /usr/bin/qemu-arm-static \ " ;; + beaglebone) + extra_pkgs="$beaglebone_pkgs" + extra_opts="\ + --variant minbase \ + --bootsize 128M \ + --boottype vfat \ + --no-kernel \ + --no-extlinux \ + --foreign /usr/bin/qemu-arm-static \ +" + ;; virtualbox) extra_opts="\ --grub \ @@ -108,7 +123,7 @@ sudo -H \ $VMDEBOOTSTRAP \ --log $(dirname $IMAGE)/freedombox.log \ --log-level debug \ - --size 3G \ + --size 4G \ --image $IMAGE.img \ --hostname freedombox \ --verbose \ |