Build ArchLinux ARM image for the Helios4 NAS
This Bash script creates an ArchLinux ARM image for the Helios4 NAS ready to be written on microSD card.
Helios4 is an powerful Open Source and Open Hardware Network Attached Storage (NAS) made by Kobol Innovations Pte. Ltd. It harnesses its processing capabilities from the ARMADA 38x-MicroSoM from SolidRun.
The resulting image file is based on the generic Arch Linux ARMv7 root filesystem and contains:
This script expects to be run on a x86 system running ArchLinux. It needs qemu-arm-static
to work. You can install it using the qemu-user-static or qemu-user-static-bin packages from the AUR.
Note: this script needs to execute commands as superuser. If not run as root, it will re-run itself using sudo. It is highly recommended to review this script and understand what it does before running it on your system.
$ git clone https://github.com/gbcreation/alarm-helios4-image-builder.git
$ cd alarm-helios4-image-builder
$ sh ./build-archlinux-img-for-helios4.sh
Once the image file is created, write it to a microSD card using Etcher or the dd
command:
$ dd bs=4M if=ArchLinuxARM-helios4-2019-02-24.img of=/dev/sdX conv=fsync
Insert the microSD card to the Helios4 and enjoy Arch Linux ARM on your NAS.
Look at Releases.
Here are all the steps performed by the script:
qemu-arm-static
executable is installed (see Requirements above).sudo
if not.arch-chroot
to enter to the created chrootmkimage
to compile the U-Boot scriptÌMG_FILE
variable in script to set the image filename.fdisk
.losetup
, forcing the kernel to scan the partition table to detect the partition inside../img/
sub-directory. Change the MOUNT_DIR
variable in script to set the target directory../img/
.90-helios4-hwmon.rules
to ./img/etc/udev/rules.d
. Patch it to replace the armada_thermal
device name by f10e4078.thermal
../img/root
.helios4-wol.service
to ./img/usr/lib/systemd/system/
.qemu-arm-static
to ./img/usr/bin
.arch-chroot
to enter to the ./img/
chroot, then:./img/root
.qemu-arm-static
from ./img/usr/bin
.fancontrol_pwm-fan-mvebu-next.conf
to ./img/etc/fancontrol
.lm75
kernel module loaded on boot by creating ./img/etc/modules-load.d/lm75.conf
.mdadm-fault-led.sh
to ./img/usr/bin
and set the PROGRAM
directive to /usr/sbin/mdadm-fault-led.sh
in ./img/etc/mdadm.conf
../img/boot/boot.cmd
.mkimage
to compile ./img/boot/boot.cmd
to ./img/boot/boot.scr
.helios-4/u-boot
Git repository and compile the U-Boot bootloader.If the script stops due to errors, the image file can still be mounted as a loop device, and its partition mounted to the ./img/
sub-directory. Before running the script again, ensure that the ./img
is unmounted:
$ sudo umount ./img
Check also if the image file is still mounted as a loop device:
$ sudo losetup -a
If so, umount it:
$ sudo losetup -d /dev/loopX
Thanks to:
MIT. Copyright (c) Gontran Baerts