]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(squash): create relative symlinks
authorKairui Song <kasong@redhat.com>
Thu, 10 Jun 2021 08:45:03 +0000 (16:45 +0800)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Mon, 28 Jun 2021 11:25:58 +0000 (11:25 +0000)
Don't use absolute path, or it may resolve to wrong files after unpack
the initramfs to a sub path on a running system.

Signed-off-by: Kairui Song <kasong@redhat.com>
modules.d/99squash/module-setup.sh

index 4e231a6b33d750b7e149f0f32744402522ae7749..a2525cff0d1dc66bfc0f9c496ebbda082e06835b 100644 (file)
@@ -53,8 +53,8 @@ installpost() {
     dracut_kernel_post
 
     # Install squash image init script.
-    ln -sfn /usr/bin "$initdir/bin"
-    ln -sfn /usr/sbin "$initdir/sbin"
+    ln_r /usr/bin /bin
+    ln_r /usr/sbin /sbin
     inst_simple "$moddir"/init-squash.sh /init
 }