I am planning on using udpcast to do linux installs on the computer systems we manufacture. But I have a couple of questions.
We have machines that come with different sizes of hard drives. 20, 40 and 80 gigs. In the past we had a script we would run on a duplicating machine that would dd a 6 gig installation with a small swap and then run parted to resize for the appropriate drive. I created a script that will grep /proc/ide/hdc/geometry and determine what size drive it is so it could run the correct parted command.
Now we want to be able to do duplication in much bigger numbers and after lots of research I have decided on udpcast. Here is where my problem is. We tested a 5 machine duplication on a 10/100 switch seperated from our network with the 20 gig drives. It took around an hour. So we figure that that time will only double when we move to 40 gig and the double again for 80 gig.
What I would like to do is just transfer the 6gig install and then run parted like before to resize the partitions. I would also like it to use my drive sensing script so that no user intervention is required. I had made a special knoppix boot disk that would auto boot and run my parted scripts but that would require us to use more than one cd. My boss wants it to be really easy, so that the guys who build the system can just pop the cd in and walk away, come back in 30 minutes and everything is done. no commands or anything necessary.
I know this should be able to be done but honestly I have no idea how. What do you guys think?
On Monday 26 May 2003 18:36, Chris Locke wrote:
I am planning on using udpcast to do linux installs on the computer systems we manufacture. But I have a couple of questions.
We have machines that come with different sizes of hard drives. 20, 40 and 80 gigs. In the past we had a script we would run on a duplicating machine that would dd a 6 gig installation with a small swap and then run parted to resize for the appropriate drive. I created a script that will grep /proc/ide/hdc/geometry and determine what size drive it is so it could run the correct parted command.
Now we want to be able to do duplication in much bigger numbers and after lots of research I have decided on udpcast. Here is where my problem is. We tested a 5 machine duplication on a 10/100 switch seperated from our network with the 20 gig drives. It took around an hour. So we figure that that time will only double when we move to 40 gig and the double again for 80 gig.
Uncompressed transfer of 20 GBat 100 Mbps should be possible in half an hour. Of course, disk transfer speed may play a role too, depending on the age of the hardware. At one of our schools, limiting factors are definately the disks.
However, on my machine at home, my disks to 40 MB/s (that's mega-Bytes, not bit), i.e. 320 Mb/s . In such a situation, limiting factor would be network (100 Mbps minus overhead would be 90 Mbps). If you are in this kind of situation, use compression. The new version of udpcast integrates both lzop, which is a compressor optimized for speed and gzip, which is better for ratio. Compression ratio for lzop should be about 50% (better if there are lots of zero sectors on the disk). You can thus assume a transfer rate between 180 Mbps (data) to 360 Mbps (zero blocks: here the disk is again the limiting factor). Which would mean about a quarter of an hour for 20 GB under the more pessimistic hypothesis, and 9 minutes under the more optimistic one.
Also make sure that your switch isn't messing up stuff. Using a pure 100 Mbp/s switch might be give better performance.
What I would like to do is just transfer the 6gig install and then run parted like before to resize the partitions. I would also like it to use my drive sensing script so that no user intervention is required. I had made a special knoppix boot disk that would auto boot and run my parted scripts but that would require us to use more than one cd. My boss wants it to be really easy, so that the guys who build the system can just pop the cd in and walk away, come back in 30 minutes and everything is done. no commands or anything necessary.
I know this should be able to be done but honestly I have no idea how. What do you guys think?
If you use the CD, it's possible.
The standard udpcast system uses busybox, in order to be able to fit on a single floppy. Busybox is a "multi-call" binary, i.e. all commands (sh, mount, insmod, udpcast itself, the udpcast dialog) are all in one single binary, behaving differently depending on what it is called as (argv[0]).
However, on CD, there are no such space constraints, so you may put "normal" programs, along with their glibc onto the image.
I'd suggest you start out from the initrd on the CD. First uncompress it, and mount it, then copy it to a local directory.
mkdir /tmp/mnt
mount -o loop udpcd.img /tmp/mnt zcat /tmp/mnt/INITRD >/tmp/initrd.img umount /tmp/mnt
mount -o loop -t romfs /tmp/initrd.img cp -a /tmp/mnt /tmp/initrd umount /tmp/mnt
At this point you have a copy of the initrd directory in /tmp/initrd. Makeing the copy is necessary, because it's a ROMfs (for space reasons, too), and you would not be able to write on it directly.
Start with installing glibc and chroot inside:
cd /tmp/initrd rpm2cpio ~/glibc-version.i586.rpm | cpio -iv --make-directories cp /usr/sbin/chroot sbin
Then copy your own stuff inside.
Then chroot inside, and test whether your stuff executes (all needed libraries present?) chroot . /bin/sh [do your tests] exit
Once you have that, you need to hook it into udpcast.
For stuff that needs to be executed _before_ the dialog, put it into etc/init.d/rcS
For stuff that needs to be executed after the dialog, it becomes more complicated. Maybe the easyest is to replace udp-receiver with a small shell-script that first calls the real udpreceiver, and then your postprocessing:
#!/bin/sh
/real/udpreceiver "$@" [postprocessing]
N.B. the basename of the real udpreceiver must stay udpreceiver, or else busybox won't know which applet to call it.
Once you're done, make the romfs:
genromfs -d /tmp/initrd -f - -A 4096,/bin/busybox -A 4096,/bin/lzop | gzip -9 -c >/tmp/initrd.gz
Then make the iso image:
mkisofs -b ISOLINUX.BIN -no-emul-boot -boot-load-size 4 -boot-info-table \ -R -l -graft-points ISOLINUX.BIN ISOLINUX.CFG LINUX INITRD=initrd.gz \ -o udpcd-new.img
(the files ISOLINUX.BIN ISOLINUX.CFG LINUX are also on the CD)
Alain