7Ji / orangepi5-archlinuxarm

ArchLinuxARM for OrangePi 5 / 5B / 5 plus with vendor and mainline kernels to choose from
GNU General Public License v3.0
101 stars 12 forks source link

Installing kernel packages from an existing archlinux arm install? #51

Closed jcelerier closed 3 months ago

jcelerier commented 3 months ago

I have an Orange Pi 5+ running archlinux arm with 5.10 kernel.

I would like to use the 6.1 kernel sources provided here without reinstalling everything, how would I got about it ?

7Ji commented 3 months ago

All kernel packages at https://github.com/7Ji-PKGBUILDs can co-exist with each other, as they store their files in unique places similar to Arch on x86, unlike official ALARM kernels. So:

  1. You can install a 6.1 kernel alongside the old 5.10
  2. Without extlinux.conf changes you would still boot into the old 5.10 kernel, nothing would be broken.
  3. You can add your patches to another, your own kernel package that uses yet another name so it co-exist with the original 6.1
  4. You're recommended to add the new kernel as a new extlinux.conf label and set it as new default, keeping the old one, so it would be easy to revert back to the old kernel to fix things up.

On 6.1, it's still not entirely natively possible to do OpenGL. The backported panthor is an OpenGLES-only driver (paired with userspace mesa-panfrost-git) with experimental Vulkan support (if paired with mesa-panvk-git). The hardware itself was no capable of non-ES OpenGL after all. But most Linux apps should work with ES. Even if you really want to run GL-only apps, you could install gl4es-git, which maps GL calls to GLES calls so the hardware could do it.

jcelerier commented 3 months ago

Great. I can work with OpenGL ES or Vulkan, thanks !

jcelerier commented 3 months ago

Would https://github.com/7Ji-PKGBUILDs/linux-aarch64-7ji/ work on a Orange Pi 5+ ? or do I need https://github.com/7Ji-PKGBUILDs/linux-aarch64-rockchip-bsp6.1-joshua-git ?

jcelerier commented 3 months ago

I've modified extlinux.conf this way:

default orangepi
menu title orange pi
prompt 1
timeout 50

LABEL orangepi
    MENU LABEL Primary kernel
    LINUX /vmlinuz-linux-aarch64-orangepi5
    FDT /dtbs/linux-aarch64-orangepi5/rockchip/rk3588-orangepi-5-plus.dtb
    APPEND initrd=/initramfs-linux-aarch64-orangepi5.img console=ttyS2,1500000 root=PARTUUID=0aa270b8-8069-4729-bf1c-38f0c546e2a8 rw rootwait audit=0 plymouth.ignore-serial-consoles loglevel=2 cma=128M mitigations=off threadirqs power_save=0 preempt=full usbcore.autosuspend=-1 blacklist=snd-usb-audio

LABEL test
    MENU LABEL 6.1 kernel
    LINUX /vmlinuz-linux-aarch64-rockchip-bsp6.1-joshua-git
    FDT /dtbs/linux-aarch64-orangepi5/rockchip/rk3588-orangepi-5-plus.dtb
    APPEND initrd=/initramfs-linux-aarch64-rockchip-bsp6.1-joshua-git.img console=ttyS2,1500000 root=PARTUUID=0aa270b8-8069-4729-bf1c-38f0c546e2a8 rw rootwait audit=0 plymouth.ignore-serial-consoles loglevel=2 cma=128M mitigations=off threadirqs power_save=0 preempt=full usbcore.autosuspend=-1 blacklist=snd-usb-audio

but I don't manage to get a boot menu to show up. If I set the default to "test" which is the new kernel the Orange Pi does not boot at all. What am I missing ? thanks!

jcelerier commented 3 months ago

I managed to boot the 5.10 kernel provided by 7Ji-PKGBUILDs. But the 6.1 and 6.10 don't boot.

7Ji commented 3 months ago

Two things:

  1. The menu would only show on serial. There's no HDMI video support currently enabled in u-boot. You need a USB-serial cable.
  2. Each kerne needs their own initcpio, defined at option INITRD

As an example, here's my current extlinux.conf on my opi5:

MENU TITLE Select a kernel to boot
TIMEOUT 10
DEFAULT linux-aarch64-rockchip-bsp6.1-joshua-git
LABEL   linux-aarch64-rockchip-bsp6.1-joshua-git
        LINUX   /vmlinuz-linux-aarch64-rockchip-bsp6.1-joshua-git
        INITRD  /booster-linux-aarch64-rockchip-bsp6.1-joshua-git.img
        FDTDIR  /dtbs/linux-aarch64-rockchip-bsp6.1-joshua-git
        APPEND  root=/dev/nvme0n1p2 rootflags=subvol=@,compress=zstd:3 rw resume=/dev/nvme0n1p3
LABEL   linux-aarch64-rockchip-bsp5.10-joshua-git
        LINUX   /vmlinuz-linux-aarch64-rockchip-bsp5.10-joshua-git
        INITRD  /booster-linux-aarch64-rockchip-bsp5.10-joshua-git.img
        FDTDIR  /dtbs/linux-aarch64-rockchip-bsp5.10-joshua-git
        APPEND  root=/dev/nvme0n1p2 rootflags=subvol=@,compress=zstd:3 rw resume=/dev/nvme0n1p3
LABEL   linux-aarch64-rockchip-rk3588-bsp5.10-orangepi-git
        LINUX   /vmlinuz-linux-aarch64-rockchip-rk3588-bsp5.10-orangepi-git
        INITRD  /booster-linux-aarch64-rockchip-rk3588-bsp5.10-orangepi-git.img
        FDTDIR  /dtbs/linux-aarch64-rockchip-rk3588-bsp5.10-orangepi-git
        APPEND  root=/dev/nvme0n1p2 rootflags=subvol=@,compress=zstd:3 rw resume=/dev/nvme0n1p3

Edit: -7ji at 6.10 would work (it worked ever since 6.7 or 6.8 IIRC), but as mostly mainline and I don't backport drivers it's missing cpufreq and HDMI video out drivers. You probably would want the armbian 6.10 kernel, which has A LOT of backported driver.

Edit2: Now I see you've define initrd as kernel options. That's for EFI boot in which kernel could tell bootloader to load the initrd for it. On aarch64 u-boot without EFI support you can't do that. It must be loaded by u-boot.

jcelerier commented 3 months ago

thanks, that explains a lot ! on my orange pi 5 + it seems to work with initrd passed as kernel parameter. I'm booting from a NVMe disk instead of a SD card, maybe that is related ? In any case I managed to get what I needed with the 6.1 kernel in the end - one mistake was that I didn't use the dtb matching the kernel.

7Ji commented 3 months ago

A thing I noticed: you didn't named your modified as a different kernel from what's available in my repo. If you have my repo configured in your pacman.conf, then future updates would probably replace it.