jeudi 17 avril 2014

Mele V2.0.5_2 en_US firmware fixing netflix issue

This firmware is supposed to fix the Netflix issue, thanks to Martinei Gregorio da Silva message, that found that Mele v1.2 version of CedarX libraries were compatible with this firmware.
It is based on Mele V2.0.5 en_US firmware
Same fixes apply, with these additions:
- reverted to Mele_v1.2 CedarX libraries
- added some optimizations in /system/build.prop thanks to
- updated ES File Explorer

Here are the firmware versions:
Customised en_US version: v2.0.5_2_en_US.img
md5sum a9232708517a672e8786cbf2615e5d6d  v2.0.5_2_en_US.img
You need PhoenixCard for this image: PhoenixCardV306

dd-able imgv2.0.5_2_en_US.ddimg.bz2
md5sum 6a23582be63de37b1a4d0ddb06d4e890  v2.0.5_2_en_US.ddimg.bz2
Under linux, to burn it, just perform:
  bzip2 -cd v2.0.5_en_US.ddimg.bz2|dd of=/dev/sdX bs=4096
  sync
Under Windows, use Win32 Disk Imager
sdcard version (sort of live-cd version): v2.0.5_2_en_US.sdcard.tgz
a2b5b32a14c413b859cf229b066a4a6b  v2.0.5_2_en_US.sdcard.tgz
By default, it uses a 4GB sdcard; under linux, uncompress and as root: make DEV=/dev/sdX (X is the device letter of your sdcard)
If you want to change for a 8GB sdcard (you get more space for /sdcard), just change the symbolic link 'partitions.txt' to point to partitions_8GB.txt (rm partitions.txt && ln -s partitions_8GB.txt partitions.txt) before make.

samedi 18 janvier 2014

How to install applications without Google Play support

... with the help of ES Explorer and a Google Play-enabled device.

Google Play can be a pain to install on Mele (and other Google non-supported devices), and if you don't need to have your Mele device in sync with your Google account, there is a simple way to install simple applications.

ES Explorer has a very useful tool: the App Manager. It allows you to send from an Android device (with Google Play) to another Android device (without Google Play) an application package provided that each one has launched ES Explorer and both are connected to a local network.
The main drawback is that the installed applications are no more connected to your Google account (no update notification, no Google account support)
Here is a step-by-step howto, to install Mount Manager app on the Mele device without having Google Play installed.
I took my Android phone, and installed Mount Manager.

On the Mele device, simply launch ES Explorer.
On the Android phone, in ES Explorer, go to Tools->App Manager:
Long-press on the required application:
Then press 'Send' action, ES Explorer will look for available devices on the network:
Once done, you have to check 'Mele HTPC', and press 'Send':
On the Mele device you will get a notification:
Confirm and select a destination directory, for example '/sdcard/Download'. Finally, ES Explorer gives you the choice to 'Open' the package, in other words to install it:
Click on 'Open' to install the application:
That's all!

jeudi 10 octobre 2013

Mele flash kitchen v3

Since this article: http://tmerle.blogspot.fr/2012/09/mele-a2000-my-own-linux-flash-kitchen.html I made some little evolutions.

Here is the Mele flash kitchen v3: mele_flash_kitchen_v3.tgz

The usage is the same.

I added a little script, convert_updater_script_to_sh.sh, that converts an Android updater script (META-INF/com/google/android/updater-script) from an update.zip into a UNIX shell script (I wrote some wrappers for Android functions).
It is useful when you want to apply an update on pre-extracted and mounted system and root partitions (you have to specify their locations to the script).
The -b option is added to mkA10card.sh so that you can blank the sdcard partitions (takes long time) before writing data on them. It is useful if you want to create an archive of the sdcard version (0 are better compressed than random values).

Here are the differences:
mele_flash_kitchen/sdcard/Makefile: fixed boot tar uncompressing error (due to bad userid)
mele_flash_kitchen/sdcard/mkA10card.sh: added -b option to wipe partitions before writing, minor fixes thanks to user Spell
Created mele_flash_kitchen/sdcard/partitions_4GB.txt and
mele_flash_kitchen/sdcard/partitions_8GB.txt (just change the symbolic link partitions.txt to point to what you prefer)
Created mele_flash_kitchen/tools/convert_updater_script_to_sh.sh: a script that converts an Android update script (found in update.zip files) to a shell script. Handy to apply an update on an uncompressed system image.

vendredi 9 août 2013

Mele V2.0.5 en_US firmware

Yet another update of the "Win8" firmware.

Original thread: V2.0.5 firmware release-A100, A1000, A2000, A3600, A3700
update.zip from this forum thread but you will get the Chinese apps and default language.
Only bugfixes in this release (from what I understand from Chinese forums - "other known bug").

