[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian installer for Linuxcare rescue CD



Adam Di Carlo writes:

> Seth David Schoen <schoen@loyalty.org> writes:
> 
> > Joey is right: we already have a working live bootable filesystem, which
> > is the main purpose of our CD (for use as a rescue system).  That's not a
> > Debian system, although we did use some things from Debian.  However, we
> > wanted to add as a new feature the ability to install, from the CD, a
> > regular Debian base system onto a hard drive.
> 
> Oh -- ok.  Well, I suggest that you merge these.  You could make a
> little bootable live system which could just replicate itself onto
> your drive (then you run lilo or whatever to add an MBR).  Such a
> system could be considered as "base plus" -- that is, the base system
> plus whatever arbitrary stuff you wanted to add.

This is a possibility, but the current system isn't Debian, it's a hodgepodge
of random useful and important stuff.  I would _never_ want the (useful) mess
that is the Bootable Business Card's /bin directory installed on any hard
drive. :-)

We have a repeating suggestion to try to base future versions off of an
appropriately chosen subset of Debian, which we are thinking of.  The
current version is specifically a rescue disk, though, rather than a normal
system.

> > The main thing that would be different on the floppies would be an unusual
> > version of init (which has to locate and mount the CD-ROM).  El Torito
> > doesn't tell you the device name of the CD-ROM drive. :-(
> 
> That's interesting.  Can you show us your code you use for this?

Sure.  It's not very different from the corresponding code in other
distributions, nor very exciting.

It begins with

for drive in `echo /dev/hd? /dev/scd? /dev/sd?`
do
   echo "Attempting to mount $drive as cdrom"
   if ! mount -r -t iso9660 $drive /mnt/tmp 2>/dev/null
   then continue
   elif [ -e /mnt/tmp/singularity ]
   then
       echo "Found the LNX CD-ROM on $drive, mounting under /mnt/cdrom-real"
       umount /mnt/tmp
       mount -r -t iso9660 $drive /mnt/cdrom-real 2>/dev/null

and you can see the whole thing on our FTP site soon, or I can send it to
you.  (I've left out a bunch of code which is specific to our system.)  The
concept is very simple, though: try every single block device which could
be a bootable CD-ROM, and see whether you can mount it and then see some
tell-tale file which indicates that it is your CD-ROM.

The code above is an excerpt from our init script, which is mostly by Tom
"inf" Crimi.

I would be pretty surprised if all major distributions that do a CD-ROM
install didn't have some version or other of that, perhaps checking some
of the more exotic CD-ROM drive types, too.

> 'init' on the boot-floppies is provided by busybox.  We might be
> interested in "borrowing" this feature.  The benefit is just that the
> CD boot device name is passed thru to init, correct, which then passes
> it down to something in /etc/init.d/rcS or whatever that cares about
> that and takes action, right?

We have init figuring this out for itself.  Since we have initrd, we have
to figure out how to get at useful filesystems from within PID 1.

> Thanks for your answers to my general questions...

No problem.

-- 
Seth David Schoen <schoen@loyalty.org>  | And do not say, I will study when I
     http://www.loyalty.org/~schoen/    | have leisure; for perhaps you will
     http://www.loyalty.org/   (CAF)    | not have leisure.  -- Pirke Avot 2:5


Reply to: