Difference between revisions of "Moto G4 Play (motorola-harpia)"

From postmarketOS
Jump to: navigation, search
(Firmware {Wifi/Modem} (TODO: package it))
Line 52: Line 52:
 
== Firmware {Wifi/Modem} (TODO: package it) ==
 
== Firmware {Wifi/Modem} (TODO: package it) ==
 
On the device extract firmware
 
On the device extract firmware
<code>
+
<code>cd /lib/firmware</code>
cd /lib/firmware
+
<code>mkdir postmarketos</code>
mkdir postmarketos
+
<code>cd postmarketos</code>
cd postmarketos
+
<code>mount /dev/disk/by-partlabel/system /mnt</code>
 +
<code>cp -ap /mnt/etc/firmware/* /lib/firmware/postmarketos</code>
 +
<code>umount /mnt</code>
 +
<code>mount /dev/disk/by-partlabel/fsg /mnt</code>
 +
<code>cp -ap /mnt/* /lib/firmware/postmarketos</code>
 +
<code>umount /mnt</code>
 +
<code>mount /dev/disk/by-partlabel/modem /mnt</code>
 +
<code>cp -ap /mnt/image/* /lib/firmware/postmarketos</code>
 +
<code>umount /mnt</code>
 +
<code>mount /dev/disk/by-partlabel/persist /mnt</code>
 +
<code>mkdir -p wlan/prima</code>
 +
<code>cp -ap /mnt/WCNSS_wlan_dictionary.dat wlan/prima/</code>
 +
<code>umount /mnt</code>
 +
 
 +
Make a link in case the firmware path doesn't include /lib/firmware/postmarketos
  
mount /dev/disk/by-partlabel/system /mnt
+
<code>cd /lib/firmware</code>
cp -ap /mnt/etc/firmware/* /lib/firmware/postmarketos
+
<code>ln -s /lib/firmware/postmarketos/* /lib/firmware/</code>
umount /mnt
 
mount /dev/disk/by-partlabel/fsg /mnt
 
cp -ap /mnt/* /lib/firmware/postmarketos
 
umount /mnt
 
mount /dev/disk/by-partlabel/modem /mnt
 
cp -ap /mnt/image/* /lib/firmware/postmarketos
 
umount /mnt
 
mount /dev/disk/by-partlabel/persist /mnt
 
mkdir -p wlan/prima
 
cp -ap /mnt/WCNSS_wlan_dictionary.dat wlan/prima/
 
umount /mnt
 
  
#make a link in case the firmware path doesn't include /lib/firmware/postmarketos
 
cd /lib/firmware
 
ln -s /lib/firmware/postmarketos/* /lib/firmware/
 
</code>
 
  
 
== Modem ==
 
== Modem ==
 
Make the necesary links for qcom_rmtfs
 
Make the necesary links for qcom_rmtfs
<code>
+
 
cd /boot
+
<code>cd /boot</code>
ln -s /dev/disk/by-partlabel/modemst1 modem_fs1
+
<code>ln -s /dev/disk/by-partlabel/modemst1 modem_fs1</code>
ln -s /dev/disk/by-partlabel/modemst2 modem_fs2
+
<code>ln -s /dev/disk/by-partlabel/modemst2 modem_fs2</code>
ln -s /dev/disk/by-partlabel/fsg modem_fsg
+
<code>ln -s /dev/disk/by-partlabel/fsg modem_fsg</code>
</code>
+
 
  
 
Install necessary software
 
Install necessary software
Line 99: Line 98:
 
Start qcom_rmtfs on a terminal
 
Start qcom_rmtfs on a terminal
  
<code>
+
<code>export LD_PRELOAD=/usr/lib/preload/libqipcrtr4msmipc.so</code>
export LD_PRELOAD=/usr/lib/preload/libqipcrtr4msmipc.so
+
<code>qcom_rmtfs -v</code>
qcom_rmtfs -v
 
</code>
 
  
 
Start ofonod on another terminal
 
Start ofonod on another terminal
  
<code>
+
<code>export LD_PRELOAD=/usr/lib/preload/libsmdpkt_wrapper.so</code>
export LD_PRELOAD=/usr/lib/preload/libsmdpkt_wrapper.so
+
<code>ofonod -d -n</code>
ofonod -d -n
 
</code>
 
  
 
Send an SMS!
 
Send an SMS!
  
<code>
+
<code>export PHONE_NUMBER="<number to send sms to ex: 1234567890>"</code>
export PHONE_NUMBER="<number to send sms to ex: 1234567890>"
 
  
sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"
+
<code>sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true"</code>
sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.GetProperties
+
<code>sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.GetProperties</code>
sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Online" variant:boolean:"true"
+
<code>sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Online" variant:boolean:"true"</code>
sudo dbus-send --system --print-reply --dest=org.ofono /gobi_0 org.ofono.MessageManager.SendMessage string:"$PHONE_NUMBER" string:"Hello world! -postmarketOS"
+
<code>sudo dbus-send --system --print-reply --dest=org.ofono /gobi_0 org.ofono.MessageManager.SendMessage string:"$PHONE_NUMBER" string:"Hello world! -postmarketOS"</code>
  
 
# receive SMS like this (might be spammy if you have other DBus apps):
 
# receive SMS like this (might be spammy if you have other DBus apps):
sudo dbus-monitor
+
<code>sudo dbus-monitor</code>
</code>
+
 
  
  

Revision as of 17:26, 24 May 2018

Motorola Moto G4 Play
Moto G4 Play running Weston
Moto G4 Play running Weston
Manufacturer Motorola
Name Moto G4 Play
Codename harpia
Released 2016
Original software Android 6.0.1
Hardware
Chipset Qualcomm MSM8916 Snapdragon 410
CPU Quad-core 1.21GHz Cortex A53
GPU Adreno 306
Display HD (720x1280)
Storage 8GB or 16GB
Memory 1GB or 2GB
Features
USB Networking
Flashing
Touchscreen
Display
WiFi
Xwayland
FDE
Mainline
Battery
3D Acceleration
Accelerometer
Audio
Bluetooth
Camera
GPS
Mobile data
SMS
Calls
USB OTG


Contributors

  • the-returning-void

Maintainer(s)

What works

  • USB Networking
  • Graphical display
  • Xorg
  • Modem (partially?)
  • SMS

What does not work

  • Wifi (wlan0 device comes up with firmware and custom kernel)


How to enter flash mode

Hold down POWER + Vol Down while booting to enter Flash Mode.

Installation

Wifi

Configure your kernel and enable the prima wifi staging driver

pmbootstrap menuconfig linux-motorola-harpia pmbootstrap build linux-motorola-harpia

On the device

apk add wcnss-wlan

/etc/init.d/wcnss-wlan start

Firmware {Wifi/Modem} (TODO: package it)

On the device extract firmware cd /lib/firmware mkdir postmarketos cd postmarketos mount /dev/disk/by-partlabel/system /mnt cp -ap /mnt/etc/firmware/* /lib/firmware/postmarketos umount /mnt mount /dev/disk/by-partlabel/fsg /mnt cp -ap /mnt/* /lib/firmware/postmarketos umount /mnt mount /dev/disk/by-partlabel/modem /mnt cp -ap /mnt/image/* /lib/firmware/postmarketos umount /mnt mount /dev/disk/by-partlabel/persist /mnt mkdir -p wlan/prima cp -ap /mnt/WCNSS_wlan_dictionary.dat wlan/prima/ umount /mnt

Make a link in case the firmware path doesn't include /lib/firmware/postmarketos

cd /lib/firmware ln -s /lib/firmware/postmarketos/* /lib/firmware/


Modem

Make the necesary links for qcom_rmtfs

cd /boot ln -s /dev/disk/by-partlabel/modemst1 modem_fs1 ln -s /dev/disk/by-partlabel/modemst2 modem_fs2 ln -s /dev/disk/by-partlabel/fsg modem_fsg


Install necessary software

apk add modem-qcom-msm-downstream-common qcom_rmtfs libsmdpkt_wrapper libqipcrtr4msmipc

Start the wcnss-wlan service to initialize the wifi card (helps the modem?) /etc/init.d/wcnss-wlan start

Start a tmux for multiple windows tmux

Start qcom_rmtfs on a terminal

export LD_PRELOAD=/usr/lib/preload/libqipcrtr4msmipc.so qcom_rmtfs -v

Start ofonod on another terminal

export LD_PRELOAD=/usr/lib/preload/libsmdpkt_wrapper.so ofonod -d -n

Send an SMS!

export PHONE_NUMBER="<number to send sms to ex: 1234567890>"

sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Powered" variant:boolean:"true" sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.GetProperties sudo dbus-send --print-reply --system --dest=org.ofono /gobi_0 org.ofono.Modem.SetProperty string:"Online" variant:boolean:"true" sudo dbus-send --system --print-reply --dest=org.ofono /gobi_0 org.ofono.MessageManager.SendMessage string:"$PHONE_NUMBER" string:"Hello world! -postmarketOS"

  1. receive SMS like this (might be spammy if you have other DBus apps):

sudo dbus-monitor


See also

  • Device requires msm-refresher to get a display past the boot splash, even though cat /sys/class/graphics/fb0/modes > /sys/class/graphics/fb0/mode doesn't fix the display
  • Steps outlined for Screen is blank outside of Weston is still required to get a display after the boot splash
  • Xorg starts with a blank display, to make the screen show ssh into the device and run sudo osk-sdl -t to fix display