packaging: make initrd creation a build option 01/32201/2
authorMikko Ylinen <mikko.ylinen@intel.com>
Tue, 16 Dec 2014 13:56:22 +0000 (15:56 +0200)
committerRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Thu, 18 Dec 2014 02:32:49 +0000 (18:32 -0800)
initrd image is being generated but not used. Further, initrd
creation adds a dependency to dracut RPM in the image.

Use %bcond_with RPM macro to make initrd creation a build option
and turn it off by default.

Change-Id: I94de75108caab640b45caae5281f98d9ea0d400b
Bug-Tizen: TC-2178
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
packaging/kernel-x86-ivi.spec

index b6eb6ba..ad9ac20 100644 (file)
@@ -3,6 +3,12 @@
 # from MeeGo/Moblin/Fedora
 #
 
+# Currently we do not use initrd for anything. Thus, there is no need to have
+# a dependency on it. If in the future initrd is used, we have all the
+# dependency logic in place in case we need it.
+
+%bcond_with initrd
+
 %define upstream_version 3.14.19
 %define profile ivi
 
@@ -116,8 +122,10 @@ Requires(post): rpm
 #Requires(postun): setup-gummiboot
 
 Requires(post): /usr/sbin/depmod
-Requires(post): /usr/bin/dracut
 Requires(post): /usr/bin/kmod
+%if %{with initrd}
+Requires(post): /usr/bin/dracut
+%endif
 
 Requires(postun): /usr/bin/ln
 Requires(postun): /usr/bin/sed
@@ -322,7 +330,9 @@ else
        fi
 fi
 
+%if %{with initrd}
 %{_bindir}/dracut /boot/initrd-%{kernel_full_version}.img %{kernel_full_version}
+%endif
 
 %post -n kernel-%{variant}-devel
 if [ -x /usr/sbin/hardlink ]; then