-
Notifications
You must be signed in to change notification settings - Fork 108
/
prepare-rpi.sh
executable file
·65 lines (58 loc) · 1.77 KB
/
prepare-rpi.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/bash
set -e
MIRROR=http://archive.raspbian.org/raspbian
VERSION=jessie
# TOOLS_DIR=$PWD/tools
ARMCHROOT=/srv/arm
USER=esteban
sudo apt-get install -yq --no-install-suggests --no-install-recommends --force-yes \
gcc-arm-linux-gnueabi \
gcc-arm-linux-gnueabihf \
qemu-system \
qemu-system-arm \
qemu-user \
qemu-user-static \
sbuild \
schroot \
scratchbox2 \
debootstrap \
zlib1g:i386 \
libstdc++6:i386 \
libffi-dev:i386 \
libffi6:i386 \
libssl1.0.0:i386 \
libbz2-1.0:i386 \
libc6-dev-i386 \
libc6:i386 \
libexpat1:i386 \
libtinfo5:i386 \
binfmt-support \
build-essential \
python-dev \
libffi-dev \
zlib1g-dev
# add chroot
sudo echo "
[rpi]
directory=$ARMCHROOT
users=$USER
root-users=$USER
groups=$USER
aliases=default
type=directory
" >> /etc/schroot/schroot.conf
# chroot
if [ ! -e "$ARMCHROOT/etc/debian_chroot" ]; then
mkdir -p $ARMCHROOT
sudo qemu-debootstrap --no-check-gpg --include=fakeroot,build-essential --arch=armhf ${VERSION} ${ARMCHROOT} ${MIRROR}
sudo su -c "echo \"deb ${MIRROR} jessie main contrib rpi\" > ${ARMCHROOT}/etc/apt/sources.list"
schroot -c rpi -u root -- apt-get update
schroot -c rpi -u root -- apt-get --allow-unauthenticated install -y \
build-essential libcairo2-dev libpango1.0-dev libssl-dev uuid-dev uuid-runtime libasound2-dev \
debhelper devscripts libssl-dev libfreetype6-dev libx11-dev libxext-dev \
libx11-dev libsm-dev libice-dev libgl1-mesa-dev libgl1-mesa-glx git libtool automake autoconf
#needed for third-party libraries
schroot -c rpi -u root -- apt-get --allow-unauthenticated install -y cmake curl
fi
schroot -c rpi -- uname -m
#sudo mount -o remount,size=100M /tmp || echo "No tmp size increase required"