jeudi 27 septembre 2012

Mele A2000: my own Linux flash kitchen

Here it is, my own linux flash kitchen that I used to generate customized ROM images for my Mele HTPC.
Mele flash kitchen for ICS, here: mele_flash_kitchen_2.tgz
This runs only on linux (Slackware, but should work on Ubuntu and so on).

It is based on the A10 flash kitchen v2, with adaptations to run on linux, and based on this topic on Miniand
I have chosen to strip down this kitchen into a packer_ics only version for Mele since this is the one I was interested in.
You still need Windows to flash on SDcard the resulting output.img, using Phoenixcard (the only tool that I was not able to run under linux with wine)

My scripts are derived from the .bat scripts found in A10 flash kitchen (e.g. extract_image.bat is now img_e1xtract.sh) that run under Windows, but I feel safe to perform all the required operations in only one operating system.
You will find a README.txt at the root directory of the extracted archive.

v2: I added the sdcard bootable kitchen.
After having put the original.img file (PhoenixCard source image), run "make build_sdcard" as root and it should create everything needed to generate the sdcard bootable image in sdcard/
Then, you will have to cd sdcard/ , then run make DEV=/dev/sdX (where X is the device letter of your sdcard).
Read this post for more information on that: Booting the Android ICS system from SDCard

Requirements:
wine, in order to extract/build the flash image.
root access, for scripts other than img_1extract.sh/img_2build.sh.
The script will create /system in your root directory. This is necessary if you make symbolic links in "system" filesystem.
Of course, you need an original image (that you will rename as original.img) to start hacking.

Many thanks to Sztupy for the A10 flash kitchen, and to Miniand Tech for the detailed tutorial!

