summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJeff Bailey <jbailey@ubuntu.com>2005-06-21 01:31:54 +0000
committerJeff Bailey <jbailey@ubuntu.com>2005-06-21 01:31:54 +0000
commitf12ad818ffc10d8243cd75d552226273df3d65a0 (patch)
tree6e66afdeba1cd1fdf76c5732b94ed06d74f0a4f9 /scripts
parent13d2d927fde9d9d79edebc9c9903929b522de44e (diff)
downloadinitramfs-tools-f12ad818ffc10d8243cd75d552226273df3d65a0.tar.gz
initramfs-tools-f12ad818ffc10d8243cd75d552226273df3d65a0.zip
* Default to currently running kernel version.
Based on a patch from maximilian attems, thanks! * Handle module arguments in /etc/mkinitramfs/modules * Do hookscripts at generation time. Drop things into /usr/share/initramfs-tools/hooks or /etc/mkinitramfs/hooks * Make sure local-bottom and nfs-bottom get created Thanks to Karl Hegbloom for these three patches! * Prune stray echo from call_scripts * Load raid1 for now so that md setups will work. * Detect ide modules load Thanks to Jeff Waugh for initial testing of this!
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions49
-rw-r--r--scripts/local2
-rw-r--r--scripts/local-top/md3
-rw-r--r--scripts/nfs1
4 files changed, 45 insertions, 10 deletions
diff --git a/scripts/functions b/scripts/functions
index 73b773a..5fb8c04 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1,3 +1,5 @@
+# -*- shell-script -*-
+
panic()
{
echo $@
@@ -92,7 +94,6 @@ reduce_prereqs()
call_scripts()
{
- echo ${runlist}
for cs_x in ${runlist}; do
${initdir}/${cs_x}
done
@@ -106,9 +107,44 @@ run_scripts()
call_scripts
}
+ide_boot_events() {
+ [ "$(echo /proc/ide/*/media)" = "/proc/ide/*/media" ] && return
+
+ for drive in /proc/ide/*/media; do
+ # nothing to do if the device has already been took in charge
+ unit=${drive#/proc/ide/}; unit=${unit%/media}
+ [ -d /sys/block/$unit ] && continue
+
+ read media < $drive
+ case "$media" in
+ disk) MODULE=ide-disk ;;
+ cdrom) MODULE=ide-cd ;;
+ tape) MODULE=ide-tape ;;
+ floppy) MODULE=ide-floppy ;;
+ *) MODULE=ide-generic ;;
+ esac
+
+ modprobe -q ${MODULE}
+ done
+}
+
load_modules()
{
- depmod
+ depmod -a
+
+ # Load custom modules first
+ if [ -e /conf/modules ]; then
+ cat /conf/modules | while read m; do
+ if [ -z "$m" ] \
+ || expr "$m" : "#" >/dev/null \
+ || expr "$m" : "[ \t]+#?" > /dev/null
+ then
+ continue;
+ else
+ modprobe -v $m
+ fi
+ done
+ fi
for x in /sys/bus/pci/devices/*; do
if [ -e ${x}/modalias ]; then
@@ -125,11 +161,6 @@ load_modules()
fi
done
- # Load the modules
- # FIXME - do module options here
- if [ -e /conf/modules ]; then
- for x in $(cat /conf/modules); do
- modprobe -v $x
- done
- fi
+ ide_boot_events
+
}
diff --git a/scripts/local b/scripts/local
index 99eea77..4a17abb 100644
--- a/scripts/local
+++ b/scripts/local
@@ -1,4 +1,4 @@
-# Local filesystem mounting
+# Local filesystem mounting -*- shell-script -*-
# Parameter: Where to mount the filesystem
mountroot ()
diff --git a/scripts/local-top/md b/scripts/local-top/md
index 864ffe4..062852f 100644
--- a/scripts/local-top/md
+++ b/scripts/local-top/md
@@ -15,4 +15,7 @@ prereqs)
;;
esac
+# FIXME detect this!
+modprobe raid1
+
/sbin/mdrun /dev
diff --git a/scripts/nfs b/scripts/nfs
index 11c61f8..1e2be2c 100644
--- a/scripts/nfs
+++ b/scripts/nfs
@@ -1,3 +1,4 @@
+# NFS filesystem mounting *- shell-script -*-
# Paramter: Where the root should be mounted
mountroot ()