LoginSignup
1
1

More than 5 years have passed since last update.

brillo の 起動シーケンスを追ってみる

Last updated at Posted at 2015-11-12

Brilloが起動scriptで読み込んでいるserviceは?

前回は、追加gitがどんなコンポーネントなのかを調査したので、今回は、起動時に実行しているserviceをみてみます。

brillo.rc
on boot
    start firewall-setup
    setprop dev.bootcomplete 1

on property:firewall.init=1
    enable firewalld

service firewall-setup /system/etc/init.firewall-setup.sh
    user root
    group root net_admin net_raw
    oneshot

service wifi-setup /system/etc/init.wifi-setup.sh
    class core
    user root
    oneshot

service dbus /system/bin/dbus-daemon --system --nofork
    class core
    socket dbus stream 0660 dbus dbus
    user dbus
    group dbus

service wpa_supplicant /system/bin/wpa_supplicant \
    -Dnl80211 -c/system/lib/shill/shims/wpa_supplicant.conf -u
    class main
    socket wpa_wlan0 dgram 0660 system system
    user system
    group system dbus inet
sensorservice.rc
service sensorservice /system/bin/sensorservice
    class main
    user root
    group system

このように、firewalldを起動した後に、dev.bootcompleteのsystem propertyをflagたてる.

そして、IPCには、DBusが使われている (これは別途解説したいと思いますが、webserverdとlibmicrohttpdの間でGPLのライセンスの関係からprocess分離をしていて、その通信に使っているみたい) (Android本家ではdbusは使わなくなったのと違っておもしろいですね)

device/generic/brillo/kconfig/common.config
CONFIG_ANDROID_BINDER_IPC=y

もあるので、binderは使っています.
(またkernelは3.10, 3.14, 3.18, 4.1を想定しているみたいです)

加えて、product/google以下にもありましたが、sensormanagerではなく、sensorserviceというものでsensorも使えるみたいです。

brilloのデバイスでは、WiFiがあることが前提のようで、wpa_supplicantだけでなく、connectivity managerの1 componentであるshillにも引数でconfを渡していますね.

weaved.rc
service weaved /system/bin/weaved
    class late_start
    user system
    group system dbus inet

根幹の1つであるweavedは、IPCにdbusを使っていることがわかります.

android_filesystem_config.h

device/generic/brillo/fs_config/android_filesystem_config.h
static const struct fs_path_config android_device_files[] = {
    { 00700, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_NET_BIND_SERVICE), "system/bin/dnsmasq" },
    { 00700, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_BLOCK_SUSPEND),    "system/bin/nativepowerman" },
    { 00700, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_SYS_TIME),         "system/bin/tlsdated" },
    { 00700, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_NET_BIND_SERVICE), "system/bin/webservd" },
    { 00700, AID_DHCP,   AID_DBUS,  CAP_MASK_LONG(CAP_NET_ADMIN) |
                                    CAP_MASK_LONG(CAP_NET_BIND_SERVICE) |
                                    CAP_MASK_LONG(CAP_NET_RAW),          "system/bin/dhcpcd-6.8.2" },
    { 00700, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_NET_ADMIN) |
                                    CAP_MASK_LONG(CAP_NET_RAW),          "system/bin/wpa_supplicant" },
    { 00700, AID_BLUETOOTH, AID_SHELL, CAP_MASK_LONG(CAP_BLOCK_SUSPEND) |
                                       CAP_MASK_LONG(CAP_WAKE_ALARM),    "system/bin/bluetoothtbd" },
    { 00550, AID_ROOT,   AID_SHELL, 0,                                   "system/etc/init.firewall-setup.sh" },
    { 00550, AID_ROOT,   AID_SHELL, 0,                                   "system/etc/init.wifi-setup.sh" },
};

とあり、dnsmasq, power managementのnativepowerman, 先に説明したwebservd (brillo内のHTTP/1.1のwebserverで、libmicrohttpdを使っている), DHCP Client daemon, そしてsecureなparasitic rdateの置き換えのreplacement tlsdatedがあります.

つづく。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1