I thought pendrivelinux did boot from a USB stick (and you can't boot from USB)?
Going back to your idea of booting from a Live CD and starting an installer, you can play around with the iso image on a Linux machine.
1. mount the iso:
mount mydistro.iso /mnt -o loop
2. find out what 'initrd' is booted at install time - for example, I go to /mnt/isolinux and find a file 'isolinux.cfg' which has lines like this:
kernel /install/2.6/vmlinuz
append DEBCONF_PRIORITY=low vga=normal initrd=/install/2.6/initrd.gz ...
3. unpack the initrd - in this case it ends in .gz so I assume it is a genuine initrd and not a cpio archive:
cp ../install/2.6/initrd.gz ~/.
cd
gunzip initrd.gz
mkdir tmp
mount initrd tmp -o loop
4. See what steps are taken after the initrd is mounted. It's pretty safe to bet that sbin/init is a bash script rather than an executable binary:
less tmp/sbin/init
And sure enough it is ... but I just peeked at that file and it really didn't do much other than invoke 'busybox' as 'init'. So ... when busybox acts as 'init' it must look at etc/inittab:
# /etc/inittab
# busybox init configuration for debian-installer
# main rc script
::sysinit:/sbin/debian-installer-startup
# main setup program
::respawn:/sbin/debian-installer
# convenience shell
vc/2::askfirst:/bin/sh
# logging
vc/3::respawn:/usr/bin/tail -f /var/log/messages
vc/4::respawn:/usr/bin/tail -f /var/log/syslog
# Stuff to do before rebooting
::ctrlaltdel:/sbin/shutdown > /dev/null 2>&1
OK - so there are all the dirty secrets. What now?
Well, you need to go through most of those motions after booting the Live CD -
unpack the initrd somewhere, mount it, 'chroot' to it, then invoke the installer script(s).
Nice and simple, eh?
