dracut/dracut.spec
Robert Milasan 1c955cd93d Accepting request 201996 from home:mvyskocil
- Mark /etc/dracut.conf.d/02-early-microcode.conf as config file

Add following entry to .changes of trenn@suse.de
"""
- Build host only images for default paths in SUSE for faster build and
  smaller images. Imply --force in this case as well.
  * suse_host_only.patch
"""
It was not documented

- Tagged all patches per policy
- Add extension .patch to all patches per policy

OBS-URL: https://build.opensuse.org/request/show/201996
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=59
2013-10-03 07:37:56 +00:00

363 lines
12 KiB
RPMSpec

#
# spec file for package dracut
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define dracutlibdir %{_prefix}/lib/dracut
%define replace_mkinitrd 1
Name: dracut
Version: 033
Release: 0
Summary: Initramfs generator using udev
License: GPL-2.0+ and LGPL-2.1+
Group: System/Base
Url: https://dracut.wiki.kernel.org/
# Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
Source0: dracut-%{version}.tar.xz
# openSUSE / SLE module to convert initrd command line parameters to dracut one
# (not to be upstreamed)
Source1: module-setup-initrd.sh
Source2: parse-suse-initrd.sh
Source3: mkinitrd_setup_dummy
# PATCH-FIX-OPENSUSE correct the paths for openSUSE - tittiatcoke@gmail.com
Patch0: correct-paths-for-opensuse.patch
# PATCH-FIX-OPENSUSE change the default naming from initramfs to initrd - tittiatcoke@gmail.com
Patch1: use_initrd_insteadof_initramfs.patch
# PATCH-FIX-OPENSUSE Strip the gz extension from the keymap mentioned in /etc/sysconfig/keyboard - tittiatcoke@gmail.com
Patch2: use_sysconfig_values_correctly.patch
# PATCH-FIX-OPENSUSE At the moment we have 2 paths that contain udev files (/lib/udev and /usr/lib/udev) - tittiatcoke@gmail.com
Patch3: use_all_paths_udev.patch
# PATCH-FIX-UPSTREAM ACPI early table override support in early cpio - trenn@suse.de
Patch4: generalize_early_cpio.patch
# PATCH-FIX-UPSTREAM Do not create early_cpio if no suitable microcode exists - trenn@suse.de
Patch5: microcode_cleanup.patch
# PATCH-FIX-UPSTREAM Implement ACPI table overriding - trenn@suse.de
Patch6: acpi_override.patch
# PATCH-FIX-OPENSUSE SUSE mkinitrd compatibility: Introduce -i -k parameters - trenn@suse.de
Patch7: mkinitrd_allow_no_option.patch
# PATCH-FIX-OPENSUSE SUSE mkinitrd compatibility: allow multiple arguments per param - trenn@suse.de
Patch8: mkinitrd_allow_multiple_args.patch
# PATCH-FIX-UPSTREAM Limit an output to essential one implementing --quiet option - trenn@suse.de
Patch9: quiet_options.patch
# PATCH-FIX-OPENSUSE SUSE mkinitrd compatibility: Allow a call w/o passing any parameters - trenn@suse.de
Patch10: implement_default.patch
# PATCH-FIX-OPENSUSE SUSE mkinitrd compatibility: add -d to pass rootfs and dummy -s - trenn@suse.de
Patch11: root_fs.patch
# PATCH-FIX-OPENSUSE Build host only images for default_kernel_images and -i/-k ones - trenn@suse.de
Patch12: suse_host_only.patch
# PATCH-FIX-OPENSUSE Write caller and used parameters to syslog if mkinitrd is called - trenn@suse.de
Patch13: suse_only_logger.patch
BuildRequires: bash
BuildRequires: dash
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: asciidoc
BuildRequires: docbook-xsl-stylesheets
BuildRequires: libxslt
BuildRequires: pkgconfig(systemd) >= 199
%if %{replace_mkinitrd}
Obsoletes: mkinitrd
Provides: mkinitrd
%endif
Requires: bash
Requires: coreutils
Requires: cpio
Requires: file
Requires: filesystem
Requires: findutils
Requires: grep
Requires: hardlink
Requires: logrotate
Requires: modutils
Requires: sed
Requires: systemd > 198
Requires: udev > 166
Requires: util-linux >= 2.21
Requires: xz
Recommends: binutils
Requires: pigz
%{?systemd_requires}
%description
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
Unlike existing implementations, dracut does hard-code as little as possible
into the initramfs. Dracut contains various modules which are driven by the
event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
NFS, iSCSI, NBD, FCoE with the dracut-network package.
%package network
Summary: Dracut modules to build a dracut initramfs with network support
Group: System/Base
Requires: %{name} = %{version}
Obsoletes: dracut-generic < 008
Provides: dracut-generic = %{version}
%description network
This package requires everything which is needed to build a generic
all purpose initramfs with network support with dracut.
%package caps
Summary: Dracut modules to build a dracut initramfs which drops capabilities
Group: System/Base
Requires: %{name} = %{version}
Requires: libcap
%description caps
This package requires everything which is needed to build an
all purpose initramfs with dracut, which drops capabilities.
%package tools
Summary: Dracut tools to build the local initramfs
Group: System/Base
Requires: %{name} = %{version}
%description tools
This package contains tools to assemble the local initrd and host configuration.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%build
%configure\
--systemdsystemunitdir=%{_unitdir}\
--bashcompletiondir=%{_sysconfdir}/bash_completion.d\
--libdir=%{_prefix}/lib
make all -e CFLAGS="%{optflags}" %{?_smp_mflags}
%install
make %{?_smp_mflags} install DESTDIR=%{buildroot}
echo "DRACUT_VERSION=%{version}-%{release}" > %{buildroot}/%{dracutlibdir}/dracut-version.sh
rm -fr %{buildroot}%{dracutlibdir}/modules.d/01fips
rm -fr %{buildroot}%{dracutlibdir}/modules.d/02fips-aesni
# we do not support dash in the initramfs
# rm -fr %{buildroot}/%{dracutlibdir}/modules.d/00dash
# add suse cmline conversion
mkdir -p %{buildroot}%{dracutlibdir}/modules.d/99suse
install -m 0755 %{S:1} %{buildroot}%{dracutlibdir}/modules.d/99suse/module-setup.sh
install -m 0755 %{S:2} %{buildroot}%{dracutlibdir}/modules.d/99suse/parse-suse-initrd.sh
# remove gentoo specific modules
rm -fr %{buildroot}%{dracutlibdir}/modules.d/50gensplash
%if %{defined _unitdir}
# with systemd IMA and selinux modules do not make sense
rm -fr %{buildroot}/%{dracutlibdir}/modules.d/96securityfs
rm -fr %{buildroot}/%{dracutlibdir}/modules.d/97masterkey
rm -fr %{buildroot}/%{dracutlibdir}/modules.d/98integrity
rm -fr %{buildroot}/%{dracutlibdir}/modules.d/98selinux
%endif
mkdir -p %{buildroot}/boot/dracut
mkdir -p %{buildroot}%{_localstatedir}/lib/dracut/overlay
mkdir -p %{buildroot}%{_localstatedir}/log
touch %{buildroot}%{_localstatedir}/log/dracut.log
#mkdir -p %{buildroot}%{_localstatedir}/initramfs
install -m 0644 dracut.conf.d/suse.conf.example %{buildroot}%{_sysconfdir}/dracut.conf.d/01-dist.conf
echo 'add_drivers+="autofs4"' >> %{buildroot}%{_sysconfdir}/dracut.conf.d/01-dist.conf
%ifarch %ix86 x86_64
echo 'early_microcode="yes"' > %{buildroot}%{_sysconfdir}/dracut.conf.d/02-early-microcode.conf
%endif
%if !%{replace_mkinitrd}
rm %{buildroot}/etc/bash_completion.d/lsinitrd
rm %{buildroot}%{_bindir}/mkinitrd
rm %{buildroot}%{_bindir}/lsinitrd
rm %{buildroot}%{_mandir}/man8/mkinitrd*
rm %{buildroot}%{_mandir}/man1/lsinitrd*
%else
# moved to /sbin
mkdir -p %{buildroot}/sbin
mv %{buildroot}%{_bindir}/mkinitrd %{buildroot}/sbin/mkinitrd
install -m 0755 %{S:3} %{buildroot}/sbin/mkinitrd_setup
%endif
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
install -m 0644 dracut.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/dracut
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
%{_bindir}/dracut
%if %{replace_mkinitrd}
/sbin/mkinitrd
/sbin/mkinitrd_setup
%{_bindir}/lsinitrd
/etc/bash_completion.d/lsinitrd
%endif
%dir %{dracutlibdir}
%dir %{dracutlibdir}/modules.d
%{dracutlibdir}/dracut-functions.sh
%{dracutlibdir}/dracut-functions
%{dracutlibdir}/dracut-version.sh
%{dracutlibdir}/dracut-logger.sh
%{dracutlibdir}/dracut-initramfs-restore
%{dracutlibdir}/dracut-install
%config(noreplace) %{_sysconfdir}/dracut.conf
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
%config %{_sysconfdir}/dracut.conf.d/01-dist.conf
%endif
%ifarch %ix86 x86_64
%config %{_sysconfdir}/dracut.conf.d/02-early-microcode.conf
%endif
%dir %{_sysconfdir}/dracut.conf.d
%{_mandir}/man8/dracut.8*
%if %{replace_mkinitrd}
%{_mandir}/man8/mkinitrd.8*
%{_mandir}/man1/lsinitrd.1*
%endif
%{_mandir}/man7/dracut.kernel.7*
%{_mandir}/man7/dracut.cmdline.7*
%{_mandir}/man7/dracut.bootup.7*
%{_mandir}/man8/dracut-cmdline.service.8*
%{_mandir}/man8/dracut-initqueue.service.8*
%{_mandir}/man8/dracut-pre-pivot.service.8*
%{_mandir}/man8/dracut-pre-trigger.service.8*
%{_mandir}/man8/dracut-pre-udev.service.8*
%{_mandir}/man8/dracut-mount.service.8.*
%{_mandir}/man8/dracut-pre-mount.service.8.*
%{_mandir}/man8/dracut-shutdown.service.8.*
%{_mandir}/man5/dracut.conf.5*
%dir /usr/lib/kernel
%dir /usr/lib/kernel/install.d
/usr/lib/kernel/install.d/50-dracut.install
/usr/lib/kernel/install.d/51-dracut-rescue.install
%dir %{dracutlibdir}/modules.d/00systemd-bootchart
%dir %{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/00systemd-bootchart/module-setup.sh
%{dracutlibdir}/modules.d/03rescue/module-setup.sh
%{dracutlibdir}/modules.d/00bootchart
%{dracutlibdir}/modules.d/00dash
%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/10i18n
%{dracutlibdir}/modules.d/30convertfs
%{dracutlibdir}/modules.d/45url-lib
%{dracutlibdir}/modules.d/50drm
%{dracutlibdir}/modules.d/50plymouth
%{dracutlibdir}/modules.d/80cms
%{dracutlibdir}/modules.d/90btrfs
%{dracutlibdir}/modules.d/90crypt
%{dracutlibdir}/modules.d/90dm
%{dracutlibdir}/modules.d/90dmraid
%{dracutlibdir}/modules.d/90dmsquash-live
%{dracutlibdir}/modules.d/90kernel-modules
%{dracutlibdir}/modules.d/90lvm
%{dracutlibdir}/modules.d/90mdraid
%{dracutlibdir}/modules.d/90multipath
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/95cifs
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95dasd
%{dracutlibdir}/modules.d/95dasd_mod
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95zfcp
%{dracutlibdir}/modules.d/95terminfo
%{dracutlibdir}/modules.d/95udev-rules
%{dracutlibdir}/modules.d/95virtfs
%if %{undefined _unitdir}
%{dracutlibdir}/modules.d/96securityfs
%{dracutlibdir}/modules.d/97masterkey
%{dracutlibdir}/modules.d/98selinux
%{dracutlibdir}/modules.d/98integrity
%endif
%{dracutlibdir}/modules.d/97biosdevname
%{dracutlibdir}/modules.d/98ecryptfs
%{dracutlibdir}/modules.d/98pollcdrom
%{dracutlibdir}/modules.d/98syslog
%{dracutlibdir}/modules.d/98systemd
%{dracutlibdir}/modules.d/98usrmount
%{dracutlibdir}/modules.d/99base
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99img-lib
%{dracutlibdir}/modules.d/99shutdown
%{dracutlibdir}/modules.d/99suse
%dir %{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03modsign/load-modsign-keys.sh
%{dracutlibdir}/modules.d/03modsign/module-setup.sh
%dir %{dracutlibdir}/modules.d/90bcache
%{dracutlibdir}/modules.d/90bcache/module-setup.sh
%dir %{dracutlibdir}/modules.d/00bash
%{dracutlibdir}/modules.d/00bash/module-setup.sh
%config(noreplace) %{_sysconfdir}/logrotate.d/dracut
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%if %{defined _unitdir}
%dir %{_unitdir}/initrd.target.wants
%{_unitdir}/*.service
%{_unitdir}/*/*.service
%endif
%{_sysconfdir}/bash_completion.d/dracut
%files network
%defattr(-,root,root,0755)
%{dracutlibdir}/modules.d/40network
%{dracutlibdir}/modules.d/95fcoe
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/90livenet
%{dracutlibdir}/modules.d/90qemu-net
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95ssh-client
%{dracutlibdir}/modules.d/45ifcfg
%{dracutlibdir}/modules.d/95znet
%files caps
%defattr(-,root,root,0755)
%{dracutlibdir}/modules.d/02caps
%files tools
%defattr(-,root,root,0755)
%{_mandir}/man8/dracut-catimages.8*
%{_bindir}/dracut-catimages
%dir /boot/dracut
%dir %{_localstatedir}/lib/dracut
%dir %{_localstatedir}/lib/dracut/overlay
%changelog