diff options
author | Jeff Bailey <jbailey@ubuntu.com> | 2005-06-17 12:17:42 +0000 |
---|---|---|
committer | Jeff Bailey <jbailey@ubuntu.com> | 2005-06-17 12:17:42 +0000 |
commit | bf8d6100fb13127151c309d842185b3a250ecfff (patch) | |
tree | f43c7051e0bc5faafd246b0f647fc651a873d454 /mkinitramfs | |
parent | 9c603dd111d019e87d0135459d3b15c996565e14 (diff) | |
download | initramfs-tools-bf8d6100fb13127151c309d842185b3a250ecfff.tar.gz initramfs-tools-bf8d6100fb13127151c309d842185b3a250ecfff.zip |
Integrate Matt Zimmerman's changes to initramfs
Diffstat (limited to 'mkinitramfs')
-rw-r--r-- | mkinitramfs | 25 |
1 files changed, 23 insertions, 2 deletions
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 |