Note: I added GappInstaller in this version. You can download the right Google apps, and install them all from GUI. To download, always choose the "Browser" app (and not ES downloader); some javascript stuff need to be run to download properly, be patient. The download status is buggy, check the download status from the launcher.

Customised en_US versionv2.0.5_en_US.img
md5sum 8886691131060437df5322f6af643135  v2.0.5_en_US.img
You need PhoenixCard for this image: PhoenixCardV306

dd-able imgv2.0.5_en_US.ddimg.bz2
md5sum 356a407d4c9cd553faa1df0109d8d6ed  v2.0.5_en_US.ddimg.bz2
Under linux, to burn it, just perform:
  bzip2 -cd v2.0.5_en_US.ddimg.bz2|dd of=/dev/sdX bs=4096
  sync
Under Windows, use Win32 Disk Imager

Edit: Fixed the "./mkA10card.sh "" /dev/sdc" issue in the sdcard version, please re-download it:
sdcard version (sort of live-cd version): v2.0.5-1_en_US.sdcard.tgz
md5sum 00e8d48568e18555bfe930dcb97bb2d1  v2.0.5-1_en_US.sdcard.tgz
By default, it uses a 4GB sdcard; under linux, uncompress and as root: make DEV=/dev/sdX (X is the device letter of your sdcard)
If you want to change for a 8GB sdcard (you get more space for /sdcard), just change the symbolic link 'partitions.txt' to point to partitions_8GB.txt (rm partitions.txt && ln -s partitions_8GB.txt partitions.txt) before make.
I included the "Spell"'s modifications (removed useless libopera.so, added an option to zero partitions before formatting, useful for making dd-able images). make DEV=/dev/sdX BLANK=yes if you want to put zeroes in partitions before formatting. 

To sum-up the functionalities of the Mele firmware:
- DLNA renderer, use UPnP to throw pictures/videos to your TV from your mobile phone (via WIFI).
- Mele mobile phone remote control, control the Mele device from your mobile phone (via WIFI), app described here: Mele mobile phone remote control
- webdav server. Don't know how to use it, but lighttpd is configured on Mele to serve something "webdav".
- adb-over-tcp functionality; from your PC, just perform adb connect your-mele-ip-addr to debug you device

Working Youtube v4.1.23: http://www.google.com/#q=YouTube+v4.1.23+Apk+App
md5sum f03826bf9ac04e18834d855d9e965482  YouTube.apk

