From a871576d170277d935306a78acebf24a52103b65 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Mon, 6 Feb 2012 08:00:32 +0000 Subject: [PATCH] Fix hardcoded paths in multipath support Signed-off-by: Robin H. Johnson --- ChangeLog | 3 +++ gen_initramfs.sh | 28 ++-------------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5115896..0dec7c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ # Distributed under the GPL v2 # $Id$ + 06 Feb 2012: Richard Yao gen_initramfs.sh: + Refactor multipath initramfs generation using copy_binaries. + 06 Feb 2012: Richard Yao gen_initramfs.sh: copy_binaries utility function for putting binaries and librares into initramfs (see git commit for full details). diff --git a/gen_initramfs.sh b/gen_initramfs.sh index b96e36e..02e6554 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -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