diff options
author | Jeff Bailey <jbailey@ubuntu.com> | 2005-06-09 20:08:12 +0000 |
---|---|---|
committer | Jeff Bailey <jbailey@ubuntu.com> | 2005-06-09 20:08:12 +0000 |
commit | d49e80ad3723c35714bf44b21545090da62f558e (patch) | |
tree | 98ea2b8d69952ffbbf73083225e8e4353c195a46 /mkinitramfs | |
parent | ac222142f849ed340c3b7a0300a57cc3153e0436 (diff) | |
download | initramfs-tools-d49e80ad3723c35714bf44b21545090da62f558e.tar.gz initramfs-tools-d49e80ad3723c35714bf44b21545090da62f558e.zip |
Hookscripts, prunce extras
Diffstat (limited to 'mkinitramfs')
-rw-r--r-- | mkinitramfs | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/mkinitramfs b/mkinitramfs index 7b6af66..2134a2d 100644 --- a/mkinitramfs +++ b/mkinitramfs @@ -1,5 +1,27 @@ #!/bin/sh +# Takes a file containing a list of modules to be added as an argument +# Figures out dependancies and adds it in. +manual_add_modules() +{ + # Sanity check + if [ ! -e ${1} ]; then + return + fi + + for x in $(sed -e '/^#/d' ${1}); do + for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do + # Prune duplicates + if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then + continue + fi + + ln -s ${y} ${TMPDIR}/modules + echo $(basename ${y}) >>${TMPDIR}/conf/modules + done + done +} + usage() { cat >&2 << EOF @@ -51,6 +73,8 @@ if [ x${outfile} = x ] || [ ${#} -ne 1 ]; then usage fi +version=${1} + if [ -d ${outfile} ]; then echo "${outfile} is a directory" exit 1 @@ -65,16 +89,8 @@ TMPDIR=$(mktemp -d) || exit 1 mkdir -p ${TMPDIR}/modules ${TMPDIR}/conf ${TMPDIR}/etc mkdir -p ${TMPDIR}/bin ${TMPDIR}/lib ${TMPDIR}/scripts -for x in $(sed -e '/^#/d' ${CONFDIR}/modules); do - for y in $(modprobe --set-version=${version} --show-depends ${x} | awk '{ print $2 }'); do - # Prune duplicates - if [ -e ${TMPDIR}/modules/$(basename ${y}) ]; then - continue - fi - - ln -s ${y} ${TMPDIR}/modules - echo $(basename ${y}) >>${TMPDIR}/conf/modules - done +for x in ${CONFDIR}/modules /usr/share/initramfs-tools/modules.d/*; do + manual_add_modules ${x} done # Have to do each file, because cpio --dereference doesn't recurse down |