[Samsung Galaxy Note 9 Themes, Apps, and Mods] basurapr:
I wrote a script that downloads and generates the image, also I tried to strip needed components into a "Template" directory, where I placed the lod_daemon, Xtightvnc binaries as the init.d/init_container.sh and vnc.sh. The issue is when I try to add the image on LinuxOnDex app it says invalid image format. I even tried by taking your void image deleting everything and copying the archlinux image content into your img file and when I transfer it into my galaxy s9+ and try to open it on dex app I get the invalid image format again... maybe it is ext3 instead of ext4?

In any case I uploaded the scripts here mega_nz/#!lVEjzazL!cpuxEf_W6m-9GdytwzQMr0OWplXrqxylrHifQdJcOkw, would be nice to make a github repo or something with the required scripts so people can create their own images after everything is sorted out.

Here are the main scripts for easier inspection:

LoDGenerator

#!/bin/bash

# Notes:
# blkid image_name.img to view the image details.
#
# To edit the image arm image on x86_64:
# ================================================================
# This provides the qemu-aarch64-static binary
# yay -S qemu-arm-static
#
# Mount my target filesystem on /mnt
# mount -o loop fs.img loddir
#
# Copy the static ARM binary that provides emulation
# cp $(which qemu-aarch64-static) loddir/usr/bin
# Or, more simply: cp /usr/bin/qemu-aarch64-static loddir/usr/bin
#
# Finally chroot into loddir, then run 'qemu-aarch64-static bash'
# This chroots; runs the emulator; and the emulator runs bash
#
# cp /etc/resolv.conf loddir/etc/
# chroot loddir qemu-arm-static /bin/bash
# ================================================================

if [ ! -e "/usr/bin/arch-chroot" ]; then
echo "Please install arch-chroot to continue."
exit
fi

if [ ! -e "/usr/bin/qemu-aarch64-static" ]; then
echo "Please install qemu-arm-static for qemu-aarch64-static support."
exit
fi

if [ ! -e "FileSystems" ]; then
mkdir FileSystems
fi

