Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Initial rubyfish port #227

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
340 changes: 340 additions & 0 deletions meta-rubyfish/LICENSE

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions meta-rubyfish/conf/layer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
BBFILE_COLLECTIONS += "rubyfish-hybris-layer"
BBFILE_PATTERN_rubyfish-hybris-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_rubyfish-hybris-layer = "8"
LAYERSERIES_COMPAT_rubyfish-hybris-layer = "kirkstone"
21 changes: 21 additions & 0 deletions meta-rubyfish/conf/machine/rubyfish.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

#@TYPE: Machine
#@NAME: TicWatch Pro 3 GPS platform
#@DESCRIPTION: Machine configuration for the TicWatch Pro 3 GPS platform

require conf/machine/include/arm/armv7a/tune-cortexa7.inc
DEFAULTTUNE = "armv7vehf-neon"
require conf/machine/include/hybris-watch.inc

MACHINE_DISPLAY_ROUND = "true"

MACHINE_HAS_WLAN = "true"
MACHINE_HAS_SPEAKER = "true"

PREFERRED_PROVIDER_virtual/android-system-image = "android"
PREFERRED_VERSION_android = "armv7+pie64"

PREFERRED_PROVIDER_virtual/kernel = "linux-rubyfish"
PREFERRED_VERSION_linux = "4.9+pie"

IMAGE_INSTALL += "udev-droid-system bluebinder swclock-offset underclock sensorfw-hybris-hal-plugins asteroid-hrm"
Binary file added meta-rubyfish/images/rubyfish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=/system/bin/init initializes the property service and launches servicemanager and logd
After=local-fs.target
Before=basic.target network.target bluetooth.service ofono.service sensord.service
DefaultDependencies=no
Conflicts=shutdown.target

[Service]
Type=simple
ExecStartPre=/bin/touch /dev/.coldboot_done
ExecStart=/usr/libexec/hal-droid/system/bin/init

[Install]
WantedBy=graphical.target
66 changes: 66 additions & 0 deletions meta-rubyfish/recipes-android/android-init/android-init/init.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on init
write /sys/bus/msm_subsys/devices/subsys0/restart_level "RELATED"
write /sys/bus/msm_subsys/devices/subsys1/restart_level "RELATED"
write /sys/bus/msm_subsys/devices/subsys2/restart_level "RELATED"
write /sys/bus/msm_subsys/devices/subsys3/restart_level "RELATED"
write /sys/bus/msm_subsys/devices/subsys4/restart_level "RELATED"

# Required to fix some symbolic links in wcnss firmware files.
mkdir /mnt/vendor/
symlink /persist /mnt/vendor/persist

mkdir /data/
mkdir /data/vendor/
mkdir /data/vendor/ssrdump/
mkdir /data/vendor/bgdaemon/

mkdir /dev/graphics/
symlink /dev/fb0 /dev/graphics/fb0
setprop sys.hwc.gpu_perf_mode 1

write /sys/class/leds/vibrator/trigger "transient"
chown system root /sys/class/leds/vibrator/trigger
chown system root /sys/class/leds/vibrator/activate
chown system root /sys/class/leds/vibrator/brightness
chown system root /sys/class/leds/vibrator/duration
chown system root /sys/class/leds/vibrator/state
chown system root /sys/class/timed_output/vibrator/enable
chmod 664 /sys/class/timed_output/vibrator/enable

load_system_props
restorecon_recursive /persist

# Needed to allow the launcher to talk to the hwbinder.
chown system root /dev/hwbinder
chown system root /dev/vndbinder

chmod 777 /dev/hwbinder
chmod 777 /dev/vndbinder
chmod 777 /dev/mdss_rotator
chmod 777 /sys/devices/platform/soc/soc:qcom,bg-rsb/enable

mkdir /data/

# Start critical services first.
start servicemanager
start hwservicemanager
start vndservicemanager
class_start core
class_start hal

service vendor.rmt_storage /vendor/bin/rmt_storage
class core

service vendor.bluetooth-1-0 /vendor/bin/hw/android.hardware.bluetooth@1.0-service
class hal
oneshot

service vendor.per_mgr /vendor/bin/pm-service
class core

on property:sys.boot_completed=1
exec -- /vendor/bin/init.rsb.sh

service vendor.vibrator-1-0 /vendor/bin/hw/android.hardware.vibrator@1.0-service
class hal
oneshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dolby.audio. u:object_r:audio_prop:s0
dolby. u:object_r:dolby_prop:s0
netd.fstman. u:object_r:netd_prop:s0
persist.huawei.shd u:object_r:mcu_prop:s0
persist.mcu u:object_r:mcu_prop:s0
persist.net.doxlat u:object_r:xlat_prop:s0
persist.sys.key_block u:object_r:key_block_prop:s0
sys.bt_modem.type u:object_r:bt_modem_type_prop:s0
sys.ims. u:object_r:qcom_ims_prop:s0
sys.product.type u:object_r:product_type_prop:s0
system.rmt_storage_prop u:object_r:rmt_storage_prop:s0
user. u:object_r:user_prop:s0
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FILESEXTRAPATHS:prepend:rubyfish := "${THISDIR}/${PN}:"

SRC_URI:append:rubyfish = " file://nonplat_property_contexts \
file://plat_property_contexts"

do_install:append:rubyfish() {
install -m 0644 ${WORKDIR}/nonplat* ${D}/
install -m 0644 ${WORKDIR}/plat* ${D}/
}

FILES:${PN}:append:rubyfish = " /nonplat* /plat*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
EGL_PLATFORM=hwcomposer
QT_QPA_PLATFORM=hwcomposer
LIPSTICK_OPTIONS="-plugin evdevtouch:/dev/input/event3 -plugin evdevkeyboard:/dev/input/event4:keymap=/usr/share/qt5/keymaps/keys.qmap -plugin evdevkeyboard:/dev/input/event0:keymap=/usr/share/qt5/keymaps/keys.qmap -plugin evdevmouse:/dev/input/event1"
QT_ENABLE_GLYPH_CACHE_WORKAROUND=true
QT_IM_MODULE=qtvirtualkeyboard
QPA_HWC_FORCE_GLES=1
QT_OPENGL_NO_BGRA=1
QT_LOGGING_RULES=qt.qpa.input=true;qt.qpa.input.keymap=true;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend:rubyfish := "${THISDIR}/asteroid-launcher-configs:"
8 changes: 8 additions & 0 deletions meta-rubyfish/recipes-core/base-files/base-files/fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/dev/root / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
tmpfs /var/volatile tmpfs defaults 0 0
/dev/mmcblk0p38 /persist auto defaults 0 0
/dev/mmcblk0p1 /vendor/firmware_mnt vfat ro 0 0
/vendor /android-root/vendor auto bind
2 changes: 2 additions & 0 deletions meta-rubyfish/recipes-core/base-files/base-files_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend:rubyfish := "${THISDIR}/${PN}:"
COMPATIBLE_MACHINE:rubyfish = "rubyfish"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Linux Firmware Loader Daemon

[Service]
Type=simple
ExecStart=/usr/bin/firmwared -d /vendor/firmware:/vendor/firmware_mnt/image:/system/etc/firmware:/etc/firmware:/lib/firmware/updates/:/lib/firmware:/firmware/image

[Install]
WantedBy=basic.target
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend:rubyfish := "${THISDIR}/${PN}:"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

BOOT_DIR=$1

# Manually mount the system partition as it contains the boot image (ramdisk) as well as the system data (under /system/system).
mkdir -m 0777 $BOOT_DIR/android-root
mount -t auto -o ro /dev/mmcblk0p29 $BOOT_DIR/android-root

# Allow Android binaries to load libraries from /usr/libexec/ (for example /usr/libexec/hal-droid/system/lib/libselinux_stubs.so)
mount --bind /ld.config.28.txt $BOOT_DIR/android-root/system/etc/ld.config.28.txt

# Make the 'system' folder available as the system partition to the rootfs.
ln -s /android-root/system/ $BOOT_DIR/system

# Check if the AsteroidOS specific machine configuration file exists.
# If it doesn't then we know that the userdata partition is mounted but doesn't contain a valid AsteroidOS root.
if [ ! -e $BOOT_DIR/etc/asteroid/machine.conf ] ; then
echo MSG "Push asteroidos.ext4 via ADB" > /run/psplash_fifo

# Setup for use with ConfigFS
/usr/bin/android-gadget-setup adb

# Correct properties as /system/ may not exist.
serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')"
echo $serial > /sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber
echo Mobvoi > /sys/kernel/config/usb_gadget/g1/strings/0x409/manufacturer
echo TicWatch Pro 3 > /sys/kernel/config/usb_gadget/g1/strings/0x409/product

/usr/bin/adbd
fi
Loading