From 172d85b9c949b321771d63dbd5f06ecf19cf94f0 Mon Sep 17 00:00:00 2001
From: Jon Ander Hernandez <jonan.h@gmail.com>
Date: Thu, 17 Feb 2011 10:35:27 +0100
Subject: [PATCH] dracut-functions: fixed installing libraries which links to another directory
$ ldd `which bash` | grep ld
/lib64/ld-linux-x86-64.so.2 (0x00007fa1cc3ff000)
$ readlink -f /lib64/ld-linux-x86-64.so.2
/lib/ld-2.12.1.so
So inst_library /lib64/ld-linux-x86-64.so.2 was doing :
(cd "/tmp/initramfs.4uaeD9/lib64" && ln -s "/lib/ld-2.12.1.so"
"ld-linux-x86-64.so.2")
But, /tmp/initramfs.4uaeD9/lib64 -> /lib... :-S
---
dracut-functions | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index ebcb7d8..1cb43e7 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -302,6 +302,8 @@ inst_library() {
lib=${src##*/}
inst_simple "$reallib" "$reallib"
inst_dir "${dest%/*}"
+ [[ -L ${initdir}${dest%/*} ]] && \
+ dest=$(readlink -f ${initdir}${dest%/*})/
(cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
else
inst_simple "$src" "$dest"