]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions.sh: only wait for the last pid spawned
authorHarald Hoyer <harald@redhat.com>
Fri, 19 Jul 2013 07:34:04 +0000 (09:34 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 19 Jul 2013 07:34:04 +0000 (09:34 +0200)
dracut-functions.sh

index 561edb3cf17ae276347bcb331dbb82c3bb4935f4..2676b45aa73158ee46ae66ee5705d92e161ab379 100755 (executable)
@@ -1455,6 +1455,7 @@ for_each_kmod_dep() {
 
 dracut_kernel_post() {
     local _moddirname=${srcmods%%/lib/modules/*}
+    local _pid
 
     if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && [[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" ]]; then
         xargs -r modprobe -a ${_moddirname+-d ${_moddirname}/} \
@@ -1478,6 +1479,7 @@ dracut_kernel_post() {
                 done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
             fi
         ) &
+        while read a ; do _pid=$a;done < <(jobs -p)
 
         if [[ $DRACUT_INSTALL ]]; then
             xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" \
@@ -1497,7 +1499,7 @@ dracut_kernel_post() {
             done
         fi
 
-        wait
+        wait $_pid
     fi
 
     for _f in modules.builtin.bin modules.builtin; do