28 commentaires:

  1. I've been trying to compile the ISO9660 and UDF modules to add CD/DVD support to the MELE, following the instructions provided before, but I'm getting error when inserting the module, though the vermagic shows the same version for a working and a non-working module (3.0.8+)

    Any clues?

    Thanks for the kitchen!

    RépondreSupprimer
  2. Perhaps the toolchain? What kind of error are you getting?
    Just follow this tutorial: http://www.cnx-software.com/2012/09/11/building-kernel-modules-for-allwinner-a10-devices-android/
    And see if you get something better...

    RépondreSupprimer
  3. The modules compile, and some work (like xpad.ko) but isofs and udf both give me "insmod: init_module 'isofs.ko' failed (Device or resource busy)"



    RépondreSupprimer
    Réponses
    1. Seems that the module already exists..
      Just try this:
      cat /proc/filesystems
      And see if you find isofs or udf.

      Supprimer
    2. Seems that the module already exists..
      Just try this:
      cat /proc/filesystems
      And see if you find isofs or udf.

      Supprimer
  4. The modules seem to be there (not marked as "nodev") but when I plug a dvdrom in the sata port, it won't get mounted nor recognised

    RépondreSupprimer
    Réponses
    1. I plugged a USB dvd-rom reader, and in a adb shell I did:
      busybox mount /dev/block/sr0 /mnt/sdcard/Movies/ (for example), and I saw the DVD-rom contents in /mnt/sdcard/Movies.
      Nevertheless I don't know what reader is able to read a mounted DVD (perhaps vlc-beta?).
      This is a manual operation, and you must perform "busybox umount /mnt/sdcard/Movies" before ejecting the DVD-rom.
      Not very handy I must admit, but shows that this could work...

      Supprimer
    2. I'll run a few test with a sata -to-usb adapter but I was using sata all along, and still can't get it to work that way

      Supprimer
    3. It works with the usb adapter.
      It worked with the sata cable.

      Somehow I totally forgot about the device being listed within the block devices, and dmesg doesn't say anything about sata devices, but you do get a message with it mounted through usb..

      (USB MESSAGE:)

      <6>[ 317.150484] usb 2-1.2: new high speed USB device number 5 using sw-ehci
      <6>[ 317.270171] scsi2 : usb-storage 2-1.2:1.0
      <5>[ 318.273207] scsi 2:0:0:0: CD-ROM HL-DT-ST DVDRAM GH20NS15 IL00 PQ: 0 ANSI: 0
      <7>[ 318.282760] sr0: scsi3-mmc drive: 78x/78x writer dvd-ram cd/rw xa/form2 cdda tray
      <7>[ 318.309789] sr 2:0:0:0: Attached scsi CD-ROM sr0
      <6>[ 319.278209] init: waitpid returned pid 724, status = 00000000
      <3>[ 319.278233] init: untracked pid 724 exited



      Thanks a lot!

      Supprimer
  5. Can you boot into recovery CWM any time that you need?
    I can do it only once after burning firmwire(

    RépondreSupprimer
    Réponses
    1. Indeed there is a trick here.
      "adb reboot recovery" does not seem to work.
      But if you try
      adb shell "echo -n boot-recovery | busybox dd of=/dev/block/nandf count=1 conv=sync; sync;"
      And then
      adb reboot
      the target reboots in recovery mode.

      Supprimer
    2. Do you see novo7 tools?
      http://dl.free.fr/ocOvJlKdo
      Looks like clone meletools.apk

      Supprimer
  6. I have a thing after burn SD card by phoenix. I have been looked for hidden partitions on SD card. I wanted create my img from SD after phienix. But i cant understand there phoenix are hide the android files on SD. Partitions are not exist, but files are situated there.
    My mission create SD like thoenix burn. Is it really? Or live suit more ease?

    RépondreSupprimer
    Réponses
    1. Windows can't see the partition that phoenix creates, you could see it with some software like partition manager or natively in linux. If you don't know a thing about linux try a live iso of gparted.

      Supprimer
    2. http://linux-sunxi.org/PhoenixCard
      same information.

      Supprimer
    3. Have you error on kitchen?

      http://data1.floomby.com/files/share/25_10_2012/gUdwc5uyq0ivBYDv86yuBA.png

      Supprimer
    4. Under Windows, you should use the miniand tutorial:
      https://www.miniand.com/wiki/Allwinner/Unpacking+and+building+LiveSuit+images
      The only modification you have to do is in the kitchen, files/image.cfg: first to remove "OEM" part, second, to add "DISK" part. Or to make it simpler, overwrite this file with the one in mele_flash_kitchen.tgz.

      Supprimer
    5. I try in ubuntu. Error showing under wine. Ok, thanks for help. What is your profession in a real life?

      Supprimer
  7. HI! You can use RX TX pins on mele and you never need to activate lan or usb ADB

    RépondreSupprimer
  8. MELE HTPC V1.3 BETA
    http://pan.baidu.com/share/link?shareid=72719&uk=3610159878

    Currently downloading, I'll test it later.

    RépondreSupprimer
  9. Hi! I've tried to download your custom kitchen but the link does not work. I've have found it in this google group:
    https://groups.google.com/forum/?fromgroups=#!topic/cubieboard/N4IRtLH07CM

    but I'd rather had the kitchen from it's original source.
    I've also noticed that the original A10 kitchen v2 for Windows is infected by a trojan. If it try to run in in a Windows VM it won't even allow me, it detects that it is running in a VM and stops. To me that is a clear sign of a virus infection. The culprit is unimg.exe.
    There is no difference between the unimg.exe file in your kitchen and the infected unimg.exe. So I wonder how safe is to use your kitchen even in linux.
    Thanks.
    Lutfi

    RépondreSupprimer
    Réponses
    1. Indeed the hoster has deleted the file (no download during 30 days).
      I uploaded it on 4shared, permanent storage.
      Here it is: http://www.4shared.com/file/FjVo90MD/mele_flash_kitchen_v2.html
      This is a v2 version since I put the sdcard kitchen. It should work, just by a "make build_sdcard" after having put "original.img" as the source PhoenixCard image.
      I have no issue with unimg, but I did not check if a network connection was done during the image extraction. And Windows trojans do not mix well on linux under wine...

      Supprimer
    2. Could someone upload this somewhere I don't have to register, please.
      Or just a paste of the "scripts to generate the sdcard version" would be enough for me.

      Supprimer
    3. Please try this: https://www.dropbox.com/sh/4kbugc4g2062r3p/FWmI9I8_bp

      Supprimer
  10. Here is the infection report for the unimg.exe file:
    https://www.virustotal.com/file/7d3c3249c257246b7af8de21de41bba63c2916e3821668be097a6a5ef8d90397/analysis/1360428351/

    RépondreSupprimer
    Réponses
    1. Indeed, even another source shows a trojan:
      https://www.virustotal.com/file/20c170f984b3d3afaf8e45704a5378b9a3cc176995884322eca931914344121b/analysis/
      The source:
      http://www.slatedroid.com/topic/29364-rom-tools-to-make-a-rom-use-them-at-your-own-risk/

      Supprimer
  11. Biggest thanks, Thierry! But there's an error with abootimg:
    ../../tools/abootimg: error while loading shared libraries: libblkid.so.1: cannot open shared object file: No such file or directory
    tools/abootimg-20120825-src/abootimg: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
    I compiled abootimg statically linked and stripped for i386 and amd64: https://www.dropbox.com/s/xbe2u7ai6aqaob1/abootimg_i386+amd64_statically_linked+stripped.tar.xz
    Haven't tested i386 natively so to be sure I also included the static libraries libblkid.a and libuuid.a and you might need blkid.h
    Change the LDLIBS line in the Makefile as follows:
    LDLIBS=-static -lblkid -luuid -L.

    RépondreSupprimer
    Réponses
    1. Indeed this is a dynamic linked version against util-linux-2.21.2 package.
      On debian, there must be a precompiled package somewhere...

      Supprimer