Your fix has allowed me to download and install the packages that were breaking now. Still get an error back from the build process though inside the output/debug/install.log file:
openpgp: Passphrase is required to unlock private key "Armbian builder (Temporary key for installing packages during Armbian image creation) <root@localhost>"
openpgp: 2048-bit RSA key, ID 92B90DE1925644A6, created 2016-08-05
Loading packages...
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Ign:1 http://localhost:8189 jammy InRelease
Hit:2 http://ports.ubuntu.com jammy InRelease
Hit:3 http://ports.ubuntu.com jammy-security InRelease
Hit:4 http://ports.ubuntu.com jammy-updates InRelease
Hit:5 http://ports.ubuntu.com jammy-backports InRelease
Hit:6 http://ppa.launchpadcontent.net/saiarcot895/chromium-beta/ubuntu jammy InRelease
Hit:7 http://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Hit:10 https://ppa.launchpadcontent.net/jonathonf/zfs/ubuntu jammy InRelease
Hit:11 http://deb.volian.org/volian scar InRelease
Hit:8 https://cli.github.com/packages stable InRelease
Hit:9 http://armbian.systemonachip.net/apt jammy InRelease
Ign:1 http://localhost:8189 jammy InRelease
Ign:1 http://localhost:8189 jammy InRelease
Err:1 http://localhost:8189 jammy InRelease
Could not connect to localhost:8189 (::1). - connect (111: Connection refused) Could not connect to localhost:8189 (127.0.0.1). - connect (111: Connection refused)
Reading package lists...
W: Failed to fetch http://localhost:8189/dists/jammy/InRelease Could not connect to localhost:8189 (::1). - connect (111: Connection refused) Could not connect to localhost:8189 (127.0.0.1). - connect (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package helloworld
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Checking that no-one is using this disk right now ... OK
Which is unusual since it seems to download the package fine in the BUILD_CHROOT environment...
I think that a good amount of my issues came from misunderstanding the build system, and good documentation would be helpful in that regard. This conversation started with me suggesting to do this all in the customize-image.sh file, so some information on when and when not to use this file would be useful. Beyond documentation, here's a short list of things I think might be improvements:
A warning message for new users might be nice if they attempt to run the build environment on something which is not officially supported by Armbian.
Some example files in the packages/extras-buildpkgs directory which contain comments and details on how to lay out the configuration file for a package would be helpful (maybe something similar to the userpatches/config-example.conf file?).
Another solution would be to create something similar to Yocto's devtool for generating and testing packages to be put onto the image. The process might be much easier for users with something like this. The BUILD_CHROOT parameter's functionality might be a part of the testing functionality for example.
In customize-image.sh it might be better to give the chroot and host environment variables instead of using userpatches/overlay and /tmp/overlay.
customize-image.sh might be better off being spread across multiple files? I imagine someone who might have multiple releases would have quite a large file here if they're doing a lot of customization to the image before unmounting.