summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/dracut')
-rw-r--r--sys-kernel/dracut/Manifest1
-rw-r--r--sys-kernel/dracut/dracut-050.ebuild165
-rw-r--r--sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch34
-rw-r--r--sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch78
-rw-r--r--sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch75
-rw-r--r--sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch39
6 files changed, 392 insertions, 0 deletions
diff --git a/sys-kernel/dracut/Manifest b/sys-kernel/dracut/Manifest
index 7b97320d25db..a2441ad9a7f4 100644
--- a/sys-kernel/dracut/Manifest
+++ b/sys-kernel/dracut/Manifest
@@ -4,3 +4,4 @@ DIST dracut-046.tar.xz 299520 BLAKE2B 1e2d848aa0db0e90734d8c60610a60b1f0ff67f8c4
DIST dracut-047.tar.xz 305836 BLAKE2B 18333ae1e24cfbbb6a152bf9ba2c48884821f6a506344259ba56c581a9f3efac7b4c88e8ca149ef1f83347a5e4d59acba61e42b8e0ab3a9e9beb8684d5db28b0 SHA512 03369726b6c2b682d0c9dead7b7dbd1c3989aaf2b4a561015634d33a94e5230d03cb634c3890191b19dd8c1c83389533ae1a46d45d2024ba885e0d2d46c5d035
DIST dracut-048.tar.xz 308484 BLAKE2B b19c8122034a8b40cbc9d09245730900b59691c336f1d231e768786ad64068e0a8daf57ae9a4182ab50d9e1c683c9b7dcac354eb26d8a60f061db78121bc11c7 SHA512 97fcfd5d314ef40687c245d95d2f1d0f3f9ff0472e66b6e6324bf9bd6b98186104f9d71fd9af344126d6ea9fa47b744d52831a374225633225f6f17fb15c04e0
DIST dracut-049.tar.gz 376857 BLAKE2B e50084164e26aae6de812345cc76782435ec84951b44eea454355d0c65fe84fdd0858733de534bdf018bdfd92922f0be30b74d74be329a918e55d96c5e4d4fb6 SHA512 51489570856538588868a66c7bcc8a3728574592529905484526c523398dc1b8f1416e6b264780303acd08d818417a9668b76f1d64d3194432b5af79dc15c9f7
+DIST dracut-050.tar.xz 333592 BLAKE2B cb0bfa5a8e7547260b8a80a3606eb284182c062926269c85b09e07d26ad177df0eeaa64b17005bff9290611f1c83fc8cd8e2216cfe14b5e66ec7f659d4c2fa7b SHA512 eba046cf1c8013369a398e585e0bff233daa8595d469ce9acc8bbc6a32d55c6a5429d4219db19abbf6001104be05b357f0961f9e66b7f926039a5d3ee7c2b850
diff --git a/sys-kernel/dracut/dracut-050.ebuild b/sys-kernel/dracut/dracut-050.ebuild
new file mode 100644
index 000000000000..5b09940bf76f
--- /dev/null
+++ b/sys-kernel/dracut/dracut-050.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 eutils linux-info 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-gentoo-ldconfig-paths.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
+
+ elog "To get additional features, a number of optional runtime"
+ elog "dependencies may be installed:"
+ elog ""
+ 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
+}
diff --git a/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch b/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch
new file mode 100644
index 000000000000..a091e4c9facc
--- /dev/null
+++ b/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch
@@ -0,0 +1,34 @@
+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
+
diff --git a/sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch b/sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch
new file mode 100644
index 000000000000..49c532b92995
--- /dev/null
+++ b/sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch
@@ -0,0 +1,78 @@
+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
+
diff --git a/sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch b/sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch
new file mode 100644
index 000000000000..cf54cabb5eb6
--- /dev/null
+++ b/sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch
@@ -0,0 +1,75 @@
+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
+
diff --git a/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch b/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch
new file mode 100644
index 000000000000..15522ef4fc1e
--- /dev/null
+++ b/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch
@@ -0,0 +1,39 @@
+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
+