7Ji / amlogic-s9xxx-archlinuxarm

ArchLinux ARM for Amlogic s9xxx tv box.
GNU General Public License v3.0
63 stars 9 forks source link

ArchLinux ARM for Amlogic s9xxx devices

This is not an official release of ArchLinuxARM, but only a pre-built flash-and-boot image of it for Amlogic platform for generic s9xxx boxes due to some kernel quirks needed to make it bootable on these devices not merged in mainline kernel

Information

Please only use the image provided in this project as live environment to install another ArchLinuxARM with pacstrap, not as your daily driver. A pre-defined ArchLinux is never an ArchLinux experience intended. I've made some decisions on configuration and packages to make the image bootable, these are probably not what you really want for your system.

Installation

Drive

Installing on USB drive is more recommended, and then [alarm-install][alarm guide on blog] can be referred to to install to eMMC or to another USB drive/SD card in the ArchLinux way

Releases & Images

All Amlogic s9xxx devices share the same generic image, i.e. there is no default u-boot.ext and dtb set, and you must set them according to your device. And take care dtb should be set both in uEnv.txt and extlinux/extlinux.conf

Three different kinds of releases are available, which you can download either from releases directly, or from actions where all three of them are zipped into one artifact:

Bootup setup

After you flash the image, you should open the FAT32 first/boot partition with label ALARMBOOT, and do the following adjustment:

Alternative kernel

There're two kernels pre-installed in the image, linux-aarch64-flippy and linux-aarch64-7ji, both maintained by myself. Unlike official linux-aarch64 from ArchLinux ARM, multiple kernels can exist side-by-side in my images.

Between them -flippy is the default one, currently using https://github.com/unifreq/linux-6.1.y as upstream, as the name suggests it's based on the LTS 6.1 kernel. It's verified by the long-passed time as stable enough for Amlogic platforms, but it's also lagged behind in versioning.

A seperate kernel linux-aarch64-7ji , upstream https://github.com/7ji/linux branch amlogic, is added using my own kernel tree with minimum diffrences from the actual mainline tree (stable at kernel.org), starting at version 6.4.3. As a result of minimum diffrences this lack a lot of non-mainstream dts not maintained upstream but only in flippy tree.

You can modify /boot/extlinux/extlinux.conf or /boot/uEnv.txt depending on your bootup scheme to change -flippy to -7ji to use the sort-of mainline kernel, and can change back at any time. An example extlinux.conf:

LABEL   Arch Linux ARM
LINUX   /vmlinuz-linux-aarch64-7ji
INITRD  /initramfs-linux-aarch64-7ji-fallback.uimg
FDT     /dtbs/linux-aarch64-7ji/amlogic/meson-gxbb-p201.dtb
APPEND  root=UUID=c0655cfd-5797-4606-8a8e-7220e04e6170 rw audit=0

Sicne the two kernels can exist side-by-side, you can also use dtbs from the flippy kernel, so you get both the latest kernel and rich dtb library.

Please read or report at the following places:

Booting

Holding the reset button with the SD card / USB drive plugged in, and power on the box, just like how you would do with Armbian and Openwrt.

Connection

Network

By default, systemd-networkd.service and systemd-resolved.service are enabled, and DHCP is enabled on en* and eth*, you can check your router to get the box's IP

SSH

By default, sshd.service is enabled, and root login is permitted, whose password is alarm_please_change_me

Users

By default, there's a user alarm in the group wheel and can use sudo with password. The user has a password alarm_please_change_me

Upgrade

Packages

It's recommended to do a full upgrade right after you boot:

sudo pacman -Syu

or (yay without argument calls sudo pacman -Syu implicitly)

Initramfs

And generate the initramfs, since only the u-boot legacy initrd fallback image is kept to save space, all other 3 initramfs were deleted before packing (standard default, standard fallback and legacy default):

mkinitcpio -P

Depending on your booting configuration you can choose whether to keep the u-boot legacy initrd or not: https://7ji.github.io/embedded/2022/11/11/amlogic-booting.html.