Hello all, I have a raspberry pi3 and installed with Raspbian image. I'm running few python applications in it. I want to make a new Image with the existing image that should include my python applications and install this image in 100 new BBBs... And few things like ifconfig settings (set a static IP), internet settings and installation of python libraries should be automatically done while the image installation is in progress.. How can I do this? Is it possible?
I am not exactly sure of te details, but can't you simply dd the whole image off the raw device protoytype SD onto a conventional linux computer and dd it back on to 100 SD cards?
--
"Socialist governments traditionally do make a financial mess. They
always run out of other people's money. It's quite a characteristic of them"
Some of it is, some isn't. I'm not sure how you'd go about modifying the image on the fly. Maybe you could write the image, then mount the image and modify the network settings, or perhaps create a run once program to assign a static IP according to the MAC address the first time it boots up.
The python libraries should already be installed before taking the image.
Please note: dd will cheerfully write over any /dev/sdX device, including devices you care about without warning. Double check that sdX is the device you want, and not the device that contains your home directory. You've been warned.
Taking an image: sudo dd bs=4M if=/dev/sdX of=my-custom.img
Writing it out: sudo dd bs=4M if=my-custom.img of=/dev/sdX
Checking your work. Use sha256sum to check that that the SD card accurately created. The sum for the image can be stored in a file,
sha256sum my-custom.img > my-custom.sha
and then check that against the output of
sudo sha256sum /dev/sdX
BBB? BeagleBone Black? I don't think they can run a pi image. I might be wrong, and it won't hurt to stick a pi SD card and see if it will boot. I expect it will fail spectacularly.
As far as making large quantities of SD cards, that's going to be painful, either in time or in money. My first thought would be to get on a linux machine with plenty of USB ports, then get some of these
formatting link
or these
formatting link
load up $x number of usb ports, open up $x number of terminal windows, and then issue $x number of "dd .. of=/dev/sd$y" were $y corresponds to each of the usb adapters.
Then go make a caffeniated beverage, go get food, take a nap, etc, and come back in a while and see if they've finished. I'd probably go with a script to also automatically check the sha256sums and give you an okee-dokee when it is finished.
I looked at amazon to see if they had SD duplicators, and they do. But they're in the US$550 range for 7 at a time.
--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
I'd treat this like any other source level port, assuming that your BBB has Python installed and a usable network connection to your home LAN:
- use the tool of your choice to copy the python sources, scripts, etc onto the BBB, i.e. ftp, scp or sftp
- recompile then on the BBB, run your regression test set to make sure they work correctly there, and install as you want.
- then make an image copy of the BBB's filesystem, check that its bootable and start copying it onto the other BBBs
If you find problems with the Python stuff, apply fixes, backport them to the RPi and retest them there. Rince, spin dry and repeat until the bugs are squashed on all systems.
Do you use any source management system (git, cvs or ...)?
If not, consider setting one up and establishing a regularly backed-up central repository for your code and access from all the places where you compile and use the programs. You'll find that doing this makes code maintenance a lot easier: fix the code on whatever system you found the problem on, commit the changes and then pull down the fixes, recompile and retest on the other machines. Anything like this is much easier to do once you have version control up and running.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
Thanks for the information.. Yeah.. Probably I can install the image one time and upload my python code in git or somewhere else .. And as soon as the machine restarts, it should probably pull my code form the git automatically...
use the 'dd' program on the SD card directly (yeah remove from Pi first after doing a nice controlled shutdown) to create an image file
copy that image onto other SD cards for the distribution
mount each copied image individually and edit the appropriate files from the Linux or BSD computer.
And if the libraries are already installed on the copied image, you won't have to do it again. Just mount the copied SD image, and edit config files and voila!
It's also possible to mount the image file directly if you want to update things, then copy the updated image to SD cards.
I have docker running on my Pi quite successfully, so you could upload docker image of your python stuff to Docker Hub. I would guess it would be simpler.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.