sys-kernel/dracut: Sync from Gentoo

Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>
This commit is contained in:
Adrian Vladu 2024-02-15 09:40:45 +00:00
parent 17ebdcc5d5
commit 79aa25a8ee
32 changed files with 867 additions and 1263 deletions

View File

@ -1,4 +1,3 @@
DIST dracut-050.tar.xz 333592 BLAKE2B cb0bfa5a8e7547260b8a80a3606eb284182c062926269c85b09e07d26ad177df0eeaa64b17005bff9290611f1c83fc8cd8e2216cfe14b5e66ec7f659d4c2fa7b SHA512 eba046cf1c8013369a398e585e0bff233daa8595d469ce9acc8bbc6a32d55c6a5429d4219db19abbf6001104be05b357f0961f9e66b7f926039a5d3ee7c2b850
DIST dracut-051.tar.xz 346500 BLAKE2B 38129b6b713b3338bbb2554fffd611f80216969eebac9fca7fb72df2db2036d4fbe66ebd54e646e562e24801e61064e54b62f066bab9e77ca88814100ebdd8ff SHA512 f3533430e479bc91c538e0a198ca97450ec449a7d661d876ecd0ad3e417e22f7e4abf0a384fc676a63a4d3479f25d717c8acdcd1bdec7d0a5714298c5c4ea6b8
DIST dracut-053.tar.xz 354668 BLAKE2B d20d0f1675e18cf44615a98255c8b1a73f23e9c665a771a1fe99716d3bf0b6082961ab20fe058bf31c106c4f521d9e8708e2ae98cff00f613197bbf9dd3abda3 SHA512 4736f84442bda208a38d3285ffeb8b845f06e52e3bf60d2aaea121240cf695e1369208c2d2cee1137a6c1d3f8f7794385675006beaf5cd86ade259d5f42d039a
DIST dracut-055.tar.xz 361752 BLAKE2B 9fcb0bce9ead2e079c70a377ea53701e4634d3dc64ae163e0e157d7d85822a274813e05f6079768640e1807818fad7a8158626413d773686a8d52fcd95fb5680 SHA512 2d2ea2889d9013bc94245bd7d1a2154f24d02bd9c2f7dbb28e5968e17d918e6598c68d85b0f551f968218980a80b19361ca0c9e8e94997ba54f4c09afcd6d866
DIST dracut-059.tar.gz 486487 BLAKE2B 86bbe18875cd3507e187b724cab212dc82e1daca7cedf79aeef13c34601adfff72bf2c0ba4c652e715b43c9a16f7be6a4a2b29dc75bef014640e1ec07c8d455b SHA512 196bc8bf18703c72bffb51a7e0493719c58173ad2da7d121eb42f9a8de47e953af36d109214dc4a10b2dc2d3bd19e844f7f51c2bdec087e064ea11f75124032d
DIST dracut-060_pre20231030.tar.gz 498954 BLAKE2B ce47f06e1304f732cbad66046c70cbcb03d33d69b9c3e87a4e2e2d30fa837b3b36949462cec9b06125e824ad82db45bd7516c22a1c84ec6884790b37e9c65ab1 SHA512 0cd2fefcd624758063c77836989260a3d5b0d533004c2395124c8200c31602f5d7d0b8c9491de37ce4afb2c5009b2cf944ddd3bb9e0e11120d84176cb1e7423c
DIST dracut-060_pre20240104.tar.gz 499965 BLAKE2B 935e0e5da348426d69c6dab6b91078f126cadd9ffc6a32378e79cd93b1dbadff35899efc3786fc12bf5a6741843d3637b0c98cc71fe4a96a8caf053ae887bac3 SHA512 f7818265f082e9c05ebb81a91b67fb9b1d3bf8b2433b7e6ea9be6bee43d28cd1ee48577648e1d9b3729c17608b028d294c13bf5d4db4cc5a18e3b007eb2cd67e

View File

@ -1,170 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit bash-completion-r1 linux-info optfeature systemd toolchain-funcs
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
else
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ppc ppc64 sparc x86"
SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz"
fi
DESCRIPTION="Generic initramfs generation tool"
HOMEPAGE="https://dracut.wiki.kernel.org"
LICENSE="GPL-2"
SLOT="0"
IUSE="selinux"
# Tests need root privileges, bug #298014
RESTRICT="test"
RDEPEND="
app-arch/cpio
>=app-shells/bash-4.0:0
sys-apps/coreutils[xattr(-)]
>=sys-apps/kmod-23[tools]
|| (
>=sys-apps/sysvinit-2.87-r3
sys-apps/openrc[sysv-utils(-),selinux?]
sys-apps/systemd[sysv-utils]
)
>=sys-apps/util-linux-2.21
virtual/pkgconfig
virtual/udev
elibc_musl? ( sys-libs/fts-standalone )
selinux? (
sec-policy/selinux-dracut
sys-libs/libselinux
sys-libs/libsepol
)
"
DEPEND="
>=sys-apps/kmod-23
elibc_musl? ( sys-libs/fts-standalone )
"
BDEPEND="
app-text/asciidoc
app-text/docbook-xml-dtd:4.5
>=app-text/docbook-xsl-stylesheets-1.75.2
>=dev-libs/libxslt-1.1.26
virtual/pkgconfig
"
DOCS=( AUTHORS HACKING NEWS README.md README.generic README.kernel README.modules
README.testsuite TODO )
QA_MULTILIB_PATHS="usr/lib/dracut/.*"
PATCHES=(
"${FILESDIR}"/050-Makefile-merge-main-version-and-git-version-earlier.patch
"${FILESDIR}"/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch
"${FILESDIR}"/050-Makefile-fix-VERSION-again.patch
"${FILESDIR}"/050-btrfs-force-preload-btrfs-module.patch
"${FILESDIR}"/050-network-manager-ensure-that-nm-run.sh-is-executed-wh.patch
"${FILESDIR}"/050-dracut-lib.sh-quote-variables-in-parameter-expansion.patch
"${FILESDIR}"/050-busybox-module-fix.patch
"${FILESDIR}"/050-systemd-remove-obsolete-syslog-parameter.patch
"${FILESDIR}"/050-lvm-fix-removal-of-pvscan-from-udev-rules.patch
"${FILESDIR}"/050-gentoo-ldconfig-paths.patch
# Flatcar: override iscsi network dependency
"${FILESDIR}"/050-change-network-dep-iscsi.patch
)
src_configure() {
local myconf=(
--prefix="${EPREFIX}/usr"
--sysconfdir="${EPREFIX}/etc"
--bashcompletiondir="$(get_bashcompdir)"
--systemdsystemunitdir="$(systemd_get_systemunitdir)"
)
tc-export CC PKG_CONFIG
echo ./configure "${myconf[@]}"
./configure "${myconf[@]}" || die
if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
# Source tarball from github doesn't include this file
echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
fi
}
src_install() {
default
insinto /etc/logrotate.d
newins dracut.logrotate dracut
docinto html
dodoc dracut.html
}
pkg_postinst() {
if linux-info_get_any_version && linux_config_exists; then
ewarn ""
ewarn "If the following test report contains a missing kernel"
ewarn "configuration option, you should reconfigure and rebuild your"
ewarn "kernel before booting image generated with this Dracut version."
ewarn ""
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
# Kernel configuration options descriptions:
local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
ERROR_DEVTMPFS+='is missing and REQUIRED'
local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
check_extra_config
echo
else
ewarn ""
ewarn "Your kernel configuration couldn't be checked."
ewarn "Please check manually if following options are enabled:"
ewarn ""
ewarn " CONFIG_BLK_DEV_INITRD"
ewarn " CONFIG_DEVTMPFS"
ewarn ""
fi
optfeature "Networking support" net-misc/networkmanager
optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
sys-apps/iproute2 "net-misc/iputils[arping]"
optfeature \
"Measure performance of the boot process for later visualisation" \
app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs
optfeature "Load kernel modules and drop this privilege for real init" \
sys-libs/libcap
optfeature "Support CIFS" net-fs/cifs-utils
optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
"sys-fs/cryptsetup[-static-libs]"
optfeature "Support for GPG-encrypted keys for crypt module" \
app-crypt/gnupg
optfeature \
"Allows use of dash instead of default bash (on your own risk)" \
app-shells/dash
optfeature "Support iSCSI" sys-block/open-iscsi
optfeature "Support Logical Volume Manager" sys-fs/lvm2
optfeature "Support MD devices, also known as software RAID devices" \
sys-fs/mdadm
optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5'
optfeature "Support network block devices" sys-block/nbd
optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
optfeature \
"Install ssh and scp along with config files and specified keys" \
net-misc/openssh
optfeature "Enable logging with rsyslog" app-admin/rsyslog
optfeature \
"Enable rngd service to help generating entropy early during boot" \
sys-apps/rng-tools
}

View File

