1

I am working with a pi image that I generated from a local pi that I customized to suit my application case. I generate the image using piclone.

Now I need to deploy the image on several pi(s) and want to customize the behaviour of each one using a config file that I would like to place on the SD card after I flashed the image (kind of like what happen with the ssh file od wpa_supplicant.conf).

Is it a good practice or am I going to create problem in the boot process? Is there any other solution to this?

Thanks!

0

1 Answer 1

1

I'm presuming by "place on the SD card" you mean in the vfat partition because you intend to do this with, eg., a windows machine that can't access the rest of the card -- but it doesn't actually matter where you put it.

am I going to create problem in the boot process?

Wouldn't that apply to any method in the sense that you probably could cause a problem by mistake, ie., if you did it wrong? So the question is more like "Can this be done in a manner that doesn't create a problem?", and just based on the fact that it works for the ssh file implies yes, of course it can.

The boot partition is certainly available when the system starts as it is mounted by default, so it is in fact very easy to create a service that makes use of files there, and the possibility of causing a problem with the boot process is pretty much the same as for any boot service: Yes, you can mess thing up if you do things the wrong way.

Is there any other solution to this?

I think that depends on what exactly it is you want to do, but in my opinion there probably isn't a much better way if it is about customizing some configuring on first boot. It's simple, which is an important virtue WRT to tech projects.

That said, if accessing the root fs in the second partition isn't a problem, and this is about static configuration, eg., providing a wpa_supplicant.conf, you could instead automate doing that directly, ie., rather than a process which applies configuration on first boot, you write something to do the same thing before first boot by putting the card in another machine.

That second option is probably even simpler than the first but depends on accessing the second partition and whether the system has to be running to do what you want.

1
  • thanks for your reply. Both options works, but not sure if we'll run the configuration under Linux or windows, so I think I'll stick with the first option. My doubt was more if I were doing something potentially harmful or considered bad practice, Mar 9, 2021 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.