summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-05-02 06:36:19 +0200
committerAaron Griffin <aaron@archlinux.org>2006-05-02 06:36:19 +0200
commitdbfcaacf40ca356d7623408b4bfca828f8bd880d (patch)
tree9b104bd4188134bda0b52f0a40dde7537a531c72
parent3a764f2b15c44b17d098629de5eacdd164b5ddc7 (diff)
downloadmkinitcpio-dbfcaacf40ca356d7623408b4bfca828f8bd880d.tar.gz
mkinitcpio-dbfcaacf40ca356d7623408b4bfca828f8bd880d.tar.xz
Misc changes to module detection - tpowa
Config file comments mdassemble in raid hook + additional raid help git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@40 880c04e9-e011-0410-abf7-b926e227c9cd
-rw-r--r--hooks/filesystems2
-rw-r--r--hooks/raid6
-rw-r--r--hooks/usb2
-rw-r--r--init4
-rw-r--r--install/filesystems2
-rw-r--r--install/ide6
-rw-r--r--install/raid16
-rw-r--r--install/sata5
-rw-r--r--install/scsi4
-rw-r--r--install/usb3
-rw-r--r--mkinitcpio.conf54
11 files changed, 78 insertions, 26 deletions
diff --git a/hooks/filesystems b/hooks/filesystems
index c676832..0990b4c 100644
--- a/hooks/filesystems
+++ b/hooks/filesystems
@@ -9,7 +9,7 @@ run_hook ()
msg "Attempting to create root device '${root}'"
dev_t=$( /bin/parseblock "${root}" )
if [ "x${dev_t}" != "x" ]; then
- /bin/mknod "${root}" b ${dev_t}
+ /bin/mknod "${root}" b ${dev_t} >/dev/null 2>&1
eval $( /bin/fstype < "${root}" )
else
FSTYPE="unknown"
diff --git a/hooks/raid b/hooks/raid
index d83e2ae..5cf4b2f 100644
--- a/hooks/raid
+++ b/hooks/raid
@@ -1,7 +1,7 @@
# vim: set ft=sh:
-# kinit handles md/raid assembly we just need modules
run_hook ()
{
- #TODO
- /bin/modprobe -aq raid0 raid1 raid2 raid5 raid6
+ #TODO scan for these somehow...
+ /bin/modprobe -aq raid0 raid1 raid2 raid5 raid6 >/dev/null 2>&1
+ /bin/mdassemble ${md} ${raid}
}
diff --git a/hooks/usb b/hooks/usb
index 5766ef9..89af004 100644
--- a/hooks/usb
+++ b/hooks/usb
@@ -3,5 +3,7 @@ run_hook ()
{
msg -n "Loading usb modules..."
/bin/modprobe -aq $(/bin/cat /sys/bus/usb/devices/*/modalias) >/dev/null 2>&1
+ #allow 'usbdelay' on the kernel param line
+ /bin/sleep ${usbdelay:-5}
msg "done."
}
diff --git a/init b/init
index b0eed45..d7bcb32 100644
--- a/init
+++ b/init
@@ -3,7 +3,7 @@
msg () { [ "${quiet}" != "y" ] && echo $@; }
err () { echo "ERROR: $@"; }
-msg ":: Begin Initramfs"
+msg ":: Loading Initramfs"
/bin/mount -t sysfs none /sys
/bin/mount -t proc none /proc
@@ -64,5 +64,5 @@ if [ "${break}" = "y" ]; then
fi
# Optimize fs type loop for mounting rootfs
-msg ":: End Initramfs - control passing to kinit"
+msg ":: Initramfs Completed - control passing to kinit"
exec /bin/kinit rootfstype=${FSTYPE} $CMDLINE < /dev/console > /dev/console
diff --git a/install/filesystems b/install/filesystems
index c012d1b..1da1f13 100644
--- a/install/filesystems
+++ b/install/filesystems
@@ -2,7 +2,7 @@
install ()
{
- MODULES=" $(all_modules '/kernel/fs') "
+ MODULES=" $(all_modules '/kernel/fs' | grep -v "nls") "
BINARIES=""
FILES=""
SCRIPT="filesystems"
diff --git a/install/ide b/install/ide
index cd9625a..bbd1ef5 100644
--- a/install/ide
+++ b/install/ide
@@ -2,11 +2,7 @@
install ()
{
- MODULES=""
- for m in $(all_modules "/ide/");
- do
- MODULES="$MODULES $(basename $m)"
- done
+ MODULES=" $(all_modules "/ide/" | grep -v "legacy") ";
BINARIES=""
FILES=""
SCRIPT="ide"
diff --git a/install/raid b/install/raid
index 6f3c90a..84339c5 100644
--- a/install/raid
+++ b/install/raid
@@ -6,12 +6,24 @@ install ()
BINARIES=""
FILES=""
SCRIPT="raid"
+ add_file "/usr/lib/klibc/bin/mdassemble" "/bin/mdassemble"
}
help ()
{
cat<<HELPEOF
- This hook loads the necessary modules for an raid root device.
- Detection will take place at runtime.
+ This hook loads the necessary modules for an raid root device,
+ and assemble the raid device when run.
+
+ Supported Kernel Parameters:
+ * raid=noautodetect : This setting is only effective if set to
+ noautodetect. When set to noautodetect, the md= parameter is used.
+ * md= ::: TODO ::: md=0,/dev/sda3,/dev/sda4
+
+ Important Note: kinit handles raid assembly by itself. If you
+ do not need to run any additional hooks on the assembled array
+ (i.e. LVM, encrypted root, etc), it is recommended that you
+ let kinit handle the assembly. You will still need to load
+ the proper raid* modules via the MODULES setting.
HELPEOF
}
diff --git a/install/sata b/install/sata
index 3c33376..708e3ff 100644
--- a/install/sata
+++ b/install/sata
@@ -2,10 +2,7 @@
install ()
{
- MODULES=" $(all_modules "scsi/.*ata") "
- for m in $MODULES; do
- [ "$m" == "ata_piix" ] && MODULES="$MODULES piix"
- done
+ MODULES=" $(all_modules "scsi/.*ata") sx8 ahci pdc_adma sd_mod sr_mod piix"
BINARIES=""
FILES=""
SCRIPT="sata"
diff --git a/install/scsi b/install/scsi
index 3e6fa2f..6e822c1 100644
--- a/install/scsi
+++ b/install/scsi
@@ -2,8 +2,8 @@
install ()
{
- MODULES=" $(all_modules "/scsi/" | grep -v "ata")
- $(all_modules "/block/")
+ MODULES=" $(all_modules "/scsi/" | grep -ve "imm" -e "pdc_adma" -e "ahci" -e "ata" -e "pcmcia" -e "ide")
+ $(all_modules "/block/" | grep -v "sx8")
$(all_modules "/fusion/")"
BINARIES=""
FILES=""
diff --git a/install/usb b/install/usb
index b7d1de8..4d53e8f 100644
--- a/install/usb
+++ b/install/usb
@@ -2,7 +2,8 @@
install ()
{
- MODULES=" $(all_modules "/usb/") usb_storage usbhid"
+ MODULES=" $(all_modules "/usb/" | grep -ve "_cs" -e "sl1811-hcd" -e "isp116x-hcd")
+ usb_storage usbhid sd_mod sr_mod "
BINARIES=""
FILES=""
SCRIPT="usb"
diff --git a/mkinitcpio.conf b/mkinitcpio.conf
index d248a6c..65b2ffa 100644
--- a/mkinitcpio.conf
+++ b/mkinitcpio.conf
@@ -1,8 +1,52 @@
# vim:set ft=sh
-#MODULES="piix ide_disk reiserfs"
-BINARIES="fbxine"
+
+# MODULES
+# The following modules are loaded before any boot hooks are
+# run. Advanced users may wish to specify all system modules
+# in this array. For instance:
+# MODULES="piix ide_disk reiserfs"
+MODULES=""
+
+# BINARIES
+# This setting includes, into the CPIO image, and additional
+# binaries a given user may wish. This is run first, so may
+# be used to override the actual binaries used in a given hook.
+# (Existing files are NOT overwritten is already added)
+# BINARIES are dependancy parsed, so you may safely ignore libraries
+BINARIES=""
+
+# FILES
+# This setting is similar to BINARIES above, however, files are added
+# as-is and are not parsed in anyway. This is useful for config files.
+# Some users may wish to include modprobe.conf for custom module options,
+# like so:
+# FILES="/etc/modprobe.conf"
FILES=""
-HOOKS="base autodetect"
-# raid dm ide"
-#HOOKS="base"
+# HOOKS
+# This is the most important setting in this file. The HOOKS control the
+# modules and scripts added to the image, and what happens at boot time.
+# Order is important, and it is recommended that you do not change the
+# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
+# help on a given hook.
+# 'base' is _required_ unless you know precisely what you are doing.
+# Examples:
+# This setup specifies all modules in the MODULES setting above.
+# No raid, lvm, or encrypted root is needed.
+# HOOKS="base"
+#
+# This setup will autodetect all modules for your system and should
+# work as a sane default
+# HOOKS="base ide scsi sata usb filesystems autodetect"
+#
+# This setup will generate a 'full' image which supports most systems.
+# No autodetection is done.
+# HOOKS="base ide scsi sata usb filesystems"
+#
+# This setup assembles an ide raid array with an encrypted root FS.
+# Note: See 'mkinitcpio -H raid' for more information on raid devices.
+# HOOKS="base ide raid encrypt"
+#
+# This setup loads an LVM volume group on a usb device.
+# HOOKS="base usb lvm"
+HOOKS="base ide scsi sata usb filesystems autodetect"