Re: inst not installing library dependencies of shared objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

2011/1/25 Jon Ander Hernandez <jonan.h@xxxxxxxxx>:
> Hello,
>
> I'm trying to add plymouth support to dracut on Ubuntu, and I'm having
> some troubles because some files
> (/lib/plymouth/{script.so,renderers/drm.so,...}) are not executable
> (as Fedora does for example), and that makes inst not install some
> libraries as libpng, libply-splash-graphics.so.2...

I modified inst_binary to also act with non-executable shared objects.

I have also fixed a bug when installing a libraries whose directory
links to another directory (better explained which commands) :

$ 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

diff --git a/dracut-functions b/dracut-functions
index 2232dc9..473c68c 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -299,6 +299,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"
@@ -317,7 +319,9 @@ inst_library() {
 # search in the usual places to find the binary.
 find_binary() {
     local binpath="/bin /sbin /usr/bin /usr/sbin" p
-    [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; }
+    [[ -z ${1##/*} ]] &&
+    ( [[ -x $1 ]] || ( [[ -e $1 ]] && file $1 | grep -q "shared
object.*dynamically linked" )) &&
+    { echo $1; return 0; }
     for p in $binpath; do
         [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
     done

Regards,

JonAn.
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux