參考資訊:
https://guidelinuxphone.wordpress.com/
步驟如下:
1. 下載檔案
$ sudo apt-get install fastboot $ cd $ wget https://maedevu.maemo.org/images/droid4/VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip $ wget https://maedevu.maemo.org/images/droid4/flash-droid-4-fw.sh $ wget https://github.com/steward-fu/website/releases/download/xt894/droid4-kexecboot.img $ wget https://github.com/steward-fu/website/releases/download/xt894/utags-mmcblk1p13.bin $ unzip VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml.zip
2. 按住電源 + 音量上 + 音量下,選擇進入Fastboot模式
3. 安裝Kexecboot
$ pushd VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml $ sudo bash ../flash-droid-4-fw.sh $ popd $ sudo fastboot flash mbm VRZ_XT894_9.8.2O-72_VZW-18-8_CFC.xml/allow-mbmloader-flashing-mbm.bin $ sudo fastboot reboot-bootloader $ sudo fastboot flash bpsw droid4-kexecboot.img $ sudo fastboot flash utags utags-mmcblk1p13.bin $ sudo fastboot reboot
4. 製作系統
$ sudo apt-get install qemu-user-static -y $ cd $ wget -P archives/basic_rootfs/alpine/ -c http://dl-cdn.alpinelinux.org/alpine/v3.11/releases/armv7/alpine-minirootfs-3.11.3-armv7.tar.gz $ git clone https://github.com/omerlle/droid4-bringup.git archives/droid4_bringup $ git -C archives/droid4_bringup/ checkout alpine $ wget -c https://github.com/TI-ECS/bt-firmware/raw/master/TIInit_10.6.15.bts -P archives/firmware/ti-connectivity $ export droid_rootfs="$PWD/rootfs/alpine/3.11.3_armv7" $ mkdir -p ${droid_rootfs} $ sudo tar -xzf alpine-minirootfs-3.11.3-armv7.tar.gz -C ${droid_rootfs}/ $ sudo rsync -a --chown=root:root archives/droid4_bringup/overlay/ ${droid_rootfs} $ 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}/proc $ sudo mount -o bind /dev ${droid_rootfs}/dev $ sudo chroot ${droid_rootfs} sh # apk update # apk upgrade # apk add bash 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 # pip3 install --upgrade pip # pip3 install evdev # echo droid4 > /etc/hostname # echo "127.0.0.1 droid4" >> /etc/hosts # sed -i 's/^#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config # rc-update add devfs sysinit # rc-update add sysfs boot # rc-update add hwclock boot # rc-update add hostname boot # rc-update add bootmisc boot # rc-update add sshd default # rc-update add droid4-startup default # rc-update add droid4-usb default # rc-update add droid4-modem-app default # rc-update add droid4-buttons-handle default # echo "/dev/mmcblk0p3 /root/user_data vfat defaults" >> /etc/fstab # sqlite3 /root/.droid4/hardware.db < /usr/local/share/droid4/python3_packages/hardware/config/hardware_db.back # sqlite3 /tmp/modem.db < /usr/local/share/droid4/python3_packages/modem/config/modem_db.back # passwd # exit $ sudo umount ${droid_rootfs}/dev $ sudo umount ${droid_rootfs}/proc $ sudo cp archives/firmware/ti-connectivity/TIInit_10.6.15.bts ${droid_rootfs}/lib/firmware/ti-connectivity/
5. 燒錄到記憶卡(zImage、omap4-droid4-xt894.dtb需先編譯好)
$ export sdcard="mmcblk0" $ set -u $ mount | grep /dev/$sdcard | cut -d ' ' -f 3 | xargs umount echo "1 : start= 2048, size= 102400, type=83 2 : start= 104448, size= 4194304, type=83 3 : start= 4298752, size= $(($(cat /sys/block/$sdcard/size)-4298752)), type=83" | sudo sfdisk /dev/$sdcard $ sudo partprobe /dev/${sdcard} $ sudo mkfs.vfat /dev/${sdcard}p1 -n BOOT $ sudo mkfs.ext4 /dev/${sdcard}p2 -L rootfs $ sudo mkfs.vfat /dev/${sdcard}p3 -n USER_DATA $ set +u $ mkdir mnt $ sudo mount /dev/${sdcard}p1 mnt $ sudo mkdir -p mnt/boot $ sudo rsync --chown=root:root archives/droid4_bringup/boot/boot.cfg mnt/boot ### sudo rsync --chown=root:root zImage omap4-droid4-xt894.dtb mnt/boot $ sync $ sudo umount mnt $ sudo mount /dev/${sdcard}p2 mnt $ sudo rsync --delete -av ${droid_rootfs}/ mnt/ ### sudo make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=mnt/ $ sync $ sudo umount mnt $ sudo mount /dev/${sdcard}p3 mnt $ sudo install -d mnt/droid4/modem/{dynamic_data,logs} $ sudo mv ${droid_rootfs}/tmp/modem.db mnt/droid4/modem/dynamic_data/ $ sync $ sudo umount mnt