What I added/fixed:
- copied some app/apks (from v1.3.1 fw) in order to support gapps (not tested)
- added ES Explorer
- boot defaults to en_US
- deactivated /system/lib/hw/sensors.exDroid.so (fixes 100% system_server bug)
- deactivated u3gmonitor, findms services (consumes lots of CPU and I don't know why)
- added /etc/init.d capability
- added capability to install gapps if zip present in /mnt/sdcard, by a /etc/init.d script
- removed the Chinese applications (you can still find them in the original update.zip in system/preinstall and system/vendor/app, I kept Flash Player).
- added xpad.ko module (found here: MELE A1000 Hacking - XBOX 360 controller support in 3.0.8 kernel)
- added GappInstaller-1.2, a user-friendly app to download and install Google apps.

mercredi 12 juin 2013

Mele V2.0.4 en_US firmware

Yet another update of the "Win8" firmware.
Original thread: Beta V2.0.4
From this thread, an update.zip is provided (you can download and install it via the system settings of the v2.0.3 firmware, but you will get the Chinese apps and default language).

I generated a customised en_US version: v2.0.4_en_US.img
Edit: md5sum 51b3ae29b4eb7938c87548600016ea6a  v2.0.4_en_US.img
Edit: if you want a working Youtube you need the v4.1.23:
http://www.google.com/#q=YouTube+v4.1.23+Apk+App

Edit: dd-able img: v2.0.4.ddimg.bz2
To burn it, just perform under linux:
bzip2 -cd v2.0.4_en_US.ddimg.bz2|dd of=/dev/sdX bs=4096

Edit[11/jul/2013] the sdcard version (sort of live-cd version): v2.0.4_en_US.sdcard.tgz
By default, it uses a 4GB sdcard; under linux, uncompress and as root: make DEV=/dev/sdX (X is the device letter of your sdcard)
If you want to change for a 8GB sdcard (you get more space for /sdcard), just change the symbolic link 'partitions.txt' to point to partitions_8GB.txt (rm partitions.txt && ln -s partitions_8GB.txt partitions.txt) before make.

From the Chinese forum, what is fixed (google translation):
1, solve network problems playback buffer Caton
2, restoring FireAir features, support multi-screen interactive
3, solve standby, the weather does not appear out of the issue
4, resolved after restart av audio output did not save the problem
5, solve AV display output standby, then start box , TV no ​​display problem upgrade:


Reminder:
PhoenixCard image is flashed using this: PhoenixCardV306

Update: I have made a less crappy app in order to install gapps.zip: GappInstaller-1.1
You have to put gapps.zip on an external SDcard and launch this application.

What I added/fixed:
- copied some app/apks (from v1.3.1 fw) in order to support gapps (not tested)
- copied Youtube apk from v1.3.1 fw
- added ES Explorer
- boot defaults to en_US
- deactivated /system/lib/hw/sensors.exDroid.so (fixes 100% system_server bug)
- added /etc/init.d capability
- added capability to install gapps if zip present in /mnt/sdcard, by a /etc/init.d script
- removed the Chinese applications (you can still find them in the original update.zip in system/preinstall and system/vendor/app, I kept Flash Player).
- added xpad.ko module (found here: MELE A1000 Hacking - XBOX 360 controller support in 3.0.8 kernel)

samedi 11 mai 2013

Mele V2.0.3: Fixing "Unfortunately, the process com.google.process.apps has stopped."

After having installed the gapps against the Mele V2.0.3 firmware, this error popup appears:
"Unfortunately, the process com.google.process.apps has stopped"
This is due to the lack of ContactsProvider app.
Adding it makes the error disapear.

Install this: ContactsProvider.apk
This package comes from the 1.3.1 version of Mele firmware

lundi 6 mai 2013

Mele V2.0.3 en_US img+sdcard version

This is an update of the v2.0.1 Win8 firmware.

Original thread: The ultimate single-core fun new firmware V2.0.3 released

This is an update from 1.3.1 firmware but I generated a new firmware image (less issues with previous state).

What is fixed:
- avi/mkv/mp4 issues fixed

Here are the modified versions:
Phoenixcard image: v2.0.3_en_US.img
dd-able img: v2.0.3_en_US.ddimg.bz2
sdcard version: v2.0.3_en_US.sdcard.bz2

Edit: fixed the "Unfortunately, the process com.google.process.apps has stopped" issue after having installed gapps.zip, refer to ->this<- post.


Reminder:
PhoenixCard image is flashed using this: PhoenixCardV306
dd-able img is flashed using:
  - under linux: bzip2 -cd Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2|dd of=/dev/sdx bs=4096
  - under Windows: uncompress the archive before, and then use WinImage
The SDCard version is something like a "live-sdcard". You can run it without affecting the flashed image.
sdcard version, under linux only, run: cd sdcard/; make DEV=/dev/sdx (where sdx is the sdcard device number).

This time I chose to not include APEX launcher.
You can download it freely from hereApex Launcher

<not tested>: To get google apps, from the installed Mele firmware, use the Internet navigator and download this:
gapps-ics-20120429-signed.zip
This will put the file in /mnt/sdcard/Download/, where the init script looks at.

Reboot, wait for the device to reboot and you are done.
The details of what is modified in this firmware from the original version:
- boot defaults to en_US
- deactivated /system/lib/hw/sensors.exDroid.so (fixes 100% system_server bug)
- added /etc/init.d capability
- added capability to install gapps if zip present in /mnt/sdcard, by a /etc/init.d script
- removed the Chinese applications (you can still find them in the original update.zip in system/preinstall and system/vendor/app, I kept Flash Player).
- added xpad.ko module (found here: MELE A1000 Hacking - XBOX 360 controller support in 3.0.8 kernel)

samedi 20 avril 2013

Mele mobile phone remote control

Mobile phone remote control software
With this piece of software you can control your Mele device from your mobile phone (over wifi).
Install this apk on your mobile phone, and you will have thie following controls (slide at the bottom of the screen):




MeLE_A10_SDK1.6_V2.0.1 img+sdcard version


This firmware is particular with its frontend looking like Windows 8.

Original thread: Mele brand new Win8 GUI v2.0.1 update
This is an update from 1.3.1 firmware but I generated a new firmware image (less issues with previous state).

From what I saw:
- mp4 seek fixed
- network issues after suspend seem to have been fixed

Here are the modified versions:

Reminder:
PhoenixCard image is flashed using this: PhoenixCardV306
dd-able img is flashed using:
  - under linux: bzip2 -cd Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2|dd of=/dev/sdx bs=4096
  - under Windows: uncompress the archive before, and then use WinImage
The SDCard version is something like a "live-sdcard". You can run it without affecting the flashed image.
sdcard version, under linux only, run: cd sdcard/; make DEV=/dev/sdx (where sdx is the sdcard device number).

This time I chose to not include APEX launcher.
You can download it freely from hereApex Launcher

<not tested>: To get google apps, from the installed Mele firmware, use the Internet navigator and download this:
http://goo.im/gapps/gapps-ics-20120429-signed.zip
This will put the file in /mnt/sdcard/Download/, where the init script looks at.

Reboot, wait for the device to reboot and you are done.
The details of what is modified in this firmware from the original version:
- boot defaults to en_US
- deactivated /system/lib/hw/sensors.exDroid.so (fixes 100% system_server bug)
- added /etc/init.d capability
- added capability to install gapps if zip present in /mnt/sdcard, by a /etc/init.d script
- removed the Chinese applications (you can still find them in the original update.zip in system/preinstall and system/vendor/app, I kept Flash Player).
- added xpad.ko module (found here: MELE A1000 Hacking - XBOX 360 controller support in 3.0.8 kernel)

jeudi 7 février 2013

Mele_HTPC_20121220_V1.3.1 en_US img+sdcard version

Another firmware.
the changelog is here: http://www.mele.cn/download/show/21.htm

Here are the modified versions:
Phoenixcard image: Mele_HTPC_20130116_V1.3.1_en_US_Apex.img
dd-able img: Mele_HTPC_20130116_V1.3.1_en_US_Apex.ddimg.bz2
sdcard version: <TBD>

To get google apps, from the installed Mele firmware, use the Internet navigator and download this:
http://goo.im/gapps/gapps-ics-20120429-signed.zip
This will put the file in /mnt/sdcard/Download/, where the init script looks at.

Reboot, wait for the device to reboot and you are done.

Original firmware: http://www.mele.cn/download/show/21.htm

I applied the same things as in my previous post:
Mele_HTPC_20121220_V1.3 en_US img+sdcard version

dimanche 3 février 2013

Keeping Google Play device entry over firmware flashes: Android ID

Edit: *DOES NOT WORK* Useless. The device is still duplicate... perhaps /data/misc/radio/imei.conf needs to be copied too?

To keep the same device entry in Google Play after a firmware flash, you must keep the "Android ID" intact.

This key is a unique identifier used by Google Play to address your device.
After each firmware flash, this unique identifier is re-generated by default, and this leads to a new device entry in Google Play (I have around 20 duplicate entries in my Play account->Parameters).

This Android ID is stored in the system database, and it is easy to change it.
First, you have to retrieve the Android ID you want to keep over the firmware flashes:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
SELECT * FROM secure WHERE name = 'android_id';
.quit

The "SELECT" command will display the Android id, like this:
34|android_id|123456789abcdef0

After a firmware flash, you just have to update this Android ID. Do that at early stage (before installing Google Applications for example), so that all applications will take into account the updated ID:
adb shell
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
UPDATE secure SET value = '<your preferred ID>' WHERE name = 'android_id';
.quit

With <your preferred ID> the one you got initially with the SELECT command (i.e. 123456789abcdef0 in my example).
Just reboot to be sure that any running application gets the new ID.

Source: http://forum.xda-developers.com/showthread.php?p=37218521

samedi 5 janvier 2013

Mele_HTPC_20121220_V1.3 en_US img+sdcard version

2 versions:
- 1 flasheable using PhoenixTools here: Mele_HTPC_20121220_V1.3_en_US_Apex.img
         or dd-able image: Mele_HTPC_20121220_V1.3_en_US_Apex.ddimg.bz2
- 1 SDCard version: sdcard_Mele_HTPC_20121220_V1.3.tar.bz2.
Choose your flavor...

Next, you can install gapps.
You just have to put in /mnt/sdcard the gapps .zip file found here: gapps-ics-20120429-signed.zip, and reboot (download from a PC, put it on a external sdcard, copy with the file manager).

The script in /etc/init.d (here: 10update_gapps) will scan at boot and install gapps if present.

In the case of SDCard version, you have to put the gapps zip file in the last partition (named UDISK, /dev/sdx10)

In details, what is modified in this firmware from the original version (Mele_HTPC_家庭版_20121220_正式版_v1.3):
- boot defaults to en_US
- deactivated /system/lib/hw/sensors.exDroid.so (fixes 100% system_server bug)
- added /etc/init.d capability
- added capability to install gapps if zip present in /mnt/sdcard, by a /etc/init.d script
- added APEX Launcher as default launcher (found here: Apex Launcher)
- added Andrew patch 2.0.apk as preinstalled app (found here: http://bbs.mele.cn/showtopic-855.aspx)
- added ES Explorer as preinstalled app (found here: Download)
- added xpad.ko module (found here: MELE A1000 Hacking - XBOX 360 controller support in 3.0.8 kernel)

Specifically in the SDCard version:
- tuned /etc/vold.fstab so that sdcard is correctly mounted.
- in first partition, you will find uEnv_recovery.txt that boots on the SDCard, recovery mode. Just replace in the first partition uEnv.txt by uEnv_recovery.txt and you will boot into recovery. Replace by uEnv_normal.txt and you will boot in normal mode.
- added recovery partition (/dev/sdX7)

samedi 22 décembre 2012

Mele_HTPC_20121220_V1.3 SDCard version

I managed to automate the creation of a SDCard bootable version from a stock Android image, under linux.
Of course you will lose your data on SDCard, and you may lose data from your computer if you don't care enough about this infamous X letter!

As an example, here is the latest firmware from Mele (20 December 2012) on which I just modified the partition names (SDCard instead of NAND), changed the default language, and added the /etc/init.d stuff :
- get this: sdcard_Mele_HTPC_20121220_V1.3.tar.bz2
- get a 8GB SDCard (not less, the partitions are created depending on this minimal size)
- uncompress the above archive,
- as root, check the SD-Card device number (/dev/sdX), and perform: make DEV=/dev/sdX
- Optionally, mount /dev/sdX1 to edit uEnv.txt that contains the MAC address. Set it to your usual MAC address if needed.
- Once done, put this SDCard into your device, power-on and enjoy.

The original firmware is here: Mele_HTPC_家庭版_20121220_正式版_v1.3

Notes:
- A slow SDCard gives slow boot process. A Class 10 SDCard gives good results.
- This SDCard image won't modify the flashed firmware, you can revert to your NAND image simply by removing the SDCard, and rebooting.

The details on what it does
The process is quite simple:
1/ create partitions on SDCard
2/ format partitions
3/ fill the partitions with the interesting things (extracted from the Mele firmware).
Mandatory modifications from the original firmware are the nandX->mmcpblk0pX stuff in order to work properly, and to avoid this SDCard firmware to corrupt the flashed firmware .
You can easily modify the created partitions' content for customization.

dimanche 25 novembre 2012

Booting the Android ICS system from SDCard

Update: from the information below, I recently added the "recovery" partition, so it shifts partition numbers.
The mele flash kitchen_v2 contains scripts to generate the sdcard version, look here:
Mele A2000: my own Linux flash kitchen

Testing new firmwares could be a pain since everything is wiped out at each update.
My idea (an I see some people had the same idea before) is to write the Android partitions on sdcard and boot from it.

There are already Linux distributions that boot from SDCard, like ArchLinux:
http://archlinuxarm.org/platforms/armv7/mele-a100
I have taken this Linux distribution as the base system.

The principle is quite easy: take a SDCard u-boot, give it the Android kernel, create the Android partitions on SDCard, fill them to make Android happy, change all "nandx" references by "mmcblk0px" in init scripts.

The Android system boots and does not need any access to NAND, a good point since I can test firmwares without affecting my flashed one.

Partitioning

Under linux, I have partitioned the SDCard (SDHC class 10, for boot speed) with fdisk.
Here is the resulting partitions:

Note that a free space of 16MB is kept at start of sdcard, it embeds the spl bootloader
I put 4GB for "data" and 10GB for /sdcard (16GB SDCard gives lot of space).
Exact size doesn't matter; if you set to 15,95MB one partition, that's not a big issue. The important thing is the number of partitions, see below.

So the matching nand-sdcard partitions are:

-nand- -sdcard-   -name-      -format-
nanda  mmcblk0p1  bootloader  vfat
nandb  -N/A-      env
nandc  mmcblk0p2  boot        ext4
nandd  mmcblk0p3  system      ext4
nande  mmcblk0p5  data        ext4
nandf  mmcblk0p6  misc        ext4
nandg  -N/A-      recovery
nandh  mmcblk0p7  cache       ext4
nandi  mmcblk0p8  private     vfat 
nandj  -N/A-      sysrecovery
nandk  mmcblk0p9  UDISK       vfat

Note: I just found out that link: http://linux-sunxi.org/Android/partitions
Almost same thing...
Note(2): under linux, mmcblk0p1 is /dev/sdb1, mmcblk0p2 is /dev/sdb2, ...

Filling partitions

Then I formatted partitions using mkfs.vfat for FAT partitions, and mkfs.ext4 for ext4 partitions that need to be formatted (look at the above table for the ones that need to be formatted, the others will be formatted by Android).
Then, from ArchlinuxARM/Mele-Bootloader I did:
# write SPL
dd if=sun4i-spl.bin of=$DRIVE bs=1024 seek=8
# write mele u-boot
dd if=mele-u-boot.bin of=$DRIVE bs=1024 seek=32
where DRIVE is /dev/sdb is sdcard is on sdb.

In the bootloader partition, I put the Mele's script.bin, and the Mele's kernel (the 3.0.8+ one), transformed into a u-boot image using this:
mkimage -A ARM -C none -T kernel -O linux  -a 40008000 -e 40008000 -d zImage uImage
I added uEnv.txt:
boot_mmc=fatload mmc 0 0x43000000 ${fexfile}; fatload mmc 0 0x48000000 ${kernel}; bootm 0x48000000
extraargs=rootwait init=/init mac_addr=00:BA:D0:MA:C0:FF
fexfile=script.bin

The "boot" partition contains the initrd contents of root.fex, and must be in mmcblk0p2 (default root partition of the spl u-boot, you can change it with root=xxx in extraargs variable)

The "system" partitions contents the files of the /system partition (system.fex mounted partition)
That's all.

Changing init scripts

In "boot" partition, you need to edit init.sun4i.rc and uevent.sun4i.rc, to change all "nandX" references into "mmcblk0pN" references conforming to the above table.
grep -r nand * shows you all the files that need to be modified.

In the same manner, change /system:
bin/sop.sh
bin/preinstall.sh
bin/data_resume.sh
etc/vold.fstab

The proof

Here is the mount table from my functional system:
root@android:/ # busybox mount                                                                                                      
rootfs on / type rootfs (rw)                                                                                                        
/dev/root on / type ext4 (ro,relatime,user_xattr,barrier=1,data=ordered)                                                            
devtmpfs on /dev type devtmpfs (rw,relatime,size=156796k,nr_inodes=39199,mode=755)                                                  
tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)                                                                              
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)                                                                  
proc on /proc type proc (rw,relatime)                                                                                               
sysfs on /sys type sysfs (rw,relatime)                                                                                              
tmpfs on /mnt type tmpfs (rw,relatime,mode=777,gid=1000)                                                                            
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)                                                                       
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)                                                                        
/dev/block/mmcblk0p3 on /system type ext4 (ro,relatime,user_xattr,barrier=0,data=ordered)                                           
/dev/block/mmcblk0p5 on /data type ext4 (rw,nosuid,nodev,noatime,user_xattr,barrier=0,journal_checksum,data=ordered,noauto_da_alloc)
/dev/block/mmcblk0p7 on /cache type ext4 (rw,nosuid,nodev,noatime,user_xattr,barrier=0,journal_checksum,data=ordered,noauto_da_alloc
)                                                                                                                                   
/dev/block/mmcblk0p8 on /mnt/private type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=ascii,sh
ortname=mixed,errors=remount-ro)                                                                                                    
/dev/block/vold/179:1 on /mnt/extsd/179_1 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1023,fmask=0702,dmask=0702
,allow_utime=0020,codepage=cp437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)                                            
/dev/block/vold/179:6 on /mnt/extsd/179_6 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1023,fmask=0702,dmask=0702
,allow_utime=0020,codepage=cp437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)                                            
/dev/block/vold/179:8 on /mnt/extsd/179_8 type vfat (rw,nosuid,nodev,noexec,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage
=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)                                                                           
/dev/block/vold/179:9 on /mnt/extsd/179_9 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1023,fmask=0702,dmask=0702
,allow_utime=0020,codepage=cp437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)                                            

