When deploying a custom Ubuntu 24.04 image, certain important steps that do happen on a vanilla 24.04 deploy, are not executed:
Setting the APT proxy according to MaaS settings
Repairing the UEFI boot order after Ubuntu 24.04 has put itself first
I managed to write a late_command in the preseed to fix the latter issue, but the lack of setting the APT proxy is a major issue. For some customers, the PXE network is non-routable (for security reasons) and thus APT commands will only work when the MaaS server is used as a proxy. Due to this, vanilla Ubuntu 24.04 installs work, but deploying a custom Ubuntu 24.04 image fails.
Deploying a custom Ubuntu 22.04 image however, works just fine. I can see that the proxy steps gets executed there:
write apt proxy info to /tmp/tmpjv99mlr_/target/etc/apt/apt.conf.d/90curtin-aptproxy
This seems to be a bug to me. I would like MaaS to execute the standard steps for Ubuntu 24.04 like the boot order and APT proxy for my custom 24.04 images as well.
It seems these steps are run by Curtin. Could it be that MaaS is running an older curtin version that isn’t detecting Ubuntu 24.04 properly in custom images?
I think I see your point though, that curtin-hooks file also logs
Running curtin builtin curthooks
So it must be the contents of this file that are being executed for the custom image.
When I look at the older internal image builder that creates our 22.04 images, I don’t see a curtin-hooks at all in there. So I think the solution could be to remove the curtin-hooks file from the image-builder and let MaaS use its default one?
It also looks like the install-custom-packages script knows how to set the APT proxy. This gets run before setup-bootloader (which is where my deployment fails). So that is responsible for setting the proxy here. I can see in the image-builder variant that install-custom-packages is empty.
I will copy over the install-custom-packages content to the image-builder and try again with that.
Both of those approaches work, but I’m going to opt for not including the curtin hooks files at all. That lets MAAS use its standard curtin hooks and those do all the things we need, including fixing the boot order.