Project

General

Profile

Actions

Wiki » History » Revision 3

« Previous | Revision 3/6 (diff) | Next »
Kamikaze, 03/04/2018 11:29 PM


Wiki

Getting ArchLinux ARM running on the Nexbox A95x

Common steps

Format the SD Card

Insert the SD Card you will be booting from.

fdisk /dev/mmcblk0

# create two partitions (or more if you want)
# first partition should be bootable, W95 FAT32, 512MB
# second partition should be your rootfs, f2fs is a good choice.
# write partition data.
# make sure it gets picked up by the kernel before you continue.

# format your partitions:
# mkfs.vfat -n boot /dev/mmcblk0p1
# mkfs.f2fs -l rootfs /dev/mmcblk0p2

Setup the rootfs.

We can copy the compiled modules and firmware later when we choose a kernel.

cd /tmp
wget http://au.mirror.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz

sudo su - 
mount LABEL=rootfs /mnt/
bsdtar -xpf /tmp/ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/
sync
sudo umount /mnt/
sync

Method 1: using balbes150 kernel

Note: I had too many stability problems with kernel 4.12.9 and the 4.13-rc. 4.13-rc would hang in some conditions (fairly frequently) and 4.12.9 would stacktrace in the network driver and the network would not recover. I am not sure yet whether this is my device, or buggy code/drivers in the balbes150 kernel. Will be trying an amlogic one next (4.9.26)

Build the kernel, DTBs, modules, and setup the boot partition

#Get balbes kernel source
cd /tmp
git clone git@github.com:150balbes/Amlogic_s905-kernel.git
cd Amlogic_s905-kernel

#Checkout a stable tag
git checkout tags/v20170828_4.12.9

export CROSS_COMPILE=aarch64-linux-gnu-
export ARCH=arm64

make clean
make mrproper

# Download the .config attached to this page, or get one with:
#   wget "https://raw.githubusercontent.com/150balbes/build/amlogic/config/kernel/linux-amlogics905x-dev.config_4.12.9" 
# Copy it to /tmp/Amlogic_s905-kernel/.config

make oldconfig

make menuconfig  #do any tweaks to the config

make -j4 Image dtbs
make -j4 modules

# Install the modules and firmware to a sub-directory. We will copy them to rootfs later.
make INSTALL_MOD_PATH=build-${ARCH}-modules INSTALL_MOD_STRIP=1 modules_install
make INSTALL_MOD_PATH=build-${ARCH}-modules INSTALL_MOD_STRIP=1 firmware_install

# Copy the DTB to the SDCard boot partition as 'dtb.img'
cp arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dtb /run/media/someuser/boot/dtb.img

# Copy the kernel image to the SDCard boot partition
cp arch/arm64/boot/Image /run/media/someuser/boot/

# Create a s905_autostart script, this is used to tell u-boot how to execute the kernel, and with what command line params.
cat > /run/media/someuser/boot/s905_autostart.booti.txt <<EOF
setenv kernel_loadaddr "0x01080000" 
setenv hdmimode "1080p60hz" 
setenv display_bpp "24" 
setenv init_hdmi "hdmimode=${hdmimode} m_bpp=${display_bpp} vout=${hdmimode},enable" 
setenv condev "console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0" 
setenv bootargs "root=/dev/mmcblk1p2 rootwait rw ${condev} ${init_hdmi} fsck.repair=yes net.ifnames=0" 
setenv boot_start booti ${kernel_loadaddr} - ${dtb_mem_addr}
if fatload mmc 0:1 ${kernel_loadaddr} Image; then if fatload mmc 0:1 ${dtb_mem_addr} dtb.img; then run boot_start; else store dtb read ${dtb_mem_addr}; run boot_start;fi;fi;
EOF

# Compile the autostart script to a usable u-boot format:
cd /run/media/someuser/boot/
mkimage -A arm -O linux -T script -C none -d s905_autostart.booti.txt s905_autoscript

Continue setting up the rootfs, copy the compiled modules and firmware

cd /tmp
sudo mount LABEL=rootfs /mnt/

[[ -d /mnt/lib/firmware ]] && echo Removing existing firmware drivers from rootfs && rm -rf /mnt/lib/firmware
rsync -av /tmp/Amlogic_s905-kernel/build-arm64-modules/lib/firmware /mnt/lib/
rsync -av /tmp/Amlogic_s905-kernel/build-arm64-modules/lib/modules/* /mnt/lib/modules/

Follow the instructions to make Nexbox A95x boot from an SDCard.

I used the toothpick method and it worked fine. (unplug the power press the reset key hidden under the AV plug with a toothpick and plug the power keeping the reset key pressed until it loads)

It should now boot up your new ArchLinux ARM installation, with a fresh kernel.

Updated by Kamikaze over 1 year ago · 3 revisions