Re: Running debian-installer from the command line?

2006-05-15 Thread Joachim Durchholz

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/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


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Running debian-installer from the command line?

2006-05-15 Thread Jens Seidel
Hi Joachim,

I also failed already using debian-installer from command line (on a
Mipsel SUPERTOLL (German for "super great", sic!) system).
I haven't tested it recently in detail but I think a few of your
steps/assumptions are wrong.

On Sun, May 14, 2006 at 11:44:07PM +0200, Joachim Durchholz wrote:
> Um... telinit alone might not work, and there's some setup work 
> involved. Let me spell out the steps:
> 
> 1. Base system has / on a RAM disk

You need to extract the initial RAM disk and chroot into it before
to have it available as /.

> 2. Partition and format the HDD as needed

You can do this step already before 1 using you fully supported (outer) system.

> 3. Mount the future root partition on (say) /mnt/root
> 4. Download the ISO into / (or to /mnt/root if it won't fit into the
>RAM disk)

A mount --bind should also work to make a subdirectory available in the RAM 
disk.

> 5. mkdir /mnt/iso, loop-mount the ISO to /mnt/iso
> 6. cp -a /mnt/iso /mnt/root

No need to copy if /mnt/root contains the ISO image. Just mount it below
/mnt/root/mnt/iso.

> 7. Shutdown most daemons. Particularly those that service any IP ports.
>(Other services, too?)

Why do you want to stop daemons, which one? Most probably you refer to
the daemons in your outer system (in which you called chroot), so you
have to exit the chroot first.

> 8. chroot /mnt/iso /bin/bash --login

??
A ISO image does not carry a valid system!
You should chroot into the directory which contains the initial RAM disk
instead.

> 9. telinit -Q

??
Why is this necessary?

Jens


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Running debian-installer from the command line?

2006-05-15 Thread Joachim Durchholz

Geert Stappers schrieb:

On Fri, May 12, 2006 at 02:54:07PM +0200, Joachim Durchholz wrote:
So... what I'm really after is a way to skip all the boot machinery in 
debian-installer. It should still do everything else (hardware 
detection, partitioning, base configuration, package installation, and 
whatever else I forgot to mention).


Have you tried to unpack the d-i image in / of the running system,
and doing a `telinit -Q` ?


Just a few questions and a progress notice:

1) What's the best place to pick the Debian installer images up from? I 
downloaded the businesscard ISO image, on the grounds that I'm heading 
for Sarge and want to stick with what's available for Sarge, but I may 
be wrong with that reasoning.


2) telinit -Q isn't exactly the right way to start things. Or, at least 
it won't do what you'd expect: there's an /sbin/init in the initrd all 
right, but it's not a SysV init, it's just a busybox shell wrapper that 
moves things into the right directories before calling "busybox init" 
(which I presume is the "right" init that will go through /etc/inittab).
I have been toying around with various approaches, but no luck yet - 
simply running /sbin/init directly failed at the point when it tried to 
mount /dev (I had though that devfs is dead in 2.6??? ... at least it's 
not compiled/loaded into the 2.6 kernel that the netboot system is 
using, grr... um, maybe I accidentally unpacked the 2.4 stuff.)


3) kexec isn't in the netboot kernel I'm stuck with, too, so I may have 
to live with slight mismatches between installer and kernel... I just 
hope that Debian installer doesn't depend too much on kernel-specific 
facilities. (But it seems to be needing devfs, so I have may been too 
optimistic here...)


4) I'll be trying a few approaches to get the initrd image into the 
current root, and have the various critical directories (dev, sys, proc) 
populated correctly. There are far too many options and combinations to 
try, so this may take me a while.


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

Regards,
Jo


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Running debian-installer from the command line?

2006-05-14 Thread Joachim Durchholz

Geert Stappers schrieb:

On Fri, May 12, 2006 at 02:54:07PM +0200, Joachim Durchholz wrote:
So... what I'm really after is a way to skip all the boot machinery in 
debian-installer. It should still do everything else (hardware 
detection, partitioning, base configuration, package installation, and 
whatever else I forgot to mention).