And the storage screenshot:

mercredi 7 novembre 2012

Handling nand flash to save/recover data using ArchLinuxArm

When booting from SDCard under linux, it is possible to access the NAND partitions.
I use ArchLinux ARM, following this tutorial: Mele A100, the only bootable image that gets correctly the NAND partitions (as under Android ICS). I changed the MAC entry in script.bin in order to have a well-known MAC address for ssh.

Under Android ICS, partitions are defined like this:

-dev-  -name-        -start-       -size-       -mountpoint-


nanda  bootloader  : 1000000       01000000      u-boot
nandb  env         : 2000000       01000000      N/A (u-boot environment)
nandc  boot        : 3000000       02000000      initrd in RAM as / + kernel
nandd  system      : 5000000       20000000      /system
nande  data        : 25000000      60000000      /data
nandf  misc        : 85000000      01000000      "boot-recovery" or 0xff*
nandg  recovery    : 86000000      02000000      N/A (recovery image)
nandh  cache       : 88000000      08000000      /cache
nandi  private     : 90000000      01000000      /mnt/private
nandj  sysrecovery : 91000000      20000000      /mnt/sysrecovery
nandk  UDISK       : b1000000      3b000000      /sdcard

Under Linux, partitions are detected correctly (the following line shows something comparable to the above output):

