HOW-TO install ArchLinux for any Khadas SBC - VIM1 VIM2 VIM3 VIM3L Edge

Which kernel version is used?

It has to be the vendor kernel, because thereā€™s no other option.

1 Like

Kernel 5.4.125
I want to update this soon

You can try merging later security updates onto the kernel, but at some point youā€™ll trip over downstream changes that make it complicated. There is no later kernel version to use or migrate to ā€¦ until Amlogic does their next forward-port of code to appease the Android kernel target gods. The amount of time that this ā€œreinvention of the wheelā€ task requires ensures the ā€œnewā€ kernel is always an old kernel by the time the task has completed. And thatā€™s why distro maintainers like myself loathe silicon vendors who donā€™t invest in upstreaming their codebase :frowning:

2 Likes

@Hyphop, script worked for me. I`m on Archlinux until nowā€¦

Linux Khadas-VIM3 6.1.2-2-aarch64-ARCH #1 SMP PREEMPT Tue Apr 4 01:58:54 +04 2023 aarch64 GNU/Linux

Please has anyone attempted installing this on VIM1S?

This might determine whether I keep this board or return :sob:

You should keep the board as it should have good support in mainline kernel.

2 Likes

Thanks @Spikerguy , I love the board too much to return it. The form factor is amazing. I currently have both VIM1S and was on the fence whether to open the VIM3 or return them both.

My end goal is to be able to run ArchLinux on either of these. For now, I hold on to them while I study them better. Iā€™ll likely unbox my VIM3 this weekend.

Why not run Manjaro arm on both?

manjaro uses upstream arch linux arm, so it will be similar experience.

There is officially Vim3 images for Manjaro Arm. I will add vim1s support in few days.

1 Like

How stable is your Arch Linux on VIM3?

I was getting heaps of kernel panic


kbd_mode: KDSKBMODE: Inappropriate ioctl for device
ROOT: recovering journal
ROOT: clean, 67246/954720 files, 826304/3812864 blocks
[    2.296004] SError Interrupt on CPU3, code 0x00000000bf000000 -- SError
[    2.296016] CPU: 3 PID: 365 Comm: (imesyncd) Not tainted 6.2.10-1-aarch64-ARCH #1
[    2.296021] Hardware name: Khadas VIM3 (DT)
[    2.296023] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    2.296026] pc : __slab_free+0x50/0x330
[    2.296037] lr : kmem_cache_free_bulk.part.0+0x3ec/0x550
[    2.296041] sp : ffff80000ba6b810
...

[    2.296075] x2 : ffff00007bb6e800 x1 : fffffc0001eedb80 x0 : 0000000000000080
[    2.296080] Kernel panic - not syncing: Asynchronous SError Interrupt
[    2.296082] CPU: 3 PID: 365 Comm: (imesyncd) Not tainted 6.2.10-1-aarch64-ARCH #1
[    2.296084] Hardware name: Khadas VIM3 (DT)
[    2.296086] Call trace:
[    2.296087]  dump_backtrace+0xdc/0x130
[    2.296091]  show_stack+0x18/0x30
[    2.296093]  dump_stack_lvl+0x64/0x80
[    2.296097]  dump_stack+0x18/0x34
[    2.296098]  panic+0x140/0x308
[    2.296102]  nmi_panic+0xac/0xb0
[    2.296107]  arm64_serror_panic+0x64/0x74
...

[    2.296189]  el0t_64_sync+0x190/0x194
[    2.296193] SMP: stopping secondary CPUs
[    2.296204] Kernel Offset: disabled
[    2.296205] CPU features: 0x00000,03068100,0000421b
[    2.296207] Memory Limit: none
[    2.552474] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---
[    2.560078] ------------[ cut here ]------------
[    2.560079] WARNING: CPU: 3 PID: 365 at kernel/sched/core.c:3184 set_task_cpu+0x160/0x1b0
[    2.560085] Modules linked in: nvmem_meson_efuse snd_soc_meson_axg_tdm_interface snd_soc_meson_axg_tdm_formatter cfg80211 rfkill loop fuse dw_hdmi_i2s_audio panfrost drm_shmem_helper gpu_sched meson_drm drm_dma_helper meson_dw_hdmi dw_hdmi meson_canvas cec rc_core display_connector adc_keys gpio_keys_polled
[    2.560108] CPU: 3 PID: 365 Comm: (imesyncd) Not tainted 6.2.10-1-aarch64-ARCH #1
[    2.560110] Hardware name: Khadas VIM3 (DT)
[    2.560111] pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    2.560114] pc : set_task_cpu+0x160/0x1b0
[    2.560117] lr : try_to_wake_up+0x1a4/0x510

It appears to be related to this similarly reported memory related panic. So how has yours been so far?

Hi. @glimit, try this kernel (6.3.0), compiled to myself, installed and worked fine.

Good luck :wink:

Thank you! Iā€™ll give it a try.

Please do you have a copy of your packaging/compilation script(s) somewhere handy?

A while back, I attempted to move the original script here to test it out, but Iā€™ve been uber-busy to play with it since there. Iā€™m keen to pick it back up and possibly extend it for VIM1S too.

I used this script and then just update system with pacman and make backups if something goes wrong)).

1 Like

Iā€™ve managed to update the originally posted script to work for VIM3 with no more kernel panics :+1:

Iā€™m sharing here if anyone else finds is useful.

Things confirmed:

  • [Working | Tested] Wi-Fi Drivers all available (but needs install client to connect). [Todo] pacstrap networkmanager
  • [Tested] No more kernel panics.
  • [Available | Not tested] VIM3 Overlays.

Pending items:

  • Boot and configure upstream uboot
  • Create Desktop Environment version
  • PacStrap helpful default packages

If possible, I could start playing with my VIM1S this weekend.

Any news on this script? We were trying to get wifi to work by using what we currently have working but sorting WIFI has been mission impossible as of late.

@kwankiu

I will be happy to help - if someone wanna maintain this script - just made fork improve it and test after i can merge all changes

@kwankiu doesnt wanna mantain it and I dont know how to do it eitherā€¦ hyhop check his image everything is working it would be interesting to see his script image in oowow.

Actually

bash <(curl -fsSL https://raw.githubusercontent.com/kwankiu/archlinux-installer-rock5/dev/archlinux-installer) --kernel=linux-rockchip-joshua-git --sbc=edge2 --addpkg=linux-firmware-joshua-git -b --disk=/dev/mmcblk0

I think that you can create an arch linux with my script, but since this currently only copy the linux kernel packages manually instead of installing all the required packages with pacman, you will still need to reboot and let arch linux run through my installer, so it would still be more connivence to use my image, the script only gives you a customisable option as it is used to build my images.

However there is a dependency of parted libarchive-tools dosfs-tools (and sudo)