dracut/0071-dracut.spec-add-compat-symlinks-to-sbin.patch

40 lines
1.2 KiB
Diff
Raw Normal View History

2012-01-26 11:56:40 +00:00
From 4cbc0c79ac19d021f6f884a779c19c05fd9e5a20 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 26 Jan 2012 12:41:03 +0100
Subject: [PATCH] dracut.spec: add compat symlinks to /sbin
---
dracut.spec | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dracut.spec b/dracut.spec
index 06533e3..4eb3ba3 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -197,13 +197,25 @@ rm $RPM_BUILD_ROOT%{_bindir}/lsinitrd
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut_log
+# create the ghosts
+mkdir -p $RPM_BUILD_ROOT%{_sbindir} $RPM_BUILD_ROOT/sbin
+ln -s ../bin/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut
+ln -s ../usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut
+
%clean
rm -rf $RPM_BUILD_ROOT
+%post -p <lua>
+posix.symlink("../bin/dracut", "%{_sbindir}/dracut")
+posix.symlink("../usr/bin/dracut", "/sbin/dracut")
+return 0
+
%files
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
%{_bindir}/dracut
+%ghost /sbin/dracut
+%ghost %{_sbindir}/dracut
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
%{_bindir}/mkinitrd
%{_bindir}/lsinitrd