echo "-dev-  -size-";cat /proc/partitions|while read x y size dev; do echo "$dev  `printf %08x $(( $size * 1024 ))`";done
[...]
-dev-  -size-
[...]
nanda  01000000
nandb  01000000
nandc  02000000
nandd  20000000
nande  60000000
nandf  01000000
nandg  02000000
nandh  08000000
nandi  01000000
nandj  20000000
nandk  3c800000
[...]

As a consequence, you can read/edit/save data from NAND using a linux distribution.
Important note: don't write on Android ICS mounted partitions, you can corrupt data!
Use cases:
1/ list installed application in /data:
mount -o noatime,nosuid,nodev,barrier=0,journal_checksum,noauto_da_alloc /dev/nande /mnt #this is how Android mounts ext4 partitions, look at init.sun4i.rc for special nand mount options.
ls -l /mnt/app/
-rw-r--r-- 1 1000 1000  4707663 Nov  5  2012 com.adobe.flashplayer-1.apk       
[...]

2/ backup a NAND partition locally:
dd if=/dev/nande bs=4096 |bzip2 -c >/root/nande.bz2

3/ backup a NAND partition via ssh (assuming my ssh server is at @192.168.1.124):
dd if=/dev/nande bs=4096 |bzip2 -c | ssh user@192.168.1.124 dd of=/home/user/nande.bz2

