Fix hardcoded paths in multipath support
authorRichard Yao <ryao@cs.stonybrook.edu>
Mon, 6 Feb 2012 08:00:32 +0000 (08:00 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Mon, 6 Feb 2012 08:19:17 +0000 (08:19 +0000)
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
ChangeLog
gen_initramfs.sh

index 51158968b64ae638952917b16743cda6fdf28ffd..0dec7c56d66cf63ab39f1113ddc8785927d845fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
 # Distributed under the GPL v2
 # $Id$
 
+  06 Feb 2012: Richard Yao <ryao@cs.stonybrook.edu> gen_initramfs.sh:
+  Refactor multipath initramfs generation using copy_binaries.
+
   06 Feb 2012: Richard Yao <ryao@cs.stonybrook.edu> gen_initramfs.sh:
   copy_binaries utility function for putting binaries and librares into
   initramfs (see git commit for full details).
index b96e36efe8cc86748a8556f42f337b8b2462775d..02e6554dabcb14dd27f28ba10fbe872bea389e48 100755 (executable)
@@ -164,32 +164,8 @@ append_multipath(){
        mkdir -p "${TEMP}/initramfs-multipath-temp/sbin/"
        mkdir -p "${TEMP}/initramfs-multipath-temp/lib/"
 
-       # Copy files to /lib
-       for i in /lib/{ld-*,libc-*,libc.*,libdl-*,libdl.*,libdevmapper*so*,libpthread*,librt*,libreadline*,libncurses*}
-       do
-               cp -a "${i}" "${TEMP}/initramfs-multipath-temp/lib" \
-                       || gen_die "Could not copy file ${i} for MULTIPATH"
-       done
-
-       for i in /usr/lib/libaio*
-       do
-                cp -a "${i}" "${TEMP}/initramfs-multipath-temp/lib" \
-                       || gen_die "Could not copy file ${i} for MULTIPATH"
-       done
-
-       # Copy files to /sbin
-       for i in /sbin/{multipath,kpartx,mpath_prio_*,devmap_name,dmsetup} /lib64/udev/scsi_id
-       do
-               cp -a "${i}" "${TEMP}/initramfs-multipath-temp/sbin" \
-                       || gen_die "Could not copy file ${i} for MULTIPATH"
-       done
-
-       # Copy files to /bin
-       for i in /bin/mountpoint
-       do
-               cp -a "${i}" "${TEMP}/initramfs-multipath-temp/bin" \
-                       || gen_die "Could not copy file ${i} for MULTIPATH"
-       done
+       # Copy files
+       copy_binaries "${TEMP}/initramfs-multipath-temp" "$(echo /sbin/{multipath,kpartx,mpath_prio_*,devmap_name,dmsetup} /lib64/udev/scsi_id /bin/mountpoint)"
 
        if [ -x /sbin/multipath ]
        then