Arch Linux on RockPro64 - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98) +--- Forum: Linux on RockPro64 (https://forum.pine64.org/forumdisplay.php?fid=101) +--- Thread: Arch Linux on RockPro64 (/showthread.php?tid=6333) |
Arch Linux on RockPro64 - mmatyas - 07-29-2018 Hello, I have been tinkering with my RockPro64 in the last few days, and as I have Arch Linux running on almost every computer in my home (unfortunately I could not find a port for my router), I was also looking into the possibility to bring a preferably vanilla Arch Linux to the RockPro64. I especially like this as this gives me the opportunity to use the precompiled packages from the Arch Linux ARM community and thus have a nice and up-to-date package source. This also promised to be a good opportunity for me to learn how images for such embedded boards can be created, as I have never done such a thing before. What I tried: There is an official Arch Linux image for the Rock64 on the Arch Linux ARM webpage, on top of that there is a somewhat ambiguous description in a forum on how Arch Linux can be ported to Rock64: https://me.m01.eu/blog/2017/12/rock64-arch-linux/ This basically combines the projects of Ayufan to compile u-boot and the arm-trusted-firmware packages, creates an image with guestfish in the format required by RockChip and extracts the stock ARMv8 Arch Linux ARM image into the /root partition. My idea was that this project could nicely be used as the starting point for my idea, as I hoped to be able to just replace every occurence of Rock64 with RockPro64 in the configuration files. Unfortunately this turned out to be harder than expected (what doesn't if you are compiling your own images?). I fought quite a lot with the strange curiosity that aarch64-linux-gnu- threw all kinds of errors when compiling u-boot under my arch build machine, but compiled nicely when under a debian host... Opposite was the behavior of guestfish, that only wanted to work under arch linux. Nevertheless, this failed as the created image simply refused to boot for some reason. I have to admit though that I still did not really understand, what the build scripts do and where it all pulls files from Ayufans compiled results. I also had problems to understand what Ayufan did in the configuration of u-boot for example (I also could not figure out yet where the compiled files from arm-trusted-firmware are ever used) but that can well have its reason in my inexperience. His images work, so he must have done some awesome magic. So, after some frustration I had a dirty backup plan: I just burned Ayufans latest Debian Stretch image to my SD card and then deleted everything on / except /boot. After that I extracted everything but the boot folder from the Arch Linux ARM file onto / on the SD card. I don't have to say, my surprise was huge as this image suddenly booted on my RockPro64. After doing an initialisation of pacman and a first package update, I noticed that Arch Linux suggested to update my kernel from 4.4 to 4.17. I thought this will happen as Ayufans Stretch images incorporate the rockchip custom 4.4 kernel. Anyways I hit the update. To my fortune the stock Arch Linux kernel is called "Image" with "initramfs-linux.img" as the init system, so instead of overwriting Ayufans kernel it just packed the stock one next to it. Then I only had to add an other entry to /boot/extlinux/extlinux.conf before the entries of Ayufan to use the stock kernel and now my RockPro64 is running vanilla Arch Linux ARM! However, this is only a first test and proof-of-concept, so there are some drawbacks: u-boot will never be upgraded in this constellation as arch linux simply does not know that there is u-boot installed on the system and there is also no package in the sources that it could use for an upgrade. Also, I did not get my HDMI monitor to work yet (but as I plan to use my RockPro as a headless server I don't care about that very much). I will also have to look to get PCIe working form my SATA card. But still, I have a vanilla Arch Linux running on my machine. I know, it was a very dirty way of getting it to run, but I will need to read more in the rockchip wiki on compiling linux and creating images to finally get this to work the traditional way... Is there anyone with interest to port Arch Linux to the RockPro with a little experience in linux and u-boot and image creation? Greetings Update after some minutes of testing: As Arch Linux uses a bleeding edge kernel, the PCIe does not seem to work, at least there is no output to the lspci command. Switching back to the 4.4 kernel at least shows my sata controller. As I just realised, the HDMI also works with this kernel, so at least I can see that there is some error displayed when I connect a HDD, so I will need to look into that. RE: Arch Linux on RockPro64 - Tigger - 08-06-2018 (07-29-2018, 03:31 PM)mmatyas Wrote: .......... Even if you had a Rock64 and followed the Arch Linux ARM for Rock64 installation instructions here : https://archlinuxarm.org/platforms/armv8/rockchip/rock64, HDMI would not have worked without putting in some work of your own. https://archlinuxarm.org/platforms/armv8/rockchip/rock64 Wrote:HDMI video is not yet supported in the mainline kernel. RE: Arch Linux on RockPro64 - hiccupstix - 08-06-2018 To be clear, HDMI support is not working? Your method, dirty or not, was smart and you should be able to employ the same basic approach to getting HDMI support up and running using Ayufan's 4.4.132 kernel. Make sure you aren't just transplanting the kernel without also replacing the dtb. RE: Arch Linux on RockPro64 - Tigger - 08-07-2018 (08-06-2018, 03:40 PM)hiccupstix Wrote: To be clear, HDMI support is not working? In the mainline Linux kernel, there is no HDMI port defined in the device tree of the Rock64. In the mainline Linux kernel, there is no device tree for the RockPro64 (yet). See here : https://github.com/torvalds/linux/tree/97ace515f01439d4cf6e898b4094040dc12d36e7/arch/arm64/boot/dts/rockchip In the Rockchip Linux kernel (non-mainline) there is : https://github.com/rockchip-linux/kernel/tree/40e877458b0dd3fedc39afc8c2a8e428adafc858/arch/arm64/boot/dts/rockchip @mmatyas : It should be possible to copy the relevant DTS files (or just the relevant DTS entries) from the Rockchip repo to the Arch source, and then (cross) compile Arch with HDMI support. The following, only if you don't know about device trees. Else skip. *.dts files contain board level definitions. *.dtsi files are include(d) files (included from *.dts) and contain SoC level difinitions (SoC === RK3399 for RockPro64, RK3328 for Rock64). If you need some grounding about device trees, this is pretty accessible : https://bootlin.com/pub/conferences/2013/elce/petazzoni-device-tree-dummies/petazzoni-device-tree-dummies.pdf After setting up a (generic) DTS, you might have to tweak the HDMI resolution and signal with U-boot's fbpanel. Starting point : https://boundarydevices.com/display-configuration-u-boot/ Or "screen resolution kernel boot parameters" like "vga=" and "video=" : https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/kernel-parameters.txt Arch Linux on RockPro64 - hiccupstix - 08-07-2018 I was linked to this thread in the IRC, so I overlooked the title. Didn't realize you were working on a Pro. I assumed we were discussing a regular Rock64. There's a RockPro64 en route to me now, and I'll be working on this issue in the weeks to come. My apologies for the oversight. Sent from my Pixel 2 XL using Tapatalk RE: Arch Linux on RockPro64 - mmatyas - 08-08-2018 Thank you! This was exactly what I was looking for, I want to understand as much as possible about creating custom images and porting Linux. Now I have plenty of material to read into. In the branch of the rockchip-linux kernel there is also a DTS for the RockPro64, I will look into how much it resembles Ayufans DTS. (08-07-2018, 03:02 AM)Tigger Wrote:(08-06-2018, 03:40 PM)hiccupstix Wrote: To be clear, HDMI support is not working? RE: Arch Linux on RockPro64 - Tigger - 08-08-2018 @mmatyas If you want to see what's going (wr)on(g) during preboot and boot : https://www.pine64.org/?product=padi-serial-console RE: Arch Linux on RockPro64 - ah- - 08-28-2018 Hey, I did the same and installed Arch by modifying one of the Ubuntu images. It doesn't seem too far off to have a straight up Arch port, I think the only bit that's actually left over from the Ubuntu image now is u-boot. It runs nicely with the default 4.4 ayufan kernel that came with Ubuntu. Surprisingly the 4.18.5 arch mainline kernel came up and even had ethernet, but a bunch of other hardware didn't work, I guess partially due to the missing dtb, partially due to patches not yet in mainline. Right now I'm running the ayufan 4.18.0-rc8, compiled via https://github.com/ah-/PKGBUILDs (https://github.com/ah-/PKGBUILDs/commit/ea418b17d55f505987760bd518a318bb9839edd0), see core/linux-rockpro64 and just run makepkg in there. After installing the packages you'll need to add the kernel to extlinux.conf: label arch kernel /boot/Image initrd /boot/initramfs-linux.img devicetreedir /boot/dtbs append rw panic=10 init=/sbin/init coherent_pool=1M ethaddr=${ethaddr} eth1addr=${eth1addr} serial=${serial#} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 root=LABEL=linux-root rootwait rootfstype=ext4 With that it runs really nicely as a server, it's fast and all the hardware I'm using works, including pcie sata. The HDMI port works somewhat, I get an image but the UI is really slow, I don't get full resolution and the image is quite noisy. I suspect this might be due to me not having any userland installed for the GPU, does anyone know what the Mali GPU needs and how t get it onto Arch? RE: Arch Linux on RockPro64 - dukla2000 - 08-29-2018 (08-28-2018, 03:14 PM)ah- Wrote: The HDMI port works somewhat, I get an image but the UI is really slow, I don't get full resolution and the image is quite noisy. I suspect this might be due to me not having any userland installed for the GPU, does anyone know what the Mali GPU needs and how t get it onto Arch? Code: libmali-rk-midgard-t86x-r14p0-gbm ? RE: Arch Linux on RockPro64 - ah- - 08-29-2018 (08-29-2018, 03:37 AM)dukla2000 Wrote: Just gave that a go, via https://github.com/apokalypzx/gru-libgl but getting Code: [11:55:33.702] Failed to load module: /usr/lib/libweston-5/drm-backend.so: undefined symbol: gbm_bo_get_offset when trying to start Weston. Searching hasn't really yielded anything yet, but haven't looked for long. Does anyone know where to get up to date userspace binaries? r14 is about half a year old, and the kernel pieces at https://developer.arm.com/products/software/mali-drivers/midgard-kernel are now at r26. However, I can't find r26 binaries anywhere. |