Jump to content

Motorola Droid 4 (motorola-maserati): Difference between revisions

From postmarketOS Wiki
link to WIP pull request
TheKit (talk | contribs)
Initial installation instructions
Line 22: Line 22:


== What works ==
== What works ==
 
* Device boots
* Framebuffer graphics
* Touchscreen
* Wi-Fi
* Hardware keyboard


== What does not work ==
== What does not work ==
Line 54: Line 58:
Tapping "install recovery" should install the SafeStrap recovery! If it's successful, tapping "Reboot to recovery" should take you to the custom SafeStrap recovery.
Tapping "install recovery" should install the SafeStrap recovery! If it's successful, tapping "Reboot to recovery" should take you to the custom SafeStrap recovery.


=== Installation ===
<source lang="bash">
$ pmbootstrap init
$ pmbootstrap install --no-fde
$ pmbootstrap export
</source>
Create ROM slot with minimal possible space for system, data, and cache partitions.
First flash [http://droid.cs.fau.de/cm-11.0/unofficial/cm-11-20160815-UNOFFICIAL-maserati.zip CyanogenMod 11] to install files needed by SafeStrap for kexec. Then connect the phone via USB in SafeStrap and do the following (android-platform-tools need to be installed):
<source lang="bash">
$ cd /tmp/postmarketOS-export
$ adb shell mount /system
$ adb push initramfs-motorola-maserati /system/etc/kexec/ramdisk.img
$ adb push vmlinuz-motorola-maserati /system/etc/kexec/kernel
$ adb shell
# In ADB shell (needed to make sure files are written before reboot):
$ umount /cache
$ umount /system
$ umount /data
$ losetup -d /dev/block/loop-cache
$ losetup -d /dev/block/loop-userdata
$ losetup -d /dev/block/loop-system
$ umount /ss
</source>
Now you can either flash motorola-maserati.img to sdcard or resize the image on host to desired size and replace userdata.img of ROM slot you created:
<source lang="bash">
$ resize2fs -s 2G motorola-maserati.img
$ adb shell mount /ss
$ slot_number=1 # Number of SafeStrap slot used
$ adb push motorola-maserati.img /ss/safestrap/rom-slot{$slot_number}/userdata.img
$ adb shell umount /ss
</source>


=== Additional Info ===
=== Additional Info ===

Revision as of 20:27, 14 March 2018

Motorola Droid 4
Motorola Droid 4
Motorola Droid 4
Manufacturer Motorola
Name Droid 4
Codename maserati
Released 2012
Hardware
Chipset TI OMAP 4430
CPU Dual-core 1.2 GHz Cortex-A9
GPU PowerVR SGX540
Display 540 x 960 TFT
Storage 16 GB
Memory 1 GB
Software
Original software Android 2.3 on Linux 2.6
postmarketOS
Category testing
Pre-built images no
Mainline no
Features
Flashing
No data
USB Networking
No data
Internal storage
No data
SD card
No data
Battery
No data
Screen
No data
Touchscreen
No data
Multimedia
3D Acceleration
No data
Audio
No data
Camera
No data
Camera Flash
No data
Connectivity
WiFi
No data
Bluetooth
No data
GPS
No data
NFC
No data
Modem
Calls
No data
SMS
No data
Mobile data
No data
Miscellaneous
FDE
No data
USB OTG
No data
HDMI/DP
No data
Sensors
Accelerometer
No data
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data


Contributors

  • TheKit
  • Hexarei
  • MartijnBraam

What works

  • Device boots
  • Framebuffer graphics
  • Touchscreen
  • Wi-Fi
  • Hardware keyboard

What does not work

  • The rest

Rooting

The Droid 4 doesn't have an unlockable bootloader, so rooting the device requires an exploit.

The easiest exploit is called "Saferoot", which was originally intended for Samsung devices, but also works for many others, including the Droid 4. You can find a saferoot .zip file in this XDA-Developers thread:

https://forum.xda-developers.com/showthread.php?t=2565758

Download saferoot.zip, extract it somewhere, then enable USB debugging on the Droid 4 and connect it to your computer. With it connected, open a command line, cd to where you extracted the files, then run install.sh if you're on a Linux machine, or install.bat if you're on a Windows machine.

Following the on-screen instructions, you should eventually have a rooted device!

Custom Recovery: Safestrap

While there's no official version of TWRP for the maserati, there is a custom recovery based on early versions: SafeStrap!

YOU MUST ROOT AS LISTED ABOVE, FIRST!

You can download that here (make sure to get the one with maserati in the name!):

Download Safestrap

It's an APK file, so enable untrusted sources on your Droid 4 and install it. Once installed, if you're properly rooted, launching it should give you three options: Install recovery, uninstall recovery, and reboot to recovery.

Tapping "install recovery" should install the SafeStrap recovery! If it's successful, tapping "Reboot to recovery" should take you to the custom SafeStrap recovery.

Installation

$ pmbootstrap init
$ pmbootstrap install --no-fde
$ pmbootstrap export

Create ROM slot with minimal possible space for system, data, and cache partitions.

First flash CyanogenMod 11 to install files needed by SafeStrap for kexec. Then connect the phone via USB in SafeStrap and do the following (android-platform-tools need to be installed):

$ cd /tmp/postmarketOS-export
$ adb shell mount /system
$ adb push initramfs-motorola-maserati /system/etc/kexec/ramdisk.img
$ adb push vmlinuz-motorola-maserati /system/etc/kexec/kernel
$ adb shell

# In ADB shell (needed to make sure files are written before reboot):
$ umount /cache
$ umount /system
$ umount /data
$ losetup -d /dev/block/loop-cache 
$ losetup -d /dev/block/loop-userdata 
$ losetup -d /dev/block/loop-system
$ umount /ss

Now you can either flash motorola-maserati.img to sdcard or resize the image on host to desired size and replace userdata.img of ROM slot you created:

$ resize2fs -s 2G motorola-maserati.img
$ adb shell mount /ss
$ slot_number=1 # Number of SafeStrap slot used
$ adb push motorola-maserati.img /ss/safestrap/rom-slot{$slot_number}/userdata.img
$ adb shell umount /ss

Additional Info

Safestrap recovery has support for what it calls "ROM slots." At the time of this writing, you must select a non-stock slot in order to flash anything besides Android.

To repeat: DO NOT TRY TO INSTALL pmOS TO THE STOCK SLOT! IT COULD BRICK YOUR DEVICE!.


See also