summaryrefslogtreecommitdiff
path: root/apparatus.txt
blob: a5c19e9fa5c169bb99d5480f2f69331103276073 (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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
Host: Debian Jessie
Target: Juno r0, running firmware/filesystem based on 15.06 Linaro firmware release and 15.03 openembedded

These instructions derived from:
https://releases.linaro.org/15.06/members/arm/platforms/
http://releases.linaro.org/openembedded/aarch64/15.07/

Install Required Host Packages
==============================
sudo apt-get install libsdl-dev chrpath acpica-tools bc bison build-essential curl flex g++-multilib gcc-multilib genext2fs git gperf iasl libc6:i386 libstdc++6:i386 libncurses5:i386 libxml2-utils make openjdk-7-jdk python python-mako uuid-dev wget zlib1g:i386 zlib1g-dev:i386 zip


Set Up Host Work Area
=====================

mkdir juno
cd juno

mkdir bin
cd bin
wget http://releases.linaro.org/14.11/components/toolchain/binaries/aarch64-linux-gnu/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu.tar.xz
tar xf gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu.tar.xz
curl https://storage.googleapis.com/git-repo-downloads/repo > repo
sha1sum repo #check version - I have 1.21. See https://source.android.com/source/downloading.html.
chmod a+x repo
cd -
export PATH="`pwd`"/bin:""`pwd`"/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin:${PATH}"

#GET FIRMWARE
mkdir workspace-latest
cd workspace-latest
repo init -u https://git.linaro.org/landing-teams/working/arm/manifest -b 15.06 -m pinned-latest.xml #get manifest. -u: repository, -b: branch, -m manifest file
repo sync -j 2
cd -

cd workspace-latest/linux
git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/firmware/linux
git fetch noise-experiment
git checkout -b juno noise-experiment/juno #get local patch(es)
cd -

cd workspace-latest/uefi/edk2
git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/edk2
git fetch noise-experiment
git checkout -b juno noise-experiment/juno #get local patch(es)
#Change commit e9b4c2f37ac8fdeea381904a8d761a1ec3bd2da2 to have the UUID for the (USB disk partition) that will contain your rootfs
cd -

cd workspace-latest/build-scripts
git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/firmware/build-scripts
git fetch noise-experiment
git checkout -b juno noise-experiment/juno #get local patch(es)
cd -

#Following repositories are duplicated at https://git.linaro.org/people/bernie.ogden/juno-bringup
#They have no local patches, just protect against unlikely event of something changing upstream
for x in manifests repo; do
  cd workspace-latest/.repo/$x
  git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/repo/$x
  git fetch noise-experiment
  git checkout -b juno noise-experiment/juno
  cd -
done
for x in arm-tf ramdisk recovery u-boot uefi/uefi-tools model-scripts busybox; do
  cd workspace-latest/$x
  git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/$x
  git fetch noise-experiment
  git checkout -b juno noise-experiment/juno
  cd -
done

#BUILD FIRMWARE
workspace-latest/build-scripts/build-all.sh juno-oe
workspace-latest/build-scripts/build-all.sh juno-oe package

#GET FILESYSTEM
mkdir openembedded
cd openembedded
git clone -b release-15.03 https://git.linaro.org/openembedded/jenkins-setup.git
sudo jenkins-setup/pre-build-root-install-dependencies.sh
jenkins-setup/init-and-build.sh
cd -

cd openembedded/meta-linaro
git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/meta-linaro
git fetch noise-experiment
git checkout -b juno noise-experiment/juno
#Note that you'll need to replace the public key in commit 2ab2039 with one that you have the corresponding private key for.
cd -

cd openembedded/openembedded-core
git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/openembedded-core
git fetch noise-experiment
git checkout -b juno noise-experiment/juno
cd -

#Following repositories are duplicated at https://git.linaro.org/people/bernie.ogden/juno-bringup
#They have no local patches, just protect against unlikely event of something changing upstream
for x in manifests repo; do
  cd openembedded/.repo/$x
  git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/_oe_/repo/$x
  git fetch noise-experiment
  git checkout -b juno noise-experiment/juno
  cd -
done
for x in meta-openembedded meta-browser jenkins-setup meta-virtualization openembedded-core/bitbake; do
  cd openembedded/$x
  git remote add noise-experiment https://git.linaro.org/people/bernie.ogden/juno-bringup/$x
  git fetch noise-experiment
  git checkout -b juno noise-experiment/juno
  cd -
done

#BUILD FILESYSTEM
cd openembedded/openembedded-core
. oe-init-build-env ../build
MACHINE=noise-experiment-juno bitbake linaro-image-toolchain-benchmark
#Generates a filesystem requiring key authentication for ssh access (as root user). Password access possible over serial port. root has no password.
cd ..

#INSTALL FIRMWARE
#Connect up the USB configuration port to your build system whereby the MMC which populates the NOR flash at boot will be mounted as a new drive
#Assuming you have mounted it at /mnt:
#TAKE CARE WITH THESE COMMANDS
#sudo rm -rf /mnt/* /mnt/.*
#sudo cp -r workspace-latest/recovery/* /mnt
#sudo cp workspace-latest/output/juno-oe/uefi/* /mnt/SOFTWARE
#sudo umount /mnt

#INSTALL ROOT FILESYSTEM
#On some USB drive partition, which I am assuming is mounted at /mnt and is empty:
#(Mine had an ext4 filesystem)
#TAKE CARE WITH THESE COMMANDS:
#sudo tar xf openembedded/build/tmp-glibc/deploy/images/noise-experiment-juno/linaro-image-toolchain-benchmark-noise-experiment-juno-*.rootfs.tar.gz -C /mnt
#sudo cp openembedded/build/tmp-glibc/deploy/images/noise-experiment-juno/linaro-image-toolchain-benchmark-noise-experiment-juno-* /mnt/home/root #To have a record of what the filesystem is installed on the filesystem
#sudo umount /mnt


Then just plug the USB drive into the Juno and power-cycle. Firmware will be updated, then system should boot.

#POST-BOOT CHANGES (these should really be part of the OE build process):
#PBC1: Make logs persistent, in case of crash
rm -f /var/log #this is a link to a location in a tmpfs filesystem
mkdir /var/log
edit /etc/default/volatiles/00_core to comment out the two lines that refer to /var/volatile/log
mv /etc/volatile.cache ~
reboot and confirm that /var/log is now persistent

#PBC2: Fix DHCP
Add something like the following to /etc/dhcp/dhclient.conf, then run /sbin/dhclient:
send host-name "<hostname>.<domainname>";
supersede domain-name "<domainname>";


#Measure 'Settling'
Repeat 5 times:
  sudo shutdown -r 0
  (log in on serial console as soon as target comes up)
  export i=0; while test $i -lt 421; do echo -n "$((i*5)) "; i=$((i+1)); cat /proc/loadavg; sleep 5; done | tee loadavg
  cat /proc/interrupts > interrupt_interation
  mv loadavg loadavg_(iteration)


#Build SPEC
wget http://releases.linaro.org/14.11/components/toolchain/binaries/aarch64-linux-gnu/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu.tar.xz
#Untar above somewhere - I'm going to assuming ~/bin
git clone -b bernie/noise-experiment-build https://git.linaro.org/toolchain/abe #bernie/noise-experiment-build = 5c4b0bd9de86bfceea4f5f0f030ca2a019cb133f in my case
#edit abe/config/sources.conf to point at your source
#My SPEC has SHA1 25b76ee068a92f17e91f748e6bb5221309f8396d
mkdir abe-build
cd abe-build
../abe/configure
../abe/scripts/benchmark.sh -s buildonly -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -c -b CPU2006 noise-control-experiment-juno-a57

#Run SPEC (all experimental conditions)
#First get SPEC onto the target, so that we don't have a single run that starts with a big rsync
(cd ../abe; git checkout bernie/noise-experiment) #bernie-noise-experiment = 3b5b1979595de22d94c3c810df43168513ab9f36 for me
ABE_BENCH_NO_WARN_ON_KEEP=1 \
../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                            -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                            -b CPU2006 -a '-n 1 --size test sjeng' noise-control-experiment-juno-2-base
rm -rf CPU2006-log

#Optionally, do a short run to check that it works
for x in ../abe/config/bench/boards/noise-control-experiment-juno-{2,3}-{aslr,base,env,freq,net,nice}.conf; do
  ssh root@noise-experiment-juno 'shutdown -r 0'
  sleep 30 #give the target some time to go down - otherwise we can succeed in sshing into it BEFORE it goes down
  while ! ssh root@noise-experiment-juno true; do sleep 11; done
  sleep 3 #settling time - first ssh in benchmark script fails if this is set too low(!)
  y="${x##*/}"
  ABE_BENCH_NO_WARN_ON_KEEP=1 \
  ../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                              -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                              -b CPU2006 -a '-n 1 --size test sjeng' "${y%.conf}"
done
rm -rf CPU2006-log

#Now run for real
for i in {1..5}; do
  for x in ../abe/config/bench/boards/noise-control-experiment-juno-{2,3,0}-{aslr,base,env,freq,net,nice}.conf; do
    ssh root@noise-experiment-juno 'shutdown -r 0'
    sleep 30 #give the target some time to go down - otherwise we can succeed in sshing into it BEFORE it goes down
    while ! ssh root@noise-experiment-juno true; do sleep 11; done
    sleep 300 #settling time
    y="${x##*/}"
    ABE_BENCH_NO_WARN_ON_KEEP=1 \
    ../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                                -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                                -b CPU2006 -a '-n 5 --size test' "${y%.conf}"
  done
  mv CPU2006-log run${i}
done







FUTURE WORK?

#New condition - all the other cores
mv CPU2006-log run1
for x in ../abe/config/bench/boards/noise-control-experiment-juno-{1,4,5}-{aslr,base,env,freq,net,nice}.conf; do
  ssh root@noise-experiment-juno 'shutdown -r 0'
  sleep 30 #give the target some time to go down - otherwise we can succeed in sshing into it BEFORE it goes down
  while ! ssh root@noise-experiment-juno true; do sleep 11; done
  sleep 300 #settling time
  y="${x##*/}"
  ABE_BENCH_NO_WARN_ON_KEEP=1 \
  ../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                              -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                              -b CPU2006 -a '-n 5 --size test' "${y%.conf}"
done

#New condition - all cores, with no settling time
mv CPU2006-log run??
for x in ../abe/config/bench/boards/noise-control-experiment-juno-*-{aslr,base,env,freq,net,nice}.conf; do
  ssh root@noise-experiment-juno 'shutdown -r 0'
  while ! ssh root@noise-experiment-juno true; do sleep 11; done
  sleep 300 #settling time
  y="${x##*/}"
  ABE_BENCH_NO_WARN_ON_KEEP=1 \
  ../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                              -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                              -b CPU2006 -a '-n 5 --size test' "${y%.conf}"
done

#New condition - all cores, with no reboots
mv CPU2006-log run??
for x in ../abe/config/bench/boards/noise-control-experiment-juno-*-{aslr,base,env,freq,net,nice}.conf; do
  while ! ssh root@noise-experiment-juno true; do sleep 11; done
  sleep 300 #settling time
  y="${x##*/}"
  ABE_BENCH_NO_WARN_ON_KEEP=1 \
  ../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                              -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                              -b CPU2006 -a '-n 5 --size test' "${y%.conf}"
done


#New condition - all low frequencies on 2 & 3
mv CPU2006-log run??
for x in ../abe/config/bench/boards/noise-control-experiment-juno-{2,3}-{slowest,slower}.conf; do
  ssh root@noise-experiment-juno 'shutdown -r 0'
  sleep 30 #give the target some time to go down - otherwise we can succeed in sshing into it BEFORE it goes down
  while ! ssh root@noise-experiment-juno true; do sleep 11; done
  sleep 300 #settling time
  y="${x##*/}"
  ABE_BENCH_NO_WARN_ON_KEEP=1 \
  ../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                              -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                              -b CPU2006 -a '-n 5 --size test' "${y%.conf}"
done

#FOR RUNNING LATER
#New condition - all high frequencies on 2 & 3
mv CPU2006-log run??
for x in ../abe/config/bench/boards/noise-control-experiment-juno-{2,3}-{faster,fastest}.conf; do
  ssh root@noise-experiment-juno 'shutdown -r 0'
  sleep 30 #give the target some time to go down - otherwise we can succeed in sshing into it BEFORE it goes down
  while ! ssh root@noise-experiment-juno true; do sleep 11; done
  sleep 300 #settling time
  y="${x##*/}"
  ABE_BENCH_NO_WARN_ON_KEEP=1 \
  ../abe/scripts/benchmark.sh -s runonly -c -k -d -j /home/root/work \
                              -i ~/bin/gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc \
                              -b CPU2006 -a '-n 5 --size test' "${y%.conf}"
done