aboutsummaryrefslogtreecommitdiffstats
path: root/packer/provision/agl_dependencies.sh
blob: 5a8a0fccfc5c4aa2a7347e73c7e1c02103b6e770 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/bin/bash
# vim: sw=2 ts=2 sts=2 et :

set -x

sudo su -c "echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until"


sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 8B48AD6246925553 || true

# go
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com F6BC817356A3D45E || true

sudo su -c "sed -i 's;http://archive.debian.org/debian;http://deb.debian.org/debian;' /etc/apt/sources.list"
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010 || true

cat /etc/apt/sources.list

# Make sure that we aren't using the vexxhost mirrors as they have issues
echo "---> Removing Vexxhost Ubuntu mirrors"
sed -i 's/ubuntu.mirror.vexxhost.com/us.archive.ubuntu.com/g' /etc/apt/sources.list

cat /etc/apt/sources.list

DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y -u dist-upgrade

DEBIAN_FRONTEND=noninteractive apt-get update && \
    apt-get -y install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat \
                       libsdl1.2-dev xterm make xsltproc docbook-utils fop dblatex xmlto autoconf automake \
                       libtool libglib2.0-dev libarchive-dev python-git git python python-minimal repo \
                       tree rsync python-yaml python-requests curl tar docker.io pandoc python3 \
                       ruby-all-dev ruby-ffi ruby-ffi-* jekyll ruby-redcarpet mkdocs \
                       python-pip python-simplejson g++-multilib make zip unzip iperf3 \
                       debian-keyring debian-archive-keyring python3-yaml python3-pip

# Adding stretch-backports for lavacli
echo "deb https://apt.lavasoftware.org/release stretch-backports main" >> /etc/apt/sources.list

wget https://apt.lavasoftware.org/lavasoftware.key.asc
sudo apt-key add lavasoftware.key.asc
rm lavasoftware.key.asc
#sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com A791358F2E49B100

DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -t stretch-backports lavacli

# we have a build blocker wrt useradd - I assume it is caused by /bin/sh being dash
# systemd: Performing useradd with
echo "dash dash/sh boolean false" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash

# add user ubuntu to docker group:
sudo usermod -a -G docker ubuntu

cat <<EOFHOSTS >> /etc/hosts

# workaround for download
10.30.72.8 download.automotivelinux.org
10.30.72.8 download-internal.automotivelinux.org

EOFHOSTS

# install newer version of jjb ... fixes issues with rendering
sudo pip install --upgrade --force-reinstall -v jenkins-job-builder==1.6.1

cat <<EOFSYSCTL >> /etc/sysctl.conf
# we have a lot of make jobs, this helps a lot
kernel.sched_child_runs_first = 1
# smooth over a lot of I/O requests and do less blocking
vm.dirty_background_bytes = 0
vm.dirty_background_ratio = 20
vm.dirty_expire_centisecs = 4320000
vm.dirtytime_expire_seconds = 432000
vm.dirty_bytes = 0
vm.dirty_ratio = 80
vm.dirty_writeback_centisecs = 0

# disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1

EOFSYSCTL

### webdocs + xds
# taken from container setup script. not documented in readme.
# install node.js and tools (npm, gulp, bower)
#
curl -v --connect-timeout 60 --retry 3 -sL https://deb.nodesource.com/setup_8.x | bash -
DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
which -a npm
dpkg -L nodejs
npm install --global gulp bower

################### SDX181207 { - obsolete: section until closing brace should be removed after migration to next docsite
# tools used to generate developer website (https://github.com/automotive-grade-linux/docs-agl)
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
    && curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=jekyll


mkdir -p /opt/AGL
cd /opt/AGL/
#mkdir webdocs
#cd webdocs
#git clone http://github.com/iotbzh/webdocs-tools
#git clone http://github.com/iotbzh/webdocs-sample
git clone https://github.com/automotive-grade-linux/docs-agl

cd ./docs-agl/doctools/webdocs/
npm install
#gem install --no-user-install -V kramdown
#gem install --no-user-install -V jekyll-plantuml

#gem install --no-user-install -V --version 3.1.6 jekyll
#gem install --no-user-install -V --version 1.13.1 kramdown

### hope that is enough
################### SDX181207 } - (closing brace)

# ruby markdown linter
sudo gem install mdl

# python markdown linter
sudo pip install mdlint

# releng-scripts needs latest (stable v2.9) jinja2
sudo pip install --force-reinstall --ignore-installed jinja2
sudo pip install --upgrade jinja2
sudo pip3 install --force-reinstall --ignore-installed jinja2
sudo pip3 install --upgrade jinja2

python -c "import sys; print sys.path"

sudo pip show jinja2
sudo pip3 show jinja2

# install go for xds build

source /etc/os-release
wget -O - "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x52B59B1571A79DBC054901C0F6BC817356A3D45E" | sudo apt-key add -
sudo bash -c "cat >> /etc/apt/sources.list.d/golang.list <<EOF
deb http://ppa.launchpad.net/longsleep/golang-backports/ubuntu ${VERSION_CODENAME} main
EOF"
sudo apt-get update
sudo apt-get install golang-go

# Crossbuild standard go libraries for MacOS and Windows
sudo GOOS=darwin GOARCH=amd64 go install -v -a std
sudo GOOS=windows GOARCH=amd64 go install -v -a std

exit 0