Sunday, 7 October 2012

Hackberry A10 - Linaro 12.06 (Desktop)

I took Toby's Linaro build for the MK802 and patched it to work for the Hackberry. Thanks to Tobay for the work he put into creating the build.



You have two options for getting an image to SD card:

1. Use download my pre-built image

The image is for the 1GB board and contains my latest uboot and a 3.0.36+ kernel compiled to work with the uboot. Kernel is now compiled with hard float resulting in improved performance. It is for a 4GB SD card but the ext4 partition is only 3.5GB. Note: not all 4GB SD cards are 4GB, they may be 3.7,3.8 etc which may mean your dd may fails early. However since we only use 3.6GB hopefully it is ok. If it fails to boot try a 8GB card if you can or re-adjust the partitions on linux after creating the image. 

    gunzip linaro_hf_3.0.36_1gb.img.gz
    dd if=linaro_hf_3.0.36_1gb.img of=/dev/<device>
    sudo sync

2. Build from scratch as below:

Download Toby's last image from linaro-alip-armhf-t4.7z. Extract image from the zip to reveal linaro-alip-armhf-t4.img.

Download my uboot files sunxi-spl.bin and u-boot.bin from here.

Use the boards existing script.bin or download from here script.bin.

Copy image and uboot files to SD card:

    sudo dd if=linaro-alip-armhf-t4.img of=/dev/sdc
    sudo sync
    sudo dd if=sunxi-spl.bin of=/dev/sdc bs=1024 seek=8
    sudo dd if=u-boot.bin of=/dev/sdc bs=1024 seek=32
    sudo sync

I suggest building a kernel to ensure it works with uboot files and copy that across to the SD card.
   
Remove SD card and re-insert to mount drives.

Replace existing evb.bin on fat16 partition with your script.bin, eg on ubuntu do:

    cp script.bin /media/<drive label>/evb.bin
    sync

Now to test it boots:


Remove SD card and place in hackberry, connect hdmi cable to your TV/monitor and boot. Fingers crossed after a while the linaro desktop should appear. Plug in a usb mouse & keyboard and away you go.

