Download link for Alpine Linux 3.12.2 wth 5.10.0 kernel builf for Odroid-C4:
https://mega.nz/file/R04ADCiJ#1dClOn_Lv ... voYhnWdurA
The conceptual process is:
1) get u-boot and kernel from LibreElec image. I used the LibreElec image because they build a mainline kernel with relevant Amlogic patches and use a mainline u-boot and it is faster/easier than compiling the kernel from source
2) Get an aarch64 Alpine-linux image
3) create an updated initramfs
4) Create modloop
5) Build an image using LE Kernel and u-boot and Alpine initramfs and filesystem
Commands:
Code: Select all
wget https://chewitt.libreelec.tv/testing/9.80/LibreELEC-AMLGX.arm-9.80.7-odroid-c4.img.gz
wget https://dl-cdn.alpinelinux.org/alpine/v3.12/releases/aarch64/alpine-uboot-3.12.2-aarch64.tar.gz
mkdir -p /tmp/alpine/le_img /tmp/alpine/le_rootfs /tmp/alpine/alpine_img /tmp/alpine/alpine_initramfs
zcat LibreELEC-AMLGX.arm-9.80.7-odroid-c4.img.gz > alpine-odroid-c4.img
tar -C /tmp/alpine/alpine_img -xf alpine-uboot-3.12.2-aarch64.tar.gz
export LOOP=`sudo losetup --partscan --show --find alpine-odroid-c4.img`
sudo mount -o uid=`id -u $USER` ${LOOP}p1 /tmp/alpine/le_img
mkdir /tmp/alpine/le_img/boot
sudo mount /tmp/alpine/le_img/SYSTEM /tmp/alpine/le_rootfs
mksquashfs /mnt/alpine/le_rootfs/usr/lib/kernel-overlays/base/lib/ /tmp/alpine/le_img/boot/modloop-odroid-c4 -b 1048576 -comp xz -Xdict-size 100%
sudo umount /mnt/alpine/le_rootfs
rm /tmp/alpine/le_img/SYSTEM*
mv /tmp/alpine/le_img/KERMEL* /tmp/alpine/le_img/boot/
pushd /tmp/alpine/alpine_initramfs
zcat ../alpine_img/boot/initramfs-lts | cpio -idmv
rm -rf lib/modules lib/firmware
find . | cpio -o -H newc ../le_img/boot/initramfs-odroid-c4
cd ../alpine_img
cp -prf alpine.apkovl.tar.gz apks ../le_img/
cat > ../le_img/extlinux/extlinux.conf << EOF
TIMEOUT 20
PROMPT 1
DEFAULT odroid-c4
LABEL odroid-c4
MENU LABEL Linux lts
LINUX /boot/KERNEL
INITRD /boot/initramfs-odroid-c4
FDT /meson-sm1-odroid-c4.dtb
APPEND console=ttyAML0,115200n8 console=tty0 debug_init
EOF
popd
sudo umount /tmp/alpine/le_img
sudo losetup -d $LOOP