Skip to content
This repository has been archived by the owner on Mar 7, 2022. It is now read-only.

Commit

Permalink
Initial commit - USB and graphical support
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentRevest committed May 4, 2019
0 parents commit 88339e9
Show file tree
Hide file tree
Showing 27 changed files with 1,858 additions and 0 deletions.
340 changes: 340 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions README-system-dir
@@ -0,0 +1,49 @@
/system/ directory build instructions
=====================================

The /system/ directory available on the mooneye platform and provided in
prebuilt form by android_mooneye-o.bb is a tricky mix of an original WearOS
/system and some recompiled parts. This is due to the half-closed nature of
WearOS. This file explains you how to rebuild manually your own /system dir.

We first need to adb pull a /system directory from a living WearOS 8.0.0
installation:
adb pull /system/ system
cd system/
rm -rf app/ fake-libs fonts/ framework/ media/ priv-app/ usr/ xbin/ manifest.xml etc/init vendor/etc/init

This installation wouldn't be enough because libhybris needs a patched bionic
Thankfully, bionic is open-source so we can download AOSP and build it. (This
may take a while)
### Download
curl https://storage.googleapis.com/git-repo-downloads/repo > repo
chmod a+x repo
mkdir -p android-o/
cd android-o
../repo init -u https://github.com/AsteroidOS/android_manifest -b android-8.0.0_r36
../repo sync

### Build (can only be done in bash)
. build/envsetup.sh
mmma system/core/init/
mma libminisf

### Installation
cp out/target/product/generic/root/init ../system/bin/
chmod +x ../system/bin/*
mkdir -p ../usr/libexec/hal-droid/system/
cp -r out/target/product/generic/system/lib ../usr/libexec/hal-droid/system

libhybris headers
=================

The second part of this tarball contains header files to compile against
libhybris. There is a script in the libhybris distribution that can pull
the header files from the downloaded android distribution (above).

git clone https://github.com/libhybris/libhybris
./libhybris/utils/extract_headers.sh android-mooneye include 8 0 0

With the system and include directories, you can create the system-dir tarball:

tar zcvf system.tar.gz system include usr
6 changes: 6 additions & 0 deletions conf/layer.conf
@@ -0,0 +1,6 @@
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
BBFILE_COLLECTIONS += "mooneye-hybris-layer"
BBFILE_PATTERN_mooneye-hybris-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_mooneye-hybris-layer = "7"
LAYERSERIES_COMPAT_mooneye-hybris-layer = "thud"
15 changes: 15 additions & 0 deletions conf/machine/mooneye.conf
@@ -0,0 +1,15 @@
#@TYPE: Machine
#@NAME: Ticwatch E & S
#@DESCRIPTION: Machine configuration for the Ticwatch E & S

require conf/machine/include/tune-cortexa7.inc
require conf/machine/include/hybris-watch.inc

MACHINE_DISPLAY_ROUND = "true"
MACHINE_HAS_WLAN = "true"

PREFERRED_VERSION_android = "oreo"
PREFERRED_PROVIDER_virtual/kernel = "linux-mooneye"
PREFERRED_VERSION_linux = "3.10+lollipop"

IMAGE_INSTALL += "android-tools android-system"
42 changes: 42 additions & 0 deletions recipes-android/android-init/android-init/init.rc
@@ -0,0 +1,42 @@
on init
load_all_props
setprop ro.board.platform mt2601
class_start core

service logd /system/bin/logd
class core
socket logd stream 0666 root root
socket logdr seqpacket 0666 root root
socket logdw dgram 0222 root root

service servicemanager /system/bin/servicemanager
class core

service 662x_launcher /vendor/bin/6620_launcher -m 4 -p /system/etc/firmware/
class core

service wmtLoader /vendor/bin/wmt_loader
class core
oneshot

service nvram_daemon /vendor/bin/nvram_daemon
class core
oneshot

service configstore-hal-1-0 /vendor/bin/hw/android.hardware.configstore@1.0-service
class core

service gralloc-2-0 /vendor/bin/hw/android.hardware.graphics.allocator@2.0-service
capabilities SYS_NICE
class core

service memtrack-hal-1-0 /vendor/bin/hw/android.hardware.memtrack@1.0-service
class core

service vndservicemanager /vendor/bin/vndservicemanager /dev/vndbinder
class core
writepid /dev/cpuset/system-background/tasks

service ril-daemon /vendor/bin/hw/rild
class core
capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
@@ -0,0 +1,14 @@
ccci.decrypt.state u:object_r:ccci_decrypt_state_prop:s0
ctl.bmc156d u:object_r:ctl_bmc156d_prop:s0
ctl.ccci_fsd u:object_r:ctl_ccci_fsd_prop:s0
ctl.gsm0710muxd u:object_r:ctl_gsm0710muxd_prop:s0
ctl.mdlogger u:object_r:ctl_mdlogger_prop:s0
ctl.msensord u:object_r:ctl_msensord_prop:s0
ctl.ril-daemon-mtk u:object_r:ctl_ril-daemon-mtk_prop:s0
debug.mtklog u:object_r:debug_mtklog_prop:s0
debug.netlog u:object_r:debug_netlog_prop:s0
persist.af. u:object_r:audioserver_prop:s0
persist.mtk.aee u:object_r:persist_mtk_aee_prop:s0
persist.mtklog u:object_r:persist_mtklog_prop:s0
persist.mtk. u:object_r:mediatek_persist_prop:s0
service.nvram_init u:object_r:nvram_init_prop:s0
91 changes: 91 additions & 0 deletions recipes-android/android-init/android-init/plat_property_contexts
@@ -0,0 +1,91 @@
asan.restore_reboot u:object_r:asan_reboot_prop:s0
bluetooth. u:object_r:bluetooth_prop:s0
config. u:object_r:config_prop:s0
ctl.adbd u:object_r:ctl_adbd_prop:s0
ctl.bootanim u:object_r:ctl_bootanim_prop:s0
ctl.bugreport u:object_r:ctl_bugreport_prop:s0
ctl.console u:object_r:ctl_console_prop:s0
ctl.dumpstate u:object_r:ctl_dumpstate_prop:s0
ctl.fuse_ u:object_r:ctl_fuse_prop:s0
ctl.mdnsd u:object_r:ctl_mdnsd_prop:s0
ctl.ril-daemon u:object_r:ctl_rildaemon_prop:s0
ctl. u:object_r:ctl_default_prop:s0
dalvik. u:object_r:dalvik_prop:s0
debug.db. u:object_r:debuggerd_prop:s0
debug. u:object_r:debug_prop:s0
dev. u:object_r:system_prop:s0
dhcp.bt-pan.result u:object_r:pan_result_prop:s0
dhcp. u:object_r:dhcp_prop:s0
dumpstate.options u:object_r:dumpstate_options_prop:s0
dumpstate. u:object_r:dumpstate_prop:s0
gsm. u:object_r:radio_prop:s0
hwservicemanager. u:object_r:hwservicemanager_prop:s0
hw. u:object_r:system_prop:s0
logd.logpersistd u:object_r:logpersistd_logging_prop:s0
log.tag.MicReader u:object_r:clockwork_log_prop:s0
log.tag.rpcs u:object_r:clockwork_log_prop:s0
log.tag.rpctransport u:object_r:clockwork_log_prop:s0
log.tag.SearchClient u:object_r:clockwork_log_prop:s0
log.tag u:object_r:log_tag_prop:s0
log.tag.VoiceLatencyLogger u:object_r:clockwork_log_prop:s0
log.tag.voicelatency u:object_r:clockwork_log_prop:s0
log.tag.voicelatencyutil u:object_r:clockwork_log_prop:s0
log.tag.WearableService u:object_r:clockwork_log_prop:s0
log.tag.WifiHAL u:object_r:wifi_log_prop:s0
log. u:object_r:log_prop:s0
net.cdma u:object_r:net_radio_prop:s0
net.dns u:object_r:net_dns_prop:s0
net.gprs u:object_r:net_radio_prop:s0
net.lte u:object_r:net_radio_prop:s0
net.ppp u:object_r:net_radio_prop:s0
net.qmi u:object_r:net_radio_prop:s0
net.rmnet u:object_r:net_radio_prop:s0
net. u:object_r:system_prop:s0
nfc. u:object_r:nfc_prop:s0
persist.audio. u:object_r:audio_prop:s0
persist.bluetooth. u:object_r:bluetooth_prop:s0
persist.debug. u:object_r:persist_debug_prop:s0
persist.logd.logpersistd u:object_r:logpersistd_logging_prop:s0
persist.logd.security u:object_r:device_logging_prop:s0
persist.logd. u:object_r:logd_prop:s0
persist.log.tag u:object_r:log_tag_prop:s0
persist.mmc. u:object_r:mmc_prop:s0
persist.radio u:object_r:radio_prop:s0
persist.security. u:object_r:system_prop:s0
persist.service.bdroid. u:object_r:bluetooth_prop:s0
persist.service. u:object_r:system_prop:s0
persist.sys.audit_safemode u:object_r:safemode_prop:s0
persist.sys.safemode u:object_r:safemode_prop:s0
persist.sys. u:object_r:system_prop:s0
persist.vendor.overlay. u:object_r:overlay_prop:s0
ril. u:object_r:radio_prop:s0
ro.boot.btmacaddr u:object_r:bluetooth_prop:s0
ro.boot.serialno u:object_r:serialno_prop:s0
ro.boottime. u:object_r:boottime_prop:s0
ro.boot.vendor.overlay. u:object_r:overlay_prop:s0
ro.bt. u:object_r:bluetooth_prop:s0
ro.build.fingerprint u:object_r:fingerprint_prop:s0
ro.config. u:object_r:config_prop:s0
ro.crypto. u:object_r:vold_prop:s0
ro.dalvik. u:object_r:dalvik_prop:s0
ro.device_owner u:object_r:device_logging_prop:s0
ro.hw. u:object_r:system_prop:s0
ro.persistent_properties.ready u:object_r:persistent_properties_ready_prop:s0
ro.ril. u:object_r:radio_prop:s0
ro.runtime.firstboot u:object_r:firstboot_prop:s0
ro.runtime. u:object_r:system_prop:s0
ro.serialno u:object_r:serialno_prop:s0
ro.sys.safemode u:object_r:safemode_prop:s0
security.perf_harden u:object_r:shell_prop:s0
selinux.restorecon_recursive u:object_r:restorecon_prop:s0
service.adb.root u:object_r:shell_prop:s0
service.adb.tcp.port u:object_r:shell_prop:s0
service. u:object_r:system_prop:s0
sys.cppreopt u:object_r:cppreopt_prop:s0
sys.powerctl u:object_r:powerctl_prop:s0
sys. u:object_r:system_prop:s0
sys.usb.config u:object_r:system_radio_prop:s0
sys.usb.ffs. u:object_r:ffs_prop:s0
* u:object_r:default_prop:s0
vold. u:object_r:vold_prop:s0
wlan. u:object_r:wifi_prop:s0
11 changes: 11 additions & 0 deletions recipes-android/android-init/android-init_1.0.bbappend
@@ -0,0 +1,11 @@
FILESEXTRAPATHS_prepend_mooneye := "${THISDIR}/${PN}:"

SRC_URI_append_mooneye = " file://nonplat_property_contexts \
file://plat_property_contexts"

do_install_append_mooneye() {
install -m 0644 ${WORKDIR}/nonplat* ${D}/
install -m 0644 ${WORKDIR}/plat* ${D}/
}

FILES_${PN} += "/nonplat* /plat*"
43 changes: 43 additions & 0 deletions recipes-android/android/android_mooneye-o.bb
@@ -0,0 +1,43 @@
inherit gettext

SUMMARY = "Downloads the Ticwatch E & S /system and /usr/include/android folders and installs them for libhybris"
LICENSE = "CLOSED"
SRC_URI = "https://dl.dropboxusercontent.com/s/ubcsdhlbv09jxxo/system-mooneye.tar.gz"
SRC_URI[md5sum] = "61269ef82bed73a2b3ba791916e1a194"
SRC_URI[sha256sum] = "bc6e8f6ea14a3d75f5f3f313b150785254eb46e350501eaed83e80fd06ddf146"
PV = "oreo"

PACKAGE_ARCH = "${MACHINE_ARCH}"
INHIBIT_PACKAGE_STRIP = "1"
COMPATIBLE_MACHINE = "mooneye"
INSANE_SKIP_${PN} = "already-stripped"
S = "${WORKDIR}"
B = "${S}"

PROVIDES += "virtual/android-system-image"
PROVIDES += "virtual/android-headers"

do_install() {
install -d ${D}/system/
cp -r system/* ${D}/system/

install -d ${D}/usr/
cp -r usr/* ${D}/usr/

install -d ${D}${includedir}/android
cp -r include/* ${D}${includedir}/android/

install -d ${D}${libdir}/pkgconfig
install -m 0644 ${D}${includedir}/android/android-headers.pc ${D}${libdir}/pkgconfig
rm ${D}${includedir}/android/android-headers.pc

cd ${D}
ln -s system/vendor vendor
}

do_package_qa() {
}

PACKAGES =+ "android-system android-headers"
FILES_android-system = "/system /vendor /usr"
FILES_android-headers = "${libdir}/pkgconfig ${includedir}/android"
@@ -0,0 +1,5 @@
EGL_PLATFORM=hwcomposer
QT_QPA_PLATFORM=hwcomposer
LIPSTICK_OPTIONS="-plugin evdevtouch:/dev/input/event1"
QT_ENABLE_GLYPH_CACHE_WORKAROUND=true
QT_IM_MODULE=qtvirtualkeyboard
@@ -0,0 +1,2 @@
FILESEXTRAPATHS_prepend_mooneye := "${THISDIR}/asteroid-launcher:"
SRC_URI_append_mooneye = " file://default.conf"

0 comments on commit 88339e9

Please sign in to comment.