Skip to contentSkip to conversation

dracut-functions: fixed doubled $initdir prefix inst_library()

PATCH In review Amadeusz Żołnowski 2 participants 2 messages Feb 25, 2011 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dracut-functions: fixed doubled $initdir prefix inst_library()

Commit 172d85b9c949b321771d63dbd5f06ecf19cf94f0 caused following error:

./dracut-functions: line 307: cd: /tmp/initramfs.mP7cPY/tmp/initramfs.mP7cPY/lib64: No such file or directory

Patch removes beginning $initdir for symlink case.

---
 dracut-functions |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
dracut-functions +4 -2
index 1cb43e7..cc16760 100755
@@ -302,8 +302,10 @@ inst_library() {
         lib=${src##*/}
         inst_simple "$reallib" "$reallib"
         inst_dir "${dest%/*}"
-        [[ -L ${initdir}${dest%/*} ]] && \
-        dest=$(readlink -f ${initdir}${dest%/*})/
+        if [[ -L ${initdir}${dest%/*} ]]; then
+            dest=$(readlink -f ${initdir}${dest%/*})/
+            dest=${dest#${initdir}}
+        fi
         (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
     else
         inst_simple "$src" "$dest"
Signature · 1 line
1.7.4.1

A message that is not in the archive (sent off-list or not yet received): 1298624374-23980-1-git-send-email-aidecoe-2qtfh70TtYba5EbDDlwbIw@public.gmane.org

#2 lore raw

Hello,

2011/2/25 Amadeusz Żołnowski <[email protected]>:

Quoted 16 lines

Commit 172d85b9c949b321771d63dbd5f06ecf19cf94f0 caused following error:

./dracut-functions: line 307: cd: /tmp/initramfs.mP7cPY/tmp/initramfs.mP7cPY/lib64: No such file or directory

Patch removes beginning $initdir for symlink case.
---
 dracut-functions |    6 ++++--

 1 files changed, 4 insertions(+), 2 deletions(-)
dracut-functions +0 -0
index 1cb43e7..cc16760 100755
@@ -302,8 +302,10 @@ inst_library() {
         lib=${src##*/}

        inst_simple "$reallib" "$reallib"

Quoted 8 lines

        inst_dir "${dest%/*}"
-        [[ -L ${initdir}${dest%/*} ]] && \
-        dest=$(readlink -f ${initdir}${dest%/*})/
+        if [[ -L ${initdir}${dest%/*} ]]; then
+            dest=$(readlink -f ${initdir}${dest%/*})/
+            dest=${dest#${initdir}}
+        fi
        (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")

I'm sorry about the trouble caused by my patch I didn't considered the case /lib64 -> lib. On debian I was getting /lib64 -> /lib

Regards,

JonAn.