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

HOW-TO install ArchLinux for any Khadas SBC

About ArchLinux and Arch Linux ARM

Arch Linux ARM port of Arch Linux, which aims for simplicity and full control to the end user.
We provide a light-weight base structure that allows you to shape the system to your needs… https://archlinuxarm.org/

Start Krescue from SD

Preparation

  • your SBC must connected to internet via ethernet or Wi-Fi
  • ethernet will auto-connect if a LAN cable is plugged in before boot-up

Wi-Fi Configuration

If you’re currently in a console / shell, just type krescue or exit to return to Krescue’s main menu

  • krescue main menu -> network -> wifi -> connect /select

Install ArchLinux into eMMC from Shell

Going into Krescue shell.

  • krescue main menu -> shell

One-line shell script installation method

Just copy-paste the line below into krescue shell

curl -jkL https://raw.githubusercontent.com/khadas/krescue/master/scripts/ArchLinux-install.sh | sh -s -

Manual installation example

Step by step:

BOARD=$(tr -d '\0' < /sys/firmware/devicetree/base/model || echo Khadas)
echo "ArchLinux installation for $BOARD ..."

# create partitions
echo "label: dos" | sfdisk $(mmc_disk)
echo "part1 : start=16M," | sfdisk $(mmc_disk)

# create rootfs
mkfs.ext4 -L ROOT $(mmc_disk)p1 < /dev/null
mkdir -p system && mount $(mmc_disk)p1 system

# can chouse any other rootfs source
SRC=http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz

echo "download and extract $SRC"
curl -A downloader -jkL $SRC | pigz -dc | tar -xf- -C system

# setup extlinux config
mkdir -p system/boot/extlinux/
cat <<-END > system/boot/extlinux/extlinux.conf
label ArchLinux
kernel /boot/Image.gz
initrd /boot/initramfs-linux.img
fdtdir /boot/dtbs
append root=LABEL=ROOT rw quiet
END

# setup rootfs
echo LABEL=ROOT / auto errors=remount-ro 1 1 >> system/etc/fstab

# setup host name
echo ${BOARD// /-} > system/etc/hostname

# setup dhcp for ethernet
echo dhcpcd eth0 -d > system/etc/rc.local
chmod 0777 system/etc/rc.local

# setup secure tty
echo ttyAML0 >> system/etc/securetty
echo ttyFIQ0 >> system/etc/securetty

umount system

# install uboot to eMMC
mmc_update_uboot online

# optional install uboot to SPI flash
spi_update_uboot online -k && echo need poweroff and poweron device again

# DONE plz reboot device

Install ArchLinux into eMMC via ssh

Your Krescue device will appear on your local network with the network name krescue.local

wget https://raw.githubusercontent.com/khadas/krescue/master/scripts/ArchLinux-install.sh
ssh root@krescue.local < ArchLinux-install.sh

Access

user: root
password: root

Additional Customisation

Please check Arch wiki Arch Linux - ArchWiki

Problems

  • not detected
  • not tested

Devices

  • VIM1 - OK
  • VIM2 - OK
  • VIM3 - OK
  • VIM3L - OK
  • Edge - OK

ENJOY :wink:

Links

3 Likes

Impressive, I think you’re doing a great job to maintaining support for the devices.

Hope you dont burn yourself while maintaining so many OS by yourself.

Does this method use upstream arch linux kernel or one maintained by you?

Good work though.

2 Likes

this same ArchLinux as-is wihout any changes and tweaks!

PS: any serous problems not detected but im sure kernel miss something anyway :wink: not tested !!!

3 Likes

next will be Gentoo linux => gentoo.org :wink: may be slackware https://arm.slackware.com/

1 Like

Lol. Good luck with gentoo haha.

both are looking cool, any possibility to get ChromeOS ? :slightly_smiling_face:

ChromeOS is a Gentoo Linux-based operating system - u still need ChromeOS ? why ?

was curious if it is possible, chromeOS is very popular choice of OS for many students and educators who are looking for a OS where most of the things can be done in the cloud, as a student myself I wanted to see if I could get ChromeOS for using one of my VIM3s as a school computer :wink:

3 Likes

tnx for very interesting information

just for beginning -> Chromium OS Board Porting Guide - The Chromium Projects

Wellcome

1 Like