Open TheSashmo opened 3 years ago
I do not know if the installer can run any scripts on first boot, but that may be something to look into. If not, it would probably come down to creating a systemd unit file which runs your script after the userspace has been loaded, but that would require some work on the preseed file and require you to put a whole bunch of commands in the late_command.
Now that I think of it, I assume your first boot is always done by the initially created user? Maybe you could source a custom script in the .bash_rc file, which would make it run on first logon; it would then have to remove itself again once completed to avoid running it on every logon, but it could work.
Maybe some other users have a better solution?
edit: Just remembered there's a thing called cloud-init, which maybe exactly what you are looking for: https://help.ubuntu.com/community/CloudInit
Also, depending on what it is you are trying to do, you may be better off using tools such as Ansible to configure your server/instance; it is what I have been using for the last 4-5 years and performs approx. 850 tasks depending on the specific use-case for that server (webserver, database, etc). If you're just trying to load your ssh keys for login etc, then cloud-init will do the trick just fine!
First of all thanks for this, I love it.
Is there a way to first that start script, or any other script, to run on that first boot? Ideally the hostname and other tools to be ready to go after X or so minutes, then I know the device is up and has all that I need. For example disable screen blanking and other small configurations.
I've been using a disk image to do my cloning, but I find that is not ideal as I make changes over time, and then I need to do the disk image again and a few steps in between.
Suggestions?