refs:
http://www.cnx-software.com/2015/11/23/how-to-build-and-run-brillo-operating-system-from-source-code/
Google formally launched Brillo operating system a few weeks ago. The new operating system is a stripped down version of Android that targets Internet of Things (IoT) applications, and more recently the company pushed the source code to their servers.
So I’ve given it a try by checking out the code, building Brillo emulator for Intel/AMD, and running it in Ubuntu 14.04 64-bit.
First you’ll need to retrieve the source code:
1
2
3
4
|
mkdir
brillo
-
master
cd
brillo
-
master
repo
init
-
u
https
:
//android.googlesource.com/brillo/manifest -b master
repo
sync
-
j8
|
It took a few hours here with some errors the first time, so I tried again and I finally got the code a few hours later. Once this is done, set the build environment and configuration:
1
|
source
build
/
envsetup
.sh
&&
lunch
|
Lunch will bring a list of possible builds:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
You'
re
building
on
Linux
Lunch
menu
.
.
.
pick
a
combo
:
1.
aosp_arm
-
eng
2.
aosp_arm64
-
eng
3.
aosp_mips
-
eng
4.
aosp_mips64
-
eng
5.
aosp_x86
-
eng
6.
aosp_x86_64
-
eng
7.
brilloemulator_arm64
-
eng
8.
brilloemulator_arm
-
eng
9.
brilloemulator_x86_64
-
eng
10.
brilloemulator_x86
-
eng
11.
edison
-
eng
12.
mini_emulator_arm64
-
userdebug
13.
m_e_arm
-
userdebug
14.
mini_emulator_x86_64
-
userdebug
15.
mini_emulator_x86
-
userdebug
16.
brillo_gpios
-
userdebug
17.
brillo_i2c
-
userdebug
18.
brillo_leds
-
userdebug
19.
ledflasher
-
userdebug
Which
would
you
like
?
[
aosp_arm
-
eng
]
9
|
You could also run the “Brillo emulator” on ARM, and edison-eng must be the build for Intel Edison board.
Now you can start the build:
1
|
make
-
j8
|
It has to complete 21491 different tasks, so depending on your computer performance it may take a few dozen of minutes to several hours.
The first time I used some different commands, and the build failed with:
1
2
3
4
5
6
7
8
|
===
===
===
===
===
===
===
===
===
===
===
===
===
===
==
Checking
build
tools
versions
.
.
.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
You
are
attempting
to
build
with
the
incorrect
version
of
java
.
Your
version
is
:
java
version
"1.6.0_45"
Java
(
TM
)
SE
Runtime
Environment
(
build
1.6.0_45
-
b06
)
Java
HotSpot
(
TM
)
64
-
Bit
Server
VM
(
build
20.45
-
b01
,
mixed
mode
)
.
The
required
version
is
:
"1.7.x"
|
and it failed again after switching to Java 1.7.x requesting OpenJDK, so I switched to OpenJDK 7.0 as shown in the error message:
1
2
3
4
5
6
|
sudo
update
-
alternatives
--
config
java
sudo
update
-
alternatives
--
config
javac
sudo
update
-
alternatives
--
config
javap
sudo
update
-
alternatives
--
config
javaws
sudo
update
-
alternatives
--
config
javadoc
sudo
update
-
alternatives
--
config
javah
|
After this configuration changes, running make clean && make -j8 did the trick and the build went much further, but still failed with:
1
|
error
:
ro
.
build
.
fingerprint
cannot
exceed
91
bytes
:
Brillo
/
brilloemulator_x86_64
/
brilloemulator_x86_64
:
6.0
/
MASTER
/
jaufranc11231649
:
eng
/
test
-
keys
(
92
)
|
So I switched to the x86 emulator instead:
1
2
|
lunch
brilloemulator_x86
-
eng
make
-
j8
|
It could build since the fingerprint string was shorter…:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
make_ext4fs
-
T
-
1
-
S
out
/
target
/
product
/
brilloemulator_x86
/
root
/
file_contexts
.
bin
-
L
/
-
l
786432000
-
a
/
out
/
target
/
product
/
brilloemulator_x86
/
obj
/
PACKAGING
/
systemimage_intermediates
/
system
.
img
/
tmp
/
tmpKVfE03
out
/
target
/
product
/
brilloemulator_x86
/
system
Creating
filesystem
with
parameters
:
Size
:
786432000
Block
size
:
4096
Blocks
per
group
:
32768
Inodes
per
group
:
8000
Inode
size
:
256
Journal
blocks
:
3000
Label
:
/
Blocks
:
192000
Block
groups
:
6
Reserved
block
group
size
:
47
Created
filesystem
with
743
/
48000
inodes
and
30413
/
192000
blocks
[
100
%
12222
/
12222
]
Install
system
fs
i
.
.
.
/
product
/
brilloemulator_x86
/
system
.
img
out
/
target
/
product
/
brilloemulator_x86
/
system
.
img
+
out
/
target
/
product
/
brilloemulator_x86
/
recovery
.
img
maxsize
=
802897920
blocksize
=
2112
total
=
793894912
reserve
=
8110080
#### make completed successfully (19:14 (mm:ss)) ####
|
You can now run the emulator:
1
|
.
/
out
/
host
/
linux
-
x86
/
bin
/
brilloemulator
-
x86
|
Let’s check the file system structure:
1
2
3
4
5
6
7
8
9
|
su
# ls
acct
etc
init
.
usb
.
rc
sbin
sys
cache
file_contexts
.
bin
lost
+
found
sdcard
system
config
fstab
.
device
mnt
seapp_contexts
ueventd
.
rc
d
init
oem
selinux_version
vendor
data
init
.
environ
.
rc
proc
sepolicy
default
.
prop
init
.
qemu
.
rc
property_contexts
service_contexts
dev
init
.
rc
root
storage
|
Memory and storage usage:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# df -h
Filesystem
Size
Used
Avail
Use
%
Mounted
on
/
dev
/
root
726M
95M
631M
14
%
/
tmpfs
502M
20K
502M
1
%
/
dev
none
502M
12K
502M
1
%
/
sys
/
fs
/
cgroup
tmpfs
502M
0
502M
0
%
/
mnt
/
dev
/
block
/
vdb
533M
34M
499M
7
%
/
data
tmpfs
502M
0
502M
0
%
/
storage
# free -m
total
used
free
shared
buffers
Mem
:
1003
74
928
0
1
-
/
+
buffers
/
cache
:
73
929
Swap
:
0
0
0
#
|
So the rootfs is kept small at 95MB, and only 74MB RAM is used.
Now the output of dmesg:
And finally the list of processes:
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
|
# ps
USER
PID
PPID
VSIZE
RSS
WCHAN
PC
NAME
root
1
0
3840
1580
ep
_poll
0813c895
S
/
init
root
2
0
0
0
kthreadd
00000000
S
kthreadd
root
3
2
0
0
smpboot
_th
00000000
S
ksoftirqd
/
0
root
4
2
0
0
worker
_thr
00000000
S
kworker
/
0
:
0
root
5
2
0
0
worker
_thr
00000000
S
kworker
/
0
:
0H
root
6
2
0
0
worker
_thr
00000000
S
kworker
/
u2
:
0
root
7
2
0
0
rcu_gp
_kth
00000000
S
rcu_sched
root
8
2
0
0
rcu_gp
_kth
00000000
S
rcu_bh
root
9
2
0
0
smpboot
_th
00000000
S
migration
/
0
root
10
2
0
0
rescuer
_th
00000000
S
khelper
root
11
2
0
0
devtmpfsd
00000000
S
kdevtmpfs
root
12
2
0
0
rescuer
_th
00000000
S
netns
root
13
2
0
0
worker
_thr
00000000
S
kworker
/
u2
:
1
root
14
2
0
0
rescuer
_th
00000000
S
perf
root
49
2
0
0
rescuer
_th
00000000
S
writeback
root
51
2
0
0
rescuer
_th
00000000
S
crypto
root
53
2
0
0
rescuer
_th
00000000
S
bioset
root
55
2
0
0
rescuer
_th
00000000
S
kblockd
root
145
2
0
0
rescuer
_th
00000000
S
ata_sff
root
150
2
0
0
rescuer
_th
00000000
S
md
root
158
2
0
0
worker
_thr
00000000
S
kworker
/
0
:
1
root
159
2
0
0
rescuer
_th
00000000
S
cfg80211
root
279
2
0
0
rescuer
_th
00000000
S
rpciod
root
301
2
0
0
kswapd
00000000
S
kswapd0
root
320
2
0
0
fsnotify
_m
00000000
S
fsnotify_mark
root
327
2
0
0
rescuer
_th
00000000
S
nfsiod
root
354
2
0
0
rescuer
_th
00000000
S
acpi_thermal_pm
root
356
2
0
0
worker
_thr
00000000
S
kworker
/
u2
:
2
root
757
2
0
0
scsi
_error
00000000
S
scsi_eh_0
root
760
2
0
0
rescuer
_th
00000000
S
scsi_tmf_0
root
761
2
0
0
scsi
_error
00000000
S
scsi_eh_1
root
763
2
0
0
rescuer
_th
00000000
S
scsi_tmf_1
root
765
2
0
0
worker
_thr
00000000
S
kworker
/
u2
:
3
root
776
2
0
0
rescuer
_th
00000000
S
kpsmoused
root
778
2
0
0
worker
_thr
00000000
S
kworker
/
0
:
2
root
787
2
0
0
rescuer
_th
00000000
S
binder
root
805
2
0
0
rescuer
_th
00000000
S
ipv6_addrconf
root
819
2
0
0
rescuer
_th
00000000
S
deferwq
root
821
2
0
0
worker
_thr
00000000
S
kworker
/
u2
:
4
root
887
2
0
0
worker
_thr
00000000
S
kworker
/
0
:
3
root
898
2
0
0
kjournald2
00000000
S
jbd2
/
vda
-
8
root
899
2
0
0
rescuer
_th
00000000
S
ext4
-
rsv
-
conver
root
901
1
3404
1316
poll
_sched
0813c970
S
/
sbin
/
ueventd
root
1172
2
0
0
worker
_thr
00000000
S
kworker
/
0
:
1H
root
1173
2
0
0
kjournald2
00000000
S
jbd2
/
vdb
-
8
root
1174
2
0
0
rescuer
_th
00000000
S
ext4
-
rsv
-
conver
logd
1175
1
11364
2760
sigsuspend
b75e0991
S
/
system
/
bin
/
logd
dbus
1179
1
5704
3020
poll_sched
b7388770
S
/
system
/
bin
/
dbus
-
daemon
system
1180
1
4628
2056
binder_thr
b75d3676
S
/
system
/
bin
/
servicemanager
shell
1183
1
4480
2300
sigsuspend
b759f991
S
/
system
/
bin
/
sh
root
1184
1
3652
676
poll
_sched
08112160
S
/
sbin
/
adbd
system
1185
1
5352
3144
poll_sched
b74df770
S
avahi
-
daemon
:
running
[
linux
.
local
]
keystore
1186
1
29000
8688
binder_thr
b6fe0676
S
/
system
/
bin
/
keystore
media
1187
1
71668
16896
binder_thr
b5f97676
S
/
system
/
bin
/
mediaserver
system
1188
1
28740
8764
ep_poll
b7437475
S
/
system
/
bin
/
nativepowerman
root
1189
1
30332
8776
binder_thr
b7472676
S
/
system
/
bin
/
sensorservice
system
1190
1
30484
9780
poll_sched
b5d737f5
S
/
system
/
bin
/
wpa_supplicant
root
1192
1
4480
2368
poll_sched
b75627f5
S
/
system
/
bin
/
sh
system
1193
1
33412
12784
ep_poll
b562f475
S
/
system
/
bin
/
metrics_collector
system
1194
1
9984
3788
ep_poll
b7114475
S
/
system
/
bin
/
metricsd
root
1195
1
4732
2072
hrtimer_na
b75fb8f1
S
/
system
/
xbin
/
perfprofd
root
1196
1
10672
6984
ep_poll
b7329475
S
/
system
/
bin
/
shill
tlsdate
1197
1
6204
3288
ep_poll
b7376475
S
/
system
/
bin
/
tlsdated
root
1199
1
11804
7588
ep_poll
b7339475
S
/
system
/
bin
/
update_engine
system
1200
1
34656
14092
ep_poll
b5937475
S
/
system
/
bin
/
weaved
system
1201
1
33352
13000
ep_poll
b58bf475
S
/
system
/
bin
/
webservd
root
1206
1197
6204
364
pipe_wait
b7377af6
S
/
system
/
bin
/
tlsdated
root
1221
2
0
0
kauditd
_th
00000000
S
kauditd
system
1247
1
7724
5588
ep_poll
b7486475
S
/
system
/
bin
/
firewalld
root
1258
1183
4480
2340
sigsuspend
b75f2991
S
/
system
/
bin
/
sh
root
1267
1258
4684
2132
0
b7477af6
R
ps
|
Some web servers, Weave daemon, a firewall, sensor monitor, adb daemon, etc.. but no ART runtime as found in the full Android. It actually looks more like a light weight Linux distribution, than something based on Android, as the root file system still remains Android like with system, vendor, data… directories.