Welcome! Log In Create A New Profile

Advanced

Debian on NAND cloning automation.

Posted by naugtur 
Debian on NAND cloning automation.
October 26, 2010 02:44PM
Hi everyone.
[ First of all - thanks Jeff - your work up to now is great. You don't even know how much you helped me. ]

I am going to develop a way to create a solution that would allow an image of once prepared system to be easily installed on brand new dockstars. The image (or rather plural: images) will cover not only mtd3, but also the basic pogo soft if somebody left it there (or anything that changed there obviously).
I will post the making tutorial and instalation script here for everybody to use, so that everybody can exchange their instalations and duplicate them easily on as many dockstars as possible. My final goal would be to make installing of provided images easy for anybody who is capable of connecting to dockstar via console. This will be a good thing for business - fast way to put certain software on multiple dockstars and for private users - easy instalation of ready-made nice software that opens up the possibilities with 0 knowledge (ok, almost :) )

This obviously requires some scripts to be created. And I need help getting started.
- I'm not sure which elements of existing instalator are required to make NAND debian boot. Is it enough to use the uBoot page - http://jeff.doozan.com/debian/uboot/ ? Or do I need more and will have to rip it from the NAND install script?
- What do I need to know to be able to properly backup all mtd* ?
I don't know much about ubifs and what mtd really is, so I'll be asking...
- Any other tips? I'm a bit afraid to experiment from scratch, because I have

Vision details:
Instalation will start from a clean and fresh default software. After getting there via ssh or serial you plug in a pendrive with install files. You run one script that prepares mtd3 partition, flashes the uBoot and then...
Here's the problem. I'm not sure if I can replace mtd1 and 2 while pogoplug linux is running. Maybe chroot to the pendrive would help?
Hopefully instalation puts images into their places and reboots.
Looks like done.

Oh, and I don't expect answers to cover all the above stuff. :) If anybody has anything to suggest/add here - go on.

__
Naugtur
Re: Debian on NAND cloning automation.
October 26, 2010 03:44PM
This is pretty much how the Lenny install script works: it just grabs a big pre-configured image and dumps that to your flash drive.

You can use the following command to create an image of an existing system:
tar \
--exclude=/lost+found \
--exclude=/tmp \
--exclude=/sys \
--exclude=/proc \
-zcf /tmp/backup.tgz

(don't forget to create empty /tmp, /sys, and /proc folders when extracting the image on a new system)

The uBoot installer will run just fine on it's own. I'd suggest just running it as-is rather than picking it apart.

That should be more than enough to get you started.

I'm in favor of anything that makes things easier for everyone, but be careful that you don't re-invent the wheel. Debian already has a great package management system. Images can get stale fast. Scripts are much more flexible and don't go stale.

You may want to consider a system that sets up some post-installation or first-boot scripts that will download and pre-configure packages after using the normal installer. The users wouldn't know the difference and it would be a heck of a lot easier to maintain: they run your installer, which just calls the normal uBoot installer and the normal Debian base installer, and then your script runs whatever scripts they select to setup additional packages.

-- Jeff
Re: Debian on NAND cloning automation.
October 27, 2010 01:26PM
Thanks, I'll take a closer look on the NAND instalation scripts. The install works similiar way to what I wish to accomplish, but the minor differences are the key here.

It just was a bit too complicated to install debian on the pendrive first and then copy stuff and recreate. Not that I didn't enjoy that myself:) I just want to make it simpler for someone to install a system I prepared on lots of dockstars.
Moreover there is some software I will install from repositories other than the embedded squeeze, and some stuff I will compile myself. But that's irrelevant here. And all this can be done the way you suggested.
I will try to make it useful for the community as well as covering the needs of my project. So I'm open to suggestions

As a compromise between package and image install I will first try to use images and do package update after first boot.
And I hope I can reduce the number of reboots.


Thanks for the tips, I'll post back when I get something done (or get stuck :) )

__
Naugtur
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: