This repository provides everything you need to install and run Arch Linux on the Odroid M1S. It includes:
- Prebuilt Arch Linux images for easy installation (see INSTALL.md).
- Scripts and instructions to build U-Boot, the Linux kernel, and initramfs.
- Guidance on flashing, partitioning, and backup & recovery procedures.
- Serial connection strongly recommended: If something goes wrong, a UART console will save your device from a hard brick.
- Follow these instructions at your own risk; bricking is unlikely but possible. See Recovery for rescue steps.
- Prerequisites
- Install Arch Linux
- Building U-Boot
- Partitioning & Flashing
- Extract Arch Linux ARM generic image
- Building the Linux Kernel
- Initramfs
- Booting the Device
- Backup
- Recovery
- Going Forward
All commands assume root permissions. Use sudo
or sudo su
as needed.
On Debian-based hosts:
You can use my build_u-boot.sh script to install the dependencies automatically.
apt-get install -y gcc-12 gcc-12-aarch64-linux-gnu python3-pyelftools libgnutls28-dev uuid-dev u-boot-tools git wget bsdtar
Create cross-compiler symlinks:
for tool in cpp gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump gcov-tool; do
ln -sf aarch64-linux-gnu-$tool-12 /usr/bin/aarch64-linux-gnu-$tool
done
Environment variables:
# build.source
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
Alternatively, source build.source:
source build.source
For a quick setup using prebuilt images, see INSTALL.md.
- Use the build_u-boot.sh script (see its
README.md
). - The script outputs
u-boot-rockchip.bin
under/usr/src/u-boot-rockchip/
.
Note:
/dev/sdX
may refer to an SD card or the Odroid in UMS mode.
dd if=u-boot-rockchip.bin of=/dev/sdX bs=32k seek=1 conv=fsync
Warning: Do not specify a partition (e.g.,
/dev/sdX1
). U-Boot is written to the first 16 MB.
-
Run
gdisk /dev/sdX
, then:d # delete existing partitions n 1 32768 +256M 8300 # create BOOT partition n 2 0 8300 # create rootfs partition w # write changes
-
Make filesystems:
mkfs.ext4 /dev/sdX1 -L BOOT mkfs.ext4 /dev/sdX2 -L rootfs
-
Download
ArchLinuxARM-aarch64-latest.tar.gz
from https://archlinuxarm.org/platforms/armv8/generic -
Extract the image:
mount /dev/sdX2 /mnt bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt
-
Clone the kernel repo:
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git cd linux
-
Copy kernel/config-odroid-m1s to
.config
and runmake menuconfig
. -
Compile:
make -j$(nproc) make modules -j$(nproc) make dtbs -j$(nproc) make INSTALL_MOD_PATH=/usr/src/linux/arch/arm64/boot/modules modules_install
-
Copy kernel & DTB to BOOT:
mount /dev/sdX1 /mnt cp arch/arm64/boot/Image /mnt/boot/ cp arch/arm64/boot/dts/rockchip/rk3566-odroid-m1s.dtb /mnt/boot/ umount /mnt
-
Copy modules to rootfs:
mount /dev/sdX2 /mnt cp -r /usr/src/linux/arch/arm64/boot/modules/lib/modules/<version> /mnt/lib/modules/ umount /mnt
-
On the Odroid (running Arch): WARNING: You need a running arch linux arm to do this step, because boot will fail without the uInitrd present.
pacman -S mkinitcpio mkinitcpio -k <version> -g /boot/initramfs-linux.img
-
On the host:
mkimage -A arm -T ramdisk -C gzip -d initramfs-linux.img uInitrd cp uInitrd /mnt/boot/
WARNING: Serial console access is required. FB and keyboard support are untested.
Access the U-Boot console by pressing CTRL-C
or the any key
rapidly after powering on the Odroid:
load mmc 0:1 ${kernel_addr_r} Image
load mmc 0:1 ${ramdisk_addr_r} /uInitrd
load mmc 0:1 ${fdt_addr_r} rk3566-odroid-m1s.dtb
setenv bootargs root=/dev/mmcblk0p2 console=ttyS2,1500000
booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
Optionally generate boot.scr
i.e. with my boot.cmd:
mkimage -C none -A arm -T script -d boot.cmd boot.scr
mount /dev/sdX1 /mnt
cp boot.scr /mnt/boot/
umount /mnt
Use the script scripts/generate_image.sh. Usage:
./generate_image.sh /dev/sdX
-
Zero-fill partitions:
for part in sdX1 sdX2; do mount /dev/$part /mnt dd if=/dev/zero of=/mnt/tmpfile bs=1M status=progress || true sync rm /mnt/tmpfile umount /mnt done
-
Create sparse image:
dd if=/dev/sdX of=odroid-m1s.img bs=4M conv=sparse status=progress sync gzip odroid-m1s.img
-
Flash
ODROID-M1S_EMMC2UMS.img
to an SD card: see wiki.odroid.com. -
Boot with the SD card while shorting the mask ROM pin to GND.
-
In U-Boot, press any key then run:
ums 0 mmc 0
Experiment with TPM, OP-TEE, and unified kernel images via scripts/build/u-boot.sh
.