05-29-2023, 01:07 AM
(This post was last modified: 06-03-2023, 01:23 PM by Der Geist der Maschine.
Edit Reason: CONFIG_SECCOMP,, GPU support, Bluetooth supprt
)
There are quite a few possible variants of the installation process. Below instructions do not require a serial console. All steps are performed on a linux pc and not on the star64.
Download armbian from the bottom of this page https://www.armbian.com/star64/, e.g. Armbian Sid CLI or Armbian Sid XFCE desktop.
dd armbian onto a micro sd card. For me, a micro sd card is /dev/sdb. YMMV:
Above image does not boot from the micro sd card - it misses a device tree for the star64.
Even with a device tree, armbian's kernel shuts down all usb ports, e.g. keyboard and mouse. For all this to work, use Fishwaldo's kernel. It can be compiled on a Linux PC.
Install a cross-compiler. That is distribution dependent. On Debian, that would be
Download Fishwaldo's kernel
Configure this kernel (CONFIG_SECCOMP is needed by armbian's default systemd service chrony)
Apply possible patches:
Crosscompile the kernel
Above step creates these files and directories
The correct way to install Fishwaldo's kernel / modules / device tree would be to run this command on a booted star64 system
I'm not awfully familiar with armbian. For some reason, the generated deb does not correctly install itself into the /boot directory. On top of this, we can't boot the current armbian installation as it misses a device tree, anyway.
A workaround is a manual installation of the kernel / modules / device tree.
Find an empty directory, say /mnt/tmp and mount the micro sd card on it:
Remove symbolic links of the kernel and device tree directory on the micro sd card (there is no need to make changes to the module directory as the old and new module directory names differ)
Copy over our kernel / modules / device tree on the micro sd card
Fix a typo of the device tree name in extlinux
Done
Next boot the micro sd card on the star64.
Tuning after a first boot:
This firmware blob for bluetooth comes from armbian-firmware-full. Install it
Possibly install GPU firmware as described in https://forum.pine64.org/showthread.php?tid=18301
Our integration of the kernel / module / device tree shortcuts the package management and armbian kernel / modules / device tree updates may overwrite our own versions.
My first try was deinstalling armbian's kernel / modules / device tree package. That turned out to have disadvantages. Packages that modify initrd trigger commands which come with the kernel package and fail updating the initrd.
For now, I can only suggest to manually copy over our kernel / modules / device tree whenever armbian overwrites them with its own versions.
On the long, armbian should better support the star64 and custom kernel / modules /device trees should not be necessary, anymore.
I was also playing around with ubuntu's riscv port. There, custom kernels can be installed with dpkg -i linux-image*.deb. They hook themselves up to grub and peacefully co-exist with the vanilla kernel.
Please post corrections and possible improvements (in particular on how to better make our own kernel co-exist with the package management).
Code:
schaecsn@pc:~ mkdir riscv && cd riscv
Download armbian from the bottom of this page https://www.armbian.com/star64/, e.g. Armbian Sid CLI or Armbian Sid XFCE desktop.
dd armbian onto a micro sd card. For me, a micro sd card is /dev/sdb. YMMV:
Code:
schaecsn@pc:~/riscv$ xzcat Armbian_23.5.0-trunk.231_Star64_sid_edge_5.15.0.img.xz | sudo dd of=/dev/sdb status=progress
Above image does not boot from the micro sd card - it misses a device tree for the star64.
Even with a device tree, armbian's kernel shuts down all usb ports, e.g. keyboard and mouse. For all this to work, use Fishwaldo's kernel. It can be compiled on a Linux PC.
Install a cross-compiler. That is distribution dependent. On Debian, that would be
Code:
schaecsn@pc:~/riscv$ sudo apt-get install libncurses-dev libssl-dev bc flex bison make gcc gcc-riscv64-linux-gnu
Download Fishwaldo's kernel
Code:
schaecsn@pc:~/riscv$ git clone https://github.com/Fishwaldo/Star64_linux linux
schaecsn@pc:~/riscv$ cd linux
Configure this kernel (CONFIG_SECCOMP is needed by armbian's default systemd service chrony)
Code:
schaecsn@pc:~/riscv/linux$ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- pine64_star64_defconfig
schaecsn@pc:~/riscv/linux$ scripts/config -e CONFIG_SECCOMP
schaecsn@pc:~/riscv/linux$ scripts/config -d CONFIG_SECCOMP_CACHE_DEBUG
Apply possible patches:
- If you have a 8GB board, apply the patch from here https://forum.pine64.org/showthread.php?tid=18263
- If you want full GPU support then apply the patch from https://forum.pine64.org/showthread.php?tid=18301 and also follow the firmware installation step (possibly after a first boot into the star64)
Crosscompile the kernel
Code:
schaecsn@pc:~/riscv/linux$ make -j4 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- bindeb-pkg
Above step creates these files and directories
Code:
schaecsn@pc:~/riscv/linux$ ls -lad ../linux-image-5.15.107-15659-g7943fd6427b0-dirty_5.15.107-15659-g7943fd6427b0-dirty-1_riscv64.deb arch/riscv/boot/Image debian/linux-image/lib/modules/5.15.107-15659-g7943fd6427b0-dirty/ debian/linux-image/usr/lib/linux-image-5.15.107-15659-g7943fd6427b0-dirty
-rw-r--r-- 1 schaecsn staff 19734212 May 28 22:47 ../linux-image-5.15.107-15659-g7943fd6427b0-dirty_5.15.107-15659-g7943fd6427b0-dirty-1_riscv64.deb
-rwxr-xr-x 1 schaecsn staff 26410944 May 28 22:45 arch/riscv/boot/Image
drwxr-xr-x 3 schaecsn staff 4096 May 28 22:46 debian/linux-image/lib/modules/5.15.107-15659-g7943fd6427b0-dirty/
drwxr-xr-x 4 schaecsn staff 4096 May 28 22:46 debian/linux-image/usr/lib/linux-image-5.15.107-15659-g7943fd6427b0-dirty
The correct way to install Fishwaldo's kernel / modules / device tree would be to run this command on a booted star64 system
Code:
sudo dpkg -i linux-image-5.15.107-15659-g7943fd6427b0-dirty_5.15.107-15659-g7943fd6427b0-dirty-1_riscv64.deb
I'm not awfully familiar with armbian. For some reason, the generated deb does not correctly install itself into the /boot directory. On top of this, we can't boot the current armbian installation as it misses a device tree, anyway.
A workaround is a manual installation of the kernel / modules / device tree.
Find an empty directory, say /mnt/tmp and mount the micro sd card on it:
Code:
schaecsn@pc:~/riscv/linux$ sudo mount /dev/sdb1 /mnt/tmp
Remove symbolic links of the kernel and device tree directory on the micro sd card (there is no need to make changes to the module directory as the old and new module directory names differ)
Code:
schaecsn@pc:~/riscv/linux$ sudo rm /mnt/tmp/boot/Image /mnt/tmp/boot/dtb
Copy over our kernel / modules / device tree on the micro sd card
Code:
schaecsn@pc:~/riscv/linux$ sudo rsync -avzH debian/linux-image/usr/lib/linux-image-5.15.107-15659-g7943fd6427b0-dirty /mnt/tmp/boot/dtb
schaecsn@pc:~/riscv/linux$ sudo rsync -avzH arch/riscv/boot/Image /mnt/tmp/boot/
schaecsn@pc:~/riscv/linux$ sudo rsync -avzH debian/linux-image/lib/modules/5.15.107-15659-g7943fd6427b0-dirty /mnt/tmp/lib/modules
Fix a typo of the device tree name in extlinux
Code:
schaecsn@pc:~/riscv/linux$ sudo sed -i s/jh7110-star64-pine64.dtb/jh7110-pine64-star64.dtb/ /mnt/tmp/boot/extlinux/extlinux.conf
Done
Code:
schaecsn@pc:~/riscv/linux$ sudo umount /dev/sdb1
Next boot the micro sd card on the star64.
Code:
schaecsn@192.168.0.216's password:
____ _ __ _ _
/ ___|| |_ __ _ _ __ / /_ | || |
\___ \| __/ _` | '__| '_ \| || |_
___) | || (_| | | | (_) |__ _|
|____/ \__\__,_|_| \___/ |_|
Welcome to Armbian 23.05.0-trunk Bookworm with bleeding edge Linux 5.15.107-15659-g7943fd6427b0-dirty
No end-user support: built from trunk
System load: 54% Up time: 0 min
Memory usage: 1% of 7.73G IP: 192.168.0.216
CPU temp: 50°C Usage of /: 23% of 7.2G
RX today: 44.0 MiB
[ 0 security updates available, 12 updates total: apt upgrade ]
Last check: 2023-05-21 15:22
Last login: Sun May 21 15:23:30 2023 from 192.168.1.231
schaecsn@star64:~$
Tuning after a first boot:
Code:
[ 21.771962] Bluetooth: hci0: RTL: firmware file rtl_bt/rtl8852bu_fw.bin not found
This firmware blob for bluetooth comes from armbian-firmware-full. Install it
Code:
schaecsn@star64:~$ sudo apt-get remove armbian-firmware
schaecsn@star64:~$ sudo apt-get install armbian-firmware-full
Possibly install GPU firmware as described in https://forum.pine64.org/showthread.php?tid=18301
Our integration of the kernel / module / device tree shortcuts the package management and armbian kernel / modules / device tree updates may overwrite our own versions.
My first try was deinstalling armbian's kernel / modules / device tree package. That turned out to have disadvantages. Packages that modify initrd trigger commands which come with the kernel package and fail updating the initrd.
For now, I can only suggest to manually copy over our kernel / modules / device tree whenever armbian overwrites them with its own versions.
On the long, armbian should better support the star64 and custom kernel / modules /device trees should not be necessary, anymore.
I was also playing around with ubuntu's riscv port. There, custom kernels can be installed with dpkg -i linux-image*.deb. They hook themselves up to grub and peacefully co-exist with the vanilla kernel.
Please post corrections and possible improvements (in particular on how to better make our own kernel co-exist with the package management).