4

I got Raspbian on a SD card. It is working. Then I installed a few program, modified some visual settings, and added some config files.

What I would like to do now is release this image to other people and have it really easy to deploy. What are a few of the steps needed to go from working SD card to getting a .img file?

Also, if possible, is there a way to "embed" a UID, like a MAC address, in the image so that the end user does not have to configure it? This might be a more tricky question but if you had a pointer on the first step it would be helpful.

  • 1
    See this question. Just make sure your configuration is generic. – Jivings Oct 4 '12 at 17:54
5

Judging from your question I assume you use one of the installers to get the Raspbian image on your SD card.

You can also use dd for this. dd works in both ways, so that means you can use it to create an image yourself as well.

Try the following on a system with dd to make an image of your SD card:

dd if=/dev/sdX of=/path/to/image.img bs=1M

In the above example, /dev/sdX must point to the SD card. If you don't know what this is, you can find out by using:

sudo fdisk -l

which will show you all connected media and their partitions. More information on fdisk can be found here. Another option is to look at the last bit of dmesg, just after plugging your SD card(reader) in:

dmesg | tail

All the above commands are very common on unix systems. If you don't use one, you can try a linux livecd. There are hundreds if not thousands of those available.

  • Any idea how the img can be modified before it is copied? So, what I would like to do is modify a file in the image to contain the MAC address and UID for a given RaspPi. – Scoop Oct 4 '12 at 18:26
2

Creating image

All you need to do is dd, as explained in How do I backup my Raspberry Pi?.

However, this will capture all personal files, configuration etc.

Off-topic

I'd be interested in adding these features to piimg, perhaps raise an issue on GitHub?

  • This looks great. It is a little overkill for what I need at the moment. It would be really great if I could add certain parameters to the image using the utility. Like for example a MAC address so that it can be really easy for a person to config the SD card, plug it into their RaspPi, then go. – Scoop Oct 4 '12 at 18:24
  • The MAC address is (should?) be part of the Ethernet chip, and isn't (as far as I'm aware) configurable. Do you mean IP address? – Alex Chamberlain Oct 4 '12 at 18:36
  • I gave the MAC address as a bad example. Ideally, I want to get a unique ID onto the device so that the user doesn't have to enter it. Thanks for the help. – Scoop Oct 4 '12 at 18:41
  • You could use the serial number of the Raspberry Pi? – Alex Chamberlain Oct 4 '12 at 18:44
  • 1
    @AlexisK See raspberrypi.stackexchange.com/q/2086/86 – Alex Chamberlain Oct 4 '12 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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