4/ restore a NAND partition locally:
bzip2 -cd /root/nande.bz2 | dd of=/dev/nande bs=4096
sync

5/ restore a NAN partition via ssh:
ssh user@192.168.1.124 bzip2 -cd /home/user/nande.bz2 | dd of=/dev/nande bs=4096

6/ make a tar.bz2 archive of a partition contents (for huge partitions, instead of saving raw data):

mount -o noatime,nosuid,nodev,barrier=0,journal_checksum,noauto_da_alloc /dev/nande /mnt
cd /mnt
tar jcf - .|ssh user@192.168.1.124 dd of=/home/user/nande.tar.bz2
cd
umount /mnt

Using these commands, you can save/restore completely some essential partitions before a crash or a new firmware flashing procedure (/data essentially, /sdcard contains user data - movies, ... - that you should save in another place by other means).

dimanche 4 novembre 2012

Creating a dd-able image (Mele_4.0_V1.3BETA_revised_en_us_4.img.bz2)


I saw the lundman method (see conversation: http://ibot.rikers.org/%23arm-netbook/20120702.html.gz, 03:01.59):
- dd if=/dev/zero of=/dev/sdx bs=4096 count=128000 #an image does not exceed 512MB, and I take 4096 as blocksize for read/write flash speedup.
- flash the firmware on the sdcard using PhoenixCard,
- using fdisk -l /dev/sdx you know the FAT partition begin, and as as consequence, the hidden partition end.
- hexdump the /dev/sdx -s <at supposed end of last partition>, see when it gets some zero, you have the real end of the flash image.
Example, on Mele_4.0_V1.3BETA_revised_en_us_4.img
Result: Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2
I flashed my firmware on my sdcard, that is shown as /dev/sdb.

fdisk -l /dev/sdb shows (I have a 2GB  SDCard):

Disk /dev/sdb: 1967 MB, 1967128576 bytes
1 heads, 62 sectors/track, 61968 cylinders, total 3842048 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *      695166     3839998     1572416+   b  W95 FAT32

Start of the visible partition is at 695166 sector # (means at 695166*512=355924992 bytes):

xxd -a -skip 355924992 /dev/sdb
1536fc00:eb3c 904d 5344 4f53 352e 3000 0208 2000  .<.MSDOS5.0... .
1536fc10:0200 0000 00f0 0000 0000 0000 0000 0000  ................
1536fc20:81fc 2f00 fd0b 0000 0000 0000 0200 0000  ../.............
1536fc30:0100 0600 0000 0000 0000 0000 0000 0000  ................
1536fc40:8000 296f 0000 0020 2020 2020 2020 2020  ..)o...         
1536fc50:2020 4641 5433 3220 2020 0000 0000 0000    FAT32   ......
1536fc60:0000 0000 0000 0000 0000 0000 0000 0000  ................
*
1536fdf0:0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
1536fe00:0000 0000 0000 0000 0000 0000 0000 0000  ................
*
15373c00:f8ff ffff ffff ffff ffff ff0f 0000 0000  ................
15373c10:0000 0000 0000 0000 0000 0000 0000 0000  ................
*
154f3600:f8ff ffff ffff ffff 0000 0000 0000 0000  ................
154f3610:0000 0000 0000 0000 0000 0000 0000 0000  ................
*
15673000:2020 2020 2020 2020 2020 2008 d0da e18c             .....
15673010:6441 6441 0000 e18c 6441 0000 0000 0000  dAdA....dA......
15673020:0000 0000 0000 0000 0000 0000 0000 0000  ................
*
1576fc00:f8ff ffff ffff ff0f ffff ff0f 0000 0000  ................
1576fc10:0000 0000 0000 0000 0000 0000 0000 0000  ................
*
15943600:f8ff ffff ffff ff0f ffff ff0f 0000 0000  ................
15943610:0000 0000 0000 0000 0000 0000 0000 0000  ................
*
15b17000:2020 2020 2020 2020 2020 2008 0000 0000             .....
15b17010:0000 0000 0000 0000 0000 0000 0000 0000  ................
... and nothing more until a little time.

