9f65cc
From 487d2686a78cfa52419b330fa2b62af715c4356b Mon Sep 17 00:00:00 2001
9f65cc
From: Kairui Song <kasong@redhat.com>
9f65cc
Date: Thu, 10 Jun 2021 16:45:03 +0800
9f65cc
Subject: [PATCH] fix(squash): create relative symlinks
9f65cc
9f65cc
Don't use absolute path, or it may resolve to wrong files after unpack
9f65cc
the initramfs to a sub path on a running system.
9f65cc
9f65cc
Signed-off-by: Kairui Song <kasong@redhat.com>
9f65cc
(cherry picked from commit a2b6be44792b68218e3378a7d844b0f8527a4805)
9f65cc
9f65cc
Resolves: #1959336
9f65cc
---
9f65cc
 modules.d/99squash/module-setup.sh | 4 ++--
9f65cc
 1 file changed, 2 insertions(+), 2 deletions(-)
9f65cc
9f65cc
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
9f65cc
index 9bb30b2e..8c9982c0 100644
9f65cc
--- a/modules.d/99squash/module-setup.sh
9f65cc
+++ b/modules.d/99squash/module-setup.sh
9f65cc
@@ -53,8 +53,8 @@ installpost() {
9f65cc
     dracut_kernel_post
9f65cc
 
9f65cc
     # Install squash image init script.
9f65cc
-    ln -sfn /usr/bin "$initdir/bin"
9f65cc
-    ln -sfn /usr/sbin "$initdir/sbin"
9f65cc
+    ln_r /usr/bin /bin
9f65cc
+    ln_r /usr/sbin /sbin
9f65cc
     inst_simple "$moddir"/init-squash.sh /init
9f65cc
 }
9f65cc
 
9f65cc