@tatanas I know I hacked a solution years ago to do just this. For the life of me I can’t seem to find that post. If you are willing to work with me I think I can give you guidance on what needs to be done, then I can create a tutorial for others.
At the end of fog.man.reg there is this section as you have found.
dots "Attempting to register host"
res=""
while [[ -z $res ]]; do
res=$(curl -Lks --data "sysuuid=${sysuuid}&mac=$mac&advanced=$(echo -n 1 | base64)&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$location64&username=$user64&groupid=$group64&snapinid=$snapin64&productKey=$productKey" ${web}service/auto.register.php 2>/dev/null)
echo "$res"
usleep 2000000
done
. /bin/fog.inventory
usleep 2000000
The curl call registers the system with FOG and also posts an imaging deploy task, because this variable is set doimage=$realdoimage
So this sets the stage for imaging.
After the call to fog.inventory what you need to do is make a call to import the new environment (from the action of registering this computer with FOG) so it can pick up the imaging task.
I wrote a hack many years ago that go incorporate into the base image for USB imaging since iPXE was not being used.
That is in the master fog
script: https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog
#!/bin/bash
. /usr/share/fog/lib/funcs.sh
### If USB Boot device we need a way to get the kernel args properly
if [[ $boottype == usb && ! -z $web ]]; then
sysuuid=$(dmidecode -s system-uuid)
sysuuid=${sysuuid,,}
mac=$(getMACAddresses)
curl -Lks -o /tmp/hinfo.txt --data "sysuuid=${sysuuid}&mac=$mac" "${web}service/hostinfo.php" -A ''
[[ -f /tmp/hinfo.txt ]] && . /tmp/hinfo.txt
fi
So what I would do is incorporate that section (minus the if statement) and once you stat the hinfo.txt file the environment should be properly setup to then jump to the /bin/fog.download command.
Will it work? It should. The fix I created at the time worked. Does it need a bit of debugging, yes it does. I think if you have made it this far with tweaking the fog.man.reg file you have the needed skills to take this next step.