cmprovision icon indicating copy to clipboard operation
cmprovision copied to clipboard

Copying files via postinstall scripts

Open AfdhalAtiffTan opened this issue 10 months ago • 2 comments

Hello,

I understand that the postinstall script is running from the CM4 that is being provisioned (source).

Is it possible to copy some files from the cmprovision server to the CM4 that is being provisioned?

Is it possible to use wget or anything similar?

Thank you.

AfdhalAtiffTan avatar Jan 29 '25 13:01 AfdhalAtiffTan

Yes. Just toss your file in /var/lib/cmprovision/public/uploads

curl --retry 10 --silent --show-error -g -o myfile http://$SERVER/uploads/myfile

See the existing post-installation scripts for an example on how to mount a partition at for example /mnt first. Can then use -o /mnt/myfile

maxnet avatar Jan 29 '25 14:01 maxnet

I got it to work, thank you @maxnet!

# file is in /var/lib/cmprovision/public/splash.png
wget -O /mnt/boot/splash.png http://172.20.0.1/splash.png

AfdhalAtiffTan avatar Jan 29 '25 14:01 AfdhalAtiffTan