Posts: 5
Joined: Tue Apr 09, 2013 4:33 am

How to create a custom Raspbian image?

Tue Apr 23, 2013 3:16 am

Hey all,

I'm running an open source project called BotQueue which allows you to control your 3D printer or CNC machine through the internet. I've found that a Raspberry Pi makes a great client/controller for connecting each machine. I'm using Raspbian as the OS and it is also rocking really hard.

Unfortunately, the installation and preparation of a vanilla Raspbian image takes literally hours with all the updates, installation, and compilation that need to happen to get all the right things working. I'd love to be able to make it easier for people to install my software on the Pi, and the easiest way I could think of is to include an ISO image they could just burn to their sd card that contains all the software pre-installed and ready to go.

I definitely don't want to roll my own distro, and I really want to continue using Raspbian. What I'm wondering is if there is a way to take a currently functioning sd card install and sanitize it to create an image that can be offered for download. It seems pretty obvious that I would use dd to create the image in the same way it is used to write the image, but how do I go about sanitizing the dozens (hundreds?) of files that are created during the use of a distro. Things like keys, configurations, cache files, etc. should all be removed.

Any ideas?

Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: How to create a custom Raspbian image?

Sat May 04, 2013 6:09 pm

Maybe not exactly what you want, but this is how I make an image with a customized kernel: https://github.com/notro/fbtft/wiki/Remake-SD-image

Forum Moderator
Forum Moderator
Posts: 3522
Joined: Wed Dec 28, 2011 11:45 pm

Re: How to create a custom Raspbian image?

Sat May 04, 2013 10:58 pm

IMO it's much better to avoid creating mess in the first place than to try and clean it up afterwards.

The scripts friggle uses for building the raspberry pi foundation images, are availble at http://github.com/asb/spindle the script I use to build the minimal image that I release for the raspbian project is availble at http://plugwash.raspbian.org/build-image . It should be possible to modify either of these scripts to add extra stuff to the images.

Edit: oops it seems I screwed up copy/paste

User avatar
Posts: 297
Joined: Tue Apr 03, 2012 12:15 am
Location: Switzerland

Re: How to create a custom Raspbian image?

Sun May 05, 2013 12:01 pm

Thanks for the link, I'd like to have a go at building a customised image. As far as I can see the scripts create two new filesystems, which then have to be imaged to an img file - is that right? Can these scripts to be run on a RPi, writing to a USB key or a USB SD-reader?

Return to “Raspbian”