Installing Alt-Linux to eMMC - any khadas board VIM1 VIM2 VIM3 VIM3L Edge

HOW-TO install AltLinux for any Khadas SBC

Start krescue from SD

Preparation notes

  • 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

Manual install Alt-Linux into eMMC from shell

  • krescue main menu -> shell
# create partitions
echo "label: dos" | sfdisk $(mmc_disk)
echo "part1 : start=16M," | sfdisk $(mmc_disk)

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

# download and extract u can chouse any other source from Images variants
SRC=http://nightly.altlinux.org/sisyphus-aarch64/tested/regular-jeos-systemd-latest-aarch64.tar.xz

curl -jkL $SRC | pixz -dc | tar -xf- -C system

# fix dtb paths
for a in system/lib/devicetree/*-alt1; do ln -s . $a/amlogic; ln -s . $a/rockchip; done

# maybe need fix extlinux config
cp system/boot/extlinux/extlinux.conf system/boot/extlinux/extlinux.conf.bak
# sed -i s/console=tty1/earlyprintk/ system/boot/extlinux/extlinux.conf

echo ttyAML0 >> system/etc/securetty
echo ttyFIQ0 >> system/etc/securetty

# install uboot to eMMC
mmc_update_uboot online
# optional to SPI
spi_update_uboot online -k && poweroff # poweron

# DONE

reboot

User/root access

user: root
password: altlinux

Problems

  • not tested
  • serial console not active
  • kernel missed some drivers

Image variants

ENJOY :wink:

LINKS

PS: next time i will write similar instructions for ArchLinux and any other distros

3 Likes

@hyphop
Very cool, thank you very much.

I tried to follow the instructions twice - I didn’t succeed.
Maybe I need to edit /boot/extlinux/extlinux.conf
But I do not know what to edit there.
After a reboot, u-boot cannot start Alt-linux on eMMC.

For work, it is better to use stable Alt-linux builds.
Here are some examples:
http://nightly.altlinux.org/p9-aarch64/release/alt-p9-mate-20210612-aarch64.tar.xz
http://nightly.altlinux.org/p9-aarch64/release/alt-p9-xfce-20210612-aarch64.tar.xz
http://nightly.altlinux.org/p9-aarch64/release/alt-p9-icewm-sysv-20210612-aarch64.tar.xz
http://nightly.altlinux.org/p9-aarch64/release/alt-p9-lxqt-20210612-aarch64.tar.xz
http://nightly.altlinux.org/p9-aarch64/release/alt-p9-lxde-20210612-aarch64.tar.xz

I have achieved a working version like this:
I left boot and the kernel from Khadas Ubuntu, and replaced rootfs with Alt-Linux (alt-p9-mate-20210612-aarch64.tar. xz)

That’s how it was

I tried to follow the instructions twice - I didn’t succeed.
Maybe I need to edit /boot/extlinux/extlinux.conf
But I do not know what to edit there.
After a reboot, u-boot cannot start Alt-linux on eMMC.

plz check all steps again (i have test it 2 times - works fine )
just copy-paste

maybe easy via ssh

ssh root@krescue.local or http://krescue.local:8088

PS: try other one-line script inside Krescue shell > krescue/AltLinux-install.sh at master · khadas/krescue · GitHub

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

I’m dreaming about ssh.
You’re probably using a serial console, I don’t have that luxury. Only ssh over the network.
Or I need to tweak the ssh settings.
Currently ssh only works on localhost.

I was able to input it manually without copy paste
It’s works.

You are a wizard, a wonderful work.

I downloaded your script, supplemented it with options for building different Alt-Linux images, made sure that it works perfectly and will use it in my work.
Thank you very much. You’ve been very helpful.

The latest krescue update fixed this issue. now I can use ssh over the network.
Thank you very much.
The longer I talk to you, the more I like you.
Well done.

ssh root@10.10.10.36

BusyBox v1.30.1 () built-in shell (ash)

Krescue

 __ _____  Khadas ## hyphop ## 
/ //_/ _ \___ ___ ______ _____ 

/ ,< / , / -|-</ __/ // / -)
//|//||_//_/_,/__/

extreme tiny and fast rescue system

BUILD: 210722_184 from: Thu Jul 22 04:37:19 2021

[i] POST_CONFIG: booted=spi + hwver=VIM3.V12 + || start: /dev/mmcblk0
[i] Device: VIM3 Amlogic:G12B ver:0x0003 6 cores 4G ram 29.1 G eMMC
[w] root password undefined
[i] just type > krescue < to start gui
root@Krescue:~#

1 Like

plz check this one 1st

1 Like

The happiness was short-lived.
A new version has been released and the task has become more complicated.
Instead of tar, img is now - not simple, it with two partitions and it is not clear how to install it.

http://nightly.altlinux.org/p10-aarch64/release/alt-p10-mate-20210805-aarch64.img.xz

root@Krescue:~# fdisk -l /tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img
Disk /tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img: 7.27 GiB, 7800356864 bytes, 15235072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2939b6ed

Device                                                   Boot  Start      End  Sectors  Size Id Type
/tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img1       32768   526335   493568  241M  c W95 FAT32 (LBA)
/tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img2 *    526336 15233023 14706688    7G 83 Linux
root@Krescue:~# udisksctl
-ash: udisksctl: not found
root@Krescue:~# mount -o loop,offset=$((526336*512)) /tmp/mounts/dumps/img/alt-p10-mate-20210805-aarch64.img /mnt
mount: mounting /dev/loop0 on /mnt failed: Invalid argument
root@Krescue:~# dmesg
[16129.601357] loop0: detected capacity change from 0 to 15235072
[16129.616417] squashfs: Unknown parameter 'offset'
[16129.618113] exfat: Unknown parameter 'offset'

tnx for notify
i will check new alt images later ( try on this week )