canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.93k stars 873 forks source link

[enhancement]: Raspberry Pi: Support "autoinstall.yaml" in /boot #5766

Closed archfrog closed 1 week ago

archfrog commented 2 weeks ago

Enhancement

Hi,

[This may be a simple error on my part. If so, please advice how to proceed :-)]

I have been unable to get Ubuntu Server 24.04.1 to pick up autoinstall.yaml from the boot partition of a freshly generated USB key (made with Raspberry Pi Imager with no OS customizations). My custom autoinstall.yaml file works perfectly when placed in the root partition of a classic PC x64 USB key before the installation starts.

There is a user-data file in the /boot partition (the first, FAT32 formatted partition on the USB key in Ubuntu Server for Raspberry Pi), but it uses a different syntax and completely different keys from autoinstall.yaml. I tried copying autoinstall.yaml into the partition, but it seems to be completely ignored. I also tried replacing user-data with autoinstall.yaml, but that made the install fail completely.

I need this because we are using different boards (sometimes Raspberry Pi 4B, sometimes Intel Compute Sticks, sometimes PCs) as kiosk machines in a local museum. I am trying to streamline the installation process so that I can use the same process on both Pis, Sticks, and PCs. I'm aiming for having an autoinstall.yaml file to set up the system automatically without user interaction and then a small script to perform the remaining customizations and installations needed by us, which is run by SSH-ing into the new machine.

As the systems are being prepared on a Windows PC (by Windows users), I am working hard to avoid having to mount and/or generate a new OS image with modifications. All in all, I am hoping to get to a point where the person preparing a new kiosk machine only need to copy in a couple of files (autoinstall.yaml and my custom script) to the /boot partition of the Pi before starting the automatic installation.

As far as I see it, the use of autoinstall.yaml should be supported and identical on both Pis and PCs. I definitely don't want to support two sets of documentation, custom scripts, and stuff as the operating system is Ubuntu Server on both types of machines.

P.S. In autoinstall.yaml is there a way to run a script after the users have been created and the system rebooted? I guess I could be nasty and use /etc/rc.local, but are there any official means of doing this?

Thanks in advance!

Sincerely, Mikael

aciba90 commented 1 week ago

Thanks, @archfrog, for making cloud-init better. The autoinstaller config module is not consumed by cloud-init but by the Ubuntu installer, see [1, 2, 3] for reference. Could you please redirect this issue to its issue tracker?

I am going to close this issue and ping @dbungert for awareness.

archfrog commented 1 week ago

Thanks for your helpful reply!

I have checked out the documentation that you sent me and now understand the basic problem (that I am configuring the wrong tool). I'll redirect this issue to subiquity if necessary, for now I'll assume that my problem can be solved without bothering them.