--- /dev/null
+Examples
+========
+
+The Freedombox project are using vmdebootstrap for ARM based images.
+
+http://anonscm.debian.org/cgit/freedombox/freedom-maker.git/
+
+Those scripts have been adapted to work directly within vmdebootstrap
+as customise scripts in this examples directory.
+
+There are also examples which fold all of the options into a single
+script which just needs to be called with a size and an image name.
+
+The only required argument for each example is the image name.
+
+Beaglebone-black
+----------------
+
+sudo ./beagleboneblack.sh --image bbb.img
+
+Arguments other than those already included in the shortcut can also
+be supplied, where required. e.g. --size, --variant, --package (can be
+specified multiple times), --hostname, --sudo, --root-password or
+--lock-root-password.
+
+CubieTruck
+----------
--- /dev/null
+#!/bin/sh -e
+
+[ -f /etc/default/autogetty ] && . /etc/default/autogetty
+
+[ 1 -gt $ENABLED ] && exit
+
+for arg in $(cat /proc/cmdline)
+do
+ case $arg in
+ console=*)
+ tty=${arg#console=}
+ tty=${tty#/dev/}
+
+ case $tty in
+ tty[a-zA-Z]* )
+ PORT=${tty%%,*}
+
+ # check for service which do something on this port
+ if [ -f /etc/init/$PORT.conf ];then continue;fi
+
+ tmp=${tty##$PORT,}
+ SPEED=${tmp%%n*}
+ BITS=${tmp##${SPEED}n}
+
+ # 8bit serial is default
+ [ -z $BITS ] && BITS=8
+ [ 8 -eq $BITS ] && GETTY_ARGS="$GETTY_ARGS -8 "
+
+ [ -z $SPEED ] && SPEED='115200,57600,38400,19200,9600'
+
+ GETTY_ARGS="$AUTOGETTY_ARGS $GETTY_ARGS $SPEED $PORT"
+ exec /sbin/getty $GETTY_ARGS
+ esac
+ esac
+done
--- /dev/null
+#!/bin/sh
+
+set -e
+
+rootdir=$1
+
+# copy u-boot to the boot partition
+cp $rootdir/usr/lib/u-boot/am335x_boneblack/MLO $rootdir/boot/MLO
+cp $rootdir/usr/lib/u-boot/am335x_boneblack/u-boot.img $rootdir/boot/u-boot.img
+
+# Setup uEnv.txt
+kernelVersion=$(basename `dirname $rootdir/usr/lib/*/am335x-boneblack.dtb`)
+version=$(echo $kernelVersion | sed 's/linux-image-\(.*\)/\1/')
+initRd=initrd.img-$version
+vmlinuz=vmlinuz-$version
+
+# uEnv.txt for Beaglebone
+# based on https://github.com/beagleboard/image-builder/blob/master/target/boot/beagleboard.org.txt
+cat >> $rootdir/boot/uEnv.txt <<EOF
+mmcroot=/dev/mmcblk0p2 ro
+mmcrootfstype=ext4 rootwait fixrtc
+
+console=ttyO0,115200n8
+
+kernel_file=$vmlinuz
+initrd_file=$initRd
+
+loadaddr=0x80200000
+initrd_addr=0x81000000
+fdtaddr=0x80F80000
+
+initrd_high=0xffffffff
+fdt_high=0xffffffff
+
+loadkernel=load mmc \${mmcdev}:\${mmcpart} \${loadaddr} \${kernel_file}
+loadinitrd=load mmc \${mmcdev}:\${mmcpart} \${initrd_addr} \${initrd_file}; setenv initrd_size \${filesize}
+loadfdt=load mmc \${mmcdev}:\${mmcpart} \${fdtaddr} /dtbs/\${fdtfile}
+
+loadfiles=run loadkernel; run loadinitrd; run loadfdt
+mmcargs=setenv bootargs console=tty0 console=\${console} root=\${mmcroot} rootfstype=\${mmcrootfstype}
+
+uenvcmd=run loadfiles; run mmcargs; bootz \${loadaddr} \${initrd_addr}:\${initrd_size} \${fdtaddr}
+EOF
+
+mkdir -p $rootdir/boot/dtbs
+cp $rootdir/usr/lib/linux-image-*-armmp/* $rootdir/boot/dtbs
--- /dev/null
+#!/bin/sh
+
+set -e
+
+sudo vmdebootstrap \
+ --owner $(whoami) --verbose \
+ --mirror http://http.debian.net/debian \
+ --log beaglebone-black.log --log-level debug \
+ --arch armhf \
+ --foreign /usr/bin/qemu-arm-static \
+ --enable-dhcp \
+ --configure-apt \
+ --no-extlinux \
+ --no-kernel \
+ --package u-boot \
+ --package linux-image-armmp \
+ --distribution sid \
+ --serial-console-command "'/sbin/getty -L ttyO0 115200 vt100'" \
+ --customize "beagleboneblack-customise.sh" \
+ --bootsize 50m --boottype vfat \
+ "$@"
--- /dev/null
+#!/bin/sh
+
+set -e
+
+rootdir=$1
+
+# u-boot needs to be dd'd to the partition
+#cp /usr/lib/u-boot/Cubietruck/uboot.elf /boot/
+#cp /usr/lib/u-boot/Cubietruck/u-boot-sunxi-with-spl.bin /boot/
+
+mkdir -p $rootdir/boot/dtbs
+cp $rootdir/usr/lib/linux-image-*-armmp/* $rootdir/boot/dtbs
--- /dev/null
+#!/bin/sh
+
+set -e
+
+sudo vmdebootstrap \
+ --owner $(whoami) --verbose \
+ --size 3G \
+ --mirror http://http.debian.net/debian \
+ --log cubietruck.log --log-level debug \
+ --arch armhf \
+ --foreign /usr/bin/qemu-arm-static \
+ --enable-dhcp \
+ --configure-apt \
+ --no-extlinux \
+ --no-kernel \
+ --package u-boot \
+ --package linux-image-armmp \
+ --distribution sid \
+ --serial-console-command "/sbin/getty -L ttyS0 115200 vt100" \
+ --customize "cubietruck-customise.sh" \
+ --serial-console-command \
+ --bootsize 50m --boottype vfat \
+ "$@"
--- /dev/null
+#!/bin/sh
+
+set -e
+
+rootdir=$1
+
+cp auto-serial-console $rootdir/bin/
--- /dev/null
+
+# Run vmdebootstrap script to create image
+sudo \
+ vmdebootstrap \
+ --log ../log \
+ --log-level debug \
+ --size 3G \
+ --image $IMAGE.img \
+ --verbose \
+ --mirror $MIRROR \
+ --customize "$basedir/bin/freedombox-customize" \
+ --arch $ARCHITECTURE \
+ --distribution $SUITE \
+ $extra_opts \
+ $pkgopts
+
+Needs u-boot:armhf & linux-image-armmp:armhf in the image.
+
+sudo ./vmdebootstrap --image ../images/test.img \
+ --size 1g --owner $(whoami) --verbose \
+ --mirror http://mirror.bytemark.co.uk/debian \
+ --log ../images/test.log --log-level debug \
+ --arch armhf \
+ --foreign /usr/bin/qemu-arm-static \
+ --no-extlinux \
+ --no-kernel \
+ --package u-boot \
+ --package linux-image-armmp \
+ --distribution sid \
+ --bootsize 20m --boottype vfat
+
+# copy u-boot specific files
+
+# copy auto-serial-console to /bin/
+
+sudo vmdebootstrap \
+ --enable-dhcp \
+ --serial-console --serial-console-command='/bin/auto-serial-console' \
+ --root-password='root' \
+ --verbose \
+ "$@"
+
+sudo vmdebootstrap \
+ --enable-dhcp --no-kernel --package=linux-image-generic \
+ --serial-console --serial-console-command='/bin/auto-serial-console' \
+ --root-password='root' --hostname='ubuntu' --user=user/pass --sudo \
+ --verbose \