Hey,
So I’ve been trying to create a custom core20 image using ubuntu-image snap
with a signed model assertion. The image creates without issue, but I would also like to be able to add a systemd service as default for the image.
Normally I’d use cloud-init but as Core20 does not support this I’m trying to use the ubuntu-image post-populate-rootfs hook.
In the directory where I have my signed model assertion I have a directory called “img-hook” which contains a shell script named post-populate-rootfs
echoing lines into /etc/systemd/system/mything.service
(also tried to use $UBUNTU_IMAGE_HOOK_ROOTFS/etc/systemd/system/
).
Finally the image is created using ubuntu-image snap --hooks-directory ./img-hook
All of which seems to work, it creates a image I can boot without issues but there is no sign of the service file anywhere in the resulting filesystem.
Anyone have any hints for working with the ubuntu-image
hook?