[debian-edu-commits] r82659 - in trunk/src: . raspberry-pi

pere at alioth.debian.org pere at alioth.debian.org
Thu Nov 7 14:20:54 UTC 2013


Author: pere
Date: 2013-11-07 14:20:54 +0000 (Thu, 07 Nov 2013)
New Revision: 82659

Added:
   trunk/src/raspberry-pi/
   trunk/src/raspberry-pi/debian-edu-rpi-build-image
   trunk/src/raspberry-pi/debian-edu-rpi-customize
Log:
Start on build system for Raspberry Pi image.

Added: trunk/src/raspberry-pi/debian-edu-rpi-build-image
===================================================================
--- trunk/src/raspberry-pi/debian-edu-rpi-build-image	                        (rev 0)
+++ trunk/src/raspberry-pi/debian-edu-rpi-build-image	2013-11-07 14:20:54 UTC (rev 82659)
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e # Exit on first error
+set -x # Enable debugging
+
+IMAGE=$1
+if [ -z "$IMAGE" ] ; then
+    IMAGE=raspberry-pi-wheezy
+fi
+
+basedir=$(dirname $0)
+
+sudo apt-get install python-cliapp qemu-user-static kpartx
+
+# Fetch vmdebootstrap version with foreign and separate /boot support
+wget https://gitorious.org/vmdebootstrap/vmdebootstrap/raw/HEAD:vmdebootstrap \
+    -O $basedir/vmdebootstrap
+chmod a+rx $basedir/vmdebootstrap
+
+MIRROR=http://http.debian.net/debian
+SUITE=wheezy
+
+base_pkgs="debian-edu-archive-keyring etckeeper"
+
+for p in $base_pkgs; do
+    pkgopts="$pkgopts --package $p"
+done
+
+# Run vmdebootstrap script to create image
+sudo \
+    SUITE="$SUITE" \
+    MIRROR="$MIRROR" \
+    $basedir/vmdebootstrap \
+    --log vmdebootstrap.log \
+    --log-level debug \
+    --size 10G \
+    --image $IMAGE.img \
+    --hostname localhost \
+    --verbose \
+    --mirror $MIRROR \
+    --customize "$basedir/debian-edu-rpi-customize" \
+    --root-password skolelinux \
+    --arch armel \
+    --distribution $SUITE \
+    --bootsize 128M \
+    --boottype vfat \
+    --no-kernel \
+    --no-extlinux \
+    --foreign /usr/bin/qemu-arm-static \
+    --enable-dhcp \
+    $pkgopts


Property changes on: trunk/src/raspberry-pi/debian-edu-rpi-build-image
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/raspberry-pi/debian-edu-rpi-customize
===================================================================
--- trunk/src/raspberry-pi/debian-edu-rpi-customize	                        (rev 0)
+++ trunk/src/raspberry-pi/debian-edu-rpi-customize	2013-11-07 14:20:54 UTC (rev 82659)
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+set -x
+rootdir="$1"
+cd "$rootdir"
+
+export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
+export LC_ALL=C LANGUAGE=C LANG=C
+
+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
+
+chroot $rootdir apt-get update
+
+wget 'http://anonscm.debian.org/viewvc/debian-edu/branches/wheezy/debian-edu-config/share/debian-edu-config/tools/debian-edu-bless?view=co' \
+     -O $rootdir/root/debian-edu-bless
+chmod a+rx $rootdir/root/debian-edu-bless
+
+mount -t proc proc $root/proc
+
+cat > $rootdir/usr/sbin/policy-rc.d <<EOF
+#!/bin/sh
+exit 101
+EOF
+chmod a+rx $rootdir/usr/sbin/policy-rc.d
+
+PROFILE=Workstation \
+    DESKTOP=xfce \
+    EDUSUITE=$SUITE-test \
+    chroot $rootdir /root/debian-edu-bless
+
+rm $rootdir/usr/sbin/policy-rc.d
+
+umount $rootdir/proc
+
+# Install non-free binary blob needed to boot Raspberry Pi.  This
+# install a kernel somewhere too.
+wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update \
+    -O $rootdir/usr/bin/rpi-update
+chmod a+x $rootdir/usr/bin/rpi-update
+mkdir -p $rootdir/lib/modules
+#touch $rootdir/boot/start.elf
+chroot $rootdir rpi-update # > $rootdir/root/rpi-update.log
+
+# Remove files that need to be generated on first boot
+cleanup() {
+    for file in \
+	/etc/ssh/ssh_host_dsa_key \
+	/etc/ssh/ssh_host_dsa_key.pub \
+	/etc/ssh/ssh_host_ecdsa_key \
+	/etc/ssh/ssh_host_ecdsa_key.pub \
+	/etc/ssh/ssh_host_rsa_key \
+	/etc/ssh/ssh_host_rsa_key.pub
+    do
+	rm -f $rootfs$file
+    done
+}


Property changes on: trunk/src/raspberry-pi/debian-edu-rpi-customize
___________________________________________________________________
Added: svn:executable
   + *




More information about the debian-edu-commits mailing list