Manually install ArchlinuxARM to NAND of PhoenixA20

This forum is for supported devices using an ARMv7 Allwinner SoC.

Manually install ArchlinuxARM to NAND of PhoenixA20

Postby radi » Tue Mar 18, 2014 9:03 am

Hi guys,
i have managed to get a basic ArchlinuxARM, installed to the NAND, running on the PhoenixA20.
The process is a little messy, true, but it works ;) i hope that you could help me to improve the process and this guide so please share your thoughts after reading/testing this.

Attention: At this point of time i dont know what works and what does not.


Here is how i managed to install it:

Preparation
    as this process messes with the NAND, do a backup of your NAND first, using this guide
    get the debian desktop image from here
    get the imgrepacker here
    get PhoeBian presented here
    get arch here

Prepare SD card
to access the NAND we first need to boot something from sd card, i used PhoeBian for that.
just copy the tf.img to the sdcard with
$this->bbcode_second_pass_code('', 'dd if=tf.img of=/dev/sdb bs=2048')
where /dev/sdb should refer to your sdcard.
Boot that thing up and get ssh so we could access the board conveniently.
login: root
password: a

Unpack the Images
Now the Debian Image downloaded before should be unpacked. The partition table and the bootloader will be extracted from that.
First unpack the *.tar.gz then unpack the *.img with imgrepacker.
Afterwards you should have a new directory *.img.dump (if you downloaded debian it looks like this: PhoenixA20-debian-desktop-nand-v1.1.img.dump)

Unpack the Archlinux Image.

Modify the NAND
The first thing we need is a working mbr.
I think we could partition the NAND manually with nand-part (sunxi-tools).
But I took the sunxi_mbr.fex from the unpacked debian image and wrote that to the NAND using
$this->bbcode_second_pass_code('', 'scp imgRePacker_205/PhoenixA20-debian-desktop-nand-v1.1.img.dump/sunxi_mbr.fex root@<phoenixA20>:/dev/nand')
wait a few seconds to make sure the NAND wrote everything then reboot the board.
If you want to modify sunxi_mbr.fex look here

Now you need to fill the partitions. Write the bootloader.fex to nanda, the env.fex to nandb, boot.fex to nandc using scp like before. If you copy rootfs.fex to nandd you will get a running debian system.

But because we love arch do a
mkfs.ext4 /dev/nandd

and copy over the rootfs from the unpacked Archlinux System. I did this using rsync.
First mount dev/nandd to /mnt

Read this.

The EXCLUDE file should look something like this:
$this->bbcode_second_pass_code('', '/dev/*
/proc/*
/sys/*
/media/*
/mnt/*
/run/*
/tmp/*
/boot/*
')

Now copy everything over
$this->bbcode_second_pass_code('', 'sudo rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress --exclude-from=EXCLUDE archlinux/ <phoenixA20>:/mnt
')
as soon as rsync is finished, shutdown the PhoenixA20, extract sd-card and reboot.
if everything went well the board should boot alarm and you could login with
login: root
password: root

And thats it!


I hope this guide helped you. Please share your thoughts and feel free to correct me.
In the future i will try to get an u-boot with SPL and try to get this going without the reliance on the debian image.
radi
 
Posts: 1
Joined: Wed Mar 12, 2014 8:19 am

Return to Allwinner

Who is online

Users browsing this forum: No registered users and 3 guests