Archlinux ARM for Firefly-rk3288

I am so exciting when I see the post of Archlinux on Firefly-rk3288 from tlgimenes, It is cool!!
I search in internet about Archlinux and I found that Archlinux arm can run smooly in raspberrypi. So It may work well in Firefly-rk3288. I try to do it, and share my note here. I should say thanks to tlgimenes here, because his post help me a lot.
there is my note
1.flash the official firmware of ubuntu to the board
2.download the miniroot from here and flash linux-boot-miniroot.img to boot partition.
3.reboot the board and enter the miniroot mode

miniroot#

4.in official firmware, /dev/mmcblk0p5 is file system of ubuntu, so make it to ext4 and mount to /mnt

[root@Arch firefly]# cp -r /path/system/ /

.connect to ethernet and download the archlinux package, you can download it from their official web too.

miniroot# mount /dev/mmcblk0p5 /mnt/
miniroot# mkdir /media
miniroot# mount /dev/sda /media/
miniroot# dd if=/dev/zero of=/media/linuxroot.img bs=1M count=1024
miniroot# mkfs.ext4 -F -L linuxroot /media/linuxroot.img
miniroot# mkdir tmp
miniroot# mount -o loop /media/linuxroot.img /tmp/
miniroot# cp -a /mnt/* /tmp/
miniroot# umount /tmp/
miniroot# umount /media/
miniroot# umount /mnt/

.uncompress

miniroot# cd /mnt/
miniroot# tar -xzf ArchLinuxARM-veyron-latest.tar.gz

7.change root to archlinux and add a user

miniroot# chroot /mnt/
[root@miniroot /]# useradd -m -s /bin/bash firefly
[root@miniroot /]# passwd firefly

8.change the hostname

[root@miniroot /]# vi /etc/hostname

9.change the service of serial

[root@miniroot /]# cp /lib/systemd/system/serial-getty\@.service /lib/systemd/system/serial-getty@ttyS2.service
[root@miniroot /]vi /lib/systemd/system/serial-getty@ttyS2.service (change the "%i.device" to "%i")
[root@miniroot /]# systemctl enable [email]serial-getty@ttyS2.service[/email]

note: the newest code change the ttyS2 to ttyFIQ0, so I change it to ttyFIQ0 in my firmware.
10.You can start archlinux now

[root@miniroot /]# exit
miniroot# boot /mnt: /lib/systemd/systemd

11.You can login using the user you just add, and I use firefly

Arch login: firefly
Password

12.Enter root mode, and the root password of archlinux is “root”

[firefly@Arch ~]$ su
Password:
[root@Arch firefly]#

13.Start network service

[root@Arch firefly]# systemctl enable dhcpcd.service
[root@Arch firefly]# systemctl start dhcpcd.service

14.Update the system

[root@Arch firefly]# pacman –Syu

Note: you should input “N” here, or you will clear all what you do just now

>>> Updating module dependencies. Please wait ...
A new kernel version needs to be flashed onto /dev/mmcblk0p5.
Do you want to do this now? [y|N]
N

15.Install sudo

[root@Arch firefly]# pacman -S sudo

edit the profile, and add the user permission

[root@Arch firefly]# visudo
firefly ALL=(ALL) ALL

16.add wifi
tlgimenes run the wifi by using libhybris, here is a simple way. I copy the file /system/ from official firmware of ubuntu to archlinux.

[root@Arch firefly]# cp -r /path/system/ /

copy the script to archlinux

[root@Arch firefly]# cp wifi-on.sh /usr/local/bin/
[root@Arch firefly]# cp wifi-off.sh /usr/local/bin/

edit the service file of systemd

[root@Arch firefly]# vi /lib/systemd/system/wifi-on.service

start the wifi service when system start

[root@Arch firefly]# systemctl enable wifi-on.service

17.add bluetooth
install bluez

[root@Arch firefly]# pacman -S bluez
[root@Arch firefly]# pacman -S bluez-utils

add profile (you can get the file from my firmware, here I put my files in u-disk, and mount in /media/)

[root@Arch firefly]# cp /media/bluetooth-brcm /etc/default/bluetooth-brcm

add the bluetooth script

