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