Remember: I zeroed 4096*128000 bytes, I must find out the end, where there are many zeroes until this limit (4096*128000=0x1f400000).
In this case: 0x15b17010 seems to be the end of my FAT32 partition.

So you can suppose that the end of image (including the fat32 partitions) is at 0x15b17010.
0x15b17010 makes in decimal: 88856 blocks of 4096 bytes (rounded up).

dd if=/dev/sdb bs=4096 count=88856 |bzip2 -9 > Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2
The resulting file is a compressed dd-able image.

To write this dd-able image, you can perform:
bzip2 -cd Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2|dd of=/dev/sdx bs=4096


Mele_HTPC_0929_BETA_V1.3 Revised version: en_US v4

Another release that fixes the "reboot never ends" bug after having launched Google Play:
Mele_4.0_V1.3BETA_revised_en_us_4.img

On 4shared:
Mele_4.0_V1.3BETA_revised_en_us_4.img(4shared)
Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2(4shared)


Edit: md5sum=70aee0c6ae9c375e72d3f87bed594ef0  Mele_4.0_V1.3BETA_revised_en_us_4.img 
        dd-able image: Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2
        md5sum=ea14dab60e131feac04f20a7947291e9  Mele_4.0_V1.3BETA_revised_en_us_4.ddimg.bz2

