The first suggestion is the pacstrap command. Hereās why.
In steps 11.iv and 11.v a rootfs is downloaded from the Archlinux arm repository as
wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
Which isnāt exactly what is wanted. Sounds like your change kernels and possibly more.
Then in step 12.viii you add more packages as
pacman -Syu base linux-x13s x13s-firmware grub git vim arch-install-scripts efibootmgr networkmanager network-manager-applet dialog os-prober mtools dosfstools base-devel
This can be accomplished in one fell stroke using pacstrap.
Once the storage device is created and mounted, then instead of downloading an image from Archlinux ARM and installing the image with bsdtar, pacstrap can be run to install necessary packages from a file list. Here is an example:
In line 61 of the script
pacstrap -cGM MP - < $(pwd)/build-configs/pkglist-rpi.txt
MP is a mount point for the storage device so you could substitute /dev/sdb (notice, no partition number) which would be a uSD or whatever partitioned and formatted to your specifications.
pkglist-rpi.txt is the list of packages to install.
Here is how I would create the package list.
Run your current process through Step 11 or however far it takes to just get a bootable rootfs.
Then boot the rootfs. log in as root. then
pacman -Q > pkglist.txt
This will yield a temporary list of every package in the rootfs and would look like this snippet
attica 5.106.0-1
attr 2.5.1-3
audiocd-kio 23.04.2-1
audit 3.1.1-1
autoconf 2.71-4
automake 1.16.5-2
avahi 1:0.8+r22+gfd482a7-1
Not usable because it contains the version numbers
awk '{print $1}' pkglist.txt > pkglist-x13s.txt
Now you should have a permanent file with all the files in the rootfs minus the version numbers.
Insert a fat 32 Thumb drive to the computer, mount it, and copy the pkglist-x13s.txt to the thumb drive.
In a computer with a full OS copy the pkglist-x13s.txt where it can be easily edited.
Now add all the packages listed in Step 12.viii to the pkglist-x13s.txt file and substitute the drop in kernel and kernel-headers and any other subtitutions.
Go through the steps again but use pacstrap to install the packages instead of downloading the Archlinux ARM Generic image.
Then at the appropriate place, create your image you put on github.
May take a little tinkering, but should be doable. Just look at man pacstrap and check which options to use.
Just food for thought.
Pudge