Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger script after provision #107

Open
reflexcameras opened this issue Jan 18, 2025 · 4 comments
Open

Trigger script after provision #107

reflexcameras opened this issue Jan 18, 2025 · 4 comments

Comments

@reflexcameras
Copy link

Is there a way I could automate triggering a script after each provision? I would like to edit the hostname and add a linked deploy key to the image I am using. I am making the deploy keys on the provisioning device

@tdewey-rpi
Copy link
Collaborator

Yes - a somewhat-trivial modification to the sb-provisioner script would perform the changes you want for now - but the intent is to introduce a range of hook-scripts at various points through the process to make this more straightforward.

After

mount -t ext4 "${ROOT_DEV}" "${TMP_DIR}"/rpi-rootfs-img-mount ${DEBUG}
, the root file system is mounted at "${TMP_DIR}"/rpi-rootfs-img-mount, and you're free to make changes to your copy to facilitate your use case.

One warning, however - making changes there may foul the hot-path detection (which relies purely on sizes and file presence). In such a mode, you would likely want to not set RPI_SB_WORKDIR, and instead regenerate your provisioning asset for each device.

@reflexcameras
Copy link
Author

Great, thankyou, I will try this and make sure I don't set the WORKDIR so that it regenerates on each provision.

If I installed the sb-provisioner via apt where will I find the rpi-sb-provisioner.sh to edit?

@tdewey-rpi
Copy link
Collaborator

Installed from apt, you'll find it in /usr/local/bin, as specified in our install file:

https://github.com/raspberrypi/rpi-sb-provisioner/blob/main/debian/install

@reflexcameras
Copy link
Author

amazing, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants