diff mbox series

[meta-initramfs] fix broken symlink in dracut config examples

Message ID 20250522102036.2075922-1-hongxu.jia@windriver.com
State New
Headers show
Series [meta-initramfs] fix broken symlink in dracut config examples | expand

Commit Message

Hongxu Jia May 22, 2025, 10:20 a.m. UTC
Due to commit [1], it installs dracut config examples under /usr.
But while enable_test=no, the symlink of test in dracut config is broken
...
root@qemux86-64:~# ls /usr/lib/dracut/dracut.conf.d/test*  -ahl
lrwxrwxrwx 1 root root 27 Apr  5  2011 /usr/lib/dracut/dracut.conf.d/test -> ../test/dracut.conf.d/test/
lrwxrwxrwx 1 root root 36 Apr  5  2011 /usr/lib/dracut/dracut.conf.d/test-makeroot -> ../test/dracut.conf.d/test-makeroot/
lrwxrwxrwx 1 root root 31 Apr  5  2011 /usr/lib/dracut/dracut.conf.d/test-root -> ../test/dracut.conf.d/test-root
root@qemux86-64:~# realpath /usr/lib/dracut/dracut.conf.d/test*
realpath: /usr/lib/dracut/dracut.conf.d/test: No such file or directory
realpath: /usr/lib/dracut/dracut.conf.d/test-makeroot: No such file or directory
realpath: /usr/lib/dracut/dracut.conf.d/test-root: No such file or directory
...

This commit cleans up test symlink if enable_test=no

[1] https://github.com/dracut-ng/dracut-ng/commit/0d369e3e30935dffe48dfff1e90463868e7f804a

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...en-symlink-in-dracut-config-examples.patch | 44 +++++++++++++++++++
 .../recipes-devtools/dracut/dracut_106.bb     |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/dracut/dracut/0001-fix-broken-symlink-in-dracut-config-examples.patch
diff mbox series

Patch

diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-fix-broken-symlink-in-dracut-config-examples.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0001-fix-broken-symlink-in-dracut-config-examples.patch
new file mode 100644
index 0000000000..7d0b65a161
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/dracut/dracut/0001-fix-broken-symlink-in-dracut-config-examples.patch
@@ -0,0 +1,44 @@ 
+From 8871c593973d9abfef45408575e5da887830f42e Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 22 May 2025 18:07:27 +0800
+Subject: [PATCH] fix broken symlink in dracut config examples
+
+Due to commit [1], it installs dracut config examples under /usr.
+But while enable_test=no, the symlink of test in dracut config is broken
+...
+root@qemux86-64:~# ls /usr/lib/dracut/dracut.conf.d/test*  -ahl
+lrwxrwxrwx 1 root root 27 Apr  5  2011 /usr/lib/dracut/dracut.conf.d/test -> ../test/dracut.conf.d/test/
+lrwxrwxrwx 1 root root 36 Apr  5  2011 /usr/lib/dracut/dracut.conf.d/test-makeroot -> ../test/dracut.conf.d/test-makeroot/
+lrwxrwxrwx 1 root root 31 Apr  5  2011 /usr/lib/dracut/dracut.conf.d/test-root -> ../test/dracut.conf.d/test-root
+root@qemux86-64:~# realpath /usr/lib/dracut/dracut.conf.d/test*
+realpath: /usr/lib/dracut/dracut.conf.d/test: No such file or directory
+realpath: /usr/lib/dracut/dracut.conf.d/test-makeroot: No such file or directory
+realpath: /usr/lib/dracut/dracut.conf.d/test-root: No such file or directory
+...
+
+This commit cleans up test symlink if enable_test=no
+
+[1] https://github.com/dracut-ng/dracut-ng/commit/0d369e3e30935dffe48dfff1e90463868e7f804a
+
+Upstream-Status: Submitted [https://github.com/dracut-ng/dracut-ng/pull/1344]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index d33aebbc..151d9f79 100644
+--- a/Makefile
++++ b/Makefile
+@@ -180,6 +180,7 @@ ifneq ($(enable_test),no)
+ 	cp -arx test $(DESTDIR)$(pkglibdir)
+ else
+ 	rm -rf $(DESTDIR)$(pkglibdir)/modules.d/80test*
++	rm -rf $(DESTDIR)$(pkglibdir)/dracut.conf.d/test*
+ endif
+ ifneq ($(enable_documentation),no)
+ 	for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done
+-- 
+2.34.1
+
diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_106.bb b/meta-initramfs/recipes-devtools/dracut/dracut_106.bb
index b474514713..b70ee4baeb 100644
--- a/meta-initramfs/recipes-devtools/dracut/dracut_106.bb
+++ b/meta-initramfs/recipes-devtools/dracut/dracut_106.bb
@@ -10,6 +10,7 @@  PE = "1"
 SRCREV = "956c08774074ddc45b2f975e13d5c13d1fc36eff"
 SRC_URI = "git://github.com/dracut-ng/dracut-ng.git;protocol=http;branch=main \
            file://0001-feat-dracut-install-split-ldd-command-arguments-for-.patch \
+           file://0001-fix-broken-symlink-in-dracut-config-examples.patch \
            "
 
 DEPENDS += "kmod"