57 comments:

  1. Hi, I tried this Linaro Desktop build, it's awesome. Thank you.
    I have couple of questions, however:

    1. The wireless kept popping up a window asking for root passwd. And although the wifi could detect a bunch of networks, it seems not connecting to any of them.

    2. Ideally, I wanna get to boot into the command line straight way since I dont wanna deal with the Gnome interface. Do you know if it's doable through a bit of tweak with this Linaro Desktop build?

    ReplyDelete
    Replies
    1. Hi,

      1. Regarding wireless, select 'Edit Connections' and then move to the 'Wireless' tab and select 'Edit'.
      2. You could enable ssh and uninstall gnome or disable the service (service lightdm stop). It may be possible to get fbcon working but that requires compiling a later kernel.

      Delete
  2. Good work on this and the blog :)

    ReplyDelete
  3. Do you have information on how you patched uboot for hackberry?

    I want to try building my own uboot.

    ReplyDelete
    Replies
    1. Is this for the 1GB or 512Mb board?

      Delete
    2. 1GB.

      Also I noticed when I was replacing evb.bin that there was also a script.bin in the Linaro image. Is this redundant?

      Delete
    3. I'll have to find the patches I made but a bit busy at moment . For the Linaro image using my patched uboot means that the kernel needs to be configured for cpu frequency scaling otherwise its stuck at 800Mhz.

      script.bin is redundant, the uboot looks for a evb.bin.

      Delete
    4. I have been playing with the new u-boot commit that adds the hackberry 1GB memory config - https://github.com/linux-sunxi/u-boot-sunxi/commit/7086c9884dc54c2fdbb63e1298db990f5e0636dd

      However it seems the current u-boot release v2012.10-sunxi has very flakey SD card support on the Hackberry with lots of bad sector reads, invalid partition table errors, problems mounting the rootfs when it managed to read uImage...

      Have you had a look at any of the more recent releases? I just want to be sure it is u-boot and not something with my board or SD card.

      It still boots you custom u-boot fine.

      Delete
    5. Hi Leith, I have created some uboots for 1GB and 512Mb boards (https://www.miniand.com/forums/forums/development--3/topics/uboot.). I didn't release there was already a board config in the source tree. Could you test to ensure they are stable then I can submit these my patches.

      Delete
  4. Hi. Good work!

    I tried, and 10 minutes later tried boot, nothing into screen, u know what it's possibly happening?

    Thaks

    ReplyDelete
    Replies
    1. Does the red LED flicker when the board is booting from the SD card?

      Delete
    2. NO red led is quite, just at start but no more, i tried more than 30 min and nothing.

      I did all steps in this manual, what's happening!

      (My hackberry is a present for friend, but it's new)

      Delete
  5. U_U

    I don't know what i did, but this morning hackberry boots perfectly into android, and now, android logo is desapeared.

    I boot hackberry, show white led ok, and red flickre 4 or 5 times and then nothing.

    I pressed the button of (screen off / on) my tv seems recognize anything but logo isn0t apear.

    What happens? Any way to fix this? Please!

    ReplyDelete
    Replies
    1. Did you remove SD card from slot?

      Did you touch anything on the NAND (the Android filesystem on the flash chip)?

      Delete
    2. Hi Leith!

      Finally i can boot normally into Android.

      I'm trining now to use linaro, lubuntu etc.. but nothing is working.

      You know if hackberry works with SDHC sd card?

      Delete
    3. Please try a new uboot I have created, instructions here https://www.miniand.com/forums/forums/development--3/topics/uboot.

      Delete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Hi!

    When i tried toby's version i have only 1 USB working, no ethernet connection and no wireless available :S

    ReplyDelete
    Replies
    1. You need to use the script.bin for our board, copy it over the evb.bin. Otherwise try the pre-built image I have created.

      Delete
    2. It works, but wifi seems not work :(

      Delete
  8. Pre-built image works fine.. but what is the su password?

    ReplyDelete
  9. Hey!

    It's possible to use XBMC with linaro?

    ReplyDelete
  10. It's a long story regarding XBMC on A10 under linux, see this thread http://forum.xbmc.org/showthread.php?tid=126995&page=110.

    ReplyDelete
  11. Which video output is working ? Only HDMI or it does support the RCA/AV

    ReplyDelete
    Replies
    1. By default script.bin/evb.bin is set for HDMI. You can change script.bin/evb.bin for RCA/AV output and try if it works.

      Delete
    2. And where can I get source to build those ? Or if I'd use method #2 with "board's" script.bin would it work ?

      Delete
    3. See this link for script.bin/evb.bin edits http://www.cnx-software.com/2012/05/06/editing-allwinner-a10-board-configuration-files-script-bin/

      Delete
    4. Thanks, I was able to get it live with berryboot, the only issue I'm facing now is the fact that the "display output" is overflowing my tv screen -> so I can not see the bottom bar and other parts of the UI. Any tips ?

      Delete
  12. i also have linaro pre built image. i flashed it onto sd card but using windows (win32 disk imager software). but unable to boot from sd card on hackberry.
    reply

    ReplyDelete
    Replies
    1. I posted a response to your question on the miniand thread.

      Delete
  13. Hi Jas Hacks,
    Can you post your .config file? I follow your compiling blog entry to build my own kernel. However, screen went black when booting Linaro. thanks

    ReplyDelete
    Replies
    1. Kernel .config is posted here:

      https://www.miniand.com/forums/forums/development--3/topics/compiling-a-kernel-armfs

      Delete
    2. Thanks for your quick response.

      I used your .config to build my kernel image and deploy to your pre-built Linaro. It boots but the screen went dark after seeing linaro desktop for 3 secs.

      I found that there are evb.bin and script.bin in your pre-built image. But you don't provide any uboot script. How does uboot found uImage and rootfs in your pre-built image?

      Anyway, it doesn't seem to be relevant to my case. Because uboot may already have done his booting job. Otherwise I should not see linaro desktop.

      I'm scratching my head now. Hope I can get my usb-serial adapter to debug it.

      Thanks! Happy holidays.

      Delete
    3. Yes, screen make go blank on start up I think if you move the mouse or hit a key it should come back on. I think the screen saver is kicking in early.

      Delete
    4. Can you confirm that this is the config file you used for Linaro kernel?
      I can see Linaro desktop. However, USB keyboard doesn't work after using your config file or sun4i default config.

      I compiled kernel based on:
      git clone git://github.com/amery/linux-allwinner.git
      git checkout 23e5456879db0175f571dec43095c49e181e0b10

      Delete
    5. Sorry to bother you. I fixed it now.

      I'm not sure if this is the cause of the problem. I apply the patch below:
      --- a/drivers/usb/sun4i_usb/hcd/hcd0/sw_hcd0.c
      +++ b/drivers/usb/sun4i_usb/hcd/hcd0/sw_hcd0.c
      @@ -1010,7 +1010,7 @@ static int sw_hcd_core_init(u16 sw_hcd_type, struct sw_hcd *sw_hcd)
      {
      u8 reg = 0;
      char *type = NULL;
      - char aInfo[78];
      + char aInfo[128];
      char aRevision[32];
      char aDate[12];
      void __iomem *usbc_base = sw_hcd->mregs;
      --

      It magically fixed the problem. Thanks!

      Delete
    6. You must be using a later kernel version, the usb driver has been broken a few times :(

      BTW you should set the default CPU governer to performance I set it to on demand. This will speed up the image.

      Delete
    7. Yes, I'm using 3.0.36 version. I heard that latest version sunxi is not stable.

      Anyway, thanks for you hints. I changed CPU freq setting as you told. It ran smoother than before in linaro desktop.

      I found a page about CPU overclocking. I'm not sure if I need it now. But I will give a try after I setting up all my stuffs for my robot car.

      I just hooked up my webcam and tested it for network streaming. BTW, do you know any available driver that can support hardware encode?

      Delete
    8. The only possibility of attempting hardware encode/decode would be to see if you could interface with the cedarx libraries. https://github.com/linux-sunxi/cedarx-libs. I don't think anyone has attempted

      Delete
    9. Thanks for your hints. I looked into document of cedarx. It seems that it only support hardware decode. I can't find any place mentioning hardware encode.

      Anyway, I bought Logitech C920 HD webcam. I patched 3.0.36 kernel to enable H.264 mapping in UVC and followed instruction (http://www.oz9aec.net/index.php/gstreamer/473-using-the-logitech-c920-webcam-with-gstreamer).

      Now I can stream H.264 HD webcam video from my Hackberry board. It only consumed less than 5% CPU usage.

      Delete
    10. Hello Ricky,

      Could you give me instructions on how to enable the H264 patch on the 3.0.36 kernel (using gentoo on MK802II = A10 Alwinner)

      Delete
    11. Ricky, Great work to get your HD webcam working!

      Delete
  14. Hi Jas Hacks!

    I don`t know how to write you, so I write here.
    First I wanna say Thank you for all your work you do for us and our Hackberrys!!!
    And then: It is possible that you compile a build like Linaro for armhf, but without any Desktops?
    I only need an build with X11 running, and the newest driver for the Hackberry Mali GPU... . The thing I want is to build my own Openbox on a clean System.
    My Problem is that I don' t know how I can completly remove the whole Linaro Desktop and Windowmanager... and I can't build X11 on an headless System, so I need help.
    Or an another Idea:
    Maybe you can use your Debian Headless and build X11 and the Mali on it, so that everbody can took the Windowmanager or Desktop who he wants. I tested linaro with openbox (without an Desktop) And then the Hackberry is realy quick...

    So that it is. Please help me :-)

    I wish you a nice day!!!

    ReplyDelete
    Replies
    1. I think the best way is the linaro build without any Desktop, isn' t it?

      Delete
    2. From what I understand Openbox runs inside GNOME,LXDE or KDE. Therefore you should be able to take the XBMC image which is Ubuntu 12.10 with fluxbox as the window manger. You can install LXDE or GNOME on that if required. If you need to update to the latest mali driver then just follow the instructions here http://linux-sunxi.org/Mali400.

      I did something similar when deploying Razor-QT (http://jas-hacks.blogspot.co.uk/2012/12/hackberry-a10-ubuntu-1210-with-razor-qt.html) which is similar to OpenBox.

      Delete
    3. I think I wanna write the next time something about what I do with the linaro.
      My Version is much more quicker denn with the original Desktop.
      But another question:
      When I don' t wanna use Android on the nand, what do you think about to delete the nand, and put the home directory, or an a swap partition on it? Maybe a Swap Partition on the nand will make the Hackberry a little quicker?

      Delete
  15. Hi,

    is there a way to use Linaro with flash player ?

    ReplyDelete
  16. When i do dd img to sd this linaro preload image or xbmc image, my sd after is not accessible. If Write this images with win32 imager from win pc, the sd card is accessible with 2 partition. But if insert sd on hackberry only blue led on mobo and black screen in tv.

    ReplyDelete
  17. Hey Jas,

    I have this error that pops up, and I have no idea about it. I just wrote a short python script for streaming video from the webcam Logitech HD C270. Do you have any ideas how to fix this? Thank you.

    "linaro@linaro-alip:~$ chmod +x webcam.py
    linaro@linaro-alip:~$ ./webcam.py
    open /dev/sequencer or /dev/snd/seq: No such file or directory
    Traceback (most recent call last):
    File "./webcam.py", line 13, in
    cam.start()
    SystemError: ioctl(VIDIOC_S_FMT) failure: no supported formats"

    ReplyDelete
  18. thank you! simple and easy, booted as expected. But discovered some problems right away
    1. No wireless connection
    2. Screen output is slightly out of the borders of my tv
    3. What's the admin password?
    Any advice?

    ReplyDelete
    Replies
    1. aha, password is linaro as mentioned in miniand wiki post

      Delete
  19. is there a faster downloadsource?

    ReplyDelete
    Replies
    1. Sorry, no faster download source.

      Delete
  20. Hey there...wondering if you have a complete build of Ubuntu/Debian for the hackberry?

    As you would be aware, miniand is gone, and with it all the forums/downloads.

    Want to use my hackberry, but can't find a complete image anywhere that will actually work lol

    ReplyDelete
    Replies
    1. Same here, I recently wanted to get my hackberry utilized by having it with kernel that supports ext4 acl/xattr to get netatalk working and possible HFS/HFS+.

      The only option right now to get OS on it is berryboot via
      http://get.berryboot.com (APK to run on sdcard )

      or just formatting SDCARD to fat32 on one partition, keeping rest free ( no partition )

      and copying over the berryboot zip contents to the sdcard to boot up && install linux.


      The thing I'm facing is :D I need to deliver custom kernel to berryboot system to "link it" to the OS it is able to run. - Any ideas ?

      Delete