Have you tried to unpack the d-i image in / of the running system,
and doing a `telinit -Q` ?


No, I didn't know anything about the way that an installation system boots.
But it does sound like a viable approach. It didn't occur to me that 
installers might use the same startup machinery as a normal system 
(silly me...)


Um... telinit alone might not work, and there's some setup work 
involved. Let me spell out the steps:


1. Base system has / on a RAM disk
2. Partition and format the HDD as needed
3. Mount the future root partition on (say) /mnt/root
4. Download the ISO into / (or to /mnt/root if it won't fit into the
   RAM disk)
5. mkdir /mnt/iso, loop-mount the ISO to /mnt/iso
6. cp -a /mnt/iso /mnt/root
7. Shutdown most daemons. Particularly those that service any IP ports.
   (Other services, too?)
8. chroot /mnt/iso /bin/bash --login
9. telinit -Q

Did I leave anything essential out? Caveats? Pitfalls?

It's a bit late for me right now. I'll try this tomorrow, with any 
advice that I might receive integrated.


Regards,
Jo


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Running debian-installer from the command line?

2006-05-13 Thread Geert Stappers
On Fri, May 12, 2006 at 02:54:07PM +0200, Joachim Durchholz wrote:
> 
> So... what I'm really after is a way to skip all the boot machinery in 
> debian-installer. It should still do everything else (hardware 
> detection, partitioning, base configuration, package installation, and 
> whatever else I forgot to mention).


Have you tried to unpack the d-i image in / of the running system,
and doing a `telinit -Q` ?


Cheers
Geert Stappers
-- 
Stupidity: Just remove the labels and let solve the problem itself.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Running debian-installer from the command line?

2006-05-12 Thread Joachim Durchholz

Wouter Verhelst schrieb:

On Fri, May 12, 2006 at 10:01:31AM +0200, Joachim Durchholz wrote:

In that case, what you need is not debian-installer; rather, you'll be
wanting debootstrap, which allows you to install the required packages
to get the base system on a partition.

>

Note that debootstrap does not take care of installing ssh, a
bootloader, or anything else; that you have to do for yourself.


Right. Been there, done that, not much luck.

As I wrote, debootstrap won't cut it.
a) (Slight disadvantage) It doesn't have a way to preseed things as in 
debian-installer. (Well, I could tinker with the package list, and have 
done so already... but it's still *very* manual.)
b) (Huge problem) When installing manually, I regularly screw up grub 
installation. Might be due to some misunderstanding on my part, or due 
to flaky hardware, or any other conceivable cause. debian-installer will 
run grub for me and (hopefully) Get It Right (TM).


Reason (a) wouldn't deter me, but reason (b) does.

So... what I'm really after is a way to skip all the boot machinery in 
debian-installer. It should still do everything else (hardware 
detection, partitioning, base configuration, package installation, and 
whatever else I forgot to mention).


Regards,
Jo


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Running debian-installer from the command line?

2006-05-12 Thread Wouter Verhelst
On Fri, May 12, 2006 at 10:01:31AM +0200, Joachim Durchholz wrote:
> Hi all,
> 
> I've been scanning all available resources and not found anything, so 
> I'm turning here for help.
> 
> I'd like to run the Debian installer from a command line.
> The machine was booted from the network and is running Linux (not 
> necessarily Debian) from a RAM disk, so there's no need for UML, chroot, 
> or other ways of sandboxing the install.
> However, the only way to access the machine is through SSH. No attached 
> console, no serial console. In other words, approaches that reboot the 
> machine to make the installer start won't work for me.

In that case, what you need is not debian-installer; rather, you'll be
wanting debootstrap, which allows you to install the required packages
to get the base system on a partition.

Note that debootstrap does not take care of installing ssh, a
bootloader, or anything else; that you have to do for yourself.

-- 
Fun will now commence
  -- Seven Of Nine, "Ashes to Ashes", stardate 53679.4


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]