Other OS

Rolling ArchLinuxARM-sun7i-latest image to BPI-R1

3 3230
Edited by technosf at Fri Jun 5, 2015 16:21


I'd like to start with a stock ArchLinuxARM-sun7i-latest image and roll it to the R1.

Of course, it doesn't work as-is - The R1 wont boot. Guessing there are firmware files needed? Which ones. Anything else?

As an alternative, I did boot from the Lemaker Arch image and then changed the Arch repo from arm6h to arm7h, ignoring the raspberrypi packages. Happily it all worked after a system upgrade, though a few files would not update (avahi, haveged etc). And although the kernal updated uname -a came back with the original 3.19 version number, not the 4.0.2 that the update brought in.

Would love to hear if this is an upgrade path.

Thanks in advance,

Edited by Nwonknu at Sat Jun 6, 2015 14:17

Try this:

- Create the working directory:
  1. mkdir /tmp/banana
  2. cd /tmp/banana
Copy the Code
- Download U-Boot, Toolchain and Rootfs:
  1. wget ftp://ftp.denx.de/pub/u-boot/u-boot-2015.04.tar.bz2
  2. wget http://archlinuxarm.org/builder/xtools/x-tools7h.tar.xz
  3. wget http://archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz
Copy the Code
- Extract u-boot and toolchain:
  1. tar xf u-boot-2015.04.tar.bz2
  2. tar xf x-tools7h.tar.xz
Copy the Code
- Add to the PATH the toolchain
  1. export PATH=$PATH:"$(pwd)/x-tools7h/arm-unknown-linux-gnueabihf/bin"
Copy the Code
- /dev/sdb is the SD card use yours.
  1. export card=/dev/sdb
Copy the Code
- Clean the SD
  1. sudo dd if=/dev/zero of=${card}
Copy the Code
- Build u-boot
  1. cd u-boot-2015.04
  2. - Replace Bananapi_defconfig to Bananapro_defconfig for the Banana Pro
  3. make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabihf- Bananapi_defconfig
  4. make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabihf- -j3
Copy the Code
- Install the bootloader
  1. sudo dd if=u-boot-sunxi-with-spl.bin of=${card} bs=1024 seek=8
Copy the Code
- Create one partition. Commands: o, n, enter, enter, enter, enter, w
  1. sudo fdisk ${card}
Copy the Code
- Make the ext4 filesystem
  1. sudo mkfs.ext4 -m 0 -L "Arch" ${card}1
  2. sudo mount ${card}1 /mnt
Copy the Code
- Unpack the rootfs
  1. sudo tar -C /mnt/ -xf /tmp/banana/ArchLinuxARM-armv7-latest.tar.gz
Copy the Code
- Create the boot.cmd file.
  1. sudo nano /mnt/boot/boot.cmd
Copy the Code
- With the following content (Replace sun7i-a20-bananapi.dtb to sun7i-a20-bananapro.dtb for the Banana Pro):
  1. ext2load mmc 0 0x46000000 boot/zImage
  2. ext2load mmc 0 0x49000000 boot/dtbs/sun7i-a20-bananapi.dtb
  3. setenv bootargs console=ttyS0,115200 [earlyprintk] root=/dev/mmcblk0p1 rootwait panic=10 rootfstype=ext4 rw ${extra}
  4. bootz 0x46000000 - 0x49000000
Copy the Code
- Generate boot.scr. Requires u-boot-tools package.
  1. sudo mkimage -C none -A arm -T script -d /mnt/boot/boot.cmd /mnt/boot/boot.scr
Copy the Code
Put the SD on the Banana and you can ssh in.
Now you can configure the system: https://wiki.archlinux.org/index ... onfigure_the_system
Acording to the sunxi wiki, you need to make the switch working apply this patches: https://github.com/Dh0mp5eur/BCM53125-Mainline-Patches

More info:

My english is very bad.

Hi Nwonknu,

Thank you for you help - Your English looks fine to me!

I've had mixed results with your instructions.

I initially compiled for the BPI-R1 with the Bananapro_config cross-compiling on an AMD64 machine. I had to install flex and then replace the libfl.2.0 library with an ARM compiled library with the correct headers: u-boot didn't like the ELF headers of the original AMD64 library.

I could not find a sun7i-a20-bananapro.dtb from google, so I changed the boot.cmd to use the bananapi file instead. It booted (though the green led was not lit). The WAN port would not self configure using dhcpcd. I need to look at the systemd-networkd config  and keep trying.

I did compile uboot with the Bananapi config... But it failed to bot, halting at the network boot.

I'll mess around with diferent configs to see if I can make head way. A link to sun7i-a20-bananapro.dtb would be much appreciated.

Thank you!

Download http://mirror.archlinuxarm.org/a ... 2-armv7h.pkg.tar.xz and unpack on the target:
  1. tar -C /mnt -xf linux-armv7-4.0.4-2-armv7h.pkg.tar.xz
Copy the Code
This update the kernel and dtbs.

When you update the system the first time, you can get an error and need to update the kernel package by hand:
  1. pacman -U --force http://mirror.archlinuxarm.org/armv7h/core/linux-armv7-4.0.4-2-armv7h.pkg.tar.xz
Copy the Code

You have to log in before you can reply Login | Sign Up

Points Rules