LoginSignup
0
0

More than 5 years have passed since last update.

Brillo と ChromeOSの関係を、system/coreやbtにみる

Last updated at Posted at 2015-11-16

Chrome OS と Brilloの関係

ここ で、brilloのコードの中には、Chrome OSから持ってきたものがと書きましたが、それは以下のようなcommitからもわかります。

commit.message
system/core: Rename "chromeos" -> "brillo" in include paths and namespaces

libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.

Bug: 24872993
Change-Id: I797613a38c7444a113f12e38366a424388477276
crash_reporter/crash_collector.cc
 #include <base/strings/string_split.h>
 #include <base/strings/string_util.h>
 #include <base/strings/stringprintf.h>
-#include <chromeos/key_value_store.h>
-#include <chromeos/process.h>
+#include <brillo/key_value_store.h>
+#include <brillo/process.h>

 namespace {

@@ -340,7 +340,7 @@
 bool CrashCollector::GetLogContents(const FilePath &config_path,
                                     const std::string &exec_name,
                                     const FilePath &output_file) {
-  chromeos::KeyValueStore store;
+  brillo::KeyValueStore store;
   if (!store.Load(config_path)) 

commit.message
core: Rename libchromeos into libbrillo

BUG: 24872993
Change-Id: Ia47ad51140f7e384822eea9d5de46c9f51ceda11
metricsd/Android.mk
  -fvisibility=default
 metrics_includes := external/gtest/include \
   $(LOCAL_PATH)/include
-libmetrics_shared_libraries := libchrome libchromeos
+libmetrics_shared_libraries := libchrome libbrillo
 metrics_daemon_shared_libraries := $(libmetrics_shared_libraries) \
+  libbrillo-http \
+  libbrillo-dbus \
   libchrome-dbus \
-  libchromeos-http \
-  libchromeos-dbus \
   libdbus \
   libmetrics \
   libprotobuf-cpp-lite \

こういうのをみていると、OSの名前とか(特定用途なものの名前)を汎用的なコンポーネントにつけると、流用性が損なわれるのがわかりますね。。。

build time変数

system/extras/brillo_config/Android.mk
Add an Android.mk to generate build time configuration.

Some build time variables need to be installed on the image. Instead of
adding those fields in some system services, create a new Android.mk for
it.

brilloのbt service "bluetoothtbd"

bluetoothtbd.rc
service bluetoothtbd /system/bin/bluetoothtbd
    class main
    user bluetooth
    group system net_bt_admin net_bt_stack

Android.mk
# Common variables
# ========================================================
btserviceCommonSrc := \
    adapter.cpp \
    adapter_state.cpp \
    daemon.cpp \
    gatt_server.cpp \
    hal/bluetooth_interface.cpp \
    ipc/ipc_handler.cpp \
    ipc/ipc_handler_unix.cpp \
    ipc/ipc_manager.cpp \
    ipc/unix_ipc_host.cpp \
    logging_helpers.cpp \
    settings.cpp \
    util/atomic_string.cpp \
    uuid.cpp
btserviceBinderSrc := \
    ipc/binder/bluetooth_binder_server.cpp \
    ipc/binder/IBluetooth.cpp \
    ipc/binder/IBluetoothCallback.cpp \
    ipc/binder/ipc_handler_binder.cpp
btserviceCommonIncludes := $(LOCAL_PATH)/../
# Native system service for target
# ========================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
    $(btserviceBinderSrc) \
    $(btserviceCommonSrc) \
    main.cpp
LOCAL_C_INCLUDES += $(btserviceCommonIncludes)
LOCAL_CFLAGS += -std=c++11
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := bluetoothtbd
LOCAL_REQUIRED_MODULES = bluetooth.default
LOCAL_STATIC_LIBRARIES += libbtcore
LOCAL_SHARED_LIBRARIES += \
    libbinder \
    libchrome \
    libcutils \
    libhardware \
    liblog \
    libutils
LOCAL_INIT_RC := bluetoothtbd.rc
include $(BUILD_EXECUTABLE)

このように、大変シンプルです。しかし、TBDってなんでしょう???

(ここでも、libchromeが・・・)

つづく

0
0
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
0
0