|  | 
Archlinux ARM for Firefly-rk3288
    
    Posted at  1/31/2016 17:27:28
            
         View:7797
     |
     Replies:3
     
  
     
 
   	
    
  Print   
        
  
   
  Only Author 
    [Copy Link]
	
    
 
  	             
1# 
 
| Last edited by linjc In 1/31/2016 17:42 Editor 
 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
 
 4.in official firmware, /dev/mmcblk0p5 is file system of ubuntu, so  make it to ext4 and mount to /mnt
 
 5.connect to ethernet and download the archlinux package, you can download it from their official web too.Copy the codeminiroot# mkfs.ext4 -E nodiscard /dev/mmcblk0p5 
miniroot# mount /dev/mmcblk0p5 /mnt/
 6.uncompressCopy the codeminiroot# udhcpc 
miniroot# wget –P /mnt http://archlinuxarm.org/os/ArchLinuxARM-veyron-latest.tar.gz
 7.change root to archlinux and add a userCopy the codeminiroot# cd /mnt/
miniroot# tar -xzf ArchLinuxARM-veyron-latest.tar.gz
 8.change the hostnameCopy the codeminiroot# chroot /mnt/
[root@miniroot /]# useradd -m -s /bin/bash firefly
[root@miniroot /]# passwd firefly
 9.change the service of serialCopy the code[root@miniroot /]# vi /etc/hostname
 note: the newest code change the ttyS2 to ttyFIQ0, so I change it to ttyFIQ0 in my firmware.Copy the code[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]
10.You can start archlinux now
 
 11.You can login using the user you just add, and I use fireflyCopy the code[root@miniroot /]# exit
miniroot# boot /mnt: /lib/systemd/systemd
 12.Enter root mode, and the root password of archlinux is "root"Copy the codeArch login: firefly
Password
 13.Start network serviceCopy the code[firefly@Arch ~]$ su
Password: 
[root@Arch firefly]#
 14.Update the systemCopy the code[root@Arch firefly]# systemctl enable dhcpcd.service
[root@Arch firefly]# systemctl start dhcpcd.service
 Note: you should input "N" here, or you will clear all what you do just nowCopy the code[root@Arch firefly]# pacman –Syu
 Copy the code>>> 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
 
 edit the profile, and add the user permissionCopy the code[root@Arch firefly]# pacman -S sudo
 Copy the code[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.
 
 copy the script to archlinuxCopy the code[root@Arch firefly]# cp -r /path/system/ /
 edit the service file of systemdCopy the code[root@Arch firefly]# cp wifi-on.sh /usr/local/bin/
[root@Arch firefly]# cp wifi-off.sh /usr/local/bin/
 start the wifi service when system startCopy the code[root@Arch firefly]# vi /lib/systemd/system/wifi-on.service
 17.add bluetoothCopy the code[root@Arch firefly]# systemctl enable wifi-on.service
install bluez
 
 add profile (you can get the file from my firmware, here I put my files in u-disk, and mount in /media/)Copy the code[root@Arch firefly]# pacman -S bluez
[root@Arch firefly]# pacman -S bluez-utils
 add the bluetooth scriptCopy the code[root@Arch firefly]# cp /media/bluetooth-brcm /etc/default/bluetooth-brcm
 start the bluetooth serviceCopy the code[root@Arch firefly]# cp /media/do-brcm-patchram-plus.sh /usr/local/bin/
 18.you should resize the partition of file system, when your system start first, I run a script service when system start hereCopy the code[root@Arch firefly]# systemctl enable bluetooth-brcm-firmware.service
[root@Arch firefly]# systemctl enable bluetooth.service
 enable the serviceCopy the code[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)
 19.You can remove some file useless, such as the software package what you installed:Copy the code[root@Arch firefly]# systemctl enable rc.local.service
 20.pack the firmwareCopy the code[root@Arch firefly]# rm /var/cache/pacman/pkg/*
I reboot the board and enter miniroot (I insert the u-disk and mount to /media/ here):
 
 Now, the linuxroot.img is the file system of archlinux.Copy the codeminiroot# 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/
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:
 
 Copy the codeminiroot# 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/ ... Tg/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
 
 
 
 | 
 |