aboutsummaryrefslogtreecommitdiffstats
path: root/org.openembedded.bc.ui/scripts/gumstix_install.sh
blob: 84264ba40a247e2f384b97c0095cdf41ace2dcb3 (plain)
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
65
66
67
68
#!/bin/bash
# Installation script for Gumstix build system.
# Adapted from instructions available at http://www.gumstix.net/Setup-and-Programming/view/Overo-Setup-and-Programming/Setting-up-a-build-environment/111.html
# This script should be executable after substituting ${} variables with real values.
# 4/8/2010 Ken Gilmer, based on a script provided by Ash Charles

# These are the variables that are queried in the UI.  The following lines are parsed by the install wizard.
# {|D|Install Directory|R|${HOME}/gumstix-oe|http://www.gumstix.net/Setup-and-Programming/view/Getting-started/Setting-up-a-build-environment/111.html|Location to install OE metadata.|}
# {|D|Download Directory|R|${HOME}/gumstix-dl||Location to install source packages.|}
# {|D|Build Directory|R|${HOME}/gumstix-build||Location for temporary build files.|}
# {|D|Temp Directory|R|${HOME}/gumstix-tmp||}
# {|T|Repository URL|R|git://gitorious.org/gumstix-oe/mainline.git org.openembedded.dev||}
# {|C|Machine Type|R|overo,verdex||Gumstix device type.|}
# {|T|Init Script|R|build/profile||Environment initialization script.|}
# {|B|Configure Host|R|false||Modify the system configuration file sysctl.conf to work with OpenEmbedded.|}
# {|B|Install Host Packages|R|false||Install required Ubunutu packages.|}

which ssh-askpass
# Installing OE Dependencies
export SUDO_ASKPASS=`which ssh-askpass`
test ${Install Host Packages} = true && sudo -A apt-get update
test ${Install Host Packages} = true && sudo -A apt-get install -y git-core subversion build-essential help2man diffstat texi2html texinfo libncurses5-dev cvs gawk python-dev python-pysqlite2 unzip
# Configuring Host Machine
test ${Configure Host} = true && sudo -A ln -sf /bin/bash /bin/sh
test ${Configure Host} = true && sudo -A sh -c 'echo -e "vm.vdso_enabled=0" >> /etc/sysctl.conf'
test ${Configure Host} = true && sudo -A sh -c 'echo -e "vm.mmap_min_addr=0" >> /etc/sysctl.conf'
test ${Configure Host} = true && sudo -A sysctl -p

# Cloning OE Repository
mkdir -p ${Install Directory}
cd ${Install Directory}
git clone --verbose --progress ${Repository URL}
test ! -d org.openembedded.dev && echo "ERROR: Repository clone of ${Repository URL} failed. !!OTEWIZARDSTOP"

# Configuring Machine Type
cd org.openembedded.dev
git checkout --track -b ${Machine Type} origin/${Machine Type}
# Cloning Bitbake Repository
cd ${Install Directory} 
git clone git://git.openembedded.net/bitbake bitbake
cd bitbake
git checkout 1.8.18

cd ${Install Directory}

# Setup environment
cp -r org.openembedded.dev/contrib/gumstix/build .
cd build/
mv profile profile.orig
echo '# Gumstix OE init file generated by OTE' > profile
echo 'export BB_ENV_EXTRAWHITE="MACHINE DISTRO ANGSTROM_MODE OVEROTOP OEBRANCH USERBRANCH TITOOLSDIR"' >> profile
echo 'export OVEROTOP="${Install Directory}"' >> profile
echo 'export OEBRANCH="${OVEROTOP}/org.openembedded.dev"' >> profile
echo 'export USERBRANCH="${OVEROTOP}/user.collection"' >> profile
echo 'export PATH="${OVEROTOP}/bitbake/bin:$PATH"' >> profile
echo 'export BBPATH="${OVEROTOP}/build:${USERBRANCH}:${OEBRANCH}"' >> profile
echo 'export TITOOLSDIR="${OVEROTOP}/ti"' >> profile
echo 'umask 0002' >> profile

mkdir ${Install Directory}/user.collection

# Fix the locations of the Download and sources directories
cd ${Install Directory}/build/conf/
sed 's|DL_DIR = "${OVEROTOP}/sources"|DL_DIR = "${Download Directory}"|' site.conf > site.conf2
sed 's|TMPDIR = ${OVEROTOP}/tmp|TMPDIR = ${Temp Directory}|' site.conf2 > site.conf3
mv site.conf site.conf.orig
rm site.conf2
mv site.conf3 site.conf