1 Star 0 Fork 9

jiaxinyyang/dracut

forked from OpenCloudOS Stream/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dracut.spec 14.81 KB
一键复制 编辑 原始数据 按行查看 历史
%define dracutlibdir %{_prefix}/lib/dracut
Summary: Initramfs generator using udev
Name: dracut
Version: 059
Release: 6%{?dist}
License: GPLv2+ and LGPLv2+ and GPLv2
URL: https://dracut.wiki.kernel.org/
Source0: https://github.com/dracutdevs/dracut/archive/%{version}/dracut-%{version}.tar.gz
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
Source2: dist.conf
Patch0001: 1521-Never-enable-the-bluetooth-module-by-default.patch
Patch0002: 1825-Skip-creating-initrd-when-initrd-is-provided.patch
Patch0003: 2218-add-module-driver-support-for-macbook-keyboards.patch
Patch0004: 2233-dmsquash-live-restore-compatibility.patch
Patch0005: 2237-kmoddir-fix-trailing-forwardslash-handling.patch
Patch0006: 2134-revert-avoid-restarting-NetworkManager.patch
Patch0007: 2224-network-include-default-mac-none-link.patch
Patch0008: 2290-remove-dependency-on-multipathd-socket.patch
Patch0009: 2377-fix-kernel-modules-add-interconnect-drivers.patch
Patch0010: 2184-add-nvmeof-module.patch
Patch0011: 0001-fix-dracut.sh-use-dynamically-uefi-s-sections-offset.patch
# https://github.com/dracutdevs/dracut/pull/2270
Patch0012: fix-rootfs-generator.patch
# https://github.com/dracutdevs/dracut/pull/2481
patch0013: remove-microcode-check.patch
# https://github.com/dracutdevs/dracut/commit/bee1c4824a8cd47ce6c01892a548bdc07b1fa678
patch0014: backport-feat-systemd-install-systemd-executor.patch
# https://github.com/systemd/systemd/commit/32295fa0
patch0015: 0001-rename-systemd-pcrphase-binary-to-systemd-pcrextend.patch
# https://github.com/systemd/systemd/commit/a628d933
patch0016: 0002-add-new-systemd-hibernate-resume.service.patch
# Basic requirements
BuildRequires: bash gcc git-core
BuildRequires: pkgconfig(libkmod) >= 23
# Pkg requirements
BuildRequires: bash-completion pkgconfig systemd
# Doc requirements
BuildRequires: asciidoc docbook-style-xsl docbook-dtds libxslt
# For FIPS compatibility
Provides: dracut-fips = %{version}-%{release}
Provides: dracut-fips-aesni = %{version}-%{release}
# Basic commands
Requires: bash >= 4
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: systemd-udev >= 219
Requires: coreutils filesystem findutils grep kmod procps-ng sed
# Compressors
Requires: cpio xz gzip
# Kernel crypto
Requires: libkcapi-hmaccalc
# Weak requirements
Recommends: memstrack
Recommends: hardlink
Recommends: pigz
Recommends: kpartx
%description
dracut is an event driven initramfs infrastructure. dracut (the tool)
is used to create bootable initramfses for the Linux kernel, by copying
tools and files from an installed system and combining it with the dracut
framework.
%package network
Summary: dracut modules to build a dracut initramfs with network support
Requires: %{name} = %{version}-%{release}
Requires: iputils iproute
Requires: (NetworkManager >= 1.20 or dhclient)
Suggests: NetworkManager
Provides: dracut-generic = %{version}-%{release}
%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
Requires: %{name} = %{version}-%{release}
Requires: libcap
%description caps
This package requires everything which is needed to build an
initramfs with dracut, which drops capabilities.
%package live
Summary: dracut modules to build a dracut initramfs with live image capabilities
Requires: %{name} = %{version}-%{release}
Requires: %{name}-network = %{version}-%{release}
Requires: tar gzip coreutils bash device-mapper curl
Requires: fuse ntfs-3g
%description live
This package requires everything which is needed to build an
initramfs with dracut, with live image capabilities, like Live CDs.
%package config-generic
Summary: dracut configuration to turn off hostonly image generation
Requires: %{name} = %{version}-%{release}
Provides: dracut-nohostonly = %{version}-%{release}
%description config-generic
This package provides the configuration to turn off the host specific initramfs
generation with dracut and generates a generic image by default.
%package config-rescue
Summary: dracut configuration to turn on rescue image generation
Requires: %{name} = %{version}-%{release}
%description config-rescue
This package provides the configuration to turn on the rescue initramfs
generation with dracut.
%package tools
Summary: dracut tools to build the local initramfs
Requires: %{name} = %{version}-%{release}
%description tools
This package contains tools to assemble the local initrd and host configuration.
%package squash
Summary: dracut module to build an initramfs with most files in a squashfs image
Requires: %{name} = %{version}-%{release}
Requires: squashfs-tools
%description squash
This package provides a dracut module to build an initramfs, but store most files
in a squashfs image, result in a smaller initramfs size and reduce runtime memory
usage.
%prep
%autosetup -n %{name}-%{version} -p1 -S git
cp %{SOURCE1} .
%build
%configure --systemdsystemunitdir=%{_unitdir} \
--bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \
--libdir=%{_prefix}/lib
%make_build
%install
%make_install libdir=%{_prefix}/lib
# Drop mksh, IMA/SELinux (systemd will handle it instead), and s390 related modules.
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00mksh
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/80cms
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet
# remove SUSE related docs, it's bundled with upstream
rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
mkdir -p $RPM_BUILD_ROOT/boot/dracut
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
# Default dist config
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
# Extra infos
echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%files
%license COPYING lgpl-2.1.txt
%doc README.md docs/HACKING.md AUTHORS NEWS.md dracut.html docs/dracut.png docs/dracut.svg
%{_bindir}/dracut
%{_bindir}/lsinitrd
# Dracut libs
%dir %{dracutlibdir}
%dir %{dracutlibdir}/dracut.conf.d
%{dracutlibdir}/dracut-functions.sh
%{dracutlibdir}/dracut-init.sh
%{dracutlibdir}/dracut-functions
%{dracutlibdir}/dracut-version.sh
%{dracutlibdir}/dracut-logger.sh
%{dracutlibdir}/dracut-initramfs-restore
%{dracutlibdir}/dracut-install
%{dracutlibdir}/dracut-util
%{dracutlibdir}/skipcpio
%{dracutlibdir}/dracut.conf.d/01-dist.conf
%dir %{_datadir}/pkgconfig
# Dracut base modules
%dir %{dracutlibdir}/modules.d
%{dracutlibdir}/modules.d/00bash
%{dracutlibdir}/modules.d/00dash
%{dracutlibdir}/modules.d/00systemd
%{dracutlibdir}/modules.d/00systemd-network-management
%{dracutlibdir}/modules.d/00warpclock
%{dracutlibdir}/modules.d/01fips
%{dracutlibdir}/modules.d/01systemd-ac-power
%{dracutlibdir}/modules.d/01systemd-ask-password
%{dracutlibdir}/modules.d/01systemd-coredump
%{dracutlibdir}/modules.d/01systemd-hostnamed
%{dracutlibdir}/modules.d/01systemd-initrd
%{dracutlibdir}/modules.d/01systemd-integritysetup
%{dracutlibdir}/modules.d/01systemd-journald
%{dracutlibdir}/modules.d/01systemd-ldconfig
%{dracutlibdir}/modules.d/01systemd-modules-load
%{dracutlibdir}/modules.d/01systemd-pcrphase
%{dracutlibdir}/modules.d/01systemd-portabled
%{dracutlibdir}/modules.d/01systemd-pstore
%{dracutlibdir}/modules.d/01systemd-repart
%{dracutlibdir}/modules.d/01systemd-resolved
%{dracutlibdir}/modules.d/01systemd-rfkill
%{dracutlibdir}/modules.d/01systemd-sysext
%{dracutlibdir}/modules.d/01systemd-sysctl
%{dracutlibdir}/modules.d/01systemd-sysusers
%{dracutlibdir}/modules.d/01systemd-timedated
%{dracutlibdir}/modules.d/01systemd-timesyncd
%{dracutlibdir}/modules.d/01systemd-tmpfiles
%{dracutlibdir}/modules.d/01systemd-udevd
%{dracutlibdir}/modules.d/01systemd-veritysetup
%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/04watchdog-modules
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/06dbus-broker
%{dracutlibdir}/modules.d/06dbus-daemon
%{dracutlibdir}/modules.d/06rngd
%{dracutlibdir}/modules.d/09dbus
%{dracutlibdir}/modules.d/10i18n
%{dracutlibdir}/modules.d/30convertfs
%{dracutlibdir}/modules.d/45url-lib
%{dracutlibdir}/modules.d/50drm
%{dracutlibdir}/modules.d/50plymouth
%{dracutlibdir}/modules.d/62bluetooth
%{dracutlibdir}/modules.d/80lvmmerge
%{dracutlibdir}/modules.d/80lvmthinpool-monitor
%{dracutlibdir}/modules.d/80test
%{dracutlibdir}/modules.d/80test-makeroot
%{dracutlibdir}/modules.d/80test-root
%{dracutlibdir}/modules.d/90btrfs
%{dracutlibdir}/modules.d/90crypt
%{dracutlibdir}/modules.d/90dm
%{dracutlibdir}/modules.d/90dmraid
%{dracutlibdir}/modules.d/90kernel-modules
%{dracutlibdir}/modules.d/90kernel-modules-extra
%{dracutlibdir}/modules.d/90lvm
%{dracutlibdir}/modules.d/90mdraid
%{dracutlibdir}/modules.d/90multipath
%{dracutlibdir}/modules.d/90nvdimm
%{dracutlibdir}/modules.d/90overlayfs
%{dracutlibdir}/modules.d/90ppcmac
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/91fido2
%{dracutlibdir}/modules.d/91pcsc
%{dracutlibdir}/modules.d/91pkcs11
%{dracutlibdir}/modules.d/91tpm2-tss
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95terminfo
%{dracutlibdir}/modules.d/95udev-rules
%{dracutlibdir}/modules.d/95virtfs
%{dracutlibdir}/modules.d/95virtiofs
%{dracutlibdir}/modules.d/97biosdevname
%{dracutlibdir}/modules.d/98dracut-systemd
%{dracutlibdir}/modules.d/98ecryptfs
%{dracutlibdir}/modules.d/98pollcdrom
%{dracutlibdir}/modules.d/98selinux
%{dracutlibdir}/modules.d/98syslog
%{dracutlibdir}/modules.d/98usrmount
%{dracutlibdir}/modules.d/99base
%{dracutlibdir}/modules.d/99memstrack
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99shutdown
# Systemd services
%{_unitdir}/dracut-shutdown.service
%{_unitdir}/dracut-shutdown-onfailure.service
%{_unitdir}/sysinit.target.wants/dracut-shutdown.service
%{_unitdir}/dracut-cmdline.service
%{_unitdir}/dracut-initqueue.service
%{_unitdir}/dracut-mount.service
%{_unitdir}/dracut-pre-mount.service
%{_unitdir}/dracut-pre-pivot.service
%{_unitdir}/dracut-pre-trigger.service
%{_unitdir}/dracut-pre-udev.service
%{_unitdir}/initrd.target.wants/dracut-cmdline.service
%{_unitdir}/initrd.target.wants/dracut-initqueue.service
%{_unitdir}/initrd.target.wants/dracut-mount.service
%{_unitdir}/initrd.target.wants/dracut-pre-mount.service
%{_unitdir}/initrd.target.wants/dracut-pre-pivot.service
%{_unitdir}/initrd.target.wants/dracut-pre-trigger.service
%{_unitdir}/initrd.target.wants/dracut-pre-udev.service
# Misc
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%dir %{_sharedstatedir}/initramfs
%dir %{_sysconfdir}/dracut.conf.d
%config(noreplace) %{_sysconfdir}/dracut.conf
%{_datadir}/pkgconfig/dracut.pc
%{_datadir}/bash-completion/completions/dracut
%{_datadir}/bash-completion/completions/lsinitrd
%{_prefix}/lib/kernel/install.d/50-dracut.install
# Docs
%{_mandir}/man8/dracut.8*
%{_mandir}/man8/*service.8*
%{_mandir}/man1/lsinitrd.1*
%{_mandir}/man7/dracut.kernel.7*
%{_mandir}/man7/dracut.cmdline.7*
%{_mandir}/man7/dracut.modules.7*
%{_mandir}/man7/dracut.bootup.7*
%{_mandir}/man5/dracut.conf.5*
%files network
%{dracutlibdir}/modules.d/01systemd-networkd
%{dracutlibdir}/modules.d/35connman
%{dracutlibdir}/modules.d/35network-manager
%{dracutlibdir}/modules.d/35network-legacy
%{dracutlibdir}/modules.d/35network-wicked
%{dracutlibdir}/modules.d/40network
%{dracutlibdir}/modules.d/45ifcfg
%{dracutlibdir}/modules.d/90kernel-network-modules
%{dracutlibdir}/modules.d/90qemu-net
%{dracutlibdir}/modules.d/95cifs
%{dracutlibdir}/modules.d/95fcoe
%{dracutlibdir}/modules.d/95fcoe-uefi
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95ssh-client
%{dracutlibdir}/modules.d/99uefi-lib
%files caps
%{dracutlibdir}/modules.d/02caps
%files live
%{dracutlibdir}/modules.d/99img-lib
%{dracutlibdir}/modules.d/90dmsquash-live
%{dracutlibdir}/modules.d/90dmsquash-live-autooverlay
%{dracutlibdir}/modules.d/90dmsquash-live-ntfs
%{dracutlibdir}/modules.d/90livenet
%files tools
%doc %{_mandir}/man8/dracut-catimages.8*
%{_bindir}/dracut-catimages
%dir /boot/dracut
%dir /var/lib/dracut
%dir /var/lib/dracut/overlay
%files squash
%{dracutlibdir}/modules.d/99squash
%files config-generic
%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
%files config-rescue
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
%changelog
* Mon Jan 22 2024 Yi Lin <nilusyi@tencent.com> - 059-6
- backport patches which fix renamed binaries from new systemd version 255.
* Thu Dec 28 2023 wynnfeng <wynnfeng@tencent.com> - 059-5
- backport patch which fix microcode check based on CONFIG_MICROCODE_[AMD|INTEL] issues.
* Fri Nov 17 2023 cunshunxia <cunshunxia@tencent.com> - 059-4
- backport patch which fix rootfs-generator issues.
* Wed Sep 20 2023 jackeyji <jackeyji@tencent.com> - 059-3
- Rebuilt for ntfs_3g 2022.10.3
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 059-2
- Rebuilt for OpenCloudOS Stream 23.09
* Tue Aug 15 2023 kianli <kianli@tencent.com> - 059-1
- Upgrade to 059
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 057-5
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 057-4
- Rebuilt for OpenCloudOS Stream 23
* Wed Feb 22 2023 Kairui Song <kasong@tencent.com> - 057-3
- fix(dracut-initramfs-restore.sh): fix initramfs path detection
* Wed Dec 28 2022 Yi Lin <nilusyi@tencent.com> - 057-2
- fix error of skipcpio running in systemd enviroment with broken pipe.
* Mon Jul 25 2022 Kairui Song <kasong@tencent.com> - 057-1
- Initial release
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/XIN_Y/dracut.git
git@gitee.com:XIN_Y/dracut.git
XIN_Y
dracut
dracut
master

搜索帮助