Tuesday, 2 October 2012

Hackberry A10 - Debian Wheezy (Headless)

There seems to be demand for a minimal headless debian wheezy image for the Hackberry. So here is a pre-built image that I've created using this armhf rootfs and compiling a 3.0.36 kernel. This should easily fit on a 1GB SD card as its fairly light weight however the pre-built image is currently for a 4GB card. You can dd the image to a smaller SD card and subsequently mend the ext4 partition. Image works on the 1Gb model haven't got a 512Mb version to test with. To deploy the image to your SD card use the following commands, you  can find the <device> of your SD card by 'df -h'.

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

Once the imaging is complete the SD card will contain a small fat16 partition for booting and the remaining space allocated to the rootfs (ext4).  You change the debian configuration as you like before booting. The default image is configured for eth0 (dhcp) and ssh enabled.  You can configure eth0 to a static ip address by editing /etc/network/interface. It is possible to enable wifi by editing /etc/modules to load 8192cu.ko, configuring  /etc/network/intefaces for wlan0.

Note: I have created a new uboot based on the lastest source, the two files sunxi-spl.bin and u-boot.bin can be download from here. Patch these to the SD card image:

    sudo dd if=sunxi-spl.bin of=/dev/<drive> bs=1024 seek=8
    sudo dd if=u-boot.bin of=/dev/<drive> bs=1024 seek=32
    sudo sync

Now boot the Hackberry with the SD card if all is ok you will need to find the ip address of the Hackberry and ssh as root (password is password) eg:

    ssh root@<ip address>

You should now be presented with a shell


Linux (none) 3.0.36+ #39 PREEMPT Sun Sep 23 14:52:17 BST 2012 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Jan  1 00:00:50 2010 from mtx512-inspiron-620.lan
root@(none):~# 

Free memory is currently showing at around 800K:

root@(none):~# free -m
             total       used       free     shared    buffers     cached
Mem:           814         30        784          0          2         12
-/+ buffers/cache:         15        799
Swap:            0          0          0

We can probably release more memory by removing unwanted kernel modules (eg mali) since this is a headless image. 













46 comments:

  1. Hi ,

    i'm trying the image .. just received my hackberry yesterday .. but can't get it to boot :(
    The red led flashes a bit when powering on and stops .. what am i doing wrong ?

    Regards

    Tom

    ReplyDelete
    Replies
    1. Hi,

      Do you see a ip address allocated from your router if you are not allocating a static one?

      Do you have a ttl-usb serial adapter to hand, this way we could see the console output.

      Delete
    2. Hi , nope .. i don"t see any lease in my router ..

      also de led really doesnt flash longtime ..

      Since it's headless i proably can't see anything ..

      I do have a usb to ttl avaialble ( profilic ) .

      Tom

      Delete

  2. When i write the berry boot to a SD card using Win 32 disk imager it boots instantly .. only ubuntu doesnt install .. get SHA1 error after download .

    I tryed writing your image using DD & Win32 diskimage .. exacly same problems ...


    Tom

    ReplyDelete
    Replies
    1. Are you dd on Linux or using Windows?

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

      Delete
  3. i can try both .. should not matter to write image i guess ? will try again on ubuntu laptop .

    Tom

    ReplyDelete
    Replies
    1. Once you dd the wheezy image on ubuntu. Re-insert the sd card and ubuntu it should show 2 partition, one called boot (fat) and the other call debian (ext4). If these show up then the imaging worked.

      Next step would be to hook up the serial port as this will show where the boot is failing if that is the cause.

      Delete
  4. ok thanks for the tips .. wil try this .

    ReplyDelete
  5. Tryed again wrote via ubuntu .. could read the 2 partitios .. but still same problem ..


    U-Boot 2011.09-rc1-dirty (Jun 18 2012 - 10:41:02) Allwinner Technology

    CPU: SUNXI Family
    Board: A10-EVB
    DRAM: 512 MiB
    NAND: 3800 MiB
    In: serial
    Out: serial
    Err: serial
    --------fastboot partitions 2--------
    -total partitions:11-
    -name- -start- -size-
    bootloader : 100000 1000000
    env : 1100000 200000
    boot : 1300000 2000000
    system : 3300000 20000000
    data : 23300000 2f648000
    misc : 52948000 100000
    recovery : 52a48000 2000000
    cache : 54a48000 10000000
    private : 64a48000 100000
    backup : 64b48000 100000
    UDISK : 64c48000 88bb8000
    -----------------------------------
    Hit any key to stop autoboot: 0

    NAND read: device 0 offset 0x1300000, size 0x2000000
    33554432 bytes read: OK

    Starting kernel ...


    Here it stops ...

    ReplyDelete
  6. Board: A10-EVB
    DRAM: 512 MiB
    MMC: SUNXI SD/MMC: 0
    In: serial
    Out: serial
    Err: serial
    Hit any key to stop autoboot: 0
    reading evb.bin

    43148 bytes read
    reading uImage

    3937940 bytes read
    ## Booting kernel from Legacy Image at 48000000 ...
    Image Name: Linux-3.0.36+
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 3937876 Bytes = 3.8 MiB
    Load Address: 40008000
    Entry Point: 40008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    <6>Initializing cgroup subsys cpuset
    <5>Linux version 3.0.36+ (mtx512@mtx512-Inspiron-620) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #39 PREEMPT Sun Sep 23 14:52:17 BST 2012
    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
    Machine: sun4i
    DRAM: 1024<6>Total Detected Memory: 1024MB with 2 banks
    <4>Ignoring unrecognised tag 0x00000000
    <4>Ignoring unrecognised tag 0x00000000
    <6>Memory Reserved(in bytes):
    <6> SYS: 0x43000000, 0x00010000
    <6> LCD: 0x5a000000, 0x02000000
    <6> G2D: 0x58000000, 0x01000000
    <6> VE : 0x44000000, 0x05000000
    <6> RAMCONSOLE : 0x5be00000, 0x00200000

    ReplyDelete
    Replies
    1. This is debian booting, here is the full console output http://pastebin.com/7fPa2jGg while booting, can you check how far yours is getting.

      Delete
  7. http://pastebin.com/mE8ubBgY

    ReplyDelete
  8. some times it gets no further then this :

    http://pastebin.com/TDg4109U

    ReplyDelete
    Replies
    1. Can you download this evb.bin (http://dl.miniand.com/jas-hacks/evb.bin) and and replace it with the one on the sd card fat partition (keep a copy old of the old evb.bin). Then boot again.

      Delete
  9. seems to make no difference :(

    do i have a bad board ? or other revision ..

    Weird thig is hackberry bootmenu works .. ( webserver / raspberry pi image etc )

    ReplyDelete
    Replies
    1. Might be the board revision is slightly different. I'm getting another board delivered in the next couple of days. I will try on that board. Could you pastebin the android boot output from start. Also maybe be easier continuing this on the miniand forum https://www.miniand.com/forums/forums/development--3/topics/debian-wheezy-headless

      Delete
    2. I've created another uboot can you try https://www.miniand.com/forums/forums/development--3/topics/debian-wheezy-headless.

      Delete
  10. Can you provide a 2GB image? I guess not all the SD cards are uniform. Since apparently my 4 GB SD card is slightly smaller than your .img and it seems that I could not manage to mend the EXT4 partition as you mentioned after dd.

    ReplyDelete
    Replies
    1. Hi, try this one http://dl.miniand.com/jas-hacks/debian_wheezy_3.0.36_2gb.img.gz. I reduced the ext4 partition to 1.8GB however the image from a 4GB sd card. When you dd it will fail after 2GB but that should be ok.

      Delete
    2. Thanks a lot! I will try it out tonight : D

      Delete
  11. Hello guys, please share a working image for "new" boards with 1gb ram (for those who had troubles with booting (one red light) but finally got it work)

    ReplyDelete
  12. Well, I'm trying to get the wireless to work on the device, but simply editing the /etc/modules file doesn't seem to be sufficient. I managed to get it loaded by doing a "depmod" and then "modprobe 8192cu" actually did something. So, now I have the kernel module loaded, but I still don't seem to have a wlan0 device running despite rebooting. Ideas?

    ReplyDelete
    Replies
    1. Use Win32DiskImager and don't drag the image on to the SD card.

      Delete
  13. Hello guys. Is it possible to install linux into the NAND?

    ReplyDelete
    Replies
    1. It is possible, first thing you need to do is to get a uboot booting from Nand instead of sd card. Another item I haven't had time to look at.

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

    ReplyDelete
  15. Can you tell me what i must do to see the console in the lcd screen attached to hdmi port?

    ReplyDelete
    Replies
    1. This is a headless image therefore no console output to hdmi. If you want a image with console output on hdmi then download my xbmc image. This contains a ubuntu 12.10 build that displays a console shell on hdmi, you don't need to use xbmc if you don't want to.

      Delete
  16. I'm trying on a mk802ii, actually seems to boot (ie if you look at /var/log/* on another machine, ie move the sd card over and look at it, things boot), but the ethernet does not come up. Guessing you did not enable ethernet/ethernet-usb (CDC) support? The only way to connect to the mk802 is via a usb-ethernet. Could you rebuild a kernel with usb-ethernet+cdc enabled? And while you are at it, usb-audio support? Or heck if you can just get the usb-ethernet added, I'll do the rest and post the updated kernel.

    ReplyDelete
    Replies
    1. It's most likely that the CDC isn't compiled as a module or you aren't loading it. On my other blog 'Compiling a kernel' there are instructions on how to do this. I suggest that you compile a kernel that way you have the freedom to determine which modules you create and load.

      Delete
  17. Hi, i just installed and everything is working fine. but... after a while i have lot of input/output error.
    any idea? i have the same problem with other distro...
    maybe could be a sd card? i have to buy a new one or can i fix it?

    thank you

    ReplyDelete
    Replies
    1. Hi, haven't noticed that problem, might be the SD card although it could be caused by some application or kernel module. Check dmesg output if see there is any clue there.

      Delete
  18. Hi, my name is Angelo and I am from Rome (Italy). I have recently bought a Hackberry card to use it as a multimedia player and also to access to internet via wi-fi.
    I have downloaded xbmc and debian headless. My question is: Is it possible to install both on the hackberry? and, if yes, how?
    Thanks in advance
    A.

    ReplyDelete
  19. Hi,

    I used the image for my cubieboard. It boots just fine, but it does not see my rfxcom interface. It is connected on the usb port and and is a ftdi usb to serial adapter for controlling domotica devices. Am i missing some modules? How do i activate usb to serial support?

    Regards, martin

    ReplyDelete
  20. Hi, I used the image on 16GB card and I would like to use the rest of the card. Right now there is only 3.7G available. How can I do it? Thanks

    ReplyDelete
    Replies
    1. You should be able to extend the partition using something like 'gparted' in ubuntu.

      Delete
    2. Thank you. Finally I mounted remaining 12GB as another partition.

      Delete
  21. Hy All!

    I have same problem. My hackberry wont work with serial to usb adapters. I tried 2 types(arduino uno and some old converter).

    lsusb say:
    Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 005: ID 2341:0043 --- this is Arduino Uno R3
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
    Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 004 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN
    Bus 002 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port --- this is old serial usb adapter

    dmesg say:
    [ 2347.320000] [sw_hcd]: reset port.
    [ 2347.390000] [sw_hcd]: reset port stopped.
    [ 2347.450000] [sw_hcd]: sw_hcd_h_disable, epnum = 0
    [ 2347.450000] [sw_hcd]: sw_hcd_h_disable, epnum = 0
    [ 2347.470000] [sw_hcd]: sw_hcd_h_disable, epnum = 0
    [ 2347.470000] [sw_hcd]: sw_hcd_h_disable, epnum = 0
    [ 2347.480000] WRN:L1722(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, STALLING ENDPOINT
    [ 2347.480000] WRN:L1741(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, ep aborting
    [ 2347.510000] WRN:L1722(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, STALLING ENDPOINT
    [ 2347.510000] WRN:L1741(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, ep aborting
    [ 2347.540000] WRN:L1722(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, STALLING ENDPOINT
    [ 2347.540000] WRN:L1741(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, ep aborting
    [ 2347.560000] WRN:L1722(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, STALLING ENDPOINT
    [ 2347.560000] WRN:L1741(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, ep aborting
    [ 2347.580000] WRN:L1722(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, STALLING ENDPOINT
    [ 2347.580000] WRN:L1741(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, ep aborting
    [ 2347.600000] WRN:L1722(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, STALLING ENDPOINT
    [ 2347.600000] WRN:L1741(drivers/usb/sun4i_usb/hcd/core/sw_hcd_host.c):ERR: sw_hcd_h_ep0_irq, ep aborting
    [ 2349.630000] usb 2-1.2: new full speed USB device number 5 using sw-ehci

    i have no idea whats wrong, but i have no new tty in /dev/.

    Please give me same help with this.

    ReplyDelete
  22. I know this is on old thread but any change the link to the image can be revived?

    ReplyDelete
    Replies
    1. You are lucky man, because I saw your message today. Here is debian image https://mega.nz/#!zJMDCRLJ!awtWyyy-wz2LQ-2vby6FtCIieQ5aeLNsfMVPh9NqpyE

      Delete
  23. Replies
    1. Unfortunately the link has been dead for a few years.

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

    ReplyDelete