[root@Arch firefly]# cp /media/do-brcm-patchram-plus.sh /usr/local/bin/

start the bluetooth service

[root@Arch firefly]# systemctl enable bluetooth-brcm-firmware.service
[root@Arch firefly]# systemctl enable bluetooth.service

18.you should resize the partition of file system, when your system start first, I run a script service when system start here

[root@Arch firefly]# touch /firstboot
[root@Arch firefly]# vi /usr/local/bin/first-boot.sh
[root@Arch firefly]# chmod a+x /usr/local/bin/first-boot.sh
[root@Arch firefly]# vi /lib/systemd/system/rc.local.service (you can get the file from my firmware)

enable the service

[root@Arch firefly]# systemctl enable rc.local.service

19.You can remove some file useless, such as the software package what you installed:

[root@Arch firefly]# rm /var/cache/pacman/pkg/*

20.pack the firmware
I reboot the board and enter miniroot (I insert the u-disk and mount to /media/ here):

miniroot# mount /dev/mmcblk0p5 /mnt/
miniroot# mkdir /media
miniroot# mount /dev/sda /media/
miniroot# dd if=/dev/zero of=/media/linuxroot.img bs=1M count=1024
miniroot# mkfs.ext4 -F -L linuxroot /media/linuxroot.img
miniroot# mkdir tmp
miniroot# mount -o loop /media/linuxroot.img /tmp/
miniroot# cp -a /mnt/* /tmp/
miniroot# umount /tmp/
miniroot# umount /media/
miniroot# umount /mnt/

Now, the linuxroot.img is the file system of archlinux.
21.pack to a update.img
I change the AndroidTool, and you can copy the files include linuxroot.img,linux-boot.img,resource.img,misc_zero.img to the direction rockdev/Image/ then run the script mkupdate.bat, the update.img will create in rockdev/
22. if you want auto enter your archlinux and don not want enter miniroot, you can change these:

miniroot# editenv
root=/dev/mmcblk0p5:
init=/sbin/init
#ethaddr=00:11:22:33:44:55
#fbset_args="-a -nonstd 1 -g 1920 1080 1920 1080 32 -rgba 8/0,8/8,8/16,8/24"
#fbset_args="-a -nonstd 4 -g 1280 720 1280 720 16 -rgba 5/11,6/5,5/0,0/0"
autoboot=1
miniroot# saveenv
miniroot# reboot –f

I just transplanted a basic archlinux file system, if you want to make a perfect system, you also need to install a lot of software, I hope you can share it with everyone, just like tlgimenes, thank you very much.

If you find the wrong place, please tell me.

google driver:archlinux firmware: https://drive.google.com/file/d/0B5q__Od5lv3FZjFjcWxDWUVVcTg/view?usp=sharing

baidu disk:
archlinux firmware link: http://pan.baidu.com/s/1bomaoVH password: mpfk
archlinux+xfce firmware link: http://pan.baidu.com/s/1numvXrV password: g82u

{:3_48:}nice job

Thanks you very much for your job

Nice Job !!

Hope people will use these nice tips :slight_smile: I just can’t duplicate it here at home because I don’t have a serial debugging cable, but if you do, I think this is a better solution than my previous one. By the ways, did you manage to make miniroot boot not only using the debug serial port but using the VGA port instead ?

I’m also still trying to figure out a way of using libhybris or any other way of having Mali accelerated openGL ES working on X/Wayland under Arch and writing a comprehensive tutorial on how to do it, like you just did with the Arch installation.

If anyone have already done it or have a hint on how doing it, please let me know :slight_smile:

cheers \o/

The viewpoints in the article are very innovative, and they’ve given me many ideas. The Associate-Developer-Apache-Spark-3.5 valid dumps book test questions are free—good luck with your exam preparations!

I really appreciate your article, it was so enlightening and refreshing. Wishing you all the best on your exams! Free 400-007 exam exercise questions available now!

Your article is outstanding, thank you for sharing! Best of luck with your exam preparations! Dumps CAS-004 free questions available for free!

That article had a huge impact on me. The AZ-305 reliable free study questions helped me climb the career ladder and earn a raise. Now, I’m sharing it for free with all of you. Wishing you success!