summaryrefslogtreecommitdiff
path: root/howto/armv8-android-fvp-lsk/HOWTO_getsourceandbuild.txt
blob: d1026e6307e3ea9f68fab8311ab697e6d34c51d7 (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
Instructions for "https://android-build.linaro.org/builds/~linaro-android-restricted/armv8-android-fvp-lsk/":https://android-build.linaro.org/builds/~linaro-android-restricted/armv8-android-fvp-lsk/

h2. Prerequisites

To clone the sources you must be able to ssh to git.linaro.org and be part of the big-little-switcher-private group. Contact "Philip Colmer" <philip.colmer@linaro.org> for access requests.

Install build dependencies on Ubuntu:
<pre>
  $ sudo add-apt-repository ppa:linaro-maintainers/tools
  $ sudo apt-get update
  $ sudo apt-get install gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc uboot-mkimage openjdk-7-jdk openjdk-7-jre vim-common python-parted python-yaml wget uuid-dev iasl
</pre>

You can also download linaro android build script(linaro_android_build_cmds.sh) from Downloads section at https://android-build.linaro.org/builds/~linaro-android-restricted/armv8-android-fvp-lsk to do a complete ARMv8 Android build for FVP models from scratch.

h2. Get the source

<pre>
  $ curl "https://android.git.linaro.org/gitweb/tools/repo.git/blob_plain/refs/heads/stable:/repo" >repo
  $ chmod +x repo
  $ ./repo init -u git://android.git.linaro.org/platform/manifest.git -b armv8-linaro -m baseline_manifest.xml
  $ ./repo sync # this may take some time
</pre>

h2. Build

<pre>
  $ export CPUS=`grep -c processor /proc/cpuinfo`
  $ export TARGET_PRODUCT=vexpress
  $ export TARGET_BUILD_VARIANT=userdebug
  $ . build/envsetup.sh
  $ make -j${CPUS} selinuxtarballs
</pre>

h2. Get linaro image tools

Run these commands to get all the dependencies for linaro-image-tools
<pre>
  $ sudo add-apt-repository ppa:linaro-maintainers/tools
  $ sudo apt-get update
  $ sudo apt-get install linaro-image-tools
</pre>
If you're using a "tip" build then we suggest you use the tip of linaro-image-tools from http://git.linaro.org/infrastructure/linaro-image-tools.git

h2. Create binary for ARM FVP Base AEMv8 models

Run linaro image tools

pre. $ linaro-android-media-create --image_file mmc.bin --image_size 2000M --dev vexpress --system system.tar.bz2 --userdata userdata.tar.bz2 --boot boot.tar.bz2

If you're using tip of linaro image tools

pre. $ ./linaro-image-tools/linaro-android-media-create --image_file mmc.bin --image_size 2000M --dev vexpress --system system.tar.bz2 --userdata userdata.tar.bz2 --boot boot.tar.bz2

h2. Extract the preboot files

pre. tar -jxvf boot.tar.bz2

h2. Setup the runtime environment

<pre>
  $ export ARMLMD_LICENSE_FILE="8224@localhost"
  $ ssh -L 8224:localhost:8224 -L 18224:localhost:18224 -N $USER@flexlm.linaro.org
</pre>

h2. Running the models (verified on FVP Base model build 5502)

<pre>
  $ cd boot
  $ /path/to/FVP_Base_AEMv8A-AEMv8A/models/Linux64_GCC-4.1/FVP_Base_AEMv8A-AEMv8A \
        -C pctl.startup=0.0.0.0 \
        -C bp.secure_memory=0 \
        -C cluster0.NUM_CORES=1 \
        -C cluster1.NUM_CORES=1 \
        -C cache_state_modelled=0 \
        -C bp.pl011_uart0.untimed_fifos=1 \
        -C bp.secureflashloader.fname=bl1.bin \
        -C bp.flashloader0.fname=fvp_fip.bin \
        -C bp.virtioblockdevice.image_path=mmc.bin
</pre>

h3. Console redirection

To redirect the console open a terminal and run

pre. telnet 127.0.0.1 5000

h3. Set UEFI configuration, update kernel/ramdisk path and bootargs

Stop the UEFI boot process and configure it for FVP models:

<pre>
$ telnet 127.0.0.1 -debug 5000 -e ^z
Telnet escape character is 'b'.
Telnet escape character is '^Z'.
Trying 127.0.0.1...
setsockopt (SO_DEBUG): Permission denied
Connected to 127.0.0.1.
Escape character is '^Z'.
  7 seconds
[1] Linaro disk image on virtio
[2] Shell
[3] Boot Manager
Start: 2
UEFI Interactive Shell v2.0
EDK II
UEFI v2.40 (ARM Fixed Virtual Platform EFI May 23 2014 12:13:52, 0x00000000)
Mapping table
      FS2: Alias(s):F8:
          VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)
      FS0: Alias(s):F3:
          MemoryMapped(0xB,0x88000000,0x8827FFFF)
      FS1: Alias(s):F4:
          MemoryMapped(0xB,0xFEC16000,0xFEDF987F)
      FS3: Alias(s):HD12b:;BLK5:
          VenHw(FE61BB5F-1B67-4C24-B346-73DB42E873E5)/HD(1,MBR,0x00000000,0x3F,0x41FC0)
      FS4: Alias(s):HD12e2:;BLK10:
          VenHw(FE61BB5F-1B67-4C24-B346-73DB42E873E5)/HD(4,MBR,0x00000000,0x242000,0x1BE000)/HD(2,MBR,0x00000000,0x362020,0x9DFE0)
     BLK3: Alias(s):
          VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)
     BLK0: Alias(s):
          VenHw(02118005-9DA7-443A-92D5-781F022AEDBB)
     BLK1: Alias(s):
          VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)
     BLK2: Alias(s):
          VenHw(CC2CBF29-1498-4CDD-8171-F8B6B41D0909)
     BLK4: Alias(s):
          VenHw(FE61BB5F-1B67-4C24-B346-73DB42E873E5)
Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
Shell> kernel dtb=fvp-base-gicv2-psci.dtb initrd=ramdisk.img console=ttyAMA0 amba-clcd.mode=VGA
EFI stub: Booting Linux Kernel...
[    0.000000] Initializing cgroup subsys cpu2E873E5)/HD(3,MBR,0x00000000,0x1C2000,0x80000)
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.63-00561-g90aa783 (buildslave@x86-64-07-android) (gcc version 4.9 20140514 (prerelease) (GCC) ) #1 SMP PREEMPT Fri Jan 23 14:41:49 CET 2015
</pre>

h3. Black screen

The boot screen has been disabled to speed up booting. This means you may not see anything on the CLCD terminal for a while depending on the performance of the machine the model is running on. For example a first boot on a 2 GHz machine with 32 GB of RAM took 20 minutes. Subsequent boots should take approximately half the time to boot.

h2. Run the Android SDK

h3. Attach ADB

ADB on FVP Base models are supported over network. Follow the instructions here https://wiki.linaro.org/Internal/Projects/Juice/SetupNetworkingOnModelsUsingBridges to setup networking and use adb.

You can also run all of the standard Android SDK tools. Learn more at "http://developer.android.com/sdk/index.html":http://developer.android.com/sdk/index.html