Precision: this release disables the Google Play updates automatically (via a /etc/init.d/ script), that makes the bug occur. You don't need to perform the steps mentioned hereafter if you take it.

I hope this will be the last under Android 4.0 (next will be 4.1 JellyBean when Mele decides to release it).
After many tries (copy Vending.apk from old firmware, revert all /system/app and /system/framework, ...), nothing solved the "reboot never ends" issue.

Then I had the idea to revert the Market update (go to Paremeters->Applications->All->"Google Play"->"Uninstall updates".
And yes, it works. The Market update is what makes the system fail.

So the solution is to disable the Market update definitely. I don't know the consequences on a long term period, but for this release, no more "reboot never ends" issue.
In order to disable the Market update, see this thread: (How-to) prevent Android Market app from updating itself, that says:

Do "uninstall updates" on the market app (in "manage applications").
Open the terminal app.
Run "su" to become root.
Run: touch /data/app/com.android.vending-1.apk
Run: chattr +i /data/app/com.android.vending-1.apk

You can perform only "uninstall updates" step, but you will have to do that at each reboot.

In the above image, there is a init.d script that performs the required touch+chattr operations automatically.
I also removed the last Chinese application (sorry for them).

Note for Chinese people: this fix should apply on the Chinese firmware, but you have to add these lines in the init.rc script (on post-fs-data) since there is no init.d system in the original firmware.

dimanche 28 octobre 2012

Mele_HTPC_0929_BETA_V1.3 Revised version: en_US v3

Here is a new firmware version:
Mele_4.0_V1.3BETA_revised_en_us_3.img
What is fixed:
- fixed the reboot bug. Many thanks to tuscanman from the Russian forum 4pda.ru that gave the solution. Google Market did not get the right permissions, fix inside android.policy.jar: http://4pda.ru/forum/index.php?showtopic=342683&st=1420
- added the xpad.ko kernel module (/system/vendor/modules/xpad.ko, http://melea1000.blogspot.co.uk/2012/08/xbox-360-controller-errors.html )
- added the /etc/init.d/ facility. At boot, all scripts inside this directory will be called. This allows the user to run custom commands at boot (look at the script 99test that writes a test file at boot). You can add commands in this script or clone it to add some other commands (like insmod /system/vendor/modules/xpad.ko)
- called mksh where busybox sh is not really necessary in startup scripts. Abuse of busybox eats memory, well this gives minor effect.

Edit: the reboot bug stilll persist, I still get a system hang at reboot... sadly.
Edit(2): I just saw that on the serial console you have a login. Here is the logcat output, need to analyse it now...: logcat_reboot_fail.log