@ -1,21 +1,22 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit bash-completion-r1 linux-info optfeature systemd toolchain-funcs
inherit bash-completion-r1 optfeature systemd toolchain-funcs
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
else
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz"
if [[ "${PV}" != *_rc* ]]; then
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
fi
SRC_URI="https://github.com/dracutdevs/dracut/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
fi
DESCRIPTION="Generic initramfs generation tool"
HOMEPAGE="https://dracut.wiki.kernel.org"
HOMEPAGE="https://github.com/dracutdevs/dracut/wiki"
LICENSE="GPL-2"
SLOT="0"
@ -24,7 +25,7 @@ IUSE="selinux test"
RESTRICT="!test? ( test )"
RDEPEND="
app-arch/cpio
app-alternatives/cpio
>=app-shells/bash-4.0:0
sys-apps/coreutils[xattr(-)]
>=sys-apps/kmod-23[tools]
@ -32,6 +33,7 @@ RDEPEND="
>=sys-apps/sysvinit-2.87-r3
sys-apps/openrc[sysv-utils(-),selinux?]
sys-apps/systemd[sysv-utils]
sys-apps/s6-linux-init[sysv-utils(-)]
)
>=sys-apps/util-linux-2.21
virtual/pkgconfig
@ -61,6 +63,15 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
PATCHES=(
"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
"${FILESDIR}"/gentoo-network-r1.patch
"${FILESDIR}"/059-kernel-install-uki.patch
"${FILESDIR}"/059-uefi-split-usr.patch
"${FILESDIR}"/059-uki-systemd-254.patch
"${FILESDIR}"/059-gawk.patch
"${FILESDIR}"/dracut-059-dmsquash-live.patch
"${FILESDIR}"/059-systemd-pcrphase.patch
"${FILESDIR}"/059-systemd-executor.patch
"${FILESDIR}"/dracut-059-install-new-systemd-hibernate-resume.service.patch
)
src_configure() {
@ -111,39 +122,9 @@ src_install() {
}
pkg_postinst() {
if linux-info_get_any_version && linux_config_exists; then
ewarn ""
ewarn "If the following test report contains a missing kernel"
ewarn "configuration option, you should reconfigure and rebuild your"
ewarn "kernel before booting image generated with this Dracut version."
ewarn ""
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
# Kernel configuration options descriptions:
local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
ERROR_DEVTMPFS+='is missing and REQUIRED'
local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
check_extra_config
echo
else
ewarn ""
ewarn "Your kernel configuration couldn't be checked."
ewarn "Please check manually if following options are enabled:"
ewarn ""
ewarn " CONFIG_BLK_DEV_INITRD"
ewarn " CONFIG_DEVTMPFS"
ewarn ""
fi
optfeature "Networking support" net-misc/networkmanager
optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
sys-apps/iproute2 "net-misc/iputils[arping]"
optfeature \
"Measure performance of the boot process for later visualisation" \
app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs
optfeature "Load kernel modules and drop this privilege for real init" \
sys-libs/libcap
@ -155,19 +136,29 @@ pkg_postinst() {
optfeature \
"Allows use of dash instead of default bash (on your own risk)" \
app-shells/dash
optfeature \
"Allows use of busybox instead of default bash (on your own risk)" \
sys-apps/busybox
optfeature "Support iSCSI" sys-block/open-iscsi
optfeature "Support Logical Volume Manager" sys-fs/lvm2
optfeature "Support Logical Volume Manager" sys-fs/lvm2[lvm]
optfeature "Support MD devices, also known as software RAID devices" \
sys-fs/mdadm
sys-fs/mdadm sys-fs/dmraid
optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5'
optfeature "Support network block devices" sys-block/nbd
optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
optfeature \
"Install ssh and scp along with config files and specified keys" \
net-misc/openssh
virtual/openssh
optfeature "Enable logging with rsyslog" app-admin/rsyslog
optfeature "Support Squashfs" sys-fs/squashfs-tools
optfeature "Support TPM 2.0 TSS" app-crypt/tpm2-tools
optfeature "Support Bluetooth (experimental)" net-wireless/bluez
optfeature "Support BIOS-given device names" sys-apps/biosdevname
optfeature "Support network NVMe" sys-apps/nvme-cli
optfeature \
"Enable rngd service to help generating entropy early during boot" \
sys-apps/rng-tools
optfeature "automatically generating an initramfs on each kernel installation" \
"sys-kernel/installkernel[dracut]"
}

View File

@ -1,31 +1,36 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit bash-completion-r1 linux-info optfeature systemd toolchain-funcs
inherit bash-completion-r1 edo optfeature systemd toolchain-funcs
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
else
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ppc ppc64 sparc x86"
SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz"
if [[ ${PV} == *_p* ]] ; then
EGIT_COMMIT="856e7acdb1462803c2517c8d64afb2e34c73c735"
SRC_URI="https://github.com/dracutdevs/dracut/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}"/${PN}-${EGIT_COMMIT}
else
SRC_URI="https://github.com/dracutdevs/dracut/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
fi
fi
DESCRIPTION="Generic initramfs generation tool"
HOMEPAGE="https://dracut.wiki.kernel.org"
HOMEPAGE="https://github.com/dracutdevs/dracut/wiki"
LICENSE="GPL-2"
SLOT="0"
IUSE="selinux"
# Tests need root privileges, bug #298014
RESTRICT="test"
if [[ "${PV}" != *_rc* ]]; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
IUSE="selinux test"
RESTRICT="!test? ( test )"
RDEPEND="
app-arch/cpio
app-alternatives/cpio
>=app-shells/bash-4.0:0
sys-apps/coreutils[xattr(-)]
>=sys-apps/kmod-23[tools]
@ -33,6 +38,7 @@ RDEPEND="
>=sys-apps/sysvinit-2.87-r3
sys-apps/openrc[sysv-utils(-),selinux?]
sys-apps/systemd[sysv-utils]
sys-apps/s6-linux-init[sysv-utils(-)]
)
>=sys-apps/util-linux-2.21
virtual/pkgconfig
@ -58,15 +64,13 @@ BDEPEND="
virtual/pkgconfig
"
DOCS=( AUTHORS README.md README.generic README.kernel )
QA_MULTILIB_PATHS="usr/lib/dracut/.*"
PATCHES=(
"${FILESDIR}"/053-network-manager.patch
"${FILESDIR}"/gentoo-ldconfig-paths.patch
# Flatcar: override iscsi network dependency
"${FILESDIR}"/050-change-network-dep-iscsi.patch
"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
"${FILESDIR}"/dracut-060-fix-resume-hostonly.patch
"${FILESDIR}"/dracut-060-systemd-255.patch
"${FILESDIR}"/dracut-059-install-new-systemd-hibernate-resume.service.patch
)
src_configure() {
@ -79,16 +83,31 @@ src_configure() {
tc-export CC PKG_CONFIG
echo ./configure "${myconf[@]}"
./configure "${myconf[@]}" || die
edo ./configure "${myconf[@]}"
}
if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
# Source tarball from github doesn't include this file
echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
src_test() {
if [[ ${EUID} != 0 ]]; then
# Tests need root privileges, bug #298014
ewarn "Skipping tests: Not running as root."
elif [[ ! -w /dev/kvm ]]; then
ewarn "Skipping tests: Unable to access /dev/kvm."
else
emake -C test check
fi
}
src_install() {
local DOCS=(
AUTHORS
NEWS.md
README.md
docs/README.cross
docs/README.generic
docs/README.kernel
docs/SECURITY.md
)
default
docinto html
@ -96,39 +115,9 @@ src_install() {
}
pkg_postinst() {
if linux-info_get_any_version && linux_config_exists; then
ewarn ""
ewarn "If the following test report contains a missing kernel"
ewarn "configuration option, you should reconfigure and rebuild your"
ewarn "kernel before booting image generated with this Dracut version."
ewarn ""
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
# Kernel configuration options descriptions:
local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
ERROR_DEVTMPFS+='is missing and REQUIRED'
local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
check_extra_config
echo
else
ewarn ""
ewarn "Your kernel configuration couldn't be checked."
ewarn "Please check manually if following options are enabled:"
ewarn ""
ewarn " CONFIG_BLK_DEV_INITRD"
ewarn " CONFIG_DEVTMPFS"
ewarn ""
fi
optfeature "Networking support" net-misc/networkmanager
optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
sys-apps/iproute2 "net-misc/iputils[arping]"
optfeature \
"Measure performance of the boot process for later visualisation" \
app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs
optfeature "Load kernel modules and drop this privilege for real init" \
sys-libs/libcap
@ -140,19 +129,29 @@ pkg_postinst() {
optfeature \
"Allows use of dash instead of default bash (on your own risk)" \
app-shells/dash
optfeature \
"Allows use of busybox instead of default bash (on your own risk)" \
sys-apps/busybox
optfeature "Support iSCSI" sys-block/open-iscsi
optfeature "Support Logical Volume Manager" sys-fs/lvm2
optfeature "Support Logical Volume Manager" sys-fs/lvm2[lvm]
optfeature "Support MD devices, also known as software RAID devices" \
sys-fs/mdadm
sys-fs/mdadm sys-fs/dmraid
optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5'
optfeature "Support network block devices" sys-block/nbd
optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
optfeature \
"Install ssh and scp along with config files and specified keys" \
net-misc/openssh
virtual/openssh
optfeature "Enable logging with rsyslog" app-admin/rsyslog
optfeature "Support Squashfs" sys-fs/squashfs-tools
optfeature "Support TPM 2.0 TSS" app-crypt/tpm2-tools
optfeature "Support Bluetooth (experimental)" net-wireless/bluez
optfeature "Support BIOS-given device names" sys-apps/biosdevname
optfeature "Support network NVMe" sys-apps/nvme-cli app-misc/jq
optfeature \
"Enable rngd service to help generating entropy early during boot" \
sys-apps/rng-tools
optfeature "automatically generating an initramfs on each kernel installation" \
"sys-kernel/installkernel[dracut]"
}

View File

@ -1,31 +1,36 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit bash-completion-r1 linux-info optfeature systemd toolchain-funcs
inherit bash-completion-r1 edo optfeature systemd toolchain-funcs
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
else
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz"
if [[ ${PV} == *_p* ]] ; then
EGIT_COMMIT="4980bad34775da715a2639b736cba5e65a8a2604"
SRC_URI="https://github.com/dracutdevs/dracut/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}"/${PN}-${EGIT_COMMIT}
else
SRC_URI="https://github.com/dracutdevs/dracut/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
fi
fi
DESCRIPTION="Generic initramfs generation tool"
HOMEPAGE="https://dracut.wiki.kernel.org"
HOMEPAGE="https://github.com/dracutdevs/dracut/wiki"
LICENSE="GPL-2"
SLOT="0"
IUSE="selinux"
# Tests need root privileges, bug #298014
RESTRICT="test"
if [[ "${PV}" != *_rc* ]]; then
KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv sparc x86"
fi
IUSE="selinux test"
RESTRICT="!test? ( test )"
RDEPEND="
app-arch/cpio
app-alternatives/cpio
>=app-shells/bash-4.0:0
sys-apps/coreutils[xattr(-)]
>=sys-apps/kmod-23[tools]
@ -33,6 +38,7 @@ RDEPEND="
>=sys-apps/sysvinit-2.87-r3
sys-apps/openrc[sysv-utils(-),selinux?]
sys-apps/systemd[sysv-utils]
sys-apps/s6-linux-init[sysv-utils(-)]
)
>=sys-apps/util-linux-2.21
virtual/pkgconfig
@ -58,14 +64,14 @@ BDEPEND="
virtual/pkgconfig
"
DOCS=( AUTHORS HACKING NEWS README.md README.generic README.kernel README.modules
README.testsuite TODO )
QA_MULTILIB_PATHS="usr/lib/dracut/.*"
PATCHES=(
"${FILESDIR}"/051-dracut.sh-move-ldconfig.patch
"${FILESDIR}"/gentoo-ldconfig-paths.patch
"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
"${FILESDIR}"/dracut-060-fix-resume-hostonly.patch
"${FILESDIR}"/dracut-060-grub-layout.patch
"${FILESDIR}"/dracut-060-systemd-255.patch
"${FILESDIR}"/dracut-059-install-new-systemd-hibernate-resume.service.patch
)
src_configure() {
@ -78,59 +84,41 @@ src_configure() {
tc-export CC PKG_CONFIG
echo ./configure "${myconf[@]}"
./configure "${myconf[@]}" || die
edo ./configure "${myconf[@]}"
}
if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
# Source tarball from github doesn't include this file
echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
src_test() {
if [[ ${EUID} != 0 ]]; then
# Tests need root privileges, bug #298014
ewarn "Skipping tests: Not running as root."
elif [[ ! -w /dev/kvm ]]; then
ewarn "Skipping tests: Unable to access /dev/kvm."
else
emake -C test check
fi
}
src_install() {
default
local DOCS=(
AUTHORS
NEWS.md
README.md
docs/README.cross
docs/README.generic
docs/README.kernel
docs/SECURITY.md
)
insinto /etc/logrotate.d
newins dracut.logrotate dracut
default
docinto html
dodoc dracut.html
}
pkg_postinst() {
if linux-info_get_any_version && linux_config_exists; then
ewarn ""
ewarn "If the following test report contains a missing kernel"
ewarn "configuration option, you should reconfigure and rebuild your"
ewarn "kernel before booting image generated with this Dracut version."
ewarn ""
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
# Kernel configuration options descriptions:
local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
ERROR_DEVTMPFS+='is missing and REQUIRED'
local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
check_extra_config
echo
else
ewarn ""
ewarn "Your kernel configuration couldn't be checked."
ewarn "Please check manually if following options are enabled:"
ewarn ""
ewarn " CONFIG_BLK_DEV_INITRD"
ewarn " CONFIG_DEVTMPFS"
ewarn ""
fi
optfeature "Networking support" net-misc/networkmanager
optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
sys-apps/iproute2 "net-misc/iputils[arping]"
optfeature \
"Measure performance of the boot process for later visualisation" \
app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs
optfeature "Load kernel modules and drop this privilege for real init" \
sys-libs/libcap
@ -142,19 +130,29 @@ pkg_postinst() {
optfeature \
"Allows use of dash instead of default bash (on your own risk)" \
app-shells/dash
optfeature \
"Allows use of busybox instead of default bash (on your own risk)" \
sys-apps/busybox
optfeature "Support iSCSI" sys-block/open-iscsi
optfeature "Support Logical Volume Manager" sys-fs/lvm2
optfeature "Support Logical Volume Manager" sys-fs/lvm2[lvm]
optfeature "Support MD devices, also known as software RAID devices" \
sys-fs/mdadm
sys-fs/mdadm sys-fs/dmraid
optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5'
optfeature "Support network block devices" sys-block/nbd
optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
optfeature \
"Install ssh and scp along with config files and specified keys" \
net-misc/openssh
virtual/openssh
optfeature "Enable logging with rsyslog" app-admin/rsyslog
optfeature "Support Squashfs" sys-fs/squashfs-tools
optfeature "Support TPM 2.0 TSS" app-crypt/tpm2-tools
optfeature "Support Bluetooth (experimental)" net-wireless/bluez
optfeature "Support BIOS-given device names" sys-apps/biosdevname
optfeature "Support network NVMe" sys-apps/nvme-cli app-misc/jq
optfeature \
"Enable rngd service to help generating entropy early during boot" \
sys-apps/rng-tools
optfeature "automatically generating an initramfs on each kernel installation" \
"sys-kernel/installkernel[dracut]"
}

View File

@ -1,30 +1,36 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit bash-completion-r1 linux-info optfeature systemd toolchain-funcs
inherit bash-completion-r1 edo optfeature systemd toolchain-funcs
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
else
[[ "${PV}" = *_rc* ]] || \
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz"
if [[ ${PV} == *_p* ]] ; then
EGIT_COMMIT="856e7acdb1462803c2517c8d64afb2e34c73c735"
SRC_URI="https://github.com/dracutdevs/dracut/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}"/${PN}-${EGIT_COMMIT}
else
SRC_URI="https://github.com/dracutdevs/dracut/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
fi
fi
DESCRIPTION="Generic initramfs generation tool"
HOMEPAGE="https://dracut.wiki.kernel.org"
HOMEPAGE="https://github.com/dracutdevs/dracut/wiki"
LICENSE="GPL-2"
SLOT="0"
if [[ ${PV} != 9999 && ${PV} != *_rc* ]]; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
fi
IUSE="selinux test"
RESTRICT="!test? ( test )"
RDEPEND="
app-arch/cpio
app-alternatives/cpio
>=app-shells/bash-4.0:0
sys-apps/coreutils[xattr(-)]
>=sys-apps/kmod-23[tools]
@ -32,6 +38,7 @@ RDEPEND="
>=sys-apps/sysvinit-2.87-r3
sys-apps/openrc[sysv-utils(-),selinux?]
sys-apps/systemd[sysv-utils]
sys-apps/s6-linux-init[sysv-utils(-)]
)
>=sys-apps/util-linux-2.21
virtual/pkgconfig
@ -73,13 +80,7 @@ src_configure() {
tc-export CC PKG_CONFIG
echo ./configure "${myconf[@]}"
./configure "${myconf[@]}" || die
if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
# Source tarball from github doesn't include this file
echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
fi
edo ./configure "${myconf[@]}"
}
src_test() {
@ -111,39 +112,9 @@ src_install() {
}
pkg_postinst() {
if linux-info_get_any_version && linux_config_exists; then
ewarn ""
ewarn "If the following test report contains a missing kernel"
ewarn "configuration option, you should reconfigure and rebuild your"
ewarn "kernel before booting image generated with this Dracut version."
ewarn ""
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
# Kernel configuration options descriptions:
local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
ERROR_DEVTMPFS+='is missing and REQUIRED'
local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
check_extra_config
echo
else
ewarn ""
ewarn "Your kernel configuration couldn't be checked."
ewarn "Please check manually if following options are enabled:"
ewarn ""
ewarn " CONFIG_BLK_DEV_INITRD"
ewarn " CONFIG_DEVTMPFS"
ewarn ""
fi
optfeature "Networking support" net-misc/networkmanager
optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
sys-apps/iproute2 "net-misc/iputils[arping]"
optfeature \
"Measure performance of the boot process for later visualisation" \
app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs
optfeature "Load kernel modules and drop this privilege for real init" \
sys-libs/libcap
@ -155,19 +126,29 @@ pkg_postinst() {
optfeature \
"Allows use of dash instead of default bash (on your own risk)" \
app-shells/dash
optfeature \
"Allows use of busybox instead of default bash (on your own risk)" \
sys-apps/busybox
optfeature "Support iSCSI" sys-block/open-iscsi
optfeature "Support Logical Volume Manager" sys-fs/lvm2
optfeature "Support Logical Volume Manager" sys-fs/lvm2[lvm]
optfeature "Support MD devices, also known as software RAID devices" \
sys-fs/mdadm
sys-fs/mdadm sys-fs/dmraid
optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5'
optfeature "Support network block devices" sys-block/nbd
optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
optfeature \
"Install ssh and scp along with config files and specified keys" \
net-misc/openssh
virtual/openssh
optfeature "Enable logging with rsyslog" app-admin/rsyslog
optfeature "Support Squashfs" sys-fs/squashfs-tools
optfeature "Support TPM 2.0 TSS" app-crypt/tpm2-tools
optfeature "Support Bluetooth (experimental)" net-wireless/bluez
optfeature "Support BIOS-given device names" sys-apps/biosdevname
optfeature "Support network NVMe" sys-apps/nvme-cli app-misc/jq
optfeature \
"Enable rngd service to help generating entropy early during boot" \
sys-apps/rng-tools
optfeature "automatically generating an initramfs on each kernel installation" \
"sys-kernel/installkernel[dracut]"
}

View File

@ -1,34 +0,0 @@
From a76aa8e39016a8564adb0f18f93bbf2e15d3243f Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Sun, 8 Mar 2020 05:47:50 +0300
Subject: [PATCH] Makefile: fix VERSION again
The variable is not undefined anymore after the first assignment, so
we should check if variable is empty instead.
---
Makefile | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index c69e2dfc..02e2c4b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,13 @@
-include dracut-version.sh
DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
-DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION)
+ifeq ($(DRACUT_MAIN_VERSION),)
+DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
+endif
DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
-DRACUT_FULL_VERSION ?= $(DRACUT_VERSION)
+ifeq ($(DRACUT_FULL_VERSION),)
+DRACUT_FULL_VERSION = $(DRACUT_VERSION)
+endif
-include Makefile.inc
--
2.24.1

View File

@ -1,78 +0,0 @@
From eb8a7a96351b6e1cfd9dc34f1e854333a8f4a4e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Fri, 6 Mar 2020 08:46:36 +0700
Subject: [PATCH] Makefile: merge main-version and git-version earlier
With GNU Make 4.3 on both ArchLinux, and VoidLinux,
GITVERION is always empty because of bad substitution.
Change '\#' to simply '#' can fix it,
but we don't need that complation.
We can merge DRACUT_MAIN_VERSION and GITVERSION into DRACUT_FULL_VERSION.
Because, GITVERSION will be attached back to DRACUT_MAIN_VERSION in all
situation.
While we're at it, detect if we're in git worktree by:
limiting GIT_CEILING_DIRECTORIES to parent directory of
dracut's top level directory; instead of checking for .git directory,
in order to support git-worktree, in such case, .git will be a file, see
gitrepository-layout(5)
---
Makefile | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 22b584f1..c69e2dfc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
-include dracut-version.sh
-DRACUT_MAIN_VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags --always 2>/dev/null || :)
+DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION)
-GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags --always 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
+DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
+DRACUT_FULL_VERSION ?= $(DRACUT_VERSION)
-include Makefile.inc
@@ -92,14 +93,14 @@ endif
%.xml: %.asc
@rm -f -- "$@"
- asciidoc -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" -d manpage -b docbook -o "$@" $<
+ asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
dracut.8: dracut.usage.asc dracut.8.asc
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
@rm -f -- dracut.xml
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
- -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" \
+ -a "version=$(DRACUT_FULL_VERSION)" \
-a numbered \
-d book -b docbook -o dracut.xml dracut.asc
@rm -f -- dracut.html
@@ -112,7 +113,7 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
dracut.pc: Makefile.inc Makefile
@echo "Name: dracut" > dracut.pc
@echo "Description: dracut" >> dracut.pc
- @echo "Version: $(DRACUT_MAIN_VERSION)$(GITVERSION)" >> dracut.pc
+ @echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
@@ -182,7 +183,7 @@ endif
dracut-version.sh:
@rm -f dracut-version.sh
- @echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)$(GITVERSION)" > dracut-version.sh
+ @echo "DRACUT_VERSION=$(DRACUT_FULL_VERSION)" > dracut-version.sh
clean:
$(RM) *~
--
2.24.1

View File

@ -1,30 +0,0 @@
From 0402b3777b1c64bd716f588ff7457b905e98489d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 11 Mar 2020 12:56:52 +0100
Subject: [PATCH] btrfs: force preload btrfs module
fixes https://github.com/dracutdevs/dracut/issues/658
raid6_pq and xor takes time doing benchmarking
[ 3.983009] request_module fs-btrfs succeeded, but still no fs?
---
modules.d/90btrfs/module-setup.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
index b0d0058b..66a254e1 100755
--- a/modules.d/90btrfs/module-setup.sh
+++ b/modules.d/90btrfs/module-setup.sh
@@ -48,5 +48,7 @@ install() {
inst_multiple -o btrfsck btrfs-zero-log
inst $(command -v btrfs) /sbin/btrfs
+ # Hack for slow machines
+ # see https://github.com/dracutdevs/dracut/issues/658
+ echo "rd.driver.pre=btrfs" > ${initdir}/etc/cmdline.d/00-btrfs.conf
}
-
--
2.26.2

View File

@ -1,102 +0,0 @@
From f769154bccf22d2b5caf5e4888f88bf7edde2662 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Mon, 25 May 2020 19:02:05 +0300
Subject: [PATCH 1/2] dracut-functions: fix find_binary() to return full path
Fixes: a01204202b30 (Allow running on a cross-compiled rootfs)
---
dracut-functions.sh | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 3cb9c7af..b5c28248 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -41,31 +41,36 @@ str_ends() { [ "${1%*"$2"}" != "$1" ]; }
# search in the usual places to find the binary.
find_binary() {
local _delim
+ local _path
local l
local p
[[ -z ${1##/*} ]] || _delim="/"
if [[ "$1" == *.so* ]]; then
for l in libdirs ; do
- if { $DRACUT_LDD "$dracutsysrootdir$l$_delim$1" &>/dev/null; }; then
- printf "%s\n" "$1"
+ _path="${l}${_delim}${1}"
+ if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
+ printf "%s\n" "${_path}"
return 0
fi
done
- if { $DRACUT_LDD "$dracutsysrootdir$_delim$1" &>/dev/null; }; then
- printf "%s\n" "$1"
+ _path="${_delim}${1}"
+ if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
+ printf "%s\n" "${_path}"
return 0
fi
fi
if [[ "$1" == */* ]]; then
- if [[ -L $dracutsysrootdir$_delim$1 ]] || [[ -x $dracutsysrootdir$_delim$1 ]]; then
- printf "%s\n" "$1"
+ _path="${_delim}${1}"
+ if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
+ printf "%s\n" "${_path}"
return 0
fi
fi
for p in $DRACUT_PATH ; do
- if [[ -L $dracutsysrootdir$p$_delim$1 ]] || [[ -x $dracutsysrootdir$p$_delim$1 ]]; then
- printf "%s\n" "$1"
+ _path="${p}${_delim}${1}"
+ if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
+ printf "%s\n" "${_path}"
return 0
fi
done
--
2.26.2
From 50cc23ba32b0fda63eff7623b529dbeb4e6a38c6 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Mon, 25 May 2020 17:49:20 +0300
Subject: [PATCH 2/2] busybox: simplify listing of supported utilities
'--list' option is supported since busybox-1.20.0, which was released
in 2010.
---
modules.d/05busybox/module-setup.sh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh
index ecbd6a13..5d88c5d1 100755
--- a/modules.d/05busybox/module-setup.sh
+++ b/modules.d/05busybox/module-setup.sh
@@ -14,15 +14,16 @@ depends() {
# called by dracut
install() {
- local _i _progs _path _busybox
+ local _i _path _busybox
+ local _progs=()
_busybox=$(type -P busybox)
inst $_busybox /usr/bin/busybox
- for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
- do
- _progs="$_progs $_i"
+ for _i in $($_busybox --list); do
+ [[ ${_i} == busybox ]] && continue
+ _progs+=("${_i}")
done
- for _i in $_progs; do
+ for _i in "${_progs[@]}"; do
_path=$(find_binary "$_i")
[ -z "$_path" ] && continue
ln_r /usr/bin/busybox $_path
--
2.26.2

View File

@ -1,12 +0,0 @@
As Flatcar uses the flatcar-network module, we need to replace it in the iscsi
module setup in order to enable iscsi support.
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
@@ -183,7 +183,7 @@
# called by dracut
depends() {
- echo network rootfs-block
+ echo flatcar-network rootfs-block
}
# called by dracut

View File

@ -1,111 +0,0 @@
From 8e1a4dc5f8a777fc718db490414ffdc9dc755f66 Mon Sep 17 00:00:00 2001
From: Jonas Witschel <diabonas@archlinux.org>
Date: Sat, 18 Apr 2020 14:55:41 +0200
Subject: [PATCH] dracut-lib.sh: quote variables in parameter expansion
patterns
According to POSIX.1-2017, 2.6.2 Parameter Expansion:
${parameter%[word]} [...] The word shall be expanded to produce a
pattern.
This means if word contains variables that itself contain special
characters like asterisks or backslashes, these are treated as pattern
characters unless the variable is quoted. Try e.g. the following example
in bash, dash or (busybox) ash:
i='a\c'; j='\'; echo "${i%$j*}"
This prints "a\c" because "$j*" is expanded to "\*", escaping the
asterisk. In contrast,
i='a\c'; j='\'; echo "${i%"$j"*}"
produces the expected result "a" because the backslash is not specially
treated any more after quoting.
The quotes that this commit adds have been previously removed in commit
f9c96cf56fed390841eac05c43826e62014c9188, citing issues with busybox
hush without further specifying the actual error. I tested a recent
busybox build (upstream commit 9aa751b08ab03d6396f86c3df77937a19687981b)
and couldn't find any problems. Note that the above example always
produces "a\c" in hush regardless of quoting $j, making hush unsuitable
for use with dracut, but using quotes in parameter expansions generally
works.
The unquoted variables break the "rd.luks.uuid/name" kernel command line
options in dracut 050 because
str_replace "$luksname" '\' '\\'
in modules.d/90crypt/parse-crypt.sh is not able to escape the
backslashes any more, see GH-723, GH-727: backslashes in the
systemd-cryptsetup@.service unit name stay unescaped for use in udev
(cf. commit 0f6d93eb9d63695a64002ec8b0421fbc9fc8a7a3), leading to
failures in starting the unit.
This partially reverts commit f9c96cf56fed390841eac05c43826e62014c9188.
---
modules.d/99base/dracut-lib.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index c53cd13b..c57523d3 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -24,7 +24,7 @@ debug_on() {
# returns OK if $1 contains literal string $2 (and isn't empty)
strstr() {
- [ "${1##*$2*}" != "$1" ]
+ [ "${1##*"$2"*}" != "$1" ]
}
# returns OK if $1 matches (completely) glob pattern $2
@@ -43,18 +43,18 @@ strglobin() {
# returns OK if $1 contains literal string $2 at the beginning, and isn't empty
str_starts() {
- [ "${1#$2*}" != "$1" ]
+ [ "${1#"$2"*}" != "$1" ]
}
# returns OK if $1 contains literal string $2 at the end, and isn't empty
str_ends() {
- [ "${1%*$2}" != "$1" ]
+ [ "${1%*"$2"}" != "$1" ]
}
trim() {
local var="$*"
- var="${var#${var%%[![:space:]]*}}" # remove leading whitespace characters
- var="${var%${var##*[![:space:]]}}" # remove trailing whitespace characters
+ var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
+ var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
printf "%s" "$var"
}
@@ -108,9 +108,9 @@ str_replace() {
local out=''
while strstr "${in}" "$s"; do
- chop="${in%%$s*}"
+ chop="${in%%"$s"*}"
out="${out}${chop}$r"
- in="${in#*$s}"
+ in="${in#*"$s"}"
done
echo "${out}${in}"
}
@@ -396,7 +396,7 @@ splitsep() {
while [ -n "$str" -a "$#" -gt 1 ]; do
tmp="${str%%$sep*}"
eval "$1='${tmp}'"
- str="${str#$tmp}"
+ str="${str#"$tmp"}"
str="${str#$sep}"
shift
done
--
2.26.2

View File

@ -1,75 +0,0 @@
From 0386e4627779cb51f4292b3c642d90586d5e71b4 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 29 Jan 2020 23:53:29 +0100
Subject: [PATCH] dracut.sh: don't call fsfreeze on subvol of root file system
dracut.sh already doesn't call fsfreeze if the output file is on
the root file system. For btrfs, however, this is not sufficient.
Because fsfreeze is a superblock operation, and all btrfs subvolumes
share the same superblock, fsfreeze may freeze the entire system
if the subvolume on which the output file is written and / are
subvolumes of the same file system. Avoid this by comparing file
system UUIDs for btrfs.
Fixes: de576db3c225 ("call fsfreeze(8) on /boot to flush initramfs data & metadata to media")
---
dracut.sh | 36 +++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index af346f3a..c14f6c0b 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -2075,6 +2075,40 @@ fi
command -v restorecon &>/dev/null && restorecon -- "$outfile"
+btrfs_uuid() {
+ btrfs filesystem show "$1" | sed -n '1s/^.*uuid: //p'
+}
+
+freeze_ok_for_btrfs() {
+ local mnt uuid1 uuid2
+ # If the output file is on btrfs, we need to make sure that it's
+ # not on a subvolume of the same file system as the root FS.
+ # Otherwise, fsfreeze() might freeze the entire system.
+ # This is most conveniently checked by comparing the FS uuid.
+
+ [[ "$(stat -f -c %T -- "/")" == "btrfs" ]] || return 0
+ mnt=$(stat -c %m -- "$1")
+ uuid1=$(btrfs_uuid "$mnt")
+ uuid2=$(btrfs_uuid "/")
+ [[ "$uuid1" && "$uuid2" && "$uuid1" != "$uuid2" ]]
+}
+
+freeze_ok_for_fstype() {
+ local outfile=$1
+ local fstype
+
+ [[ "$(stat -c %m -- "$outfile")" == "/" ]] && return 1
+ fstype=$(stat -f -c %T -- "$outfile")
+ case $fstype in
+ msdos)
+ return 1;;
+ btrfs)
+ freeze_ok_for_btrfs "$outfile";;
+ *)
+ return 0;;
+ esac
+}
+
# We sync/fsfreeze only if we're operating on a live booted system.
# It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent,
# and there's no reason to sync, and *definitely* no reason to fsfreeze.
@@ -2087,7 +2121,7 @@ if test -d $dracutsysrootdir/run/systemd/system; then
fi
# use fsfreeze only if we're not writing to /
- if [[ "$(stat -c %m -- "$outfile")" != "/" && "$(stat -f -c %T -- "$outfile")" != "msdos" ]]; then
+ if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then
if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then
dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")"
fi
--
2.24.1

View File

@ -1,26 +0,0 @@
From 07417b7fc5cb261187519c916e4735189f20f4c6 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Sat, 23 May 2020 18:03:47 +0300
Subject: [PATCH] lvm: fix removal of pvscan from udev rules
udev rules provided by lvm 2.02.128 and newer uses '+=' instead of '='.
---
modules.d/90lvm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index d6d2c185..52c803f7 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -101,7 +101,7 @@ install() {
sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' \
${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
- sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
+ sed -i -e 's/^ENV{SYSTEMD_WANTS}+\?=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
else
sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \
${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
--
2.26.2

View File

@ -1,48 +0,0 @@
From 3dcaa97ca4dcfa8092252a22df62c60941e59ce3 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Wed, 11 Mar 2020 09:40:50 +0100
Subject: [PATCH] network-manager: ensure that nm-run.sh is executed when
needed
The network-manager command line hook must install a
initqueue/finished hook to ensure that nm-run.sh is executed when
there are network connections to activate.
Fixes: #694
---
modules.d/35network-manager/nm-config.sh | 11 +++++++++++
modules.d/35network-manager/nm-run.sh | 2 ++
2 files changed, 13 insertions(+)
diff --git a/modules.d/35network-manager/nm-config.sh b/modules.d/35network-manager/nm-config.sh
index 1efa737c..39a1c8bd 100755
--- a/modules.d/35network-manager/nm-config.sh
+++ b/modules.d/35network-manager/nm-config.sh
@@ -5,3 +5,14 @@ if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
fi
/usr/libexec/nm-initrd-generator -- $(getcmdline)
+
+if getargbool 0 rd.neednet; then
+ for i in /usr/lib/NetworkManager/system-connections/* \
+ /run/NetworkManager/system-connections/* \
+ /etc/NetworkManager/system-connections/* \
+ /etc/sysconfig/network-scripts/ifcfg-*; do
+ [ -f "$i" ] || continue
+ echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh
+ break
+ done
+fi
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
index 4079b735..fc5280a1 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -22,3 +22,5 @@ do
source_hook initqueue/online $ifname
/sbin/netroot $ifname
done
+
+> /tmp/nm.done
--
2.26.2

View File

@ -1,241 +0,0 @@
From 265f696b532f63f0ac1f9f341e0469a6eafe2fdd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:26:00 +0000
Subject: [PATCH 01/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/90stratis/stratisd-init.service | 2 --
1 file changed, 2 deletions(-)
diff --git a/modules.d/90stratis/stratisd-init.service b/modules.d/90stratis/stratisd-init.service
index 318e8c27..1be2e33b 100644
--- a/modules.d/90stratis/stratisd-init.service
+++ b/modules.d/90stratis/stratisd-init.service
@@ -8,8 +8,6 @@ DefaultDependencies=no
Type=simple
ExecStart=/sbin/stratisd-init --debug
KillSignal=SIGINT
-StandardOutput=syslog
-StandardError=syslog
[Install]
WantedBy=sysinit.target
--
2.26.2
From 38ba90bf88b38228e128c65be40a2da287c0b1ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:29:34 +0000
Subject: [PATCH 02/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/99squash/squash-mnt-clear.service | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99squash/squash-mnt-clear.service b/modules.d/99squash/squash-mnt-clear.service
index 84441f60..9d94c524 100644
--- a/modules.d/99squash/squash-mnt-clear.service
+++ b/modules.d/99squash/squash-mnt-clear.service
@@ -12,6 +12,6 @@ ConditionPathExists=/squash/root
Type=oneshot
RemainAfterExit=no
StandardInput=null
-StandardOutput=syslog+console
-StandardError=syslog+console
+StandardOutput=journal+console
+StandardError=journal+console
ExecStart=/squash/clear-squash.sh
--
2.26.2
From 5cb2a4004d18e4b96ddc18f221fae922350a9000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:31:17 +0000
Subject: [PATCH 03/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-trigger.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-trigger.service b/modules.d/98dracut-systemd/dracut-pre-trigger.service
index 7bf16167..6f1ba521 100644
--- a/modules.d/98dracut-systemd/dracut-pre-trigger.service
+++ b/modules.d/98dracut-systemd/dracut-pre-trigger.service
@@ -20,8 +20,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-trigger
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
--
2.26.2
From 317d841c788e841d3533515ceda5597a099eb64e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:31:59 +0000
Subject: [PATCH 04/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/98dracut-systemd/dracut-initqueue.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-initqueue.service b/modules.d/98dracut-systemd/dracut-initqueue.service
index 207d545d..3a8679a5 100644
--- a/modules.d/98dracut-systemd/dracut-initqueue.service
+++ b/modules.d/98dracut-systemd/dracut-initqueue.service
@@ -21,8 +21,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-initqueue
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
--
2.26.2
From 0c1bd016ecfb9c6d194c4356199b509d90db4071 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:32:44 +0000
Subject: [PATCH 05/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-pivot.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-pivot.service b/modules.d/98dracut-systemd/dracut-pre-pivot.service
index 9a1f0854..e893d1dd 100644
--- a/modules.d/98dracut-systemd/dracut-pre-pivot.service
+++ b/modules.d/98dracut-systemd/dracut-pre-pivot.service
@@ -27,8 +27,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-pivot
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
--
2.26.2
From e1130a83405648777210fdc99f7eee087eebaadc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:33:33 +0000
Subject: [PATCH 06/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-udev.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-udev.service b/modules.d/98dracut-systemd/dracut-pre-udev.service
index 570ec02d..e4092e35 100644
--- a/modules.d/98dracut-systemd/dracut-pre-udev.service
+++ b/modules.d/98dracut-systemd/dracut-pre-udev.service
@@ -24,8 +24,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-udev
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
--
2.26.2
From c437933cb0490e800e776cb7695d2ea0e95056a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:34:17 +0000
Subject: [PATCH 07/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-mount.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-mount.service b/modules.d/98dracut-systemd/dracut-pre-mount.service
index d3909689..18c9730c 100644
--- a/modules.d/98dracut-systemd/dracut-pre-mount.service
+++ b/modules.d/98dracut-systemd/dracut-pre-mount.service
@@ -19,8 +19,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-mount
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
--
2.26.2
From d9149c6ca7c52c204c1b346e9b6a32bbadd0b2ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:35:02 +0000
Subject: [PATCH 08/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/98dracut-systemd/dracut-cmdline.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-cmdline.service b/modules.d/98dracut-systemd/dracut-cmdline.service
index e577ec88..a8078bd2 100644
--- a/modules.d/98dracut-systemd/dracut-cmdline.service
+++ b/modules.d/98dracut-systemd/dracut-cmdline.service
@@ -23,8 +23,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-cmdline
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
--
2.26.2
From 8cb5ac1b30be458df9497911ba601d90e68f4d5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:35:38 +0000
Subject: [PATCH 09/10] As of v246 of systemd "syslog" and "syslog-console"
switches have been deprecated
---
modules.d/98dracut-systemd/dracut-mount.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-mount.service b/modules.d/98dracut-systemd/dracut-mount.service
index 77d34f62..c88e6d84 100644
--- a/modules.d/98dracut-systemd/dracut-mount.service
+++ b/modules.d/98dracut-systemd/dracut-mount.service
@@ -19,8 +19,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-mount
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
--
2.26.2

View File

@ -1,60 +0,0 @@
From 48258fae9fa58046d7d1a246ea3d821530180643 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Fri, 18 Dec 2020 00:01:32 +0300
Subject: [PATCH] dracut.sh: Move ldconfig after library workaround
This fixes boot failures when libgcc_s.so.1 is in a non-standard
directory.
Bug: https://bugs.gentoo.org/760249
Fixes: de3cb0e3214c (dracut.sh: Move the library workaround after squash)
---
dracut.sh | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 0f4648397..c6c361acc 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1724,20 +1724,6 @@ for ((i=0; i < ${#include_src[@]}; i++)); do
fi
done
-if [[ $kernel_only != yes ]]; then
- # make sure that library links are correct and up to date
- for f in $dracutsysrootdir/etc/ld.so.conf $dracutsysrootdir/etc/ld.so.conf.d/*; do
- [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
- done
- if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
- if [[ $EUID = 0 ]]; then
- derror "ldconfig exited ungracefully"
- else
- derror "ldconfig might need uid=0 (root) for chroot()"
- fi
- fi
-fi
-
if [[ $do_hardlink = yes ]] && command -v hardlink >/dev/null; then
dinfo "*** Hardlinking files ***"
hardlink "$initdir" 2>&1
@@ -1920,6 +1906,20 @@ if [[ $kernel_only != yes ]]; then
fi
fi
+if [[ $kernel_only != yes ]]; then
+ # make sure that library links are correct and up to date
+ for f in $dracutsysrootdir/etc/ld.so.conf $dracutsysrootdir/etc/ld.so.conf.d/*; do
+ [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
+ done
+ if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
+ if [[ $EUID = 0 ]]; then
+ derror "ldconfig exited ungracefully"
+ else
+ derror "ldconfig might need uid=0 (root) for chroot()"
+ fi
+ fi
+fi
+
if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
dinfo "*** Stripping files ***"
find "$initdir" -type f \

View File

@ -1,24 +0,0 @@
From ba4bcf5f4f11ad624c647ddf4f566997186135e7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 31 Mar 2021 16:11:41 +0200
Subject: [PATCH] fix(network-manager): no default deps for nm-run.service
Otherwise nm-run.service will run only in basic.target, which is too
late in the initramfs.
---
modules.d/35network-manager/nm-run.service | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules.d/35network-manager/nm-run.service b/modules.d/35network-manager/nm-run.service
index 63fe7564d0..f3493c41a3 100644
--- a/modules.d/35network-manager/nm-run.service
+++ b/modules.d/35network-manager/nm-run.service
@@ -2,6 +2,8 @@
# SPDX-License-Identifier: GPL-2.0-or-later
[Unit]
+DefaultDependencies=no
+
#make sure all devices showed up
Wants=systemd-udev-settle.service
After=systemd-udev-settle.service

View File

@ -0,0 +1,35 @@
https://github.com/dracutdevs/dracut/pull/2436
From 77214c229dadd1441f0d6243221ceed0708cbfcf Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Thu, 20 Jul 2023 04:36:01 +0100
Subject: [PATCH] fix(dracut.sh): use gawk for strtonum
strtonum is a gawkism and is not available in all awks, e.g. mawk. Use gawk
to avoid failure.
Fixes: f32e95bcadbc5158843530407adc1e7b700561b1
Signed-off-by: Sam James <sam@gentoo.org>
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1047,7 +1047,7 @@ pe_file_format() {
if [[ $# -eq 1 ]]; then
local magic
magic=$(objdump -p "$1" \
- | awk '{if ($1 == "Magic"){print strtonum("0x"$2)}}')
+ | gawk '{if ($1 == "Magic"){print strtonum("0x"$2)}}')
magic=$(printf "0x%x" "$magic")
# 0x10b (PE32), 0x20b (PE32+)
[[ $magic == 0x20b || $magic == 0x10b ]] && return 0
--- a/dracut.sh
+++ b/dracut.sh
@@ -2467,7 +2467,7 @@ if [[ $uefi == yes ]]; then
fi
fi
- offs=$(objdump -h "$uefi_stub" 2> /dev/null | awk 'NF==7 {size=strtonum("0x"$3);\
+ offs=$(objdump -h "$uefi_stub" 2> /dev/null | gawk 'NF==7 {size=strtonum("0x"$3);\
offset=strtonum("0x"$4)} END {print size + offset}')
if [[ $offs -eq 0 ]]; then
dfatal "Failed to get the size of $uefi_stub to create UEFI image file"

View File

@ -0,0 +1,150 @@
Combination of:
- https://github.com/dracutdevs/dracut/pull/2405
- https://github.com/dracutdevs/dracut/pull/2495
- https://github.com/dracutdevs/dracut/pull/2521
Fixes installing manually configured kernel in uki layout and
allows dropping workaround from dist-kernel-utils.eclass
Provides compatibility with systemd-254's ukify plugin
--- a/dracut.sh
+++ b/dracut.sh
@@ -2594,6 +2594,9 @@ freeze_ok_for_fstype() {
zfs)
return 1
;;
+ tmpfs)
+ return 1
+ ;;
btrfs)
freeze_ok_for_btrfs "$outfile"
;;
--- a/install.d/50-dracut.install 2023-09-21 10:19:00.843827541 +0200
+++ b/install.d/50-dracut.install 2023-07-20 16:53:51.000000000 +0200
@@ -11,27 +11,69 @@
exit 0
fi
-if [[ -d "$BOOT_DIR_ABS" ]]; then
- INITRD="initrd"
+# Do not attempt to create initramfs if the supplied image is already a UKI
+if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then
+ exit 0
+fi
+
+# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess.
+if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
+ BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
+ if [[ -z $KERNEL_INSTALL_UKI_GENERATOR || $KERNEL_INSTALL_UKI_GENERATOR == "dracut" ]]; then
+ # No uki generator preference set or we have been chosen
+ IMAGE="uki.efi"
+ UEFI_OPTS="--uefi"
+ elif [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then
+ # We aren't the uki generator, but we have been requested to make the initrd
+ IMAGE="initrd"
+ UEFI_OPTS="--no-uefi"
+ else
+ exit 0
+ fi
+elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
+ BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
+ if [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then
+ IMAGE="initrd"
+ UEFI_OPTS="--no-uefi"
+ else
+ exit 0
+ fi
else
- BOOT_DIR_ABS="/boot"
- INITRD="initramfs-${KERNEL_VERSION}.img"
+ # No layout information, use users --uefi/--no-uefi preference
+ UEFI_OPTS=""
+ if [[ -d $BOOT_DIR_ABS ]]; then
+ IMAGE="initrd"
+ else
+ BOOT_DIR_ABS="/boot"
+ IMAGE="initramfs-${KERNEL_VERSION}.img"
+ fi
fi
ret=0
+
case "$COMMAND" in
add)
- INITRD_IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
- if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
- # we found an initrd at the same place as the kernel
+ if [[ $IMAGE == "uki.efi" ]]; then
+ IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi
+ else
+ IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
+ fi
+ if [[ -f ${IMAGE_PREGENERATED} ]]; then
+ # we found an initrd or uki.efi at the same place as the kernel
# use this and don't generate a new one
- cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \
- && chown root:root "$BOOT_DIR_ABS/$INITRD" \
- && chmod 0600 "$BOOT_DIR_ABS/$INITRD" \
+ [[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo \
+ "There is an ${IMAGE} image at the same place as the kernel, skipping generating a new one"
+ cp --reflink=auto "$IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$IMAGE" \
+ && chown root:root "$BOOT_DIR_ABS/$IMAGE" \
+ && chmod 0600 "$BOOT_DIR_ABS/$IMAGE" \
&& exit 0
fi
- if [[ -f /etc/kernel/cmdline ]]; then
+ if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
+ if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
+ read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
+ fi
+ elif [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
@@ -40,14 +82,14 @@
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
- [[ "${i#initrd=*}" != "$i" ]] && continue
+ [[ ${i#initrd=*} != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
unset noimageifnotneeded
- for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
+ for ((i = 0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
# shellcheck disable=SC1001
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
noimageifnotneeded="yes"
@@ -55,16 +97,21 @@
fi
done
+ # shellcheck disable=SC2046
dracut -f \
${noimageifnotneeded:+--noimageifnotneeded} \
- $([[ "$KERNEL_INSTALL_VERBOSE" == 1 ]] && echo --verbose) \
- "$BOOT_DIR_ABS/$INITRD" \
- "$KERNEL_VERSION"
+ $([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
+ $([[ -n $KERNEL_IMAGE ]] && echo --kernel-image "$KERNEL_IMAGE") \
+ "$UEFI_OPTS" \
+ --kver "$KERNEL_VERSION" \
+ "$BOOT_DIR_ABS/$IMAGE"
ret=$?
- ;;
+ ;;
+
remove)
- rm -f -- "$BOOT_DIR_ABS/$INITRD"
+ rm -f -- "$BOOT_DIR_ABS/$IMAGE"
ret=$?
- ;;
+ ;;
esac
+
exit $ret

View File

@ -0,0 +1,31 @@
From bee1c4824a8cd47ce6c01892a548bdc07b1fa678 Mon Sep 17 00:00:00 2001
From: Frantisek Sumsal <frantisek@sumsal.cz>
Date: Sat, 14 Oct 2023 23:45:57 +0200
Subject: [PATCH] feat(systemd): install systemd-executor
In [0] systemd gained a new binary - systemd-executor - that's used to
spawn processes forked off systemd. Let's copy it into the initrd if
it's available.
[0] https://github.com/systemd/systemd/pull/27890
Signed-off-by: Brian Harring <ferringb@gmail.com>
---
modules.d/00systemd/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
index 554c25a08..9a13a1dbb 100755
--- a/modules.d/00systemd/module-setup.sh
+++ b/modules.d/00systemd/module-setup.sh
@@ -34,6 +34,7 @@ install() {
"$systemdutildir"/systemd \
"$systemdutildir"/systemd-coredump \
"$systemdutildir"/systemd-cgroups-agent \
+ "$systemdutildir"/systemd-executor \
"$systemdutildir"/systemd-shutdown \
"$systemdutildir"/systemd-reply-password \
"$systemdutildir"/systemd-fsck \
--
2.41.0

View File

@ -0,0 +1,91 @@
https://github.com/dracutdevs/dracut/pull/2586
From cd6f683d634970112a29867137431d0d57f8c957 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Thu, 9 Feb 2023 13:55:47 +0100
Subject: [PATCH] fix(systemd-pcrphase): only include
systemd-pcrphase-initrd.service
The only systemd-pcrphase related unit configured to run in the initrd is
systemd-pcrphase-initrd.service.
Both systemd-pcrphase.service and systemd-pcrphase-sysinit.service contain
`ConditionPathExists=!/etc/initrd-release`.
Signed-off-by: Brian Harring <ferringb@gmail.com>
---
modules.d/01systemd-pcrphase/module-setup.sh | 8 --------
1 file changed, 8 deletions(-)
diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh
index 3dbb4974..fa960a42 100755
--- a/modules.d/01systemd-pcrphase/module-setup.sh
+++ b/modules.d/01systemd-pcrphase/module-setup.sh
@@ -28,10 +28,6 @@ install() {
inst_multiple -o \
"$systemdutildir"/systemd-pcrphase \
- "$systemdsystemunitdir"/systemd-pcrphase.service \
- "$systemdsystemunitdir/systemd-pcrphase.service.d/*.conf" \
- "$systemdsystemunitdir"/systemd-pcrphase-sysinit.service \
- "$systemdsystemunitdir/systemd-pcrphase-sysinit.service/*.conf" \
"$systemdsystemunitdir"/systemd-pcrphase-initrd.service \
"$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \
"$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service
@@ -39,10 +35,6 @@ install() {
# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
- "$systemdsystemconfdir"/systemd-pcrphase.service \
- "$systemdsystemconfdir/systemd-pcrphase.service.d/*.conf" \
- "$systemdsystemconfdir"/systemd-pcrphase-sysinit.service \
- "$systemdsystemconfdir/systemd-pcrphase-sysinit.service.d/*.conf" \
"$systemdsystemconfdir"/systemd-pcrphase-initrd.service \
"$systemdsystemconfdir/systemd-pcrphase-initrd.service.d/*.conf" \
"$systemdsystemconfdir"/initrd.target.wants/systemd-pcrphase-initrd.service
--
2.41.0
From cd93aaa2e096a8cbd1f1789dcce06857067b35c9 Mon Sep 17 00:00:00 2001
From: Brian Harring <ferringb@gmail.com>
Date: Mon, 11 Dec 2023 17:10:20 -0800
Subject: [PATCH] fix(systemd-255): handle systemd-pcr{phase -> extend} rename
The binary systemd-pcrphase was renamed to systemd-pcrextend
in systemd 255, but the backing units were all left named
systemd-pcrphase.
Fixes: #2583
Signed-off-by: Brian Harring <ferringb@gmail.com>
---
modules.d/01systemd-pcrphase/module-setup.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh
index fa960a42c..87efd0c1a 100755
--- a/modules.d/01systemd-pcrphase/module-setup.sh
+++ b/modules.d/01systemd-pcrphase/module-setup.sh
@@ -6,7 +6,11 @@
check() {
# If the binary(s) requirements are not fulfilled the module can't be installed.
- require_binaries "$systemdutildir"/systemd-pcrphase || return 1
+ # systemd-255 renamed the binary, check for old and new location.
+ if ! require_binaries "$systemdutildir"/systemd-pcrphase && \
+ ! require_binaries "$systemdutildir"/systemd-pcrextend; then
+ return 1
+ fi
# Return 255 to only include the module, if another module requires it.
return 255
@@ -28,6 +32,7 @@ install() {
inst_multiple -o \
"$systemdutildir"/systemd-pcrphase \
+ "$systemdutildir"/systemd-pcrextend \
"$systemdsystemunitdir"/systemd-pcrphase-initrd.service \
"$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \
"$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service
--
2.41.0

View File

@ -0,0 +1,48 @@
https://github.com/dracutdevs/dracut/pull/2365
From 3462e0ac6f3562a5247bbeda2dc41eaf4e4ebf5e Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Fri, 26 May 2023 15:56:45 -0400
Subject: [PATCH] Fix path to UEFI stub on split-usr systems
systemd always installs the UEFI stub in ${prefix}/lib/systemd/boot/efi.
On split-usr systems, systemdutildir is ${rootprefix}/lib/systemd, which
makes dracut look in the wrong place.
Instead, grab 'prefix' from systemd.pc and store it in 'systemd_prefix'.
Bug: https://bugs.gentoo.org/765208
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
dracut.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index bbb34697..52a83061 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1389,6 +1389,11 @@ esac
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
+[[ -n $systemd_prefix ]] \
+ || systemd_prefix=$(pkg-config systemd --variable=prefix 2> /dev/null)
+
+[[ -n $systemd_prefix ]] || systemd_prefix=/usr
+
[[ -d $dracutsysrootdir$systemdutildir ]] \
|| systemdutildir=$(pkg-config systemd --variable=systemdutildir 2> /dev/null)
@@ -1467,7 +1472,7 @@ if [[ ! $print_cmdline ]]; then
esac
if ! [[ -s $uefi_stub ]]; then
- uefi_stub="$dracutsysrootdir${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"
+ uefi_stub="$dracutsysrootdir${systemd_prefix}/lib/systemd/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"
fi
if ! [[ -s $uefi_stub ]]; then
--
2.40.1

View File

@ -0,0 +1,134 @@
https://github.com/dracutdevs/dracut/issues/2431
https://github.com/dracutdevs/dracut/commit/f32e95bcadbc5158843530407adc1e7b700561b1
From f32e95bcadbc5158843530407adc1e7b700561b1 Mon Sep 17 00:00:00 2001
From: Valentin Lefebvre <valentin.lefebvre@suse.com>
Date: Mon, 13 Mar 2023 12:06:13 +0100
Subject: [PATCH] fix(dracut.sh): use dynamically uefi's sections offset
* Uefi section are creating by `objcopy` with hardcoded sections
offset. This commit allow to have the correct offset between
each part of the efi file, needed to create an UKI. Offsets
are simply calculated so no sections overlap, as recommended
in https://wiki.archlinux.org/title/Unified_kernel_image#Manually
Moreover, efi stub file's header is parsed to apply the correct
offsets according the section alignment factor.
* Remove EFI_SECTION_VMA_INITRD, no need anymore as initrd
section offset dynamically calculated
Fixes dracutdevs#2275
Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1023,3 +1023,26 @@ get_dev_module() {
fi
echo "$dev_drivers"
}
+
+# Check if file is in PE format
+pe_file_format() {
+ if [[ $# -eq 1 ]]; then
+ local magic
+ magic=$(objdump -p "$1" \
+ | awk '{if ($1 == "Magic"){print strtonum("0x"$2)}}')
+ magic=$(printf "0x%x" "$magic")
+ # 0x10b (PE32), 0x20b (PE32+)
+ [[ $magic == 0x20b || $magic == 0x10b ]] && return 0
+ fi
+ return 1
+}
+
+# Get the sectionAlignment data from the PE header
+pe_get_section_align() {
+ local align_hex
+ [[ $# -ne "1" ]] && return 1
+ [[ $(pe_file_format "$1") -eq 1 ]] && return 1
+ align_hex=$(objdump -p "$1" \
+ | awk '{if ($1 == "SectionAlignment"){print $2}}')
+ echo "$((16#$align_hex))"
+}
--- a/dracut.sh
+++ b/dracut.sh
@@ -1506,7 +1506,6 @@ if [[ ! $print_cmdline ]]; then
exit 1
fi
unset EFI_MACHINE_TYPE_NAME
- EFI_SECTION_VMA_INITRD=0x3000000
case "${DRACUT_ARCH:-$(uname -m)}" in
x86_64)
EFI_MACHINE_TYPE_NAME=x64
@@ -1516,8 +1515,6 @@ if [[ ! $print_cmdline ]]; then
;;
aarch64)
EFI_MACHINE_TYPE_NAME=aa64
- # aarch64 kernels are uncompressed and thus larger, so we need a bigger gap between vma sections
- EFI_SECTION_VMA_INITRD=0x4000000
;;
*)
dfatal "Architecture '${DRACUT_ARCH:-$(uname -m)}' not supported to create a UEFI executable"
@@ -2467,29 +2464,57 @@ if [[ $uefi == yes ]]; then
fi
fi
+ offs=$(objdump -h "$uefi_stub" 2> /dev/null | awk 'NF==7 {size=strtonum("0x"$3);\
+ offset=strtonum("0x"$4)} END {print size + offset}')
+ if [[ $offs -eq 0 ]]; then
+ dfatal "Failed to get the size of $uefi_stub to create UEFI image file"
+ exit 1
+ fi
+ align=$(pe_get_section_align "$uefi_stub")
+ if [[ $? -eq 1 ]]; then
+ dfatal "Failed to get the sectionAlignment of the stub PE header to create the UEFI image file"
+ exit 1
+ fi
+ offs=$((offs + "$align" - offs % "$align"))
+ [[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
+ [[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
+ [[ -s $uefi_osrelease ]] \
+ && uefi_osrelease_offs=${offs} \
+ && offs=$((offs + $(stat -Lc%s "$uefi_osrelease"))) \
+ && offs=$((offs + "$align" - offs % "$align"))
+
if [[ $kernel_cmdline ]] || [[ $hostonly_cmdline == yes && -e "${uefi_outdir}/cmdline.txt" ]]; then
echo -ne "\x00" >> "$uefi_outdir/cmdline.txt"
dinfo "Using UEFI kernel cmdline:"
dinfo "$(tr -d '\000' < "$uefi_outdir/cmdline.txt")"
uefi_cmdline="${uefi_outdir}/cmdline.txt"
+ uefi_cmdline_offs=${offs}
+ offs=$((offs + $(stat -Lc%s "$uefi_cmdline")))
+ offs=$((offs + "$align" - offs % "$align"))
else
unset uefi_cmdline
fi
- [[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
- [[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
if [[ -s ${dracutsysrootdir}${uefi_splash_image} ]]; then
uefi_splash_image="${dracutsysrootdir}${uefi_splash_image}"
+ uefi_splash_offs=${offs}
+ offs=$((offs + $(stat -Lc%s "$uefi_splash_image")))
+ offs=$((offs + "$align" - offs % "$align"))
else
unset uefi_splash_image
fi
+ uefi_linux_offs="${offs}"
+ offs=$((offs + $(stat -Lc%s "$kernel_image")))
+ offs=$((offs + "$align" - offs % "$align"))
+ uefi_initrd_offs="${offs}"
+
if objcopy \
- ${uefi_osrelease:+--add-section .osrel="$uefi_osrelease" --change-section-vma .osrel=0x20000} \
- ${uefi_cmdline:+--add-section .cmdline="$uefi_cmdline" --change-section-vma .cmdline=0x30000} \
- ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=0x40000} \
- --add-section .linux="$kernel_image" --change-section-vma .linux=0x2000000 \
- --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd="${EFI_SECTION_VMA_INITRD}" \
+ ${uefi_osrelease:+--add-section .osrel="$uefi_osrelease" --change-section-vma .osrel=$(printf 0x%x "$uefi_osrelease_offs")} \
+ ${uefi_cmdline:+--add-section .cmdline="$uefi_cmdline" --change-section-vma .cmdline=$(printf 0x%x "$uefi_cmdline_offs")} \
+ ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=$(printf 0x%x "$uefi_splash_offs")} \
+ --add-section .linux="$kernel_image" --change-section-vma .linux="$(printf 0x%x "$uefi_linux_offs")" \
+ --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd="$(printf 0x%x "$uefi_initrd_offs")" \
"$uefi_stub" "${uefi_outdir}/linux.efi"; then
if [[ -n ${uefi_secureboot_key} && -n ${uefi_secureboot_cert} ]]; then
if sbsign \

View File

@ -0,0 +1,26 @@
From 19e4839ab70a691f95a0284aa0152a247eb5c63d Mon Sep 17 00:00:00 2001
From: Laszlo Gombos <laszlo.gombos@gmail.com>
Date: Fri, 24 Feb 2023 01:57:19 +0000
Subject: [PATCH] fix(dmsquash-live): restore compatibility with earlier
releases
Follow-up to 40dd5c90e0efcb9ebaa9abb42a38c7316e9706bd .
---
modules.d/90dmsquash-live/dmsquash-live-root.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
index 62d1b5e7cd..a98e258c26 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
@@ -403,6 +403,10 @@ fi
ROOTFLAGS="$(getarg rootflags)"
+if [ "$overlayfs" = required ]; then
+ echo "rd.live.overlay.overlayfs=1" > /etc/cmdline.d/dmsquash-need-overlay.conf
+fi
+
if [ -n "$overlayfs" ]; then
if [ -n "$FSIMG" ]; then
mkdir -m 0755 -p /run/rootfsbase

View File

@ -0,0 +1,21 @@
From https://github.com/dracutdevs/dracut/pull/2527
From a2fe89116db4b286fbf515f26bd1773b5e6ee8ad Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Tue, 26 Sep 2023 09:43:37 +0200
Subject: [PATCH] fix(resume): add new systemd-hibernate-resume.service
Since https://github.com/systemd/systemd/commit/a628d933, the generator only
does the initial validation of the system info and then enables the new
`systemd-hibernate-resume.service`.
Fixes #2513
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -44,6 +44,7 @@ install() {
if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
inst_multiple -o \
"$systemdutildir"/system-generators/systemd-hibernate-resume-generator \
+ "$systemdsystemunitdir"/systemd-hibernate-resume.service \
"$systemdsystemunitdir"/systemd-hibernate-resume@.service \
"$systemdutildir"/systemd-hibernate-resume
return 0

View File

@ -0,0 +1,65 @@
https://bugs.gentoo.org/917000
https://github.com/dracutdevs/dracut/pull/2494
From b88d0bab791bdc4ca75d13802f0391caf537650d Mon Sep 17 00:00:00 2001
From: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Date: Sun, 20 Aug 2023 11:47:22 +0200
Subject: [PATCH] fix(resume): include in hostonly mode if resume= on cmdline
The grep introduced in commit e3a7112bef794e2f2dd741ec2c74fa9cb9117651
does not work as intended. The resume module is always excluded in hostonly
mode.
Made this a bit more explicit with if/else so it is more clear what is going
on. The in-line ||/&& makes the line really long and makes it more difficult
to understand what is going on.
Bug: https://github.com/dracutdevs/dracut/issues/924
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
---
modules.d/95resume/module-setup.sh | 32 +++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index d255103366..2d48043827 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -10,13 +10,31 @@ check() {
return 1
}
- # Only support resume if hibernation is currently on
- # and no swap is mounted on a net device
- [[ $hostonly ]] || [[ $mount_needs ]] && {
- swap_on_netdevice || [[ -f /sys/power/resume && "$(< /sys/power/resume)" == "0:0" ]] || grep -rq '^\|[[:space:]]resume=' /proc/cmdline /etc/cmdline /etc/cmdline.d /etc/kernel/cmdline /usr/lib/kernel/cmdline 2> /dev/null && return 255
- }
-
- return 0
+ # If hostonly check if we want to include the resume module
+ if [[ $hostonly ]] || [[ $mount_needs ]]; then
+ # Resuming won't work if swap is on a netdevice
+ swap_on_netdevice && return 255
+ if grep -rq 'resume=' /proc/cmdline /etc/cmdline /etc/cmdline.d /etc/kernel/cmdline /usr/lib/kernel/cmdline 2> /dev/null; then
+ # hibernation support requested on kernel command line
+ return 0
+ else
+ # resume= not set on kernel command line
+ if [[ -f /sys/power/resume ]]; then
+ if [[ "$(< /sys/power/resume)" == "0:0" ]]; then
+ # hibernation supported by the kernel, but not enabled
+ return 255
+ else
+ # hibernation supported by the kernel and enabled
+ return 0
+ fi
+ else
+ # resume file doesn't exist, hibernation not supported by kernel
+ return 255
+ fi
+ fi
+ else
+ return 0
+ fi
}
# called by dracut

View File

@ -0,0 +1,31 @@
Ensures that the generated initrd is installed in the "new" way via the
staging area in the grub layout. This prevents accidentally creating
an UKI named initrd, and also ensures that BOOT_ROOT and
KERNEL_INSTALL_INITRD_GENERATOR are respected when the layout is set to grub.
Downstream only since the grub layout for using grub with systemd's
kernel-install is not supported by systemd upstream and therefore this
patch is unlikely to be accepted by dracut upstream.
diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install
index 441414ac..a98449fe 100755
--- a/install.d/50-dracut.install
+++ b/install.d/50-dracut.install
@@ -38,6 +38,17 @@ elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; t
else
exit 0
fi
+elif [[ $KERNEL_INSTALL_LAYOUT == "grub" || $KERNEL_INSTALL_LAYOUT == "compat" ]]; then
+ BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
+ if [[ -z $KERNEL_INSTALL_UKI_GENERATOR || $KERNEL_INSTALL_UKI_GENERATOR == "dracut" ]]; then
+ IMAGE="uki.efi"
+ UEFI_OPTS="--uefi"
+ elif [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then
+ IMAGE="initrd"
+ UEFI_OPTS="--no-uefi"
+ else
+ exit 0
+ fi
else
# No layout information, use users --uefi/--no-uefi preference
UEFI_OPTS=""

View File

@ -0,0 +1,26 @@
https://github.com/dracutdevs/dracut/pull/2586/files
diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh
index fa960a42c1..87efd0c1a6 100755
--- a/modules.d/01systemd-pcrphase/module-setup.sh
+++ b/modules.d/01systemd-pcrphase/module-setup.sh
@@ -6,7 +6,11 @@
check() {
# If the binary(s) requirements are not fulfilled the module can't be installed.
- require_binaries "$systemdutildir"/systemd-pcrphase || return 1
+ # systemd-255 renamed the binary, check for old and new location.
+ if ! require_binaries "$systemdutildir"/systemd-pcrphase && \
+ ! require_binaries "$systemdutildir"/systemd-pcrextend; then
+ return 1
+ fi
# Return 255 to only include the module, if another module requires it.
return 255
@@ -28,6 +32,7 @@ install() {
inst_multiple -o \
"$systemdutildir"/systemd-pcrphase \
+ "$systemdutildir"/systemd-pcrextend \
"$systemdsystemunitdir"/systemd-pcrphase-initrd.service \
"$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \
"$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service

View File

@ -1,39 +0,0 @@
From 0674b9136831b1beb6a7ec91147fd5c280c693a3 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Mon, 9 Mar 2020 02:47:07 +0300
Subject: [PATCH] Remove redundant gcc paths in ldconfig_paths()
Bug: https://bugs.gentoo.org/705728
---
dracut-functions.sh | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 3cb9c7af..5337ff6c 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -76,7 +76,20 @@ find_binary() {
ldconfig_paths()
{
- $DRACUT_LDCONFIG ${dracutsysrootdir:+-r ${dracutsysrootdir} -f /etc/ld.so.conf} -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
+ local gccpath
+
+ if type -P gcc-config &>/dev/null; then
+ gccpath=$(gcc-config -c)
+ gccpath=/usr/lib/gcc/${gccpath%-*}/${gccpath##*-}
+ fi
+
+ while read -r line; do
+ if [[ ${line} != /usr/lib/gcc/* || -z ${gccpath} ]]; then
+ echo ${line}
+ elif [[ ${line} == ${gccpath} ]]; then
+ echo ${line}
+ fi
+ done < <($DRACUT_LDCONFIG ${dracutsysrootdir:+-r ${dracutsysrootdir} -f /etc/ld.so.conf} -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq)
}
# Version comparision function. Assumes Linux style version scheme.
--
2.24.1

View File

@ -0,0 +1,29 @@
From 5443396f3cb591f2589888b25e07f21f03989057 Mon Sep 17 00:00:00 2001
From: Laszlo Gombos <laszlo.gombos@gmail.com>
Date: Sat, 24 Dec 2022 01:48:04 +0000
Subject: [PATCH] When no systemd then only network-legacy is supported
Bug: https://github.com/dracutdevs/dracut/issues/1756
---
modules.d/40network/module-setup.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index 1ab13ef..da49947 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -16,6 +16,11 @@ depends() {
fi
done
+ # When systemd is not available only network-legacy is supported
+ if [ -z "$network_handler" ] && ! find_binary systemctl > /dev/null; then
+ network_handler="network-legacy"
+ fi
+
if [ -z "$network_handler" ]; then
if [[ -e $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then
network_handler="network-wicked"
--
2.34.1

View File

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>chutzpah@gentoo.org</email>
<name>Patrick McLean</name>
</maintainer>
<maintainer type="person" proxied="yes">
<email>alexander@tsoy.me</email>
<name>Alexander Tsoy</name>
@ -13,4 +9,7 @@
<email>floppym@gentoo.org</email>
<name>Mike Gilbert</name>
</maintainer>
<upstream>
<remote-id type="github">dracutdevs/dracut</remote-id>
</upstream>
</pkgmetadata>