
Note:Modifying or replacing your device’s software will void your device’s warranty, and can cause to damage to the device and to your computer or losing data(of device and computer), execute the following commands is entirely at your own risk.
Note:this guide try to apply the bringup of droid4 flowing Tony Lindgren blog. there still missing parts such as camera or connact to internet, that i hope that will fill up in the next time
requires:linux computer,Motorola Droid4(XT894),sdcard(more then 3G),usb cable.optional-Debug UART
you need also a micro-USB-B breakout board and USB-TTL Adapter with 3.3V signal-A detailed explanation is available in Tony Lindgren blog Debug UART.get started
go to the path that you want to create the project(replace “/path/to/project/” with the path):pushd /path/to/project/create directory hierarchy structure for boot components:
install -d bringup/{linux/{linux-stable,images},mnt,archives/{stock_rom/droid4,kexecboot/droid4,buildroot,firmware,basic_rootfs/{ubuntu-base,alpine}},mnt,rootfs/{alpine,ubuntu,buildroot}}go into bringup directory:
cd bringupupdate stock rom
first of all we need to update the stock rom to VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip.for that we need fastboot, if you don’t have fastboot you can install it by:
sudo apt-get install android-tools-fastbootdownload and extract VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip into droid4/archives/stock_rom:
wget https://maedevu.maemo.org/images/droid4/VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip -P archives/stock_rom/droid4unzip archives/stock_rom/droid4/VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip -d archives/stock_rom/droid4rm archives/stock_rom/droid4/VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zipdownload Tony Lindgren script for update the stock_rom:
wget -P archives/stock_rom/droid4 -c wget https://raw.githubusercontent.com/omerlle/droid4-bringup/alpine/boot/flash-droid-4-fw.shturn on the device by press on Vol Down & Power buttons this will go into Fastboot mode(the first line in the screen is:”AP Fastboot Flash Mode (S)”)
connect the device to the computer via usb and make sure the bottom lines are “Transfer Mode: USB Connected”
make sure you see the device by the command:
fastboot devicesthe output supposed to be something like:
0123456789ABCDEF fastbootif you get this output:
permissions fastboottry:
sudo fastboot devicesif it solve the problem change the script to run “sudo fastboot” by the command:
sed -i 's/fastboot=fastboot/fastboot="sudo fastboot"/' archives/stock_rom/droid4/flash-droid-4-fw.shgo into VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml directory:
pushd archives/stock_rom/droid4/VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xmland run the script:
bash ../flash-droid-4-fw.shreturn to base directory by:
popdinstall Kexecboot bootloader
if you don’t have git you can install it by:sudo apt-get install gitclone Tony Lindgren repository for droid4 kexecboot by the command:
git clone https://github.com/tmlind/droid4-kexecboot.git archives/kexecboot/droid4/install the Kexecboot by the commands(you can remove sudo keyword if you don’t need sudo for fastboot)[my current version is 2021-01-28]:
sudo fastboot flash mbm archives/stock_rom/droid4/VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml/allow-mbmloader-flashing-mbm.bin;sudo fastboot reboot bootloader;sudo fastboot flash bpsw archives/kexecboot/droid4/current/droid4-kexecboot.img;sudo fastboot flash utags archives/kexecboot/droid4/utags-mmcblk1p13.bin;sudo fastboot flash mbm archives/stock_rom/droid4/VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml/mbm.binyou can poweroff the device for now by press Power button
build kernel
if you don’t have the following tools you can install it by:sudo apt-get install libncurses5-dev make exuberant-ctags bc libssl-devand the arm cross compailer:
apt-get install gcc-arm-linux-gnueabihfclone tony lindgren kernel repository:
git clone https://github.com/tmlind/linux linux/tmlind_linuxgo into tmlind_linux:
pushd linux/tmlind_linuxcheckout the latest kernel branch:
git checkout -b local/droid4-pending-v5.12 origin/droid4-pending-v5.12setup your default kernel configuration:
make ARCH=arm omap2plus_defconfigcompaile the kernel:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- omap4-droid4-xt894.dtb bzImage modules -j9return to base directory by:
popdbuild rootfs
you can create a ubuntu rootfs instead of alpine rootfs following this page
install qemu-user-static arm emulator:sudo apt-get install qemu-user-staticdownload the alpine minimal rootfs archive:
wget -P archives/basic_rootfs/alpine/ -c http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/armv7/alpine-minirootfs-3.12.4-armv7.tar.gzclone bringup repository for droid4 more rootfs scripts:
git clone https://github.com/omerlle/droid4-bringup.git archives/droid4_bringupcheckout the alpine branch:
git -C archives/droid4_bringup/ checkout alpinedownload bluetooth firmware:
wget -c https://github.com/TI-ECS/bt-firmware/raw/master/TIInit_10.6.15.bts -P archives/firmware/ti-connectivitychoose name to rootfs directory and create it:
droid_rootfs="$PWD/rootfs/alpine/3.12.4_armv7"mkdir ${droid_rootfs}extract alpine minimal rootfs into the directory:
sudo tar -xzf archives/basic_rootfs/alpine/alpine-minirootfs-3.12.4-armv7.tar.gz -C ${droid_rootfs}/add usage scripts:
sudo rsync -a --chown=root:root archives/droid4_bringup/overlay/ ${droid_rootfs}sudo rsync -a --chown=root:root archives/droid4_bringup/src ${droid_rootfs}/tmp/add tony lindgren pm and droid4-dtmf.sh script:
sudo wget -c https://raw.githubusercontent.com/tmlind/droid4-pm/master/scripts/openrc/droid4-pm -P ${droid_rootfs}/etc/init.dsudo chmod +x ${droid_rootfs}/etc/init.d/droid4-pmsudo wget -c https://raw.githubusercontent.com/tmlind/droid4-sms-tools/master/droid4-dtmf.sh -P ${droid_rootfs}/usr/local/binsudo chmod +x ${droid_rootfs}/usr/local/bin/droid4-dtmf.shadd files and mount some directories for chroot work properly:
sudo cp /etc/resolv.conf ${droid_rootfs}/etc/sudo cp -a /usr/bin/qemu-arm-static ${droid_rootfs}/usr/bin/sudo mount -t proc /proc ${droid_rootfs}/procsudo mount -o bind /dev ${droid_rootfs}/devrun chroot to config the rootfs on pc:
sudo chroot ${droid_rootfs} shinstall useful packages:
apk updateapk upgradeapk add openrc udev openssh python3 alsa-utils util-linux rsync xorg-server xinit i3wm evince xterm tmux eog linux-headers build-base python3-dev sqlite kbd libqmi emacs linux-firmware wpa_supplicant bluez wireless-tools py3-pip iw mpg123 sqlite-dev dhclient xf86-input-evdevpip3 install --upgrade pippip3 install evdevbuild the bins:
make install -C /tmp/src/droid4_hardwareemacs -batch -f batch-byte-compile /usr/local/share/emacs/client_app.elset the databases:
sqlite3 /root/.droid4/hardware.db < /usr/local/share/python/hardware/config/hardware_db.back
sqlite3 /root/.droid4/modem/dynamic_data.db < /usr/local/share/python/droid4_modem/config/modem_db.backset the password for root user:
passwd[for uart debug:
echo ttyS2 >> /etc/securetty;sed -i 's/^#ttyS0\:\:respawn\:\/sbin\/getty -L ttyS0 115200 vt100/ttyS2\:\:respawn\:\/sbin\/getty -L ttyS2 115200 vt100/' /etc/inittab]exit from chroot:
exitunmount /proc and /dev from the rootfs:
sudo umount ${droid_rootfs}/devsudo umount ${droid_rootfs}/proccopy TIInit_10.6.15 to the rootfs:
sudo cp archives/firmware/ti-connectivity/TIInit_10.6.15.bts ${droid_rootfs}/lib/firmware/ti-connectivity/create bootable sd
format the sdcard:note:this part is very dangerous because you can erase your hard disk if you will not do it right
use this command to figure out your sdcard name, you need be sure it appear and disappear when you connect it and disconnect it otherwise you can erase important data:lsblkwhen you are sure what the name of the sd replace the “mmcblk0” keyword with your name and run the following commands:
sdcard="mmcblk0"set -umount | grep /dev/$sdcard | cut -d ' ' -f 3 | xargs umountecho "1 : start= 2048, size= 102400, type=832 : start= 104448, size= 4194304, type=833 : start= 4298752, size= $(($(cat /sys/block/$sdcard/size)-4298752)), type=83" | sudo sfdisk /dev/$sdcardsudo partprobe /dev/${sdcard}sudo mkfs.ext4 /dev/${sdcard}p1 -L boot -O^metadata_csum,^64bitsudo mkfs.ext4 /dev/${sdcard}p2 -L rootfssudo mkfs.vfat /dev/${sdcard}p3 -n USER_DATAset +umount the first partition of sdcard:
sudo mount /dev/${sdcard}p1 mntcopy the boot components:
sudo rsync --chown=root:root archives/droid4_bringup/boot/boot.cfg linux/tmlind_linux/arch/arm/boot/zImage linux/tmlind_linux/arch/arm/boot/dts/omap4-droid4-xt894.dtb mnt/boot[for uart debug:
sudo rsync --chown=root:root archives/droid4_bringup/boot/boot.cfg.uart mnt/boot/boot.cfg ]unmount the first partition of sdcard and mount the second partition:
syncsudo umount mntsudo mount /dev/${sdcard}p2 mntcopy the rootfs to the second partition:
sudo rsync --delete -av ${droid_rootfs}/ mnt/install the modules in the rootfs:
sudo make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=${PWD}/mnt/ -C linux/tmlind_linuxsave and umount the second partition of sdcard:
syncsudo umount mntreturn to your original path:
popdfor droid4 usage you can see droid4-alpine-usage.