Since we do not have the debian keys in custom kernels, wireless-regdb doesn't properly load and without this you can't set the regdomain, so on boards that have a custom kernel, make sure to point to the upstream regulatory.db not the debian signed one.
See https://github.com/beagleboard/Latest-Images/issues/33 for more info
I dislike calling it current_dir since the current dir would be whatever we are in, when we are really talking about the base directory of the repository, so lets call it repo_dir.
Most of the arm boards don't have a realtime clock, and if the time is too far out of sync, networking doesn't work. systemd-timesyncd doesn't show the same issue so lets go ahead and install it in most of the images that weren't already doing so.
We don't use this anymore as we simply dpkg-reconfigure in the runonce scripts. So lets save a bit of time from doing the download and space of storing a package that never gets used.
We use growpart from the cloud-guest-utils package (actually from Canonical's repo on github), and this allows us to resize all of the filesystem without random dropping journals.
Tested on rpi0w, rpi4 (32bit and 64bit), pinebook, pinebook-pro, nanopi neoplus2, rpi2, odroid-c2. So I am thinking it's in a spot to make it available everywhere.
Also, somehow enabling ssh was dropped, likely due to misreading the purpose of "enable-ssh" service, which is a feature parity thing from raspbian where you could drop a "ssh" or "ssh.txt" file on /boot and it would enable ssh. We decided long ago however, to always eable ssh on the arm images.
We were restoring the mirror to the defaults, but then we would include sources.list again, which then sets it back to what the build system is set up to use. Obviously, we don't want to do that, so don't.
Not sure where the change came from, but the latest testing shows you can't
use e.g. nmtui or nmcli when sshing into an rpi.
Issue was reported by KoalaV2 on discord/gitlab.
Recommend sudo usage instead of just saying run as root.
Attempt to download packages 3 times before giving up.
Change suite to kali-rolling if it isn't set to that.
Increase number of cpus used to compress if > 3 exist.
RPi3-64: Supress output during build that isn't needed in the logs.
RPi3-64: Limit to 2 jobs during build since we're build via emulation.