function make_archlinux {
distro="ArchLinux"
url="os_archlinuxarm_org/os/ArchLinuxARM-aarch64-latest.tar.gz" # cant post links yet
directory=archlinux
filesystem=ArchLinuxARM-aarch64-latest.tar.gz
image_name=ArchLinux_LoD.img
image_size=3076
setup_file=archlinux_setup.sh

if [ ! -d "${directory}" ]; then
mkdir $directory
fi

if [ "$(ls $directory)" != "" ]; then
echo "Umounting previous image."
umount $directory/proc 2>&1 > /dev/null
umount $directory/sys/firmware/efi/efivars 2>&1 > /dev/null
umount $directory/sys 2>&1 > /dev/null
umount $directory/dev/pts 2>&1 > /dev/null
umount $directory/dev/shm 2>&1 > /dev/null
umount $directory/dev 2>&1 > /dev/null
umount $directory/run 2>&1 > /dev/null
umount $directory/tmp 2>&1 > /dev/null
umount $directory/etc/resolv.conf 2>&1 > /dev/null
umount $directory 2>&1 > /dev/null
sleep 3
fi

echo "Creating ${distro} disk image..."
if [ -e "${image_name}" ]; then
rm $image_name
fi

dd if=/dev/zero of=$image_name bs=1M count=$image_size

mkfs.ext4 -L cloudimg-rootfs \
-U 455a35d3-488b-4c5e-89b0-883ef8e77f68 \
$image_name

mount -o loop $image_name $directory

echo "Downloading ${distro}..."
if [ ! -e "FileSystems/${filesystem}" ]; then
wget -O "FileSystems/${filesystem}" "${url}"
fi

echo "Decompressing ${distro}..."
bsdtar -xpf FileSystems/$filesystem -C $directory

echo "Preparing image for chroot with qemu..."
cp /usr/bin/qemu-aarch64-static $directory/usr/bin/

echo "Starting distro setup..."
cp -av Setup/$setup_file $directory/
arch-chroot $directory qemu-aarch64-static /bin/bash $setup_file

rm $directory/$setup_file

umount $directory/proc 2>&1 > /dev/null
umount $directory/sys/firmware/efi/efivars 2>&1 > /dev/null
umount $directory/sys 2>&1 > /dev/null
umount $directory/dev/pts 2>&1 > /dev/null
umount $directory/dev/shm 2>&1 > /dev/null
umount $directory/dev 2>&1 > /dev/null
umount $directory/run 2>&1 > /dev/null
umount $directory/tmp 2>&1 > /dev/null
umount $directory/etc/resolv.conf 2>&1 > /dev/null

# Wait for proper umount
sleep 3

echo "Setting dextop user account..."
echo "dextop:x:1000:1000::/home/dextop:/bin/bash" \
>> $directory/etc/passwd

echo "dextop:$6$3uD6fDYK$U.wCye7zuGkuyftaiuKbJ35nQiY6eeS0QCbRJSLmGBJBXR9jpif4Yw/fFdrHoI4Y6MT.Dh9dcpqkNNQDj.jcz/:17644:0:99999:7:::" \
>> $directory/etc/shaddow

echo "dextop:x:1000:" \
>> $directory/etc/group

echo "dextop:!::" \
>> $directory/etc/gshadow

echo "Setting directory permissions..."
chown -R 1638400000:1638400000 $directory/bin
chown -R 1638400000:1638400000 $directory/boot
chown -R 1638400000:1638400000 $directory/dev
chown -R 1638400000:1638400000 $directory/devro
chown -R 1638400000:1638400000 $directory/etc
chown -R 1638400000:1638400000 $directory/ext_sd
chown -R 1638400000:1638400000 $directory/home
chown -R 1638400000:1638400000 $directory/lib
chown -R 1638400000:1638400000 $directory/lost+found
chown -R 1638400000:1638400000 $directory/mnt
chown -R 1638400000:1638400000 $directory/opt
chown -R 1638400000:1638400000 $directory/proc
chown -R 1638400000:1638400000 $directory/root
chown -R 1638400000:1638400000 $directory/run
chown -R 1638400000:1638400000 $directory/sbin
chown -R 1638400000:1638400000 $directory/share
chown -R 1638400000:1638400000 $directory/srv
chown -R 1638400000:1638400000 $directory/sys
chown -R 1638400000:1638400000 $directory/tmp
chown -R 1638400000:1638400000 $directory/usr
chown -R 1638400000:1638400000 $directory/var

echo "Copying LinuxOnDex dependencies..."
cp -av Template/usr $directory/
cp -av Template/devro $directory/
cp -av Template/share $directory/
cp -av Template/ext_sd $directory/
cp -av Template/etc/init.d $directory/etc/
cp -av Template/home/dextop $directory/home/
cp -av Template/dev/* $directory/dev/
}

make_archlinux

and here is the script that setups ArchLinux:

#!/bin/bash

# to prevent mmap errors due to qemu and proper mount...
sleep 3

# since network isnt't working with plain resolv.conf we add some hosts
cp /etc/hosts /etc/hosts.original
echo "50.116.36.110 mirror.archlinuxarm.org" >> /etc/hosts
echo "216.155.157.40 fl.us.mirror.archlinuxarm.org" >> /etc/hosts

cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.original
echo 'Server = fl_us_mirror_archlinuxarm_org/$arch/$repo' \
> /etc/pacman.d/mirrorlist

# Init archlinuxarm packages keyring
pacman-key --init
pacman-key --populate archlinuxarm

# Remove kernel
pacman --noconfirm -Rcs linux-aarch64

# Update the base system
pacman --noconfirm -Suy

# Install additional packages
pacman --noconfirm -S sudo pulseaudio xorg-server xorg-apps \
ttf-liberation ttf-opensans ttf-hack \
tigervnc fluxbox

# Clean downloaded packages
pacman --noconfirm -Scc

# Enable sudo on all user accounts
echo "%wheel ALL=(ALL) ALL" > /etc/sudoers.d/wheel

# Fix Xtightvnc missing dependency
ln -s /usr/lib/libXfont2.so.2.0.0 /usr/lib/libXfont.so.1

# Remove default user
userdel -f -r alarm

exit