Blame 0006-dracut-functions-fixed-installing-libraries-which-li.patch

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