# Building a .img file for Tablet (rockchip 3066)



## albertobsd (May 8, 2015)

Hi!

I need a little help or orientation to build a .img file firmware for a cheap tablet with rockchip 3066
I download the actual firmware of the tablet to get some clue about how it is building.

Actually I made a custom kernel of FreeBSD 10.1 using the following article http://people.freebsd.org/~cognet/arm.html

Kernel Build

```
mkdir /usr/cross
cd /usr/cross
mkdir -p usr/bin
mkdir -p usr/lib
mkdir -p usr/include
mkdir -p usr/share/man/man1
mkdir -p usr/share/info
mkdir -p usr/libdata/ldscripts
mkdir -p usr/libexec
mkdir -p usr/include/gcc
mkdir -p usr/include/gcc/4.2
cd /usr/src/gnu/usr.bin/cc
make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross clean depend all
make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross DESTDIR=/usr/cross install
cd /usr/src/gnu/usr.bin/binutils
make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross clean depend all
make TARGET_ARCH=arm TOOLS_PREFIX=/usr/cross DESTDIR=/usr/cross install
setenv CC /usr/cross/usr/bin/gcc
setenv AS /usr/cross/usr/bin/as
setenv NM /usr/cross/usr/bin/nm
setenv RANLIB /usr/cross/usr/bin/ranlib
setenv LD /usr/cross/usr/bin/ld
setenv OBJCOPY /usr/cross/usr/bin/objcopy
setenv SIZE /usr/cross/usr/bin/size
setenv MACHINE arm
setenv MACHINE_ARCH arm
cd /sys/arm/conf
config RK3066
cd ../compile/RK3066
make depend
make
```

The Actual Firmware

I found some interesting strings in the actual firmware:

`strings firmware.img`


```
...
...
RK30SDK
package-file
package-file
bootloader
RK30xxLoader(L)_V1.14.bin
parameter
parameter
misc
Image/misc.img
kernel
Image/kernel.img
boot
Image/boot.img
recovery
Image/recovery.img
system
Image/system.img
backup
RESERVED
update-script
update-script
recover-script
recover-script
# NAME     Relative path
#HWDEF     HWDEF
package-file   package-file
bootloader   RK30xxLoader(L)_V1.14.bin
parameter   parameter
misc     Image/misc.img
kernel     Image/kernel.img
boot  Image/boot.img
recovery   Image/recovery.img
system     Image/system.img
backup
update.img
# SELF
update.img
SELF
SELF
# RESERVED
backup
backup     RESERVED
update-script   update-script
recover-script   recover-script
BOOTf
r4sh0s
...
...
PARMV
FIRMWARE_VER:4.0.4
MACHINE_MODEL:S1
MACHINE_ID:007
MANUFACTURER:RK30SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3066
CHECK_MASK: 0x80
KERNEL_IMG: 0x60408000
#RECOVER_KEY: 1,1,0,20,0
CMDLINE: console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x00004000@0x00004000(kernel),0x00008000@0x00008000(boot),0x00008000@0x00010000(recovery),0x000C0000@0x00018000(backup),0x00040000@0x000D8000(cache),0x00200000@0x00118000(userdata),0x00002000@0x00318000(kpanic),0x000FA000@0x0031A000(system),-@0x00414000(user)
boot-recovery
recovery
--wipe_all
KRNL$
AT@0
UUUU
070701000002D1000041ED00000000000000000000000250A06A3400000000000000030000000100000000000000000000000400000000dev
070701000002D20000218000000000000000000000000150A06A3400000000000000030000000100000005000000010000000C00000000dev/console
070701000002D3000041C000000000000000000000000250A06A3400000000000000030000000100000000000000000000000500000000root
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!
console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init
l??b
uncached
buffered
writethrough
writeback
writealloc
<3>%s: can't register clocksource!
idle
mma7660
rt5633
es8323
wm8326
tps659102
logo_RKlogo_clut
...
...
```

*The cheap tablet*

Specification:
Display: 7", 800*480 (16:9)
Touch Panel: Capacitive 5-touch
CPU: Rockchip 3066 Cortex A9,1.6GHz,Dual-core CPU+Quad-core GPU
RAM: 1GB DDR3
Flash memory: 8GB
Operation System: Android 4.1
Camera: Front 0.3M
WiFi: 802.11/b/g/n
Internal 3G built-in: No
External 3G support: Yes
Bluetooth :No
Others: G-sensor, Micro SD slot, mic, speaker, mini HDMI output
Multimedia:Audio, Video(1080P), Photo,ebook,game, email, internet…
Battery capacity: 3200 mAh by 3.7V
housing material: plastic back


*What we have?*
alot of questions here but something we know are

Possible Driver list:
rt5633 (SoC audio for rockchip)
mma7660 : Low g, Digital Accelerometer|Freescale

We need some files for build our IMG file

bootloader  RK30xxLoader(L)_V1.14.bin

misc  Image/misc.img ( ??)
kernel  Image/kernel.img (Hope to be our FreeBSD kernel)
boot  Image/boot.img ( I have no Idea what put here)
recovery  Image/recovery.img ( ?? )
system  Image/system.img (I guest the file system with shell utilities and other stuff)

looking for I found the RK30xxLoader(L)_V1.14.bin in github but I dont know if is necessary edit or do something with it

One more thing, we need some tools for buid the img file.

I hope someone is interested in the project and can provide some help

kind regards!!


----------

