Welcome, Guest

Author Topic: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)  (Read 12085 times)

progmetalbg

  • Full Member
  • ***
  • Posts: 135
  • Karma: +17/-0
[HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« on: March 12, 2015, 11:58:13 AM »
There is already a guide in the forum for building Arch Linux ARM image for A20-OLinuXino-MICRO, but it is was modified several times in the last 18 months and meanwhile Olimex released 2 other boards based on the same SoC.
Official how-to on Arch Linux ARM site for AllWinner A20 OLinuXinos does not exist at the moment, but u-boot packages are provided for every Olimex board and sun7i linux kernel supports all AllWinner A20 based boards.
This how-to is based on http://archlinuxarm.org/platforms/armv7/allwinner/cubieboard-2

Install to a micro SD card
Replace sdX in the following instructions with the device name for the SD card as it appears on your computer (in most cases it is either /dev/sdb or /dev/mmcblk0).

1. Zero the beginning of the SD card:
Code: [Select]
dd if=/dev/zero of=/dev/sdX bs=1M count=8
2. Start fdisk to partition the SD card:
Code: [Select]
fdisk /dev/sdXAt the fdisk prompt, delete old partitions and create a new one:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Now type n, then p for primary, 1 for the first partition on the drive, 2048 for the first sector, and then press ENTER to accept the default last sector.
Write the partition table and exit by typing w.

3. Create and mount the ext4 filesystem:
Code: [Select]
mkfs.ext4 -m 1 /dev/sdX1
mkdir mnt
mount /dev/sdX1 mnt

4. Download and extract the root filesystem:
Code: [Select]
wget http://archlinuxarm.org/os/ArchLinuxARM-sun7i-latest.tar.gz
bsdtar -xpf ArchLinuxARM-sun7i-latest.tar.gz -C mnt
sync

5. Install the U-Boot bootloader:
5a. A20-OLinuXino-LIME
Code: [Select]
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-lime/u-boot-sunxi-with-spl.bin
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-lime/boot.scr -O mnt/boot/boot.scr
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-lime/script.bin -O mnt/boot/script.bin

5b. A20-OLinuXino-LIME2
Code: [Select]
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-lime2/u-boot-sunxi-with-spl.bin
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-lime2/boot.scr -O mnt/boot/boot.scr
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-lime2/script.bin -O mnt/boot/script.bin
Note: For some reason kernel module for gigabit ethernet MAC is not loaded automatically, it can be enabled that way:
Code: [Select]
echo sunxi_gmac > mnt/etc/modules-load.d/lime2.conf

5c. A20-OLinuXino-MICRO
Code: [Select]
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-micro/u-boot-sunxi-with-spl.bin
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-micro/boot.scr -O mnt/boot/boot.scr
wget http://archlinuxarm.org/os/sunxi/boot/a20-olinuxino-micro/script.bin -O mnt/boot/script.bin

For all boards:
Code: [Select]
dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
umount mnt
sync

Insert the micro SD card into the A20-OLinuXino-(LIME|LIME2|MICRO), connect ethernet, and apply power (5V for LIME/LIME2, 6-16V for MICRO).
Use the serial console or SSH to the IP address given to the board by your router. The default root password is 'root'.



Install the U-Boot package

In order to receive updates to the U-Boot bootloader, after logging into the system type:
Code: [Select]
rm /boot/script.bin
Depending on board model type one of the commands below:
Code: [Select]
pacman -Syu uboot-a20-olinuxino-lime
Code: [Select]
pacman -Syu uboot-a20-olinuxino-lime2
Code: [Select]
pacman -Syu uboot-a20-olinuxino-microWhen prompted, press y and hit enter to flash the bootloader to the SD card.
Merge any pacnew files created by the package overwriting the manually installed bootloader files.



Mainline Kernel

Install the new kernel, which will remove the linux-sun7i package:
Code: [Select]
pacman -Syu linux-armv7Or you can try also the latest release candidate, which at the time of writing this post is 4.0.0-rc3:
Code: [Select]
pacman -Syu linux-armv7-rcReboot the system:
Code: [Select]
reboot*Note that at the moment mainline kernel does not support GPU/VPU and audio, it is only useful for headless systems
« Last Edit: March 16, 2015, 08:17:38 PM by progmetalbg »

ShervinEmami

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #1 on: March 13, 2015, 02:12:02 AM »
Thanks!

davidahoward

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #2 on: March 13, 2015, 10:44:16 PM »
LIME2 crash and burn on u-boot...


U-Boot SPL 2015.01-4 (Jan 27 2015 - 22:12:53)
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2


U-Boot 2015.01-4 (Jan 27 2015 - 22:12:53) Arch Linux ARM

CPU:   Allwinner A20 (SUN7I)
I2C:   ready
DRAM:  1016 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

Reserved 8192kB of RAM for Framebuffer.
HDMI connected.
Setting up a 1024x768 console.
In:    serial
Out:   vga
Err:   vga
SCSI:  SUNXI SCSI INIT
AHCI PHY power up failed.
Net:   dwmac.1c50000
data abort
pc : [<4a017aa4>]          lr : [<4a017a88>]
sp : 7f33bd28  ip : 00000074     fp : 7f33c6c0
r10: 00000002  r9 : 7f33bf00     r8 : 7f7a23a8
r7 : 4a03d16b  r6 : 4a05a89c     r5 : ffffffcb  r4 : ffffffff
r3 : 0000008b  r2 : 00000000     r1 : 4a03d16c  r0 : ffffff8b
Flags: NzCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...

progmetalbg

  • Full Member
  • ***
  • Posts: 135
  • Karma: +17/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #3 on: March 14, 2015, 09:05:42 AM »
Quote
HDMI connected.
Setting up a 1024x768 console.
Try booting the board without HDMI cable connected to it and paste here the output from u-boot.

sakishrist

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #4 on: March 16, 2015, 07:47:09 AM »
With linux-sun7i I could not get the integrated ethernet to work, no tools for wireless either. I ended up using a usb ethernet adapter. When I switched to latest kernel everything was good.

Anyway, it's working so thanks for the effort!

progmetalbg

  • Full Member
  • ***
  • Posts: 135
  • Karma: +17/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #5 on: March 16, 2015, 11:14:41 AM »
With linux-sun7i I could not get the integrated ethernet to work

Which one of the 3 boards do you have - MICRO, LIME or LIME2? I have MICRO and it is working fine with both linux-sun7i and mainline kernel. If you have LIME2 with Gigabit ethernet you can try to manually load the sunxi_gmac module with
Code: [Select]
modprobe sunxi_gmac

jmyreen

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +4/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #6 on: March 16, 2015, 11:24:44 AM »

Which one of the 3 boards do you have - MICRO, LIME or LIME2? I have MICRO and it is working fine with both linux-sun7i and mainline kernel. If you have LIME2 with Gigabit ethernet you can try to manually load the sunxi_gmac module with
Code: [Select]
modprobe sunxi_gmac

Just a quick note: I have a LIME2 board, and can confirm that Ethernet is not working "out of the box". I didn't have time to investigate the problem any further.

progmetalbg

  • Full Member
  • ***
  • Posts: 135
  • Karma: +17/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #7 on: March 16, 2015, 01:27:55 PM »
Quote from: jmyreen
Just a quick note: I have a LIME2 board, and can confirm that Ethernet is not working "out of the box". I didn't have time to investigate the problem any further.
Please try to load sunxi_gmac kernel module and let us know the result.
Also create a file /etc/modules-load.d/lime2.conf with contents
Code: [Select]
sunxi_gmacOn next reboot/power on this module should be automatically loaded.
If this workaround works I'll update the first post.

Gerrit

  • Full Member
  • ***
  • Posts: 242
  • Karma: +7/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #8 on: March 16, 2015, 04:46:05 PM »
Quote from: jmyreen
Just a quick note: I have a LIME2 board, and can confirm that Ethernet is not working "out of the box". I didn't have time to investigate the problem any further.
Please try to load sunxi_gmac kernel module and let us know the result.
Also create a file /etc/modules-load.d/lime2.conf with contents
Code: [Select]
sunxi_gmacOn next reboot/power on this module should be automatically loaded.
If this workaround works I'll update the first post.

I can confirm both, LIME2 does not load the sunxi_gmac without any help so no ethernet after boot.
but your solution creating the file /etc/modules-load.d/lime2.conf does make it work.


progmetalbg

  • Full Member
  • ***
  • Posts: 135
  • Karma: +17/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #9 on: March 16, 2015, 08:19:10 PM »
Quote from: Gerrit link
I can confirm both, LIME2 does not load the sunxi_gmac without any help so no ethernet after boot.
but your solution creating the file /etc/modules-load.d/lime2.conf does make it work.
Thanks!
I updated first post.

sakishrist

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #10 on: March 17, 2015, 07:53:59 PM »
With linux-sun7i I could not get the integrated ethernet to work

Which one of the 3 boards do you have - MICRO, LIME or LIME2? I have MICRO and it is working fine with both linux-sun7i and mainline kernel. If you have LIME2 with Gigabit ethernet you can try to manually load the sunxi_gmac module with
Code: [Select]
modprobe sunxi_gmac
Yep, it's a LIME2. After installing mainline everything works fine. Thanks again!

majesticra

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #11 on: April 06, 2015, 10:53:16 PM »
What about installing arch linux to NAND? (A20-Olinuxino-LIME)

kdubious

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #12 on: March 03, 2016, 05:50:33 AM »
This no longer works, http://archlinuxarm.org/os/ArchLinuxARM-sun7i-latest.tar.gz is a dead link.

Anyone have updated instructions? The ones on the ALARM site lead me to a crash after "Loading kernel"

progmetalbg

  • Full Member
  • ***
  • Posts: 135
  • Karma: +17/-0
Re: [HowTo] Arch Linux ARM for A20-OLinuXino-(LIME|LIME2|MICRO)
« Reply #13 on: March 03, 2016, 08:55:08 AM »
Arch Linux ARM no longer supports linux sunxi kernel 3.4 for Allwinner devices (because of issues with systemd).
I have A20-OLinuXino-MICRO, followed instructions on ALARM site: https://archlinuxarm.org/platforms/armv7/allwinner/a20-olinuxino-micro and everyting works.
I currently use it as a torrent box/home NAS and it is pretty stable, uptime is several weeks.
You can ask in Arch Linux ARM forum for assistance since all Allwinner A20 Olimex boards are supported.