ArchLinux Guide

edited July 2019 in AML-S805X-AC
Finally I got ArchLinux generic build running on LaFrite, here are the steps for any one interested
This is for booting from USB, can be installed on eMMC as well in similar steps
  1. Prepare USB stick with first partition as ext4
  2. Download Generic Arm64 build of ArchLinux https://archlinuxarm.org/platforms/armv8/generic
  3. Follow the instructions on that page, mount the USB stick on Linux computer and extract the ArchLinuxARM-aarch64-latest.tar.gz using bsdtar as root
    bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C mountpoint
  4.  Install uboot tools, go to boot folder under mounted partition
    cd mountpoint/boot
  5.  Create Uboot Kernel Image, do all following operations as root user
    mkimage -A arm64 -O linux -C none -T kernel -a 0x01080000 -e 0x01080000 -d Image uImage
  6. Create Uboot initrd image
    mkimage -A arm64 -O linux -T ramdisk -n "initramfs" -C gzip -a 0x13000000 -e 0x13000000 -d initramfs-linux.img uInitramfs
  7. Create text file for uboot script (lets say lafrite-boot.txt), with following uboot commands
    load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} /boot/uImage
    load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /boot/uInitramfs
    load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/dtbs/amlogic/meson-gxl-s805x-libretech-ac.dtb
    setenv bootargs console=ttyAML0,115200 root=/dev/sda1 rw
    bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
  8. Covert it to a boot script
    mkimage -T script -C none -n "ArchLinux Boot Script" -d lafrite-boot.txt boot.scr
  9. Now you should have uImage, uInitramfs, boot.scr under boot folder of mounted USB partition
  10. Go ahead and unmount it, put in lafrite, you should have Arch booting now, and follow rest of instructions from Arch site i.e setup pacman keys etc. and default user ids and password are given there.
Tagged:

Comments

  • I followed your instructions, but when i boot the USB afterwards the image output on my monitor is all FUBAR, I'm gonna try and recreate the whole process again tonight to see if i skipped something. (The device boots fine without the USB with clear image output and everything)
    Are there any resolution restrictions on this thing?
  • I followed your instructions, but when i boot the USB afterwards the image output on my monitor is all FUBAR, I'm gonna try and recreate the whole process again tonight to see if i skipped something. (The device boots fine without the USB with clear image output and everything)
    Are there any resolution restrictions on this thing?
    I only tested headless and that is how I use it i.e ssh into the device. I am sure there could be display related issues. I will look into it when I get some time to spend on it.
  • I've been experimenting with PXE booting Arch (spoilers, I haven't got that working).  And while doing that I also saw the same garbage console output on HDMI.  I eventually just tried booting Arch from USB (following the instructions above) and it worked, with a readable console, yay!  After upgrading the Arch image, including a new kernel I forgot to update the uImage and uInitramfs, the result was a garbage console again.  A quick mount and mkimage later and I noticed something interesting, during boot the console was garbled, but then corrected itself.  Not sure if that happened with the non-upgraded Arch image as I was looking at the serial console during that boot.

    So, long meandering story, but I think the relevant pieces are that a miss-matched kernel/initramfs resulted in garbage on the console, but rebuilding the u-boot images fixed it.
  • Also, there is a typo in the kernel command line above.  The console should be /dev/ttyAML0, not /dev/ttyALM0.  :)
  • Actually, what I wrote above is not quite right, the kernel command line should be:
    console=ttyAML0,115200 root=/dev/sda1 rw
    The console parameter doesn't want a /dev/ in front of the device name.

  • I figured out why the console looks wrong for a while, the default Arch initrd is missing the meson DRM modules.
  • Thanks @Anton for boot command line corrections, I will be correcting and expanding the guide with further sets to get to desktop environment soon.
  • i tried to run arch linux with this tutorial on my tanix tx3 max android tv box. I burned manajro khadas vim2 minimal image(heres the link "https://manjaro.org/downloads/arm/khadas-vim-2/arm8-vim2-minimal/") to an sdcard and removed manajro rootfs and replaced it with arch linux aarch64 rootfs and i copied arch linux boot dir to the manajro boot parititon and i mentonied the Image and initramfs-linux.img in extlinux.conf but when i boot my box i got booted into arch fine but when i try to use a display manager(login screen) its just a black screen with a white dot blinking, when i use armbian boot directory it just works all fine but i cant use any kernel modules and the kernel is messed up because armbian uses kernel 5.9.0 whereas arch uses 5.11.4-1 kernel. any idea on how to build a initramfs-linux.img and Image from which i can used arch with a gui?

Sign In or Register to comment.