summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog15
-rw-r--r--init10
-rw-r--r--mkinitramfs25
-rw-r--r--scripts/functions20
-rw-r--r--scripts/local2
5 files changed, 61 insertions, 11 deletions
diff --git a/debian/changelog b/debian/changelog
index 88abe0c..5cd9969 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,22 @@
-initramfs-tools (0.9) breezy; urgency=low
+initramfs-tools (0.10) breezy; urgency=low
* Unconditionally require busybox. Might revert this eventually
but it's too much of a pain right now do this without
- a reasonably environment.
+ a reasonably environment
+
+ * Use modprobe to load modules
+
+ * Iterate through /sys/bus/pci and /sys/bus/usb and load drivers
+ based on their modalias
-- Jeff Bailey <jbailey@ubuntu.com> Thu, 16 Jun 2005 02:23:50 +0000
+initramfs-tools (0.9) breezy; urgency=low
+
+ * Be consistent about y/n vs. yes/no values for the readonly variable
+
+ -- Matt Zimmerman <mdz@ubuntu.com> Thu, 16 Jun 2005 15:22:30 -0700
+
initramfs-tools (0.8) breezy; urgency=low
The "We are one in the spirit..." release
diff --git a/init b/init
index 73981a5..52e10bd 100644
--- a/init
+++ b/init
@@ -30,10 +30,10 @@ for x in $(cat /proc/cmdline); do
BOOT=${x#boot=}
;;
ro)
- readonly=yes
+ readonly=y
;;
rw)
- readonly=no
+ readonly=n
;;
break)
break=yes
@@ -45,11 +45,7 @@ run_scripts /scripts/init-top
. /scripts/${BOOT}
-# Load the modules
-# FIXME - do module options here
-for x in $(cat /conf/modules); do
- modprobe $x
-done
+load_modules
# Populate /dev tree
udevstart
diff --git a/mkinitramfs b/mkinitramfs
index bfb0007..c3e98a3 100644
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -19,7 +19,24 @@ manual_add_modules()
mkdir -p ${TMPDIR}/$(dirname ${y})
ln -s ${y} ${TMPDIR}/$(dirname ${y})
depmod -b ${TMPDIR} ${version}
- echo $(basename ${y}) >>${TMPDIR}/conf/modules
+ echo $(basename ${y} .ko) >>${TMPDIR}/conf/modules
+ done
+ done
+}
+
+# Modules that we always add to the initramfs
+auto_add_modules()
+{
+ for x in ext3 ext2 raid1 md sd_mod sata_svw usbhid ohci_hcd ehci_hcd; do
+ for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do
+ # Prune duplicates
+ if [ -e ${TMPDIR}/${y} ]; then
+ continue
+ fi
+
+ mkdir -p ${TMPDIR}/$(dirname ${y})
+ ln -s ${y} ${TMPDIR}/$(dirname ${y})
+ depmod -b ${TMPDIR} ${version}
done
done
}
@@ -90,11 +107,14 @@ fi
TMPDIR=$(mktemp -d) || exit 1
mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc
mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts
+mkdir -p ${TMPDIR}/sbin
for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do
manual_add_modules ${x}
done
+auto_add_modules
+
# Have to do each file, because cpio --dereference doesn't recurse down
# symlinks.
@@ -119,7 +139,8 @@ ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/sh
ln -s /usr/lib/initramfs-tools/bin/busybox ${TMPDIR}/bin/busybox
# Modutils
-ln -s /sbin/modprobe ${TMPDIR}/bin
+ln -s /sbin/modprobe ${TMPDIR}/sbin
+ln -s /sbin/rmmod ${TMPDIR}/bin
# Raid
ln -s /sbin/mdadm ${TMPDIR}/bin
diff --git a/scripts/functions b/scripts/functions
index 717418f..7e8c725 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -105,3 +105,23 @@ run_scripts()
reduce_prereqs
call_scripts
}
+
+load_modules()
+{
+ for x in /sys/bus/pci/devices/*; do
+ modprobe -q $(cat ${x}/modalias)
+ done
+
+ # Give the USB bus a moment to catch up
+ sleep 2
+
+ for x in /sys/bus/usb/devices/*; do
+ modprobe -q $(cat ${x}/modalias)
+ done
+
+ # Load the modules
+ # FIXME - do module options here
+ for x in $(cat /conf/modules); do
+ modprobe -v $x
+ done
+}
diff --git a/scripts/local b/scripts/local
index cf9e331..99eea77 100644
--- a/scripts/local
+++ b/scripts/local
@@ -20,6 +20,8 @@ mountroot ()
roflag=-w
fi
+ modprobe ${FSTYPE}
+
# Mount root
mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt}