-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-rpi-mesh-node
executable file
·47 lines (39 loc) · 1.06 KB
/
build-rpi-mesh-node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#
# Set up a Raspberry Pi using Debian Jessie as a batman-adv mesh node.
# Based on https://kmp.or.at/~klaus/raspberry/build_rpi_sd_card.sh
set -e
if [ $EUID -ne 0 ]; then
echo "this tool must be run as root"
exit 1
fi
# Avoid problems caused by libpam-tmpdir
unset TMPDIR TEMP TEMPDIR TMP
basedir=$(dirname $0)
builddir=$basedir/build
options=
if [[ ! -e $builddir ]]; then
mkdir $builddir
fi
apt-get install binfmt-support python-cliapp qemu-user-static \
qemu-utils debootstrap kpartx parted mbr vmdebootstrap
vmdebootstrap \
--log=$builddir/debug.log \
--log-level=debug \
--variant minbase \
--arch armel \
--distribution jessie \
--mirror http://httpredir.debian.org/debian \
--image $builddir/test.img \
--size 800M \
--bootsize 64M \
--boottype vfat \
--log-level debug \
--verbose \
--no-kernel \
--no-extlinux \
--root-password raspberry \
--hostname raspberrypi \
--foreign /usr/bin/qemu-arm-static \
--customize $basedir/build-rpi-mesh-node-customize \
$options