Jim Penny <[EMAIL PROTECTED]> wrote:

> These are:
> 1) how do I boot from a non-IDE root disk?

You don't need to do anything special unless mkinitrd doesn't recognise
your root device.

> 2)  How do I control what goes into initrd in a more reasonable
> way than nothing/most/all.  (and what does most do, anyway?).

Quoting the man page:

        Setting  it  to  most  will  cause  mkinitrd(8)  to
        exclude modules which are considered unlikely to be
        necessary in the process of bringing up a root file
        system.

Turn probe off and write one or more scripts in /etc/mkinitrd/scripts if you
want to control the image exactly.

For example, this is how I boot off LVM (which will be in the package
proper once it is stable):

----------------------------------------
# /etc/mkinitrd/mkinitrd.conf:
#  Configuration file for mkinitrd(8).  See mkinitrd.conf(5).
#
# This file is meant to be parsed as a shell script.

# What modules to install.
MODULES=none

# The length (in seconds) of the startup delay during which linuxrc may be
# interrupted.
DELAY=5

# If this is set to probe mkinitrd will try to figure out what's needed to
# mount the root file system.  This is equivalent to the old PROBE=on setting.
ROOT=

# This controls the permission of the resulting initrd image.
UMASK=022

# Turn this on to see the messages from mkcramfs.
VERBOSE=off

----------------------------------------
# /etc/mkinitrd/modules: Kernel modules to load for initrd.
#
# This file should contain the names of kernel modules and their arguments
# (if any) that are needed to mount the root file system, one per line.
# Comments begin with a `#', and everything on the line after them are ignored.
#
# Examples:
#
#  ext2
#  wd io=0x300
ext2
lvm-mod
ide-probe-mod
ide-disk

--------------------/etc/mkinitrd/scripts/lvm--------------------
#!/bin/sh

cd $INITRDDIR

{
        echo /dev/lvm
        echo /dev/legolas/group
        echo /dev/legolas/root0
        echo /etc/lvmconf/legolas.conf
        echo /etc/lvmtab.d/legolas
        echo /etc/lvmtab
        echo $MODULEDIR/kernel/drivers/ide/ide-probe-mod.o
        echo $MODULEDIR/kernel/drivers/ide/ide-mod.o
        echo $MODULEDIR/kernel/drivers/ide/ide-disk.o
        echo $MODULEDIR/kernel/drivers/md/lvm-mod.o
        echo $MODULEDIR/kernel/fs/ext2/ext2.o
        echo /usr/lib/liblvm.so
        for i in \
                /bin/mount /bin/umount /sbin/vgscan /sbin/vgchange \
                /sbin/pivot_root
        do
                echo $i
                ldd $i | sed 's/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/'
        done
} | sort -u | cpio -pLd --quiet .

mkdir mnt proc devfs
ln -s ../devfs/ide dev/ide

cat > scripts/lvm.sh <<- EOF
        mount -nt devfs devfs /devfs
        mount -nt proc proc /proc
        mount -nt tmpfs tmpfs /etc
        vgscan
        vgchange -a y
        vgchange -a n
        vgchange -a y
        umount -n /etc
        echo 256 > /proc/sys/kernel/real-root-dev
        umount -n /proc
        umount -n /devfs
        mount -nrt ext2 /dev/legolas/root0 /mnt
        cd /mnt
        pivot_root . initrd
EOF
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Reply via email to