[packages/kernel/LINUX_3_4] Make usable /boot/initrd symlink for dracut
baggins
baggins at pld-linux.org
Thu Oct 24 12:50:19 CEST 2013
commit 6bb51fece24810c64e2f68b8f92f4ccd60a67fb0
Author: Jacek Konieczny <jajcus at jajcus.net>
Date: Wed Oct 23 17:38:33 2013 +0200
Make usable /boot/initrd symlink for dracut
When Dracut is used instead of geninitrd the /boot/initrd
symlink would point to nothing. This will fix that by
symlinking the Dracut-generated /boot/initramfs-* there, but only if
geninitrd is not used.
kernel.spec | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 62d428a..8b78426 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1149,23 +1149,31 @@ fi
%posttrans
# use posttrans to generate initrd after all dependant module packages (-drm, etc) are installed
[ -f /etc/sysconfig/kernel ] && . /etc/sysconfig/kernel
+initrd_file=""
if [[ "$USE_GENINITRD" != [Nn][Oo] ]]; then
/sbin/geninitrd -f --initrdfs=initramfs %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release} || :
+ initrd_file="initrd-%{kernel_release}.gz"
fi
+
+# if dracut is present then generate full-featured initramfs
+if [[ "$USE_DRACUT" != [Nn][Oo] ]] && [ -x /sbin/dracut ]; then
+ /sbin/dracut --force --quiet /boot/initramfs-%{kernel_release}.img %{kernel_release}
+ [ -n "$initrd_file" ] || initrd_file="initramfs-%{kernel_release}.img"
+fi
+
if [[ "$CREATE_SYMLINKS" != [Nn][Oo] ]]; then
mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
- ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
+ if [ -n "$initrd_file" ] ; then
+ ln -sf "$initrd_file" %{initrd_dir}/initrd
+ fi
%if 0%{?alt_kernel:1}
mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null
- ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}
+ if [ -n "$initrd_file" ] ; then
+ ln -sf "$initrd_file" %{initrd_dir}/initrd%{_alt_kernel}
+ fi
%endif
fi
-# if dracut is present then generate full-featured initramfs
-if [[ "$USE_DRACUT" != [Nn][Oo] ]] && [ -x /sbin/dracut ]; then
- /sbin/dracut --force --quiet /boot/initramfs-%{kernel_release}.img %{kernel_release}
-fi
-
# update boot loaders when old package files are gone from filesystem
if [ -x /sbin/update-grub -a -f /etc/sysconfig/grub ]; then
if [ "$(. /etc/sysconfig/grub; echo ${UPDATE_GRUB:-no})" = "yes" ]; then
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/a23d074c33cfc35365ad674d49adc656a5f968b0
More information about the pld-cvs-commit
mailing list