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

Re: Running debian-installer from the command line?



Joachim Durchholz schrieb:
5) I'll be back as soon as I have more results :-)

Hoo-key. After rummaging around in the /sbin/init script, I found that its main purpose was to set up a few directories, making sure that the root directory is a freshly installed RAM disk with the contents of the initrd image, and running the command "/bin/busybox init".

Since my netboot system is already running in an initrd image, I can get away by setting everything up in /initrd, then chrooting. Here's how I did it:

-- snip --

# Setup up a growable RAM disk on /tmp
# (the netboot system I'm using has a too-small fixed-size one)
mount -t ramfs nofs /tmp

# Download and mount businesscard ISO image from debian.org
cd /tmp
wget http://cdimage.debian.org/debian-cd/3.1_r2/i386/iso-cd/debian-31r2-i386-businesscard.iso
mount -o loop /tmp/debian-31r2-i386-businesscard.iso /cdrom

# Extract and mount 2.6 initrd from mounted ISO image
gunzip -c /cdrom/install/2.6/initrd.gz >/tmp/initrd
mount -o loop /tmp/initrd /initrd

# Things are almost correct now,
# we just need to map /proc and /dev over to /initrd:
mount --rbind /proc /initrd/proc
mount --rbind /dev /initrd/dev

# Run "busybox init"
cd /initrd
/usr/sbin/chroot . /bin/busybox init </proc/self/fd/0 >/proc/self/fd/1 2>/proc/self/fd/2

-- snip --

Everything worked fine, except that this darn "/bin/busybox init" command refused to run. When called from a chroot command, it would say

-- snip --
BusyBox v1.00-pre10 (Debian 20040623-1) multi-call binary

Usage: init
-- snip --

and terminate. (I'm not aware of any usage errors - actually there isn't much room for that, so this message had me "Huh??".)

----------

An alternate approach would be running the various scripts directly. If I interpret the /etc/inittab file in the initrd correctly, it's running first debian-installer-startup, then debian-installer. These scripts run the files in
  /lib/debian-installer-install.d
  /etc/rcS.d (which happens to be empty)
  /lib/debian-installer.d

I tried that, but ran into lots of error messages.

Actually most of these errors seem harmless - I don't really care if the frame buffer can't be properly set up when I'm going through SSH :-) However, there's no indication which of the scripts are there to help the installer, and which are preparing things for the new system. It's all a large monolithic blob, and I'd have to spend a *lot* of time finding out what's relevant for me and what isn't.

----------

Conclusion: It would be nice to use Debian installer, but it's too difficult to separate the relevant from the irrelevant parts. I think more work on the Debian installer for this case is needed. I'd suggest setting up a debian-installer-linux command and associated script directory, which would carry just those scripts that are relevant for the install-Debian-from-a-running-Linux case.

This seems like a workable path to me. Unfortunately, it's somewhat beyond my Debian-installer expertise and way beyond my time budget.

Which means I'm giving up.
I hope this all did/does help somebody even though it's a negative result...

Regards,
Jo



Reply to: