[Android Software/Hacking General [Developers Only]] stragulus:
Please, no more slowchat!

Just report if you have something meaningful to say. Also talk about new firmware, if not used for actual development, does not belong here! Go to this thread instead.

On the actual rom development then.

For those who are eager to help with getting froyo to work, I've compiled a few tarballs and a 'manual', if you like, to setup a working environment. Manual follows below!

!!!!! BEWARE !!!!!!!

Running this froyo build is ONLY meant for experienced linux / android devs. If you do not know how to write shellscripts, and the majority of your running applications are not terminal windows, then you must not proceed! Unless you're using the native text consoles of your *nix box, in which case, kudos to you :)

Seriously. Do not bother if the above does not apply. The current build is completely unusable, and you'll probably brick your pc or tablet if you attempt to follow the instructions.

!!!!! /BEWARE !!!!!!

These instructions explain how to setup a development froyo build on your flytouch2.

You need these files:

* Froyo build filesystems: http://www.stack.nl/~brama/flytouch2/android_froyo_flytouch2_build_engineer.tar.bz2

* FW1170 filesystems: http://www.stack.nl/~brama/flytouch2/flytouch2_fw1170_filesystems.tar.bz2

* FW1170 kernel: http://www.stack.nl/~brama/flytouch2/uImage

You will also need burntool-0.75 on a Windows XP install (I use a vmware image on my ubuntu dev pc). Search this thread to find it.

You will also want an NFS server, although it *is* possible to extract the root filesystem on the primary ext2 partition on an SD-card. I do not recommend that, as it makes debugging extremely difficult until at least networking works properly.

Extract Firmware files

Download flytouch2_fw1170_filesystems.tar.bz2 from the forum, and extract to your local computer

E.g.:

mkdir ~/flytouch2_firmware
tar -C ~/flytouch2_firmware -xvjf /path/to/flytouch2_fw1170_filesystems.tar.bz2

Extract root filesystem

I have configured the setup to run from a single filesystem, whereas normal android builds use separate partitions for /data, /system etc. This makes development a lot easier. Once things actually start to work good enough, we can easily create images for the filesystems.

Extract the attached tarball, e.g.:

mkdir ~/flytouch2_build
tar -C /flytouch2_build -xvjf android_froyo_flytouch2_build_engineer.tar.bz2

The tarball contains a 100% clean engineering build, which means the default adb shell is root, and it ships with additional useful tools. I've only patched the build slightly in an attempt to get wifi working (which it does, somewhat). To turn it into a bootable build, follow the following instructions. Make sure to adjust the paths in the first set of exports!

# paths to extracted files, and new rootdir
export BUILDDIR=$HOME/flytouch2_build
export FWROOT=$HOME/flytouch2_firmware
export NEWROOT=/spare/nfsroots/flytouch2

