Tools and Environment for building TMF Custom ROM - remay/tmf-hudl GitHub Wiki
This page described the tools and process for developers building a custom ROM. If you just want to download and install a pre-built image then go to the main Wiki page and choose how you want to install.
(1) Tools to build the image:
(a) imgrepackerrk - for packing and unpacking RockChip image files Download and unpack the lastest executable from https://forum.xda-developers.com/showthread.php?t=2257331
On 64-bit Ubuntu I needed to enable 32-bit apps with:
$ sudo dpkg --add-architecture i386 $ sudo apt-get install libc6-i386
(b) Tools for generating the bootanimation (see bootanimation/mkanimation: zip, unzip, composite, zopflipng
$ sudo apt-get install zip unzip imagemagick zopfli
(c) (rkflashtool &) rkmisc rkmisc is ued by the build process to generate a misc partition that forces a wipe of the /data and /cache partitions on first boot after install
$ sudo apt-get install rkflashtool
(d) syslinux Used when building the bootable flash disk image
$ sudo apt-get install syslinux
(2) Tools to flash the image:
(a) adb Optional, but install includes the udev rules to allow access to the USB devices without needing root permissions so this is recomended. If present it may be used by the tmf-flash.sh script to put the Hudl into bootloader (flashing) mode.
$ sudo apt-get install android-sdk-platform-tools
After installing add the following to /lib/udev/rules.d/51-android.rules
if
there is not an entry for these venodrs/products, this will allow use of both
#Archos (Tesco Hudl - needed to allow adb to work without root permission)
SUBSYSTEM=="usb", ATTR{idVendor}=="0e79", ENV{adb_user}="yes"
#Rockchip RK3188(Hudl in bootloader/flash mode - needed to allow rkflashtool to work without root permission)
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", ATTR{idProduct}=="310b", ENV{adb_user}="yes"
(b) rkflashtool used by tmf-flash.sh to actually flash the image to the device. Can do 'partial' flashes e.g. only the system partition which is a good speed increase during development. Can also read teh flash back to your computer, useful for backup.
$ sudo apt-get install rkflashtool
(3) Other tools
(a) apktool useful for instpecting/modifying the contents of .apk files Follow the instructions at https://ibotpeaches.github.io/Apktool/install/
(4) Building
The build process is fairly straightforward. Clone this repository, and then from the repo root directory run
$ sudo ./build.sh
Root permission is required to have enough privileges to remove and correctly create files within the Android image. In short it does the following:
- Downloads the stock image (if not already downloaded), and unpacks it
- Make modifications
- Re-packs the modified image
The build script itself is well documented with the changes it makes. Should you wish to apply additional changes they either add them to the build script, or get the build script to leave the build artefacts and then manually make modifications before running the build script again to re-pack. Run
$ ./build.sh -h
for information on available options.
The build process generates 3 outputs, any of which may be used to flash to a Hudl, depending on your choice of flashing tools. The build output can be found in `.tmf-rom-build\vX.X' directory under the repo root directory.
(1) Monolithic RockChip RKFW Image file (hudl.20140424.153851.tmf-custom-vX.X.img.zip)
- unzip the file to get a *.img file
- Flash the *.img file using 3rd party tools
3rd party tools for flashing image files like this include
- Windows: RK Batch Tool - see https://github.com/remay/tmf-hudl/wiki/Flashing-from-a-Windows-Computer-using-RK-Batch-Tool
- Linux: RockChip upgrade_tool - http://opensource.rock-chips.com/wiki_Upgradetool
(2) USB Bootable Flash Drive (tmf-hudl-thumbdrive-vX.X.zip) This constains a bootable flashdrive image that will walk you through the steps to flash your tablet. The image is based on Tiny Core Linux (http://tinycorelinux.net/)
Extract and burn the image to a USB drive (1GB or bigger drive) using Rufus (Windows) - https://rufus.ie/ Etcher (Multi-platform) - https://www.balena.io/etcher/
Put the USB drive into a USB port on you computer and boot from it, and follow the instruction to connect your Hudl and flash it. More here: https://github.com/remay/tmf-hudl/wiki/Flashing-from-any-Computer-using-a-bootable-USB-Flash-Drive
(3) The partition images are left by build.sh in the
.tmf-rm-build/vX.X/hudl.20140424.153851.tmf-custom-vX.X.img.dump/Image
directory and can be
flashed with the ./hudl-flash.sh script (which is a wrapper around
rkflashtool, and is also the script used by the bootable USB flash drive.
Run
$ ./hudl-flash ./tmf-rom-build/vX.X/hudl.20140424.153851.tmf-custom-vX.X.img.dump/
or
$ ./hudl-flash --help
to see the options available.