cp -r $BUILDDIR/root/* $NEWROOT
cp -r $BUILDDIR/system/* $NEWROOT/system/
# copy custom init.rc
cp $BUILDDIR/init.rc $NEWROOT/

# lazy exports
export S=$FWROOT/system
export D=$NEWROOT/system
export B=$BUILDDIR/system

# fix button mappings
cp $S/usr/keychars/* $D/usr/keychars/

# copy libs from fw1170 if they do not yet exist
cd $D/lib ; for f in lib7280enc.so libDeflatingDecompressor.so libGAL.so libGLESv2SC.so libJNIforCamera.so libJNIforHDMIService.so libJNIforHDMISetting.so libJNIforOSD.so libJNIforTheatreModeService.so libLineBreak.so libRS.so liba2dp.so libaes.so libasound.so libaudiopolicy.so libaudiopolicygeneric.so libavcodec.so libavformat.so libavutil.so libbluedroid.so libbluetooth.so libbluetoothd.so libcamera.so libcamif.so libdecx170h.so libdecx170m.so libdecx170m2.so libdecx170p.so libdecx170rv.so libdecx170v.so libdwlx170.so libeee168.so libeee168_jni.so libeth_client.so libeu-ril.so libgtalk_jni.so libhwdecinterface.so libigps.so libjni_eee168_pinyinime.so liblx_ipc.so libmm_dma.so libomx_avcenc_sharedlibrary.so libomx_imapdec_sharedlibrary.so libomx_m4venc_sharedlibrary.so libomx_radec_sharedlibrary.so libomx_wmadec_sharedlibrary.so libopencore_flvlocal.so libopencore_flvlocalreg.so libopencorehw.so libosd.so libparser.so librs_jni.so libspeech.so libswscale.so libtslib.so libwmapro.so libwu-ril.so libx170j.so ; do [ -f "$f" ] || { cp "$S/lib/$f" $D/lib/ ; echo "Copied $f" ; } ; done
cd $S/lib && cp -r modules hw $D/lib/
cd $S/lib/egl && cp egl.cfg libEGL_VIVANTE.so libGLESv1_CM_VIVANTE.so libGLESv2_VIVANTE.so $D/lib/egl/
cd $D/lib && ln -s egl/libEGL_VIVANTE.so

cd $D/bin
for f in bluetoothd busybox copy_log.sh dumpcrash eth_supplicant hciattach inshal mountd pppoe pppoe.pppd recovery2 scli scrshot sdptool wowbackup_server ; do [ -f "$f" ] || { cp "$S/bin/$f" . ; echo "Copied /system/bin/$f" ; } ; done

# create a giant amount of symlinks to busybox. Makes dev life easier!
cd $D/bin
for cmd in adjtimex ar arp arping ash awk beep blkid brctl bunzip2 bzcat bzip2 cal cat catv chat chattr chgrp chmod chown chpasswd chpst chrt chvt cksum clear cmp comm cp cpio crond crontab cryptpw cttyhack cut date dc dd deallocvt depmod devmem df diff dmesg dnsd dnsdomainname dos2unix du dumpkmap echo ed egrep eject env envdir envuidgid ether-wake expand expr fakeidentd false fbset fbsplash fdflush fdformat fdisk fgrep findfs fold free freeramdisk fsck fsck.minix fsync ftpd fuser getopt grep halt hd hdparm head hexdump hostid hostname hush hwclock id ifconfig ifdown ifenslave ifplugd ifup inetd init insmod install ionice ip ipcrm ; do test -f "$cmd" || ln -s busybox "$cmd" ; done
for cmd in ipcs kbd_mode klogd last length less linux32 linux64 linuxrc ln loadfont loadkmap logname logread losetup lpd lpq lpr ls lsattr lsmod lzmacat lzop lzopcat makedevs makemime man md5sum mdev mesg microcom mkdir mkdosfs mkfifo mkfs.minix mkfs.vfat mknod mkpasswd mkswap mktemp modprobe more mount mountpoint msh mt mv netstat nice nmeter nohup nslookup od openvt patch pgrep pidof ping pipe_progress pivot_root pkill popmaildir poweroff printenv printf ps pwd raidautorun rdate rdev readahead readlink readprofile realpath reboot reformime renice reset resize rm rmdir rmmod route rtcwake run-parts runlevel runsv runsvdir rx ; do test -f "$cmd" || ln -s busybox "$cmd" ; done
for cmd in script scriptreplay sed seq setarch setconsole setfont setkeycodes setlogcons setsid setuidgid sh sha1sum sha256sum sha512sum showkey sleep softlimit sort split stat strings stty sum sv svlogd swapoff swapon switch_root sync sysctl syslogd tac tail tar tcpsvd tee telnet telnetd test tftp tftpd time timeout touch tr true tty ttysize umount uname uncompress unexpand uniq unix2dos unlzma unlzop uptime usleep uudecode uuencode vi vlock volname watch watchdog wc wget which ; do test -f "$cmd" || ln -s busybox "$cmd" ; done

# files required by the boot process, wifi (what is aiding.bin!? I think wifi uses this)
cd $S/etc && cp -r aiding.bin firmware Wireless wifi $D/etc/
# use 'wifi' as group rather than system, the rest also assumes this.
sed -i s/'GROUP=system'/'GROUP=wifi'/ $D/etc/wifi/wpa_supplicant.conf
# default dhcp setup is broken, fix.
chmod +x $D/etc/dhcpcd/dhcpcd-run-hooks
rm $D/etc/dhcpcd/dhcpcd-hooks/01-test

cp $S/../ramdisk/sbin/HDMI $D/../sbin
# the green boot logo.
cp $S/../ramdisk/initlogo.rle $D/../

Boot build

Now, boot tablet using burntool. Click setting, then setup like this:

I used these settings to boot over NFS:

noinitrd init=/init root=/dev/nfs nfsroot=192.168.3.2:/spare/nfsroots/flytouch2,proto=tcp,nolock ip=192.168.3.16:192.168.3.2:192.168.3.1:255.255.255.0::eth0:off console=ttySAC3,115200 bmagic=0xdb6db610 androidboot.mode=normal
# 192.168.3.16: ip of tablet
# 192.168.3.2: ip of nfs server
# 192.168.3.1: ip of gateway

Make sure you connect the tablet using the ethernet port!

If you want to boot from sdcard instead, use something like this:

noinitrd init=/init root=/dev/mmcblk0p1 rw rootfstype=ext2 rootwait console=ttySAC3,115200 bmagic=0xdb6db610 androidboot.mode=normal
#mmcblk0p1: first sd-card slot (nearest to top with button), first partition. Must be formatted as ext2.

Now, click the bottom-left button to save the changes in the settings screen.

Boot the tablet with the home+menu buttons on top pressed, then press power. Make sure to install the usb device drivers for burntool first, see earlier in this topic! If windows has these drivers installed, you will see 'communicating with pc' on the tablet, and something will turn green in burntool. Click 'start' and it will boot!

DEBUGGING

First thing, you want to go to settings -> applications -> development and turn on 'stay awake'. Once the tablet goes into standby mode, it won't wake up!

To watch the boot process from the NFS server:

sudo tail -f $NEWROOT/data/local/logcat.log

To connect to the build over the network:

adb connect '192.168.3.16:5555'
adb shell

Useful commands: iftop (shows traffic-per-device), vi (duh), busybox ls, busybox ps, exec busybox ash to get a slightly more sophisticated shell

Luckily, with NFS, you can directly edit files from your server using your favorite tools. Also, you can monitor output more easily.

STATUS

Hope you didn't get your hopes up too high! Here's the dirt:

What works:

* The display

* all hardware buttons

* vibrator

* The touchscreen, though slightly misaligned

* android launcher + home app work

* wifi, but only for a short time after boot

What doesn't work (e.g. didn't bother with this yet):

* sd-card

* wifi connection drops after a few minutes, and keeps on flapping. Cannot be kicked into a working state anymore.

* tablet doesn't get out of standby mode (one can occasionally see the screen flash)

* screen brightness control doesn't work

* g-sensor responds, but rotation is off by 90 degrees.

* Calibration is off (the further away you get from the center, the further it is misaligned). But it's usable for testing.

Untested:

* everything else (camera, ..)

TODO

Well, a lot has to be done obviously. In order of importance, these things should definitely be fixed first:

* stable working wifi

* properly aligned touchscreen

Once that is in place, the next steps would be to get the market working, so that software can be installed properly.

Should a new thread be created for this? Is there much interest from other devs to work on it? Let me know and we can work something out. For me, it has mostly been an exercise in getting to know more about android internals. I don't care about 'pimping' roms, so a nice clean build that supports the most important hardware, and which works with the least amount of modifications to it is what I want out of this. This can then be used as a base for any other roms which have lots of apps preinstalled, stylish themes, and whatnot. But I don't think the dev scene is that big